aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-05-18 18:59:27 -0700
committerChris Robinson <[email protected]>2018-05-18 18:59:27 -0700
commit5e7513d0a0b3248f8f5bdba1ebc1d96fd7724a39 (patch)
tree3b916ebf4845b5c5ff723d6bafab689b1fcc2838
parentcd2fd126c4024f43730a7c857fca223b35fe0a5b (diff)
Accumulate ambisonic upsampler gains using double-precision
-rw-r--r--Alc/bformatdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c
index dcde7d70..58898083 100644
--- a/Alc/bformatdec.c
+++ b/Alc/bformatdec.c
@@ -450,11 +450,11 @@ void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device, ALfloat
{
for(j = 0;j < device->Dry.NumChannels;j++)
{
- ALfloat gain=0.0f;
+ ALdouble gain = 0.0;
for(k = 0;k < COUNTOF(Ambi3DDecoder);k++)
- gain += Ambi3DDecoder[k][i] * encgains[k][j];
- ambiup->Gains[i][j][HF_BAND] = gain * Ambi3DDecoderHFScale[i];
- ambiup->Gains[i][j][LF_BAND] = gain;
+ gain += (ALdouble)Ambi3DDecoder[k][i] * encgains[k][j];
+ ambiup->Gains[i][j][HF_BAND] = (ALfloat)(gain * Ambi3DDecoderHFScale[i]);
+ ambiup->Gains[i][j][LF_BAND] = (ALfloat)gain;
}
}
}