[FFmpeg-cvslog] avfilter/af_aiir: do not ignore k option for audio filtering

Paul B Mahol git at videolan.org
Sat Jul 13 13:30:24 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jul 13 12:25:54 2019 +0200| [60e6db2f5bf6136ae4b603c3e5ee6697d47b1ef1] | committer: Paul B Mahol

avfilter/af_aiir: do not ignore k option for audio filtering

Previously it was used only for displaying frequency response.

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

 libavfilter/af_aiir.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c
index 5a3b9e849d..b23aa3c868 100644
--- a/libavfilter/af_aiir.c
+++ b/libavfilter/af_aiir.c
@@ -135,6 +135,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
     const int nb_b = s->iir[ch].nb_ab[1];                               \
     const double *a = s->iir[ch].ab[0];                                 \
     const double *b = s->iir[ch].ab[1];                                 \
+    const double g = s->iir[ch].g;                                      \
     int *clippings = &s->iir[ch].clippings;                             \
     type *dst = (type *)out->extended_data[ch];                         \
     int n;                                                              \
@@ -153,7 +154,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
             sample -= a[x] * oc[x];                                     \
                                                                         \
         oc[0] = sample;                                                 \
-        sample *= og;                                                   \
+        sample *= og * g;                                               \
         sample = sample * mix + ic[0] * (1. - mix);                     \
         if (need_clipping && sample < min) {                            \
             (*clippings)++;                                             \
@@ -186,6 +187,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb
     const type *src = (const type *)in->extended_data[ch];              \
     type *dst = (type *)out->extended_data[ch];                         \
     IIRChannel *iir = &s->iir[ch];                                      \
+    const double g = iir->g;                                            \
     int *clippings = &iir->clippings;                                   \
     int nb_biquads = (FFMAX(iir->nb_ab[0], iir->nb_ab[1]) + 1) / 2;     \
     int n, i;                                                           \
@@ -209,7 +211,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb
             i1 = src[n];                                                \
             o2 = o1;                                                    \
             o1 = o0;                                                    \
-            o0 *= og;                                                   \
+            o0 *= og * g;                                               \
                                                                         \
             o0 = o0 * mix + (1. - mix) * sample;                        \
             if (need_clipping && o0 < min) {                            \



More information about the ffmpeg-cvslog mailing list