Merge pull request #9955 from Tilka/ax2

DSPHLE: fix and re-enable polyphase resampling
This commit is contained in:
Tilka 2021-07-25 17:09:06 +01:00 committed by GitHub
commit 1119488e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -231,11 +231,8 @@ u32 ResampleAudio(std::function<s16(u32)> input_callback, s16* output, u32 count
{ {
int read_samples_count = 0; int read_samples_count = 0;
// TODO(delroth): find out why the polyphase resampling algorithm causes
// audio glitches in Wii games with non integral ratios.
// If DSP DROM coefficients are available, support polyphase resampling. // If DSP DROM coefficients are available, support polyphase resampling.
if (0) // if (coeffs && srctype == SRCTYPE_POLYPHASE) if (coeffs && srctype == SRCTYPE_POLYPHASE)
{ {
s16 temp[4]; s16 temp[4];
u32 idx = 0; u32 idx = 0;
@ -264,7 +261,7 @@ u32 ResampleAudio(std::function<s16(u32)> input_callback, s16* output, u32 count
s64 samp = (t0 * c[0] + t1 * c[1] + t2 * c[2] + t3 * c[3]) >> 15; s64 samp = (t0 * c[0] + t1 * c[1] + t2 * c[2] + t3 * c[3]) >> 15;
output[i] = (s16)samp; output[i] = MathUtil::SaturatingCast<s16>(samp);
} }
last_samples[3] = temp[--idx & 3]; last_samples[3] = temp[--idx & 3];