summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dsp.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-12-06 12:22:40 +0000
committerDiego Biurrun <diego@biurrun.de>2013-12-08 17:57:15 +0100
commit4958f35a2ebc307049ff2104ffb944f5f457feb3 (patch)
treea71bf8e6ea26d5df56bcfd754d5dc44e8e8da9a2 /libavcodec/ac3dsp.c
parent120797e2ef0ca317daf63ad79be5f72f835e9ac2 (diff)
downloadffmpeg-4958f35a2ebc307049ff2104ffb944f5f457feb3.tar.gz
dsputil: Move apply_window_int16 to ac3dsp
The (optimized) functions are used nowhere else.
Diffstat (limited to 'libavcodec/ac3dsp.c')
-rw-r--r--libavcodec/ac3dsp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
index ef19f6a449..e792bcfce5 100644
--- a/libavcodec/ac3dsp.c
+++ b/libavcodec/ac3dsp.c
@@ -23,6 +23,7 @@
#include "avcodec.h"
#include "ac3.h"
#include "ac3dsp.h"
+#include "mathops.h"
static void ac3_exponent_min_c(uint8_t *exp, int num_reuse_blocks, int nb_coefs)
{
@@ -196,6 +197,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;
@@ -208,6 +222,7 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
c->compute_mantissa_size = ac3_compute_mantissa_size_c;
c->extract_exponents = ac3_extract_exponents_c;
c->downmix = ac3_downmix_c;
+ c->apply_window_int16 = apply_window_int16_c;
if (ARCH_ARM)
ff_ac3dsp_init_arm(c, bit_exact);