SPU2: Put clamp_mix in header for more inlining

This commit is contained in:
Ziemas 2023-10-19 03:32:18 +02:00 committed by refractionpcsx2
parent 5eacc7c327
commit 676402854b
3 changed files with 11 additions and 13 deletions

View File

@ -28,16 +28,6 @@ static const s32 tbl_XA_Factor[16][2] =
{98, -55},
{122, -60}};
__forceinline s32 clamp_mix(s32 x)
{
return std::clamp(x, -0x8000, 0x7fff);
}
__forceinline StereoOut32 clamp_mix(StereoOut32 sample)
{
return StereoOut32(clamp_mix(sample.Left), clamp_mix(sample.Right));
}
static void __forceinline XA_decode_block(s16* buffer, const s16* block, s32& prev1, s32& prev2)
{
const s32 header = *block;

View File

@ -16,5 +16,3 @@
#pragma once
extern void Mix();
extern s32 clamp_mix(s32 x);
extern StereoOut32 clamp_mix(StereoOut32 sample);

View File

@ -40,11 +40,21 @@ extern s16 spu2M_Read(u32 addr);
extern void spu2M_Write(u32 addr, s16 value);
extern void spu2M_Write(u32 addr, u16 value);
static inline s16 SignExtend16(u16 v)
static __forceinline s16 SignExtend16(u16 v)
{
return (s16)v;
}
static __forceinline s32 clamp_mix(s32 x)
{
return std::clamp(x, -0x8000, 0x7fff);
}
static __forceinline StereoOut32 clamp_mix(StereoOut32 sample)
{
return StereoOut32(clamp_mix(sample.Left), clamp_mix(sample.Right));
}
struct V_VolumeLR
{
static V_VolumeLR Max;