changeset 5679:8f64e86e1b63 libavcodec

fix random dithering of zero-bit mantissas
author jbr
date Sat, 15 Sep 2007 00:43:40 +0000
parents 53c43e7156bc
children 5ae5a74b0e4b
files ac3dec.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ac3dec.c	Sat Sep 15 00:19:21 2007 +0000
+++ b/ac3dec.c	Sat Sep 15 00:43:40 2007 +0000
@@ -518,7 +518,7 @@
         tbap = bap[i];
         switch (tbap) {
             case 0:
-                coeffs[i] = ((av_random(&ctx->dith_state) & 0xFFFF) * LEVEL_MINUS_3DB) / 32768.0f;
+                coeffs[i] = ((av_random(&ctx->dith_state) & 0xFFFF) / 65535.0f) - 0.5f;
                 break;
 
             case 1: