0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

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-22 19:04:14 +09:00 committed by Jim
parent f625bb579f
commit 50db09760c

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];