diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-11-28 12:49:25 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-11-28 13:12:06 +0100 |
commit | 50e2ad41de9129d55e1c7bf7c96ff7d43cf6cac5 (patch) | |
tree | 796aab66a5cdd24cea72e2c399aa460c720ec69b /libavfilter/af_acrossover.c | |
parent | 81503ac58a763a36b1f57264013b1e76acb62b68 (diff) |
avfilter/af_acrossover: remove unecessary allpass calls
Diffstat (limited to 'libavfilter/af_acrossover.c')
-rw-r--r-- | libavfilter/af_acrossover.c | 19 |
1 files changed, 10 insertions, 9 deletions
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); \ } \ } \ } \ |