summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-09-13 19:35:18 +0100
committerMans Rullgard <mans@mansr.com>2012-12-09 15:52:01 +0000
commit30b39164256999efc8d77edc85e2e0b963c24834 (patch)
tree0b927b8bbcf6cf72206db8ef84894227bb0520e0 /libavcodec/ac3dec.c
parentb8f3ab8e6a7ce3627764da53b809628c828d4047 (diff)
ac3dec: make downmix() take array of pointers to channel data
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index c5507cc3e9..fe709defa9 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -160,6 +160,8 @@ static av_cold void ac3_tables_init(void)
static av_cold int ac3_decode_init(AVCodecContext *avctx)
{
AC3DecodeContext *s = avctx->priv_data;
+ int i;
+
s->avctx = avctx;
ff_ac3_common_init();
@@ -185,6 +187,12 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
avcodec_get_frame_defaults(&s->frame);
avctx->coded_frame = &s->frame;
+ for (i = 0; i < AC3_MAX_CHANNELS; i++) {
+ s->outptr[i] = s->output[i];
+ s->xcfptr[i] = s->transform_coeffs[i];
+ s->dlyptr[i] = s->delay[i];
+ }
+
return 0;
}
@@ -1231,18 +1239,18 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
do_imdct(s, s->channels);
if (downmix_output) {
- s->ac3dsp.downmix(s->output, s->downmix_coeffs,
+ s->ac3dsp.downmix(s->outptr, s->downmix_coeffs,
s->out_channels, s->fbw_channels, 256);
}
} else {
if (downmix_output) {
- s->ac3dsp.downmix(s->transform_coeffs + 1, s->downmix_coeffs,
+ s->ac3dsp.downmix(s->xcfptr + 1, s->downmix_coeffs,
s->out_channels, s->fbw_channels, 256);
}
if (downmix_output && !s->downmixed) {
s->downmixed = 1;
- s->ac3dsp.downmix(s->delay, s->downmix_coeffs, s->out_channels,
+ s->ac3dsp.downmix(s->dlyptr, s->downmix_coeffs, s->out_channels,
s->fbw_channels, 128);
}