Mercurial > libavcodec.hg
comparison ac3dec.c @ 10297:12d40dab6d80 libavcodec
Rearrange loop structure for approx. 35-50% faster calc_transform_coeffs_cpl()
depending on content.
author | jbr |
---|---|
date | Sun, 27 Sep 2009 07:16:51 +0000 |
parents | 916c2b7ecd02 |
children | 6bca3f74d77d |
comparison
equal
deleted
inserted
replaced
10296:a919d9583abd | 10297:12d40dab6d80 |
---|---|
414 { | 414 { |
415 int bin, band, ch; | 415 int bin, band, ch; |
416 | 416 |
417 bin = s->start_freq[CPL_CH]; | 417 bin = s->start_freq[CPL_CH]; |
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_end = bin + s->cpl_band_sizes[band]; | 420 int band_end = bin + s->cpl_band_sizes[band]; |
420 for (; bin < band_end; bin++) { | 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]; |
424 for (bin = band_start; bin < band_end; bin++) { | |
423 s->fixed_coeffs[ch][bin] = ((int64_t)s->fixed_coeffs[CPL_CH][bin] * | 425 s->fixed_coeffs[ch][bin] = ((int64_t)s->fixed_coeffs[CPL_CH][bin] * |
424 (int64_t)s->cpl_coords[ch][band]) >> 23; | 426 cpl_coord) >> 23; |
425 if (ch == 2 && s->phase_flags[band]) | |
426 s->fixed_coeffs[ch][bin] = -s->fixed_coeffs[ch][bin]; | |
427 } | 427 } |
428 } | 428 if (ch == 2 && s->phase_flags[band]) { |
429 } | 429 for (bin = band_start; bin < band_end; bin++) |
430 s->fixed_coeffs[2][bin] = -s->fixed_coeffs[2][bin]; | |
431 } | |
432 } | |
433 } | |
434 bin = band_end; | |
430 } | 435 } |
431 } | 436 } |
432 | 437 |
433 /** | 438 /** |
434 * Grouped mantissas for 3-level 5-level and 11-level quantization | 439 * Grouped mantissas for 3-level 5-level and 11-level quantization |