diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-21 17:16:34 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-01-25 18:21:58 +0400 |
commit | 06cc49310719da502012c238af6529213b45309c (patch) | |
tree | f32fe7f4178df35fb0b7fc419fbce3d9687936f2 | |
parent | c254bc52ea552a8e700e9393e7b99c1d1ba5241f (diff) |
ac3dec: fix non-optimal dithering of zero bit mantissaslav0.55.2
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>
-rw-r--r-- | libavcodec/ac3dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 567c797659..124815c986 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -442,7 +442,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; |