mirror of https://github.com/PCSX2/pcsx2.git
SPU2: Remove unused Lowpass files
This commit is contained in:
parent
40da5697c5
commit
cf3d5bc040
|
@ -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
|
||||
|
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "Global.h"
|
||||
#include "Lowpass.h"
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
template <typename FloatType>
|
||||
__forceinline LowPassFilter<FloatType>::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 <typename FloatType>
|
||||
__forceinline FloatType LowPassFilter<FloatType>::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);
|
||||
}
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
template <typename FloatType>
|
||||
struct LowPassFilter
|
||||
{
|
||||
FloatType coef[9];
|
||||
FloatType d[4];
|
||||
|
||||
LowPassFilter(FloatType freq, FloatType srate);
|
||||
FloatType sample(FloatType inval);
|
||||
};
|
||||
|
||||
struct LowPassFilter32
|
||||
{
|
||||
LowPassFilter<float> impl_lpf;
|
||||
|
||||
LowPassFilter32(float freq, float srate);
|
||||
float sample(float inval);
|
||||
};
|
||||
|
||||
struct LowPassFilter64
|
||||
{
|
||||
LowPassFilter<double> impl_lpf;
|
||||
|
||||
LowPassFilter64(double freq, double srate);
|
||||
double sample(double inval);
|
||||
};
|
|
@ -340,7 +340,6 @@
|
|||
<ClCompile Include="SPU2\RegLog.cpp" />
|
||||
<ClCompile Include="SPU2\SndOut_Portaudio.cpp" />
|
||||
<ClCompile Include="SPU2\wavedump_wav.cpp" />
|
||||
<ClCompile Include="SPU2\Lowpass.cpp" />
|
||||
<ClCompile Include="SPU2\SndOut.cpp" />
|
||||
<ClCompile Include="SPU2\Timestretcher.cpp" />
|
||||
<ClCompile Include="SPU2\Windows\SndOut_waveOut.cpp" />
|
||||
|
@ -775,7 +774,6 @@
|
|||
<ClInclude Include="SPU2\Config.h" />
|
||||
<ClInclude Include="SPU2\Global.h" />
|
||||
<ClInclude Include="SPU2\interpolate_table.h" />
|
||||
<ClInclude Include="SPU2\Lowpass.h" />
|
||||
<ClInclude Include="SPU2\SndOut.h" />
|
||||
<ClInclude Include="SPU2\spdif.h" />
|
||||
<ClInclude Include="SPU2\defs.h" />
|
||||
|
|
|
@ -1059,9 +1059,6 @@
|
|||
<ClCompile Include="SPU2\Mixer.cpp">
|
||||
<Filter>System\Ps2\SPU2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SPU2\Lowpass.cpp">
|
||||
<Filter>System\Ps2\SPU2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SPU2\Windows\Config.cpp">
|
||||
<Filter>System\Ps2\SPU2</Filter>
|
||||
</ClCompile>
|
||||
|
@ -2098,9 +2095,6 @@
|
|||
<ClInclude Include="SPU2\interpolate_table.h">
|
||||
<Filter>System\Ps2\SPU2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SPU2\Lowpass.h">
|
||||
<Filter>System\Ps2\SPU2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SPU2\Config.h">
|
||||
<Filter>System\Ps2\SPU2</Filter>
|
||||
</ClInclude>
|
||||
|
|
Loading…
Reference in New Issue