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

jbr subversion at mplayerhq.hu
Sun Aug 24 06:48:40 CEST 2008


Author: jbr
Date: Sun Aug 24 06:48:40 2008
New Revision: 3571

Log:
avoid 64-bit multiplies in GAQ mantissa decoding

Modified:
   eac3/eac3dec.c

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



More information about the FFmpeg-soc mailing list