summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-21 14:16:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-21 14:22:04 +0100
commitfbdb0313f53f84f5a8a5a23ad1880bf7ef4dcc5f (patch)
tree6eafc2fe2ebf013164ad384945383954e9c2bf7e /libavcodec/ac3dec.c
parent144529e09493fa5e395eabb8a214e6aec1cfc166 (diff)
ac3dec: fix non-optimal dithering of zero bit mantissas
Use a noise range of -0.707 to 0.707 instead of -0.5 to 0.5 Based on patch by: Mathias Rauen <madshi@gmail.com> and commit by Justin Ruggles (04ea5491) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 0d1c710eca..ee8b9701b1 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -443,7 +443,7 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
switch (bap) {
case 0:
if (dither)
- mantissa = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
+ mantissa = (((av_lfg_get(&s->dith_state)>>8)*181)>>8) - 5931008;
else
mantissa = 0;
break;