X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fpsymodel.c;h=b3cfb0e75fb9824fe3f01f60d3e72767d7538548;hb=0bb57f8bf029427059be21a562527dcfa0e264c9;hp=faadb1b8705308d12b473b272e857e66a7a45380;hpb=95d6e5bdd58d5caaa52c57bad1e1d87df59fb7f8;p=ffmpeg diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c index faadb1b8705..b3cfb0e75fb 100644 --- a/libavcodec/psymodel.c +++ b/libavcodec/psymodel.c @@ -112,20 +112,15 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av return ctx; } -void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, - const int16_t *audio, int16_t *dest, - int tag, int channels) +void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int channels) { - int ch, i; + int ch; + int frame_size = ctx->avctx->frame_size; + if (ctx->fstate) { for (ch = 0; ch < channels; ch++) - ff_iir_filter(ctx->fcoeffs, ctx->fstate[tag+ch], ctx->avctx->frame_size, - audio + ch, ctx->avctx->channels, - dest + ch, ctx->avctx->channels); - } else { - for (ch = 0; ch < channels; ch++) - for (i = 0; i < ctx->avctx->frame_size; i++) - dest[i*ctx->avctx->channels + ch] = audio[i*ctx->avctx->channels + ch]; + ff_iir_filter_flt(ctx->fcoeffs, ctx->fstate[ch], frame_size, + &audio[ch][frame_size], 1, &audio[ch][frame_size], 1); } }