From 50db09760c1a130730da564c8eea505b25ca9810 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Sun, 22 Jan 2023 19:04:14 +0900 Subject: [PATCH] obs-filters: Make continuous gain on upward compressor The upward compressor has a -60 dB threshold to stop increasing the gain. At the threshold, the gain was not continuous, which is not ideal. Co-authored-by: pkv Signed-off-by: pkv --- plugins/obs-filters/expander-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/obs-filters/expander-filter.c b/plugins/obs-filters/expander-filter.c index aef9a9972..d9b7f0687 100644 --- a/plugins/obs-filters/expander-filter.c +++ b/plugins/obs-filters/expander-filter.c @@ -351,8 +351,8 @@ static inline void process_sample(size_t idx, float *samples, float *env_buf, float env_db = mul_to_db(env_buf[idx]); float diff = threshold - env_db; - if (is_upwcomp && env_db <= -60.0f) - diff = 0.0f; + if (is_upwcomp && env_db <= (threshold - 60.0f) / 2) + diff = env_db + 60.0f; float gain = diff > 0.0f ? fmaxf(slope * diff, -60.0f) : 0.0f; float prev_gain = gain_db[idx - 1];