Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-13 17:35:50 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-09-13 17:35:50 +0400
commite3e09f2bad12fae4d2449cebb6130e2cf2266083 (patch)
tree4e62dffcef37727e4cfa2507bacd5b9fb225341d /libavcodec/ac3dsp.c
parentc942e8b1d75243b97db24e0c75f7d5c7b9d585eb (diff)
parentca6b544ac9d07dcd4d151d5729f0bf52f4f8653d (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: os_support: Choose between direct.h and io.h using a configure check os_support: Include io.h instead of direct.h on mingw32ce x86: ac3dsp: Only refer to the ac3_downmix_sse symbol if it has been declared swscale: Remove two bogus asserts ac3: move ac3_downmix() from dsputil to ac3dsp lavr/audio_mix_matrix: acknowledge the existence of LFE2. mlp_parser: avoid mapping multiple disctinct TrueHD channels to the same Libav channel. lavu/audioconvert: add a second low frequency channel. Conflicts: doc/APIchanges libavcodec/ac3dsp.c libavcodec/ac3dsp.h libavcodec/mlp_parser.c libavutil/audioconvert.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dsp.c')
-rw-r--r--libavcodec/ac3dsp.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
index 581e5f5071..4e1e4bd709 100644
--- a/libavcodec/ac3dsp.c
+++ b/libavcodec/ac3dsp.c
@@ -214,6 +214,31 @@ static void ac3_sum_square_butterfly_float_c(float sum[4],
}
}
+static void 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;
+ }
+ }
+}
+
av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
{
c->ac3_exponent_min = ac3_exponent_min_c;
@@ -227,6 +252,7 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
c->extract_exponents = ac3_extract_exponents_c;
c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c;
c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c;
+ c->downmix = ac3_downmix_c;
if (ARCH_ARM)
ff_ac3dsp_init_arm(c, bit_exact);