summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-03-13 15:38:11 +0100
committerPaul B Mahol <onemda@gmail.com>2022-03-13 17:28:24 +0100
commit3cb5a5f64c87d0129efb28ebd34a63693daf1cf4 (patch)
tree33de328fe12e83129f92909aa48348a13f8edc6a /libavfilter
parent9e279c8c2d0ce36f20f7981ad0a771eaef4d1f44 (diff)
avfilter/af_afftdn: improve residual tracking
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_afftdn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 03e55f893f..726ea4aade 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -580,7 +580,7 @@ static void set_parameters(AudioFFTDeNoiseContext *s, DeNoiseChannel *dnch, int
if (update_var || dnch->last_residual_floor != dnch->residual_floor) {
update_var = 1;
dnch->last_residual_floor = dnch->residual_floor;
- dnch->last_noise_reduction = fmax(dnch->last_noise_floor - dnch->last_residual_floor, 0);
+ dnch->last_noise_reduction = fmax(dnch->last_noise_floor - dnch->last_residual_floor + 100., 0);
dnch->max_gain = exp(dnch->last_noise_reduction * (0.5 * C));
}
} else if (update_var || dnch->noise_reduction != dnch->last_noise_reduction) {
@@ -998,11 +998,11 @@ static void set_noise_profile(AudioFFTDeNoiseContext *s,
for (int m = 0; m < NB_PROFILE_BANDS; m++)
sum += temp[m];
- d1 = (int)(sum / NB_PROFILE_BANDS - 0.5);
+ d1 = sum / NB_PROFILE_BANDS;
for (int m = 0; m < NB_PROFILE_BANDS; m++)
temp[m] -= d1;
- new_noise_floor = d1 + 2.5;
+ new_noise_floor = round(d1) + 2.5;
if (new_profile) {
av_log(s, AV_LOG_INFO, "bn=");