Merge pull request #1097 from LegendOfDragoon/improve-resampler

Improve alist_resample
This commit is contained in:
zilmar 2016-05-26 11:00:49 +10:00
commit 64e1f0f6f8
1 changed files with 5 additions and 5 deletions

View File

@ -633,11 +633,11 @@ void alist_resample( CHle * hle, bool init, bool flag2, uint16_t dmemo, uint16_t
{ {
const int16_t* lut = RESAMPLE_LUT + ((pitch_accu & 0xfc00) >> 8); const int16_t* lut = RESAMPLE_LUT + ((pitch_accu & 0xfc00) >> 8);
*sample(hle, opos++) = clamp_s16( *sample(hle, opos++) = clamp_s16( (
((*sample(hle, ipos) * lut[0]) >> 15) + (*sample(hle, ipos ) * lut[0]) +
((*sample(hle, ipos + 1) * lut[1]) >> 15) + (*sample(hle, ipos + 1) * lut[1]) +
((*sample(hle, ipos + 2) * lut[2]) >> 15) + (*sample(hle, ipos + 2) * lut[2]) +
((*sample(hle, ipos + 3) * lut[3]) >> 15)); (*sample(hle, ipos + 3) * lut[3]) ) >> 15);
pitch_accu += pitch; pitch_accu += pitch;
ipos += (pitch_accu >> 16); ipos += (pitch_accu >> 16);