mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Performance improvement in limiter, about 2%
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22735 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
293a4b62d7
commit
b2aa2452e7
1 changed files with 10 additions and 13 deletions
|
@ -1934,9 +1934,6 @@ static int limiter_process(int count, int32_t *buf[])
|
|||
}
|
||||
/* Implement the limiter: adjust gain of the outbound samples by the gain
|
||||
* amounts in the gain steps array corresponding to the peak values. */
|
||||
for (ch = 0; ch < AUDIO_DSP.data.num_channels; ch++)
|
||||
{
|
||||
int32_t *d = buf[ch];
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (out_buf_peak[i] > 0)
|
||||
|
@ -1947,8 +1944,8 @@ static int limiter_process(int count, int32_t *buf[])
|
|||
if ((gain_peak < 48) && (gain_rem > 0))
|
||||
gain -= gain_rem * ((gain_steps[gain_peak] -
|
||||
gain_steps[gain_peak + 1]) / 90);
|
||||
d[i] = FRACMUL_SHL(d[i], gain, 3);
|
||||
}
|
||||
for (ch = 0; ch < AUDIO_DSP.data.num_channels; ch++)
|
||||
buf[ch][i] = FRACMUL_SHL(buf[ch][i], gain, 3);
|
||||
}
|
||||
}
|
||||
return count;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue