mirror of https://github.com/PCSX2/pcsx2.git
SPU2: Put clamp_mix in header for more inlining
This commit is contained in:
parent
5eacc7c327
commit
676402854b
|
@ -28,16 +28,6 @@ static const s32 tbl_XA_Factor[16][2] =
|
||||||
{98, -55},
|
{98, -55},
|
||||||
{122, -60}};
|
{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)
|
static void __forceinline XA_decode_block(s16* buffer, const s16* block, s32& prev1, s32& prev2)
|
||||||
{
|
{
|
||||||
const s32 header = *block;
|
const s32 header = *block;
|
||||||
|
|
|
@ -16,5 +16,3 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
extern void Mix();
|
extern void Mix();
|
||||||
extern s32 clamp_mix(s32 x);
|
|
||||||
extern StereoOut32 clamp_mix(StereoOut32 sample);
|
|
||||||
|
|
|
@ -40,11 +40,21 @@ extern s16 spu2M_Read(u32 addr);
|
||||||
extern void spu2M_Write(u32 addr, s16 value);
|
extern void spu2M_Write(u32 addr, s16 value);
|
||||||
extern void spu2M_Write(u32 addr, u16 value);
|
extern void spu2M_Write(u32 addr, u16 value);
|
||||||
|
|
||||||
static inline s16 SignExtend16(u16 v)
|
static __forceinline s16 SignExtend16(u16 v)
|
||||||
{
|
{
|
||||||
return (s16)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
|
struct V_VolumeLR
|
||||||
{
|
{
|
||||||
static V_VolumeLR Max;
|
static V_VolumeLR Max;
|
||||||
|
|
Loading…
Reference in New Issue