]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_dynaudnorm: use better limits for maximal amplification
authorPaul B Mahol <onemda@gmail.com>
Sat, 11 Jan 2020 13:08:52 +0000 (14:08 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sat, 11 Jan 2020 13:08:52 +0000 (14:08 +0100)
Fixes regression in smoothness of amplification.

libavfilter/af_dynaudnorm.c

index db91d28b3652ad469c843208f46d2418f2d8eed4..365453d60d9479d6b77e897a05786be09556d268 100644 (file)
@@ -521,10 +521,11 @@ static void update_gain_history(DynamicAudioNormalizerContext *s, int channel,
     }
 
     while (cqueue_size(s->gain_history_minimum[channel]) >= s->filter_size) {
-        double smoothed;
+        double smoothed, limit;
 
         smoothed = gaussian_filter(s, s->gain_history_minimum[channel], s->threshold_history[channel]);
-        smoothed = FFMIN(smoothed, cqueue_peek(s->gain_history_minimum[channel], s->filter_size / 2));
+        limit    = cqueue_peek(s->gain_history_original[channel], 0);
+        smoothed = FFMIN(smoothed, limit);
 
         cqueue_enqueue(s->gain_history_smoothed[channel], smoothed);