From 7bb37deb51c6c1d0faa4f2fbe92f8051e64d6401 Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Wed, 21 Oct 2020 17:16:27 -0700 Subject: Replace the mixer fraction macros with constexpr variables --- alc/effects/pshifter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'alc/effects/pshifter.cpp') 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; -- cgit v1.2.3