summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-09-11 17:55:11 +0100
committerMans Rullgard <mans@mansr.com>2012-09-12 23:39:50 +0100
commit97cb9236cf3c45eb8a8fba8b88bdde6ece3f496f (patch)
tree82d61b5b9f447f09a61277e34022336833853193 /libavcodec/ac3dec.c
parentb901c30da606ade7427fbfb0f9651cc5bfb953a7 (diff)
ac3: move ac3_downmix() from dsputil to ac3dsp
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c40
1 files changed, 6 insertions, 34 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index daa0702460..37426c6158 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -621,34 +621,6 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
}
/**
- * Downmix the output to mono or stereo.
- */
-void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2],
- int out_ch, int in_ch, int len)
-{
- int i, j;
- float v0, v1;
- if (out_ch == 2) {
- for (i = 0; i < len; i++) {
- v0 = v1 = 0.0f;
- for (j = 0; j < in_ch; j++) {
- v0 += samples[j][i] * matrix[j][0];
- v1 += samples[j][i] * matrix[j][1];
- }
- samples[0][i] = v0;
- samples[1][i] = v1;
- }
- } else if (out_ch == 1) {
- for (i = 0; i < len; i++) {
- v0 = 0.0f;
- for (j = 0; j < in_ch; j++)
- v0 += samples[j][i] * matrix[j][0];
- samples[0][i] = v0;
- }
- }
-}
-
-/**
* Upmix delay samples from stereo to original channel layout.
*/
static void ac3_upmix_delay(AC3DecodeContext *s)
@@ -1266,19 +1238,19 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
do_imdct(s, s->channels);
if (downmix_output) {
- s->dsp.ac3_downmix(s->output, s->downmix_coeffs,
- s->out_channels, s->fbw_channels, 256);
+ s->ac3dsp.downmix(s->output, s->downmix_coeffs,
+ s->out_channels, s->fbw_channels, 256);
}
} else {
if (downmix_output) {
- s->dsp.ac3_downmix(s->transform_coeffs + 1, s->downmix_coeffs,
- s->out_channels, s->fbw_channels, 256);
+ s->ac3dsp.downmix(s->transform_coeffs + 1, s->downmix_coeffs,
+ s->out_channels, s->fbw_channels, 256);
}
if (downmix_output && !s->downmixed) {
s->downmixed = 1;
- s->dsp.ac3_downmix(s->delay, s->downmix_coeffs, s->out_channels,
- s->fbw_channels, 128);
+ s->ac3dsp.downmix(s->delay, s->downmix_coeffs, s->out_channels,
+ s->fbw_channels, 128);
}
do_imdct(s, s->out_channels);