mirror of https://github.com/PCSX2/pcsx2.git
SPU2: Optimize reverb downsampling.
Skip multiplying the 0's
This commit is contained in:
parent
599d25c59b
commit
458f22d214
|
@ -96,11 +96,15 @@ s32 __forceinline V_Core::ReverbDownsample(bool right)
|
||||||
{
|
{
|
||||||
s32 out = 0;
|
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];
|
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;
|
out >>= 15;
|
||||||
Clampify(out, INT16_MIN, INT16_MAX);
|
Clampify(out, INT16_MIN, INT16_MAX);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue