diff options
author | Chris Robinson <[email protected]> | 2019-01-06 04:16:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-01-06 04:16:51 -0800 |
commit | da3a916042a7ba9426af1d6f03e689dbd7760191 (patch) | |
tree | ab6cfc0d2fd26504a013989af7ecd399a4034914 /Alc/filters | |
parent | 98f3e6a16295029129193a073680a70c034703dd (diff) |
Replace macros with constexpr inline functions
Diffstat (limited to 'Alc/filters')
-rw-r--r-- | Alc/filters/biquad.cpp | 2 | ||||
-rw-r--r-- | Alc/filters/biquad.h | 4 | ||||
-rw-r--r-- | Alc/filters/splitter.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Alc/filters/biquad.cpp b/Alc/filters/biquad.cpp index b010ebed..e4b7bec0 100644 --- a/Alc/filters/biquad.cpp +++ b/Alc/filters/biquad.cpp @@ -16,7 +16,7 @@ void BiquadFilterR<Real>::setParams(BiquadType type, Real gain, Real f0norm, Rea // Limit gain to -100dB assert(gain > 0.00001f); - const Real w0{F_TAU * f0norm}; + const Real w0{al::MathDefs<Real>::Tau() * f0norm}; const Real sin_w0{std::sin(w0)}; const Real cos_w0{std::cos(w0)}; const Real alpha{sin_w0/2.0f * rcpQ}; diff --git a/Alc/filters/biquad.h b/Alc/filters/biquad.h index a7d830a2..57edd782 100644 --- a/Alc/filters/biquad.h +++ b/Alc/filters/biquad.h @@ -124,13 +124,13 @@ inline double calc_rcpQ_from_slope(double gain, double slope) */ inline float calc_rcpQ_from_bandwidth(float f0norm, float bandwidth) { - const float w0{F_TAU * f0norm}; + const float w0{al::MathDefs<float>::Tau() * f0norm}; return 2.0f*std::sinh(std::log(2.0f)/2.0f*bandwidth*w0/std::sin(w0)); } inline double calc_rcpQ_from_bandwidth(double f0norm, double bandwidth) { - const double w0{F_TAU * f0norm}; + const double w0{al::MathDefs<double>::Tau() * f0norm}; return 2.0*std::sinh(std::log(2.0)/2.0*bandwidth*w0/std::sin(w0)); } diff --git a/Alc/filters/splitter.cpp b/Alc/filters/splitter.cpp index 27ea697a..0f099661 100644 --- a/Alc/filters/splitter.cpp +++ b/Alc/filters/splitter.cpp @@ -12,7 +12,7 @@ void BandSplitter::init(float f0norm) { - float w = f0norm * F_TAU; + float w = f0norm * al::MathDefs<float>::Tau(); float cw = std::cos(w); if(cw > std::numeric_limits<float>::epsilon()) coeff = (std::sin(w) - 1.0f) / cw; @@ -62,7 +62,7 @@ void BandSplitter::process(float *RESTRICT hpout, float *RESTRICT lpout, const f void SplitterAllpass::init(float f0norm) { - float w = f0norm * F_TAU; + float w = f0norm * al::MathDefs<float>::Tau(); float cw = std::cos(w); if(cw > std::numeric_limits<float>::epsilon()) coeff = (std::sin(w) - 1.0f) / cw; |