aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-06-01 12:40:01 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-06-04 19:08:37 -0400
commit35d5cb1ab4dab657ef31b845893cf98d885c8add (patch)
tree975601e1e6f84878de8776edbc4dbd354fae927d
parent594fbe42c6b21aef76b938ce97524fa92a48e7a0 (diff)
downloadffmpeg-35d5cb1ab4dab657ef31b845893cf98d885c8add.tar.gz
ac3enc: extract all exponents for the frame at once
-rw-r--r--libavcodec/ac3enc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index dbe7784eae..53f6251a5e 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -900,15 +900,11 @@ static av_cold void exponent_init(AC3EncodeContext *s)
*/
static void extract_exponents(AC3EncodeContext *s)
{
- int blk, ch;
+ int ch = !s->cpl_on;
+ int chan_size = AC3_MAX_COEFS * AC3_MAX_BLOCKS * (s->channels - ch + 1);
+ AC3Block *block = &s->blocks[0];
- for (ch = !s->cpl_on; ch <= s->channels; ch++) {
- for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
- AC3Block *block = &s->blocks[blk];
- s->ac3dsp.extract_exponents(block->exp[ch], block->fixed_coef[ch],
- AC3_MAX_COEFS);
- }
- }
+ s->ac3dsp.extract_exponents(block->exp[ch], block->fixed_coef[ch], chan_size);
}