diff options
Diffstat (limited to 'chromium/third_party/ffmpeg/libavcodec/ac3dsp.c')
-rw-r--r-- | chromium/third_party/ffmpeg/libavcodec/ac3dsp.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c b/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c index feda6ddc6e8..b746817c9d9 100644 --- a/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c +++ b/chromium/third_party/ffmpeg/libavcodec/ac3dsp.c @@ -1,5 +1,5 @@ /* - * AC-3 DSP utils + * AC-3 DSP functions * Copyright (c) 2011 Justin Ruggles * * This file is part of FFmpeg. @@ -239,6 +239,31 @@ static void ac3_downmix_c(float **samples, float (*matrix)[2], } } +static void ac3_downmix_c_fixed(int32_t **samples, int16_t (*matrix)[2], + int out_ch, int in_ch, int len) +{ + int i, j; + int64_t v0, v1; + if (out_ch == 2) { + for (i = 0; i < len; i++) { + v0 = v1 = 0; + for (j = 0; j < in_ch; j++) { + v0 += (int64_t)samples[j][i] * matrix[j][0]; + v1 += (int64_t)samples[j][i] * matrix[j][1]; + } + samples[0][i] = (v0+2048)>>12; + samples[1][i] = (v1+2048)>>12; + } + } else if (out_ch == 1) { + for (i = 0; i < len; i++) { + v0 = 0; + for (j = 0; j < in_ch; j++) + v0 += (int64_t)samples[j][i] * matrix[j][0]; + samples[0][i] = (v0+2048)>>12; + } + } +} + static void apply_window_int16_c(int16_t *output, const int16_t *input, const int16_t *window, unsigned int len) { @@ -266,6 +291,7 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) 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; + c->downmix_fixed = ac3_downmix_c_fixed; c->apply_window_int16 = apply_window_int16_c; if (ARCH_ARM) |