Mercurial > libavcodec.hg
comparison eac3dec.c @ 9708:d23332ab364f libavcodec
eac3dec: get rid of unnecessary left shifts in 16-bit * 24-bit
multiplication in GAQ mantissa ramapping.
author | jbr |
---|---|
date | Mon, 25 May 2009 16:12:51 +0000 |
parents | 815664144471 |
children | 7ad7d4094d1f |
comparison
equal
deleted
inserted
replaced
9707:b69723e55653 | 9708:d23332ab364f |
---|---|
184 /* remap mantissa value to correct for asymmetric quantization */ | 184 /* remap mantissa value to correct for asymmetric quantization */ |
185 if (mant >= 0) | 185 if (mant >= 0) |
186 b = 1 << (23 - log_gain); | 186 b = 1 << (23 - log_gain); |
187 else | 187 else |
188 b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8; | 188 b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8; |
189 mant += (((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] << 8) * (int64_t)mant) >> 23) + b; | 189 mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b; |
190 } else { | 190 } else { |
191 /* small mantissa, no GAQ, or Gk=1 */ | 191 /* small mantissa, no GAQ, or Gk=1 */ |
192 mant <<= 24 - bits; | 192 mant <<= 24 - bits; |
193 if (!log_gain) { | 193 if (!log_gain) { |
194 /* remap mantissa value for no GAQ or Gk=1 */ | 194 /* remap mantissa value for no GAQ or Gk=1 */ |
195 mant += ((ff_eac3_gaq_remap_1[hebap-8] << 8) * (int64_t)mant) >> 23; | 195 mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15; |
196 } | 196 } |
197 } | 197 } |
198 s->pre_mantissa[ch][bin][blk] = mant; | 198 s->pre_mantissa[ch][bin][blk] = mant; |
199 } | 199 } |
200 } | 200 } |