diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-07-29 00:52:53 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-07-29 11:30:16 +0200 |
commit | 6f6907fd202a08826ceefe0fe2bd6501a696ed15 (patch) | |
tree | f133948089ad7dbb47f03a7aff5a9fa3f9fedc5f /libavfilter | |
parent | 27b43643395543783f071731665924d570287ff1 (diff) | |
download | ffmpeg-6f6907fd202a08826ceefe0fe2bd6501a696ed15.tar.gz |
avfilter/avf_showcwt: fix very low freqs leakage
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/avf_showcwt.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |