diff options
author | Jason Jang <jcj83429@gmail.com> | 2022-01-28 17:12:41 -0800 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-02-05 14:52:16 +0100 |
commit | 18fceb99260a74ec80d661b28f0ab32783130516 (patch) | |
tree | 84e7376146f8c15897e617da517df06f7fef7dc8 | |
parent | b4ad13420f57ff7b2a411f2f70217635d1516a80 (diff) | |
download | ffmpeg-18fceb99260a74ec80d661b28f0ab32783130516.tar.gz |
avfilter/af_apsyclip: fix peak overestimation
Ignore more samples that are near the edge of the block. The reason
is that the filtering tends to cause these samples to go above the
window more than the samples near the middle. If these samples are
included in the unwindowed peak estimation, the peak can be
overestimated. Because the block is windowed again before
overlapping, overshoots near the edge of the block are not very
important.
0.1 is the value from the version originally contributed to calf.
Signed-off-by: Jason Jang <jcj83429@gmail.com>
-rw-r--r-- | libavfilter/af_apsyclip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_apsyclip.c b/libavfilter/af_apsyclip.c index 0bc469c1a1..2a79ed3a8a 100644 --- a/libavfilter/af_apsyclip.c +++ b/libavfilter/af_apsyclip.c @@ -87,7 +87,7 @@ static void generate_hann_window(float *window, float *inv_window, int size) window[i] = value; // 1/window to calculate unwindowed peak. - inv_window[i] = value > 0.01f ? 1.f / value : 0.f; + inv_window[i] = value > 0.1f ? 1.f / value : 0.f; } } |