diff options
author | Chris Robinson <[email protected]> | 2020-10-21 17:16:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-10-21 17:16:27 -0700 |
commit | 7bb37deb51c6c1d0faa4f2fbe92f8051e64d6401 (patch) | |
tree | e1a8cf7da46d8816ee0e1a3ff6151206735bc981 /alc/effects/pshifter.cpp | |
parent | 3e62600ecc3c2f1be4da0d3e8166f5c67cc25fed (diff) |
Replace the mixer fraction macros with constexpr variables
Diffstat (limited to 'alc/effects/pshifter.cpp')
-rw-r--r-- | alc/effects/pshifter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp index d923e376..44ddc694 100644 --- a/alc/effects/pshifter.cpp +++ b/alc/effects/pshifter.cpp @@ -107,7 +107,7 @@ void PshifterState::deviceUpdate(const ALCdevice *device) { /* (Re-)initializing parameters and clear the buffers. */ mCount = FIFO_LATENCY; - mPitchShiftI = FRACTIONONE; + mPitchShiftI = MixerFracOne; mPitchShift = 1.0; mFreqPerBin = device->Frequency / double{STFT_SIZE}; @@ -127,8 +127,8 @@ void PshifterState::update(const ALCcontext*, const ALeffectslot *slot, const Ef { const int tune{props->Pshifter.CoarseTune*100 + props->Pshifter.FineTune}; const float pitch{std::pow(2.0f, static_cast<float>(tune) / 1200.0f)}; - mPitchShiftI = fastf2u(pitch*FRACTIONONE); - mPitchShift = mPitchShiftI * double{1.0/FRACTIONONE}; + mPitchShiftI = fastf2u(pitch*MixerFracOne); + mPitchShift = mPitchShiftI * double{1.0/MixerFracOne}; const auto coeffs = CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f); @@ -206,7 +206,7 @@ void PshifterState::process(const size_t samplesToDo, const al::span<const Float std::fill(mSynthesisBuffer.begin(), mSynthesisBuffer.end(), FrequencyBin{}); for(size_t k{0u};k < STFT_HALF_SIZE+1;k++) { - const size_t j{(k*mPitchShiftI + (FRACTIONONE>>1)) >> FRACTIONBITS}; + const size_t j{(k*mPitchShiftI + (MixerFracOne>>1)) >> MixerFracBits}; if(j >= STFT_HALF_SIZE+1) break; mSynthesisBuffer[j].Amplitude += mAnalysisBuffer[k].Amplitude; |