[Ffmpeg-devel] Simpler Patch to bring AC3 encoder output up to input level

Bill O'Shaughnessy bill.oshaughnessy
Tue Nov 21 23:36:54 CET 2006


Hello all,
  After some inputs, the overflow protection of using 32bit multiplies
is not necessary and a simpler patch does work to bring ac3 output up
to the exact level of the input.  I have tested this on a wave file
normalized
to the maximum of 16 bits.  It does work and the output is at the
exact level of the input.

Good Luck,
  Bill O.

Here is the Patch

--- ac3enc.corg    2006-11-21 13:31:59.984375000 -0800
+++ ac3enc.c    2006-11-21 13:31:48.171875000 -0800
@@ -1379,7 +1379,7 @@
             v = 14 - log2_tab(input_samples, N);
             if (v < 0)
                 v = 0;
-            exp_samples[i][ch] = v - 9;
+            exp_samples[i][ch] = v - 10;
             lshift_tab(input_samples, N, v);

             /* do the MDCT */




More information about the ffmpeg-devel mailing list