[FFmpeg-cvslog] avfilter/af_dynaudnorm: do not clip audio
Paul B Mahol
git at videolan.org
Sat Jan 4 20:37:08 EET 2020
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jan 4 10:27:46 2020 +0100| [6a1305e8b7d191e6b8647f89a22efbad7e81cc05] | committer: Paul B Mahol
avfilter/af_dynaudnorm: do not clip audio
Clipping can happen when smoothed gain is higher than maximum
allowed gain factor for current frame and peak value option is
set to enough low value.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a1305e8b7d191e6b8647f89a22efbad7e81cc05
---
libavfilter/af_dynaudnorm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c
index 4b9153e418..09d2aeb816 100644
--- a/libavfilter/af_dynaudnorm.c
+++ b/libavfilter/af_dynaudnorm.c
@@ -490,6 +490,7 @@ static void update_gain_history(DynamicAudioNormalizerContext *s, int channel,
double smoothed;
av_assert0(cqueue_size(s->gain_history_minimum[channel]) == s->filter_size);
smoothed = gaussian_filter(s, s->gain_history_minimum[channel]);
+ smoothed = FFMIN(smoothed, cqueue_peek(s->gain_history_minimum[channel], s->filter_size / 2));
cqueue_enqueue(s->gain_history_smoothed[channel], smoothed);
More information about the ffmpeg-cvslog
mailing list