summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-15 01:58:45 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2011-01-15 01:58:45 +0000
commit7cc4be58b4daecd256deba31e5caf5bb11870f15 (patch)
treed5ce20d13a6ac027ce43a19d76a5f3c12ab5da32 /libavcodec/ac3enc.c
parentd881a0e89548abaafb8466192923fb10905dabef (diff)
Rearrange exponent buffer to group all blocks for a single channel together.
This will allow for faster and simpler processing of all blocks at once. Originally committed as revision 26351 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r--libavcodec/ac3enc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index f96883464f..1a87bb9a0f 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1757,14 +1757,17 @@ static av_cold int allocate_buffers(AVCodecContext *avctx)
alloc_fail);
for (ch = 0; ch < s->channels; ch++) {
+ /* arrangement: block, channel, coeff */
block->bap[ch] = &s->bap_buffer [AC3_MAX_COEFS * (blk * s->channels + ch)];
block->mdct_coef[ch] = &s->mdct_coef_buffer [AC3_MAX_COEFS * (blk * s->channels + ch)];
- block->exp[ch] = &s->exp_buffer [AC3_MAX_COEFS * (blk * s->channels + ch)];
block->grouped_exp[ch] = &s->grouped_exp_buffer[128 * (blk * s->channels + ch)];
block->psd[ch] = &s->psd_buffer [AC3_MAX_COEFS * (blk * s->channels + ch)];
block->band_psd[ch] = &s->band_psd_buffer [64 * (blk * s->channels + ch)];
block->mask[ch] = &s->mask_buffer [64 * (blk * s->channels + ch)];
block->qmant[ch] = &s->qmant_buffer [AC3_MAX_COEFS * (blk * s->channels + ch)];
+
+ /* arrangement: channel, block, coeff */
+ block->exp[ch] = &s->exp_buffer [AC3_MAX_COEFS * (AC3_MAX_BLOCKS * ch + blk)];
}
}