[FFmpeg-devel] [PATCH 3/3] avfilter/af_loudnorm: remove hard clipping of samples
Paul B Mahol
onemda at gmail.com
Tue Feb 22 18:46:16 EET 2022
It can cause unpleasant artifacts.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
libavfilter/af_loudnorm.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libavfilter/af_loudnorm.c b/libavfilter/af_loudnorm.c
index 7c8ac3a39d..9bb0c65bb7 100644
--- a/libavfilter/af_loudnorm.c
+++ b/libavfilter/af_loudnorm.c
@@ -394,12 +394,8 @@ static void true_peak_limiter(LoudNormContext *s, double *out, int nb_samples, i
} while (smp_cnt < nb_samples);
for (n = 0; n < nb_samples; n++) {
- for (c = 0; c < channels; c++) {
+ for (c = 0; c < channels; c++)
out[c] = buf[index + c];
- if (fabs(out[c]) > ceiling) {
- out[c] = ceiling * (out[c] < 0 ? -1 : 1);
- }
- }
out += channels;
index += channels;
if (index >= s->limiter_buf_size)
--
2.33.0
More information about the ffmpeg-devel
mailing list