From 26292d4b6b96fd8123774a94143b68c7d3c63448 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 15 Mar 2022 11:20:03 +0100 Subject: [PATCH] avfilter/af_afftdn: use log10 instead to get noise levels --- libavfilter/af_afftdn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c index fb1e031cbf..f42243dd8b 100644 --- a/libavfilter/af_afftdn.c +++ b/libavfilter/af_afftdn.c @@ -974,7 +974,7 @@ static void finish_sample_noise(AudioFFTDeNoiseContext *s, dnch->noise_band_var[i] -= dnch->noise_band_avr[i] * dnch->noise_band_avr[i] + dnch->noise_band_avi[i] * dnch->noise_band_avi[i]; dnch->noise_band_auto_var[i] = dnch->noise_band_var[i]; - sample_noise[i] = (1.0 / C) * log(dnch->noise_band_var[i] / s->floor) - 100.0; + sample_noise[i] = 10.0 * log10(dnch->noise_band_var[i] / s->floor) - 100.0; } if (s->noise_band_count < NB_PROFILE_BANDS) { for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++) @@ -1091,7 +1091,7 @@ static void get_auto_noise_levels(AudioFFTDeNoiseContext *s, { if (s->noise_band_count > 0) { for (int i = 0; i < s->noise_band_count; i++) { - levels[i] = (1.0 / C) * log(dnch->noise_band_auto_var[i] / s->floor) - 100.0; + levels[i] = 10.0 * log10(dnch->noise_band_auto_var[i] / s->floor) - 100.0; } if (s->noise_band_count < NB_PROFILE_BANDS) { for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++)