[FFmpeg-cvslog] avfilter/af_afftdn: use log10 instead to get noise levels
Paul B Mahol
git at videolan.org
Tue Mar 15 17:11:24 EET 2022
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Mar 15 11:20:03 2022 +0100| [26292d4b6b96fd8123774a94143b68c7d3c63448] | committer: Paul B Mahol
avfilter/af_afftdn: use log10 instead to get noise levels
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=26292d4b6b96fd8123774a94143b68c7d3c63448
---
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++)
More information about the ffmpeg-cvslog
mailing list