diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 04:12:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-09 04:12:40 +0100 |
commit | 8e70fdab3614a5ef709d60b67c6729c3eca93c21 (patch) | |
tree | e18aa3e652eb2ec4949bd4186e49aa385a0d39a8 /libavcodec/ac3dsp.c | |
parent | a12f679a5db9a2069f58a993317720c5b4f82c27 (diff) | |
parent | 4958f35a2ebc307049ff2104ffb944f5f457feb3 (diff) | |
download | ffmpeg-8e70fdab3614a5ef709d60b67c6729c3eca93c21.tar.gz |
Merge commit '4958f35a2ebc307049ff2104ffb944f5f457feb3'
* commit '4958f35a2ebc307049ff2104ffb944f5f457feb3':
dsputil: Move apply_window_int16 to ac3dsp
Conflicts:
libavcodec/arm/ac3dsp_init_arm.c
libavcodec/arm/ac3dsp_neon.S
libavcodec/x86/ac3dsp_init.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dsp.c')
-rw-r--r-- | libavcodec/ac3dsp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c index 6df3a68a45..feda6ddc6e 100644 --- a/libavcodec/ac3dsp.c +++ b/libavcodec/ac3dsp.c @@ -239,6 +239,19 @@ static void ac3_downmix_c(float **samples, float (*matrix)[2], } } +static void apply_window_int16_c(int16_t *output, const int16_t *input, + const int16_t *window, unsigned int len) +{ + int i; + int len2 = len >> 1; + + for (i = 0; i < len2; i++) { + int16_t w = window[i]; + output[i] = (MUL16(input[i], w) + (1 << 14)) >> 15; + output[len-i-1] = (MUL16(input[len-i-1], w) + (1 << 14)) >> 15; + } +} + av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) { c->ac3_exponent_min = ac3_exponent_min_c; @@ -253,6 +266,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->apply_window_int16 = apply_window_int16_c; if (ARCH_ARM) ff_ac3dsp_init_arm(c, bit_exact); |