SPU2: Remove awful dealias filter that made games sound like crap.

This commit is contained in:
Christian Kenny 2021-07-22 15:57:19 -04:00 committed by refractionpcsx2
parent 11ed747741
commit 97749e6005
8 changed files with 0 additions and 114 deletions

View File

@ -76,8 +76,6 @@ extern float VolumeAdjustBRdb;
extern float VolumeAdjustSLdb;
extern float VolumeAdjustSRdb;
extern float VolumeAdjustLFEdb;
extern bool postprocess_filter_enabled;
extern bool postprocess_filter_dealias;
extern int dplLevel;

View File

@ -58,8 +58,6 @@ float VolumeAdjustSL;
float VolumeAdjustSR;
float VolumeAdjustLFE;
bool postprocess_filter_enabled = true;
bool postprocess_filter_dealias = false;
bool _visual_debug_enabled = false; // Windows-only feature
// OUTPUT
@ -85,7 +83,6 @@ void ReadSettings()
initIni();
Interpolation = CfgReadInt(L"MIXING", L"Interpolation", 5);
postprocess_filter_dealias = CfgReadBool(L"MIXING", L"DealiasFilter", false);
FinalVolume = ((float)CfgReadInt(L"MIXING", L"FinalVolume", 100)) / 100;
if (FinalVolume > 1.0f)
FinalVolume = 1.0f;
@ -186,7 +183,6 @@ void WriteSettings()
}
CfgWriteInt(L"MIXING", L"Interpolation", Interpolation);
CfgWriteBool(L"MIXING", L"DealiasFilter", postprocess_filter_dealias);
CfgWriteInt(L"MIXING", L"FinalVolume", (int)(FinalVolume * 100 + 0.5f));
CfgWriteBool(L"MIXING", L"AdvancedVolumeControl", AdvancedVolumeControl);

View File

@ -66,8 +66,6 @@ static __forceinline bool RegDump() { return _RegDump & DebugEnabled; }*/
extern int Interpolation;
extern float FinalVolume;
extern bool postprocess_filter_enabled;
extern bool postprocess_filter_dealias;
extern int AutoDMAPlayRate[2];

View File

@ -744,84 +744,6 @@ StereoOut32 V_Core::Mix(const VoiceMixSet& inVoices, const StereoOut32& Input, c
return TD + ApplyVolume(RV, FxVol);
}
// Filters that work on the final output to de-alias and equlize it.
// Taken from http://nenolod.net/projects/upse/
#define OVERALL_SCALE (0.87f)
StereoOut32 Apply_Frequency_Response_Filter(StereoOut32& SoundStream)
{
static FrequencyResponseFilter FRF = FrequencyResponseFilter();
s32 in, out;
s32 l, r;
s32 mid, side;
l = SoundStream.Left;
r = SoundStream.Right;
mid = l + r;
side = l - r;
in = mid;
out = FRF.la0 * in + FRF.la1 * FRF.lx1 + FRF.la2 * FRF.lx2 - FRF.lb1 * FRF.ly1 - FRF.lb2 * FRF.ly2;
FRF.lx2 = FRF.lx1;
FRF.lx1 = in;
FRF.ly2 = FRF.ly1;
FRF.ly1 = out;
mid = out;
l = ((0.5) * (OVERALL_SCALE)) * (mid + side);
r = ((0.5) * (OVERALL_SCALE)) * (mid - side);
in = l;
out = FRF.ha0 * in + FRF.ha1 * FRF.History_One_In.Left + FRF.ha2 * FRF.History_Two_In.Left - FRF.hb1 * FRF.History_One_Out.Left - FRF.hb2 * FRF.History_Two_Out.Left;
FRF.History_Two_In.Left = FRF.History_One_In.Left;
FRF.History_One_In.Left = in;
FRF.History_Two_Out.Left = FRF.History_One_Out.Left;
FRF.History_One_Out.Left = out;
l = out;
in = r;
out = FRF.ha0 * in + FRF.ha1 * FRF.History_One_In.Right + FRF.ha2 * FRF.History_Two_In.Right - FRF.hb1 * FRF.History_One_Out.Right - FRF.hb2 * FRF.History_Two_Out.Right;
FRF.History_Two_In.Right = FRF.History_One_In.Right;
FRF.History_One_In.Right = in;
FRF.History_Two_Out.Right = FRF.History_One_Out.Right;
FRF.History_One_Out.Right = out;
r = out;
//clamp_mix(l);
//clamp_mix(r);
SoundStream.Left = l;
SoundStream.Right = r;
return SoundStream;
}
StereoOut32 Apply_Dealias_Filter(StereoOut32& SoundStream)
{
static StereoOut32 Old = StereoOut32::Empty;
s32 l, r;
l = SoundStream.Left;
r = SoundStream.Right;
l += (l - Old.Left);
r += (r - Old.Right);
Old.Left = SoundStream.Left;
Old.Right = SoundStream.Right;
SoundStream.Left = l;
SoundStream.Right = r;
return SoundStream;
}
// used to throttle the output rate of cache stat reports
static int p_cachestat_counter = 0;
@ -884,18 +806,6 @@ __forceinline
Out.Left = MulShr32(Out.Left << SndOutVolumeShift, Cores[1].MasterVol.Left.Value);
Out.Right = MulShr32(Out.Right << SndOutVolumeShift, Cores[1].MasterVol.Right.Value);
#ifdef DEBUG_KEYS
if (postprocess_filter_enabled)
#endif
{
if (postprocess_filter_dealias)
{
// Dealias filter emphasizes the highs too much.
Out = Apply_Dealias_Filter(Out);
}
Out = Apply_Frequency_Response_Filter(Out);
}
// Final Clamp!
// Like any good audio system, the PS2 pumps the volume and incurs some distortion in its
// output, giving us a nice thumpy sound at times. So we add 1 above (2x volume pump) and

View File

@ -56,9 +56,6 @@ float VolumeAdjustSL;
float VolumeAdjustSR;
float VolumeAdjustLFE;
bool postprocess_filter_enabled = 1;
bool postprocess_filter_dealias = false;
// OUTPUT
int SndOutLatencyMS = 100;
int SynchMode = 0; // Time Stretch, Async or Disabled.
@ -83,7 +80,6 @@ void ReadSettings()
{
Interpolation = CfgReadInt(L"MIXING", L"Interpolation", 5);
postprocess_filter_dealias = CfgReadBool(L"MIXING", L"DealiasFilter", false);
FinalVolume = ((float)CfgReadInt(L"MIXING", L"FinalVolume", 100)) / 100;
if (FinalVolume > 1.0f)
FinalVolume = 1.0f;
@ -160,7 +156,6 @@ void WriteSettings()
{
CfgWriteInt(L"MIXING", L"Interpolation", Interpolation);
CfgWriteBool(L"MIXING", L"DealiasFilter", postprocess_filter_dealias);
CfgWriteInt(L"MIXING", L"FinalVolume", (int)(FinalVolume * 100 + 0.5f));
CfgWriteBool(L"MIXING", L"AdvancedVolumeControl", AdvancedVolumeControl);
@ -275,7 +270,6 @@ BOOL CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
EnableWindow(GetDlgItem(hWnd, IDC_OPEN_CONFIG_SOUNDTOUCH), (SynchMode == 0));
EnableWindow(GetDlgItem(hWnd, IDC_OPEN_CONFIG_DEBUG), DebugEnabled);
SET_CHECK(IDC_DEALIASFILTER, postprocess_filter_dealias);
SET_CHECK(IDC_DEBUG_ENABLE, DebugEnabled);
SET_CHECK(IDC_DSP_ENABLE, dspPluginEnabled);
}
@ -360,7 +354,6 @@ BOOL CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SoundtouchCfg::OpenDialog(hWnd);
break;
HANDLE_CHECK(IDC_DEALIASFILTER, postprocess_filter_dealias);
HANDLE_CHECK(IDC_DSP_ENABLE, dspPluginEnabled);
HANDLE_CHECKNB(IDC_DEBUG_ENABLE, DebugEnabled);
DebugConfig::EnableControls(hWnd);

View File

@ -34,8 +34,6 @@ BEGIN
GROUPBOX "Mixing Settings",IDC_STATIC,3,5,154,115
LTEXT "Interpolation:",IDC_STATIC,9,16,61,10,NOT WS_GROUP
COMBOBOX IDC_INTERPOLATE,9,26,145,84,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Use the de-alias filter",IDC_DEALIASFILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,92,126,10
LTEXT "(overemphasizes the highs)",IDC_STATIC,23,104,114,12,NOT WS_GROUP
GROUPBOX "",IDC_STATIC,3,124,154,45
CHECKBOX "Enable Debug Options",IDC_DEBUG_ENABLE,11,135,118,10,NOT WS_TABSTOP
PUSHBUTTON "Configure...",IDC_OPEN_CONFIG_DEBUG,11,147,52,13

View File

@ -16,7 +16,6 @@
#define IDC_DEBUG 1009
#define IDC_DEBUG_ENABLE 1010
#define IDC_INTERPOLATE 1011
#define IDC_DEALIASFILTER 1012
#define IDC_OUTPUT 1013
#define IDC_BUFFERS_SLIDER 1014
#define IDC_SPEAKERS 1015

View File

@ -393,12 +393,6 @@ void SPU2async(u32 cycles)
if ((cState[i] && !lState[i]) && i != 5)
Interpolation = i;
if ((cState[i] && !lState[i]) && i == 5)
{
postprocess_filter_enabled = !postprocess_filter_enabled;
printf("Post process filters %s \n", postprocess_filter_enabled ? "enabled" : "disabled");
}
lState[i] = cState[i];
}