Commit 550067e3 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Limiter: don't skip first sample lookahead initialization.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent ee7eb03b
...@@ -43,7 +43,7 @@ Limiter::process (const vector<float>& samples) ...@@ -43,7 +43,7 @@ Limiter::process (const vector<float>& samples)
{ {
for (uint j = 0; j < look_ahead; j++) for (uint j = 0; j < look_ahead; j++)
{ {
if (int (i) - int (j) > 0) if (int (i) - int (j) >= 0)
{ {
double alpha = double (j) / look_ahead; double alpha = double (j) / look_ahead;
max_buffer[i - j] = max<float> (max_buffer[i - j], fabs (buffer[i]) * (1 - alpha) + 1 * alpha); max_buffer[i - j] = max<float> (max_buffer[i - j], fabs (buffer[i]) * (1 - alpha) + 1 * alpha);
......
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