Commit 138c6142 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Only perform one limiter division per frame.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 84f770ff
......@@ -77,8 +77,9 @@ Limiter::process (const vector<float>& samples)
if (maximum < max_buffer[i])
maximum = max_buffer[i];
const float scale = ceiling / maximum;
for (uint c = 0; c < n_channels; c++)
out[i * n_channels + c] = buffer[i * n_channels + c] / maximum * ceiling;
out[i * n_channels + c] = buffer[i * n_channels + c] * scale;
}
buffer.erase (buffer.begin(), buffer.begin() + todo * n_channels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment