You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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.
This commit is contained in:
@@ -490,6 +490,7 @@ static void update_gain_history(DynamicAudioNormalizerContext *s, int channel,
|
|||||||
double smoothed;
|
double smoothed;
|
||||||
av_assert0(cqueue_size(s->gain_history_minimum[channel]) == s->filter_size);
|
av_assert0(cqueue_size(s->gain_history_minimum[channel]) == s->filter_size);
|
||||||
smoothed = gaussian_filter(s, s->gain_history_minimum[channel]);
|
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);
|
cqueue_enqueue(s->gain_history_smoothed[channel], smoothed);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user