diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-08 23:02:54 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-08 23:59:09 +0200 |
commit | 7e22514d98ecd56cc4e55dac7c813551e2152b80 (patch) | |
tree | 13c47e1e1215525323177a008d5406a7d61a418a /libavcodec/aacenc.c | |
parent | e016e3c9d7ce1493b952bdd8232f7e03077469a3 (diff) | |
parent | 3b81a18ba30bf18bab78f56744d8f3e1e4060104 (diff) | |
download | ffmpeg-7e22514d98ecd56cc4e55dac7c813551e2152b80.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
float_dsp: ppc: add a separate header for Altivec function prototypes
ARM: fix float_dsp breakage from d5a7229
Add a float DSP framework to libavutil
PPC: Move types_altivec.h and util_altivec.h from libavcodec to libavutil
ARM: Move asm.S from libavcodec to libavutil
vc1dsp: mark put/avg_vc1_mspel_mc() always_inline
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r-- | libavcodec/aacenc.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 234ebff39a..7696e96bdf 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -30,6 +30,7 @@ * add temporal noise shaping ***********************************/ +#include "libavutil/float_dsp.h" #include "libavutil/opt.h" #include "avcodec.h" #include "put_bits.h" @@ -182,7 +183,9 @@ static void put_audio_specific_config(AVCodecContext *avctx) } #define WINDOW_FUNC(type) \ -static void apply_ ##type ##_window(DSPContext *dsp, SingleChannelElement *sce, const float *audio) +static void apply_ ##type ##_window(DSPContext *dsp, AVFloatDSPContext *fdsp, \ + SingleChannelElement *sce, \ + const float *audio) WINDOW_FUNC(only_long) { @@ -190,7 +193,7 @@ WINDOW_FUNC(only_long) const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024; float *out = sce->ret; - dsp->vector_fmul (out, audio, lwindow, 1024); + fdsp->vector_fmul (out, audio, lwindow, 1024); dsp->vector_fmul_reverse(out + 1024, audio + 1024, pwindow, 1024); } @@ -200,7 +203,7 @@ WINDOW_FUNC(long_start) const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128; float *out = sce->ret; - dsp->vector_fmul(out, audio, lwindow, 1024); + fdsp->vector_fmul(out, audio, lwindow, 1024); memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448); dsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128); memset(out + 1024 + 576, 0, sizeof(out[0]) * 448); @@ -213,7 +216,7 @@ WINDOW_FUNC(long_stop) float *out = sce->ret; memset(out, 0, sizeof(out[0]) * 448); - dsp->vector_fmul(out + 448, audio + 448, swindow, 128); + fdsp->vector_fmul(out + 448, audio + 448, swindow, 128); memcpy(out + 576, audio + 576, sizeof(out[0]) * 448); dsp->vector_fmul_reverse(out + 1024, audio + 1024, lwindow, 1024); } @@ -227,7 +230,7 @@ WINDOW_FUNC(eight_short) int w; for (w = 0; w < 8; w++) { - dsp->vector_fmul (out, in, w ? pwindow : swindow, 128); + fdsp->vector_fmul (out, in, w ? pwindow : swindow, 128); out += 128; in += 128; dsp->vector_fmul_reverse(out, in, swindow, 128); @@ -235,7 +238,9 @@ WINDOW_FUNC(eight_short) } } -static void (*const apply_window[4])(DSPContext *dsp, SingleChannelElement *sce, const float *audio) = { +static void (*const apply_window[4])(DSPContext *dsp, AVFloatDSPContext *fdsp, + SingleChannelElement *sce, + const float *audio) = { [ONLY_LONG_SEQUENCE] = apply_only_long_window, [LONG_START_SEQUENCE] = apply_long_start_window, [EIGHT_SHORT_SEQUENCE] = apply_eight_short_window, @@ -248,7 +253,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce, int i; float *output = sce->ret; - apply_window[sce->ics.window_sequence[0]](&s->dsp, sce, audio); + apply_window[sce->ics.window_sequence[0]](&s->dsp, &s->fdsp, sce, audio); if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output); @@ -693,6 +698,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s) int ret = 0; ff_dsputil_init(&s->dsp, avctx); + avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT); // window init ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); |