fix poppy interpolation audio quality bug
This commit is contained in:
parent
4aff5bb444
commit
55122bb9fa
|
@ -521,13 +521,12 @@ extern "C" void SPU_WriteLong(u32 addr, u32 val)
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
static FORCEINLINE s32 Interpolate(SPUInterpolationMode INTERPOLATE_MODE, s32 a, s32 b, double _ratio)
|
static FORCEINLINE s32 Interpolate(SPUInterpolationMode INTERPOLATE_MODE, s32 a, s32 b, double ratio)
|
||||||
{
|
{
|
||||||
float ratio = (float)_ratio;
|
|
||||||
if(INTERPOLATE_MODE == SPUInterpolation_Cosine)
|
if(INTERPOLATE_MODE == SPUInterpolation_Cosine)
|
||||||
{
|
{
|
||||||
//why did we change it away from the lookup table? somebody should research that
|
//why did we change it away from the lookup table? somebody should research that
|
||||||
ratio = ratio - (int)ratio;
|
ratio = ratio - sputrunc(ratio);
|
||||||
double ratio2 = ((1.0 - cos(ratio * M_PI)) * 0.5);
|
double ratio2 = ((1.0 - cos(ratio * M_PI)) * 0.5);
|
||||||
//double ratio2 = (1.0f - cos_lut[((int)(ratio*256.0))&0xFF]) / 2.0f;
|
//double ratio2 = (1.0f - cos_lut[((int)(ratio*256.0))&0xFF]) / 2.0f;
|
||||||
return (s32)(((1-ratio2)*a) + (ratio2*b));
|
return (s32)(((1-ratio2)*a) + (ratio2*b));
|
||||||
|
|
Loading…
Reference in New Issue