diff options
author | Chris Robinson <[email protected]> | 2018-02-12 21:24:58 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-02-12 21:24:58 -0800 |
commit | 6b76eddbe395dd7622ede8393f3561b7a7c2fa50 (patch) | |
tree | 0d21cc240d772b96e8a78d5d7b704d26ee3fbe7e /Alc | |
parent | 59934b47de5d58fe20d920bee6879f5c78994c49 (diff) |
Supply HF coefficient scales with a single-band ambisonic matrix
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/bformatdec.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c index 4f8e725a..6141aaba 100644 --- a/Alc/bformatdec.c +++ b/Alc/bformatdec.c @@ -171,15 +171,19 @@ static const ALfloat Ambi3DPoints[8][3] = { { -0.577350269f, -0.577350269f, 0.577350269f }, { 0.577350269f, -0.577350269f, 0.577350269f }, }; -static const ALfloat Ambi3DDecoder[8][NUM_BANDS][MAX_AMBI_COEFFS] = { - { { 0.25f, 0.1443375672f, 0.1443375672f, 0.1443375672f }, { 0.125f, 0.125f, 0.125f, 0.125f } }, - { { 0.25f, -0.1443375672f, 0.1443375672f, 0.1443375672f }, { 0.125f, -0.125f, 0.125f, 0.125f } }, - { { 0.25f, 0.1443375672f, 0.1443375672f, -0.1443375672f }, { 0.125f, 0.125f, 0.125f, -0.125f } }, - { { 0.25f, -0.1443375672f, 0.1443375672f, -0.1443375672f }, { 0.125f, -0.125f, 0.125f, -0.125f } }, - { { 0.25f, 0.1443375672f, -0.1443375672f, 0.1443375672f }, { 0.125f, 0.125f, -0.125f, 0.125f } }, - { { 0.25f, -0.1443375672f, -0.1443375672f, 0.1443375672f }, { 0.125f, -0.125f, -0.125f, 0.125f } }, - { { 0.25f, 0.1443375672f, -0.1443375672f, -0.1443375672f }, { 0.125f, 0.125f, -0.125f, -0.125f } }, - { { 0.25f, -0.1443375672f, -0.1443375672f, -0.1443375672f }, { 0.125f, -0.125f, -0.125f, -0.125f } }, +static const ALfloat Ambi3DDecoder[8][MAX_AMBI_COEFFS] = { + { 0.125f, 0.125f, 0.125f, 0.125f }, + { 0.125f, -0.125f, 0.125f, 0.125f }, + { 0.125f, 0.125f, 0.125f, -0.125f }, + { 0.125f, -0.125f, 0.125f, -0.125f }, + { 0.125f, 0.125f, -0.125f, 0.125f }, + { 0.125f, -0.125f, -0.125f, 0.125f }, + { 0.125f, 0.125f, -0.125f, -0.125f }, + { 0.125f, -0.125f, -0.125f, -0.125f }, +}; +static const ALfloat Ambi3DDecoderHFScale[MAX_AMBI_COEFFS] = { + 2.0f, + 1.15470054f, 1.15470054f, 1.15470054f }; @@ -546,14 +550,11 @@ void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device) { for(j = 0;j < device->Dry.NumChannels;j++) { - ALfloat hfgain=0.0f, lfgain=0.0f; + ALfloat gain=0.0f; for(k = 0;k < COUNTOF(Ambi3DDecoder);k++) - { - hfgain += Ambi3DDecoder[k][HF_BAND][i]*encgains[k][j]; - lfgain += Ambi3DDecoder[k][LF_BAND][i]*encgains[k][j]; - } - ambiup->Gains[i][j][HF_BAND] = hfgain; - ambiup->Gains[i][j][LF_BAND] = lfgain; + gain += Ambi3DDecoder[k][i] * encgains[k][j]; + ambiup->Gains[i][j][HF_BAND] = gain * Ambi3DDecoderHFScale[i]; + ambiup->Gains[i][j][LF_BAND] = gain; } } } |