diff options
author | Bojan Zivkovic <bojan@mips.com> | 2013-03-06 14:55:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-20 12:44:32 +0100 |
commit | 7d29c6eebc428741004071f7a92ea37d8d1d2cce (patch) | |
tree | e4b09858dac4c966b304b00db59bcc802fdc0ef2 /libavcodec/psymodel.c | |
parent | 26f3924d782b6081ba76fd42c4d35af6ce8cde36 (diff) | |
download | ffmpeg-7d29c6eebc428741004071f7a92ea37d8d1d2cce.tar.gz |
mips: Optimization of IIR filter function
Signed-off-by: Bojan Zivkovic <bojan@mips.com>
Reviewed-by: Nedeljko Babic <Nedeljko.Babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/psymodel.c')
-rw-r--r-- | libavcodec/psymodel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c index 09dd83d315..ea11636ce2 100644 --- a/libavcodec/psymodel.c +++ b/libavcodec/psymodel.c @@ -88,6 +88,7 @@ typedef struct FFPsyPreprocessContext{ float stereo_att; struct FFIIRFilterCoeffs *fcoeffs; struct FFIIRFilterState **fstate; + struct FFIIRFilterContext fiir; }FFPsyPreprocessContext; #define FILT_ORDER 4 @@ -115,6 +116,9 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av for (i = 0; i < avctx->channels; i++) ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER); } + + ff_iir_filter_init(&ctx->fiir); + return ctx; } @@ -122,11 +126,12 @@ void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int ch { int ch; int frame_size = ctx->avctx->frame_size; + FFIIRFilterContext *iir = &ctx->fiir; if (ctx->fstate) { for (ch = 0; ch < channels; ch++) - ff_iir_filter_flt(ctx->fcoeffs, ctx->fstate[ch], frame_size, - &audio[ch][frame_size], 1, &audio[ch][frame_size], 1); + iir->filter_flt(ctx->fcoeffs, ctx->fstate[ch], frame_size, + &audio[ch][frame_size], 1, &audio[ch][frame_size], 1); } } |