[FFmpeg-cvslog] avfilter: fix highshelf zdf coefficients

Paul B Mahol git at videolan.org
Mon Aug 7 12:51:33 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Aug  7 11:55:13 2023 +0200| [d295b6b6936c9c691a4871851fdaec04d407e54b] | committer: Paul B Mahol

avfilter: fix highshelf zdf coefficients

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

 libavfilter/adynamicequalizer_template.c | 2 +-
 libavfilter/af_biquads.c                 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/adynamicequalizer_template.c b/libavfilter/adynamicequalizer_template.c
index 94a27ea1cc..26fcebf8bc 100644
--- a/libavfilter/adynamicequalizer_template.c
+++ b/libavfilter/adynamicequalizer_template.c
@@ -238,7 +238,7 @@ static int fn(filter_channels)(AVFilterContext *ctx, void *arg, int jobnr, int n
                     break;
                 case 2:
                     k = itqfactor;
-                    g = fg / SQRT(gain);
+                    g = fg * SQRT(gain);
 
                     fa[0] = ONE / (ONE + g * (g + k));
                     fa[1] = g * fa[0];
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 2bcc6fd4a5..e465539411 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -722,7 +722,7 @@ static void convert_dir2zdf(BiquadsContext *s, int sample_rate)
     case treble:
     case highshelf:
         A = ff_exp10(s->gain / 40.);
-        g = tan(M_PI * s->frequency / sample_rate) / sqrt(A);
+        g = tan(M_PI * s->frequency / sample_rate) * sqrt(A);
         k = 1. / Q;
         a[0] = 1. / (1. + g * (g + k));
         a[1] = g * a[0];



More information about the ffmpeg-cvslog mailing list