[FFmpeg-cvslog] avfilter/avf_showcwt: fix very low freqs leakage

Paul B Mahol git at videolan.org
Sat Jul 29 12:23:25 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jul 29 00:52:53 2023 +0200| [6f6907fd202a08826ceefe0fe2bd6501a696ed15] | committer: Paul B Mahol

avfilter/avf_showcwt: fix very low freqs leakage

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

 libavfilter/avf_showcwt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/avf_showcwt.c b/libavfilter/avf_showcwt.c
index 4aa008ca2e..85cb19103b 100644
--- a/libavfilter/avf_showcwt.c
+++ b/libavfilter/avf_showcwt.c
@@ -636,6 +636,7 @@ static int compute_kernel(AVFilterContext *ctx)
     const int fsize = s->frequency_band_count;
     int *kernel_start = s->kernel_start;
     int *kernel_stop = s->kernel_stop;
+    const int hsize = size >> 1;
     unsigned *index = s->index;
     int kernel_min = INT_MAX;
     int kernel_max = 0, ret = 0;
@@ -656,6 +657,7 @@ static int compute_kernel(AVFilterContext *ctx)
         for (int n = 0; n < size; n++) {
             float ff, f = n-frequency;
 
+            f = hsize - fabsf(f - hsize);
             ff = expf(-f*f*deviation);
             tkernel[n] = ff;
         }



More information about the ffmpeg-cvslog mailing list