[FFmpeg-cvslog] avfilter/af_aiir: reverse order of biquads in serial processing

Paul B Mahol git at videolan.org
Sat Oct 17 19:46:44 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Oct 17 18:23:35 2020 +0200| [7c1eef48e182ca5e24987fdb9b00363544bdfb58] | committer: Paul B Mahol

avfilter/af_aiir: reverse order of biquads in serial processing

This avoids most of clippings for fixed-point precision inputs.
Also add warning about filtering fixed-point precision with parallel processing.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c1eef48e182ca5e24987fdb9b00363544bdfb58
---

 libavfilter/af_aiir.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c
index 8900b0a7c4..f5e5dbb036 100644
--- a/libavfilter/af_aiir.c
+++ b/libavfilter/af_aiir.c
@@ -195,7 +195,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg,       \
     int nb_biquads = (FFMAX(iir->nb_ab[0], iir->nb_ab[1]) + 1) / 2;     \
     int n, i;                                                           \
                                                                         \
-    for (i = 0; i < nb_biquads; i++) {                                  \
+    for (i = nb_biquads - 1; i >= 0; i--) {                             \
         const double a1 = -iir->biquads[i].a[1];                        \
         const double a2 = -iir->biquads[i].a[2];                        \
         const double b0 = iir->biquads[i].b[0];                         \
@@ -1226,6 +1226,8 @@ static int config_output(AVFilterLink *outlink)
         if (ret < 0)
             return ret;
     } else if (s->format > 0 && s->process == 2) {
+        if (s->precision > 1)
+            av_log(ctx, AV_LOG_WARNING, "Parallel processing is not recommended for fixed-point precisions.\n");
         ret = decompose_zp2biquads(ctx, inlink->channels);
         if (ret < 0)
             return ret;



More information about the ffmpeg-cvslog mailing list