Browse Source

avfilter/af_dynaudnorm: use better limits for maximal amplification

Fixes regression in smoothness of amplification.
tags/n4.3
Paul B Mahol 5 years ago
parent
commit
b650046860
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavfilter/af_dynaudnorm.c

+ 3
- 2
libavfilter/af_dynaudnorm.c View 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) { 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 = 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); cqueue_enqueue(s->gain_history_smoothed[channel], smoothed);




Loading…
Cancel
Save