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

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
This commit is contained in:
Mathias Rauen
2013-01-05 11:30:31 -05:00
committed by Justin Ruggles
parent d9bf716945
commit 04ea5491a8
2 changed files with 15 additions and 14 deletions

View File

@@ -442,8 +442,9 @@ static void ac3_decode_transform_coeffs_ch(AC3DecodeContext *s, int ch_index, ma
int mantissa;
switch (bap) {
case 0:
/* random noise with approximate range of -0.707 to 0.707 */
if (dither)
mantissa = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000;
mantissa = (av_lfg_get(&s->dith_state) / 362) - 5932275;
else
mantissa = 0;
break;