diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 6654fbf422..a375a25bcd 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -242,7 +242,6 @@ set(pcsx2SPU2Sources SPU2/Debug.cpp SPU2/DplIIdecoder.cpp SPU2/Dma.cpp - SPU2/Lowpass.cpp SPU2/Mixer.cpp SPU2/spu2.cpp SPU2/ReadInput.cpp @@ -276,7 +275,6 @@ set(pcsx2SPU2Headers SPU2/Dma.h SPU2/Global.h SPU2/interpolate_table.h - SPU2/Lowpass.h SPU2/Mixer.h SPU2/spu2.h SPU2/regs.h diff --git a/pcsx2/SPU2/Lowpass.cpp b/pcsx2/SPU2/Lowpass.cpp deleted file mode 100644 index 7eff1aa448..0000000000 --- a/pcsx2/SPU2/Lowpass.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2020 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#include "PrecompiledHeader.h" -#include "Global.h" -#include "Lowpass.h" -#include -#include - -template -__forceinline LowPassFilter::LowPassFilter(FloatType freq, FloatType srate) -{ - typedef FloatType FT; - - FloatType omega = (FT)2.0 * freq / srate; - static const FloatType g = (FT)1.0; - - // calculating coefficients: - - FloatType k, p, q, a; - FloatType a0, a1, a2, a3, a4; - - k = ((FT)4.0 * g - (FT)3.0) / (g + (FT)1.0); - p = (FT)1.0 - (FT)0.25 * k; - p *= p; - - // LP: - a = (FT)1.0 / (tan((FT)0.5 * omega) * ((FT)1.0 + p)); - p = (FT)1.0 + a; - q = (FT)1.0 - a; - - a0 = (FT)1.0 / (k + p * p * p * p); - a1 = (FT)4.0 * (k + p * p * p * q); - a2 = (FT)6.0 * (k + p * p * q * q); - a3 = (FT)4.0 * (k + p * q * q * q); - a4 = (k + q * q * q * q); - p = a0 * (k + (FT)1.0); - - coef[0] = p; - coef[1] = (FT)4.0 * p; - coef[2] = (FT)6.0 * p; - coef[3] = (FT)4.0 * p; - coef[4] = p; - coef[5] = -a1 * a0; - coef[6] = -a2 * a0; - coef[7] = -a3 * a0; - coef[8] = -a4 * a0; -} - -// Processes a single sample into the LPF. -template -__forceinline FloatType LowPassFilter::sample(FloatType inval) -{ - const FloatType out = (coef[0] * inval) + d[0]; - d[0] = (coef[1] * inval) + (coef[5] * out) + d[1]; - d[1] = (coef[2] * inval) + (coef[6] * out) + d[2]; - d[2] = (coef[3] * inval) + (coef[7] * out) + d[3]; - d[3] = (coef[4] * inval) + (coef[8] * out); - - return out; -} - -LowPassFilter32::LowPassFilter32(float freq, float srate) - : impl_lpf(freq, srate) -{ -} - -LowPassFilter64::LowPassFilter64(double freq, double srate) - : impl_lpf(freq, srate) -{ -} - -float LowPassFilter32::sample(float inval) -{ - return impl_lpf.sample(inval); -} - -double LowPassFilter64::sample(double inval) -{ - return impl_lpf.sample(inval); -} diff --git a/pcsx2/SPU2/Lowpass.h b/pcsx2/SPU2/Lowpass.h deleted file mode 100644 index f6ae6bd2ee..0000000000 --- a/pcsx2/SPU2/Lowpass.h +++ /dev/null @@ -1,42 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2020 PCSX2 Dev Team - * - * PCSX2 is free software: you can redistribute it and/or modify it under the terms - * of the GNU Lesser General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with PCSX2. - * If not, see . - */ - -#pragma once - -template -struct LowPassFilter -{ - FloatType coef[9]; - FloatType d[4]; - - LowPassFilter(FloatType freq, FloatType srate); - FloatType sample(FloatType inval); -}; - -struct LowPassFilter32 -{ - LowPassFilter impl_lpf; - - LowPassFilter32(float freq, float srate); - float sample(float inval); -}; - -struct LowPassFilter64 -{ - LowPassFilter impl_lpf; - - LowPassFilter64(double freq, double srate); - double sample(double inval); -}; diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 77a1a41fdc..ec220cc320 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -340,7 +340,6 @@ - @@ -775,7 +774,6 @@ - diff --git a/pcsx2/pcsx2.vcxproj.filters b/pcsx2/pcsx2.vcxproj.filters index 6348fa78af..f73ec26b28 100644 --- a/pcsx2/pcsx2.vcxproj.filters +++ b/pcsx2/pcsx2.vcxproj.filters @@ -1059,9 +1059,6 @@ System\Ps2\SPU2 - - System\Ps2\SPU2 - System\Ps2\SPU2 @@ -2098,9 +2095,6 @@ System\Ps2\SPU2 - - System\Ps2\SPU2 - System\Ps2\SPU2