From 5e7513d0a0b3248f8f5bdba1ebc1d96fd7724a39 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 18 May 2018 18:59:27 -0700 Subject: Accumulate ambisonic upsampler gains using double-precision --- Alc/bformatdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc') 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; } } } -- cgit v1.2.3