aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc_float.c
diff options
context:
space:
mode:
authorJustin Ruggles2011-01-13 15:28:06 -0500
committerMans Rullgard2011-01-22 17:53:28 +0000
commit3b924294ea0ab891cf28fb30f26962a7960f7f37 (patch)
tree8ba0fef5760cd4f4f863ac70d627f930863038e8 /libavcodec/ac3enc_float.c
parent6eabb0d3ad42b91c1b4c298718c29961f7c1653a (diff)
ac3enc: use dsputil functions in apply_window()
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/ac3enc_float.c')
-rw-r--r--libavcodec/ac3enc_float.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c
index f3246362e7..33e8294fbf 100644
--- a/libavcodec/ac3enc_float.c
+++ b/libavcodec/ac3enc_float.c
@@ -48,17 +48,19 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
int nbits)
{
float *window;
- int n, n2;
+ int i, n, n2;
n = 1 << nbits;
n2 = n >> 1;
- window = av_malloc(n2 * sizeof(*window));
+ window = av_malloc(n * sizeof(*window));
if (!window) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate memory.\n");
return AVERROR(ENOMEM);
}
ff_kbd_window_init(window, 5.0, n2);
+ for (i = 0; i < n2; i++)
+ window[n-1-i] = window[i];
mdct->window = window;
return ff_mdct_init(&mdct->fft, nbits, 0, -2.0 / n);
@@ -79,16 +81,10 @@ static void mdct512(AC3MDCTContext *mdct, float *out, float *in)
/**
* Apply KBD window to input samples prior to MDCT.
*/
-static void apply_window(float *output, const float *input,
+static void apply_window(DSPContext *dsp, float *output, const float *input,
const float *window, int n)
{
- int i;
- int n2 = n >> 1;
-
- for (i = 0; i < n2; i++) {
- output[i] = input[i] * window[i];
- output[n-i-1] = input[n-i-1] * window[i];
- }
+ dsp->vector_fmul(output, input, window, n);
}