aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/eac3dec.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2015-03-14 11:48:59 +0000
committerMichael Niedermayer <michaelni@gmx.at>2015-03-14 14:26:28 +0100
commit7ff46a20d5cc2d746d7396cc80120cb77e5fd90e (patch)
tree67b7d096d86d0861a4b492e62fda38c9f414b8a3 /libavcodec/eac3dec.c
parent7edd380668457782e06093320c41c4f060635861 (diff)
downloadffmpeg-7ff46a20d5cc2d746d7396cc80120cb77e5fd90e.tar.gz
eac3dec: fix scaling
This is the remaining error, the output on the SPX samples, respectively csi_miami_stereo_128_spx.eac3 and csi_miami_5.1_256_spx.eac3, goes from: stddev: 8.71 PSNR: 77.52 MAXDIFF: 235 stddev:24270.51 PSNR: 22.17 MAXDIFF:47166 to: stddev: 0.12 PSNR:114.12 MAXDIFF: 1 stddev: 0.12 PSNR:114.73 MAXDIFF: 1 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 0c3339f4bd7aceebfd74deb437ba2e5c04ef3d0e) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/eac3dec.c')
-rw-r--r--libavcodec/eac3dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c
index cd2eec8d00..ef815afb55 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -143,7 +143,9 @@ static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
float sscale = s->spx_signal_blend[ch][bnd];
#if USE_FIXED
+ // spx_noise_blend and spx_signal_blend are both FP.23
nscale *= 1.0 / (1<<23);
+ sscale *= 1.0 / (1<<23);
#endif
for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
float noise = nscale * (int32_t)av_lfg_get(&s->dith_state);