From 50e2ad41de9129d55e1c7bf7c96ff7d43cf6cac5 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 28 Nov 2020 12:49:25 +0100 Subject: avfilter/af_acrossover: remove unecessary allpass calls --- libavfilter/af_acrossover.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'libavfilter/af_acrossover.c') diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c index 3b31031c43..f989ac81d9 100644 --- a/libavfilter/af_acrossover.c +++ b/libavfilter/af_acrossover.c @@ -305,38 +305,39 @@ static int filter_channels_## name(AVFilterContext *ctx, void *arg, int jobnr, i \ for (int band = 0; band < ctx->nb_outputs; band++) { \ for (int f = 0; band + 1 < ctx->nb_outputs && f < s->filter_count; f++) { \ - const type *src = band == 0 ? (const type *)in->extended_data[ch] : (const type *)frames[band]->extended_data[ch]; \ + const type *src = (const type *)in->extended_data[ch]; \ + const type *prv = (const type *)frames[band]->extended_data[ch]; \ type *dst = (type *)frames[band + 1]->extended_data[ch]; \ - const type *hsrc = f == 0 ? src : dst; \ + const type *hsrc = (band == 0 && f == 0) ? src : f == 0 ? prv : dst; \ BiquadContext *hp = &xover->hp[band][f]; \ \ biquad_process_## name(hp, dst, hsrc, nb_samples); \ } \ \ for (int f = 0; band + 1 < ctx->nb_outputs && f < s->filter_count; f++) { \ - const type *src = band == 0 ? (const type *)in->extended_data[ch] : (const type *)frames[band]->extended_data[ch]; \ + const type *src = (const type *)in->extended_data[ch]; \ type *dst = (type *)frames[band]->extended_data[ch]; \ - const type *lsrc = f == 0 ? src : dst; \ + const type *lsrc = (band == 0 && f == 0) ? src : dst; \ BiquadContext *lp = &xover->lp[band][f]; \ \ biquad_process_## name(lp, dst, lsrc, nb_samples); \ } \ \ - for (int aband = band + 1; aband < ctx->nb_outputs; aband++) { \ + for (int aband = band + 1; aband + 1 < ctx->nb_outputs; aband++) { \ if (s->first_order) { \ - const type *src = (const type *)frames[band]->extended_data[ch]; \ + const type *asrc = (const type *)frames[band]->extended_data[ch]; \ type *dst = (type *)frames[band]->extended_data[ch]; \ BiquadContext *ap = &xover->ap[band][aband][0]; \ \ - biquad_process_## name(ap, dst, src, nb_samples); \ + biquad_process_## name(ap, dst, asrc, nb_samples); \ } \ \ for (int f = s->first_order; f < s->ap_filter_count; f++) { \ - const type *src = (const type *)frames[band]->extended_data[ch]; \ + const type *asrc = (const type *)frames[band]->extended_data[ch]; \ type *dst = (type *)frames[band]->extended_data[ch]; \ BiquadContext *ap = &xover->ap[band][aband][f]; \ \ - biquad_process_## name(ap, dst, src, nb_samples); \ + biquad_process_## name(ap, dst, asrc, nb_samples); \ } \ } \ } \ -- cgit v1.2.3