[FFmpeg-soc] [soc]: r3032 - eac3/eac3dec.c

jbr subversion at mplayerhq.hu
Tue Aug 5 05:26:19 CEST 2008


Author: jbr
Date: Tue Aug  5 05:26:19 2008
New Revision: 3032

Log:
remove 2 unneeded variables and simplify GAQ decoding

Modified:
   eac3/eac3dec.c

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Tue Aug  5 05:26:19 2008
@@ -98,26 +98,23 @@ void ff_eac3_get_transform_coeffs_aht_ch
             gbits = bits - log_gain;
 
             for (blk = 0; blk < 6; blk++) {
-                int mant;
-                int pre_mantissa = get_sbits(gbc, gbits);
-                if (pre_mantissa == -(1 << (gbits-1))) {
+                int mant = get_sbits(gbc, gbits);
+                if (mant == -(1 << (gbits-1))) {
                     /* large mantissa */
-                    int64_t a, b;
+                    int64_t b;
                     mant = get_sbits(gbc, bits-2+log_gain) << (26-log_gain-bits);
                     /* remap mantissa value to correct for asymmetric quantization */
-                    a = ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] + 32768;
                     if (mant >= 0)
                         b = 32768 >> log_gain;
                     else
                         b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1];
-                    mant = (a * mant + b) >> 15;
+                    mant += ((int64_t)ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * mant + b) >> 15;
                 } else {
                     /* small mantissa, no GAQ, or Gk=1 */
-                    mant = pre_mantissa << (24 - bits);
+                    mant <<= 24 - bits;
                     if (!log_gain) {
                         /* remap mantissa value for no GAQ or Gk=1 */
-                        int64_t a = ff_eac3_gaq_remap_1[hebap-8] + 32768;
-                        mant = (a * mant) >> 15;
+                        mant += ((int64_t)ff_eac3_gaq_remap_1[hebap-8] * mant) >> 15;
                     }
                 }
                 s->pre_mantissa[blk][ch][bin] = mant;



More information about the FFmpeg-soc mailing list