Mercurial > libavcodec.hg
comparison ac3dec.c @ 10865:bcdc5343a577 libavcodec
Use MULH instead of 64x64 multiplication, around 5% overall speedup on Intel Atom.
Patch by myself and Yuriy Kaminskiy [yumkam mail ru]
author | reimar |
---|---|
date | Tue, 12 Jan 2010 23:02:07 +0000 |
parents | f8fc0a56745e |
children | 621268959a5c |
comparison
equal
deleted
inserted
replaced
10864:e3f5eb016712 | 10865:bcdc5343a577 |
---|---|
418 for (band = 0; band < s->num_cpl_bands; band++) { | 418 for (band = 0; band < s->num_cpl_bands; band++) { |
419 int band_start = bin; | 419 int band_start = bin; |
420 int band_end = bin + s->cpl_band_sizes[band]; | 420 int band_end = bin + s->cpl_band_sizes[band]; |
421 for (ch = 1; ch <= s->fbw_channels; ch++) { | 421 for (ch = 1; ch <= s->fbw_channels; ch++) { |
422 if (s->channel_in_cpl[ch]) { | 422 if (s->channel_in_cpl[ch]) { |
423 int64_t cpl_coord = s->cpl_coords[ch][band]; | 423 int cpl_coord = s->cpl_coords[ch][band] << 5; |
424 for (bin = band_start; bin < band_end; bin++) { | 424 for (bin = band_start; bin < band_end; bin++) { |
425 s->fixed_coeffs[ch][bin] = ((int64_t)s->fixed_coeffs[CPL_CH][bin] * | 425 s->fixed_coeffs[ch][bin] = MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord); |
426 cpl_coord) >> 23; | |
427 } | 426 } |
428 if (ch == 2 && s->phase_flags[band]) { | 427 if (ch == 2 && s->phase_flags[band]) { |
429 for (bin = band_start; bin < band_end; bin++) | 428 for (bin = band_start; bin < band_end; bin++) |
430 s->fixed_coeffs[2][bin] = -s->fixed_coeffs[2][bin]; | 429 s->fixed_coeffs[2][bin] = -s->fixed_coeffs[2][bin]; |
431 } | 430 } |