SPU2: Optimize reverb downsampling.

Skip multiplying the 0's
This commit is contained in:
Ziemas 2021-02-17 21:10:26 +01:00 committed by refractionpcsx2
parent 599d25c59b
commit 458f22d214
1 changed files with 5 additions and 1 deletions

View File

@ -96,11 +96,15 @@ s32 __forceinline V_Core::ReverbDownsample(bool right)
{
s32 out = 0;
for (u32 i = 0; i < NUM_TAPS; i++)
// Skipping the 0 coefs.
for (u32 i = 0; i < NUM_TAPS; i += 2)
{
out += RevbDownBuf[right][((RevbSampleBufPos - NUM_TAPS) + i) & 63] * filter_coefs[i];
}
// We also skipped the middle so add that in.
out += RevbDownBuf[right][((RevbSampleBufPos - NUM_TAPS) + 19) & 63] * filter_coefs[19];
out >>= 15;
Clampify(out, INT16_MIN, INT16_MAX);