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 <pkv@obsproject.com>
Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
Norihiro Kamae
2023-01-26 23:23:45 -08:00
committed by Jim
co-authored by pkv
parent f625bb579f
commit 50db09760c
+2 -2
View File
@@ -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];