diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2023-01-17 21:56:29 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2023-01-17 21:56:29 -0800 |
commit | 4171f9460fb7c6f634690d772f67af5d83fbdb64 (patch) | |
tree | f460d0e9f8c49f138d961467627e8092164e937f /alc/effects | |
parent | c5d42ceb107fafd0583c49aedc1c63f3beb35663 (diff) |
Make a variable for a reused value
Diffstat (limited to 'alc/effects')
-rw-r--r-- | alc/effects/chorus.cpp | 2 | ||||
-rw-r--r-- | alc/effects/pshifter.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 7b4630b1..44d8c32a 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -248,7 +248,7 @@ void ChorusState::process(const size_t samplesToDo, const al::span<const FloatBu { const size_t bufmask{mSampleBuffer.size()-1}; const float feedback{mFeedback}; - const uint avgdelay{(static_cast<uint>(mDelay) + (MixerFracOne>>1)) >> MixerFracBits}; + const uint avgdelay{(static_cast<uint>(mDelay) + MixerFracHalf) >> MixerFracBits}; float *RESTRICT delaybuf{mSampleBuffer.data()}; uint offset{mOffset}; diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp index f0a4c1dd..c2bf0ebf 100644 --- a/alc/effects/pshifter.cpp +++ b/alc/effects/pshifter.cpp @@ -227,10 +227,10 @@ void PshifterState::process(const size_t samplesToDo, const al::span<const Float */ std::fill(mSynthesisBuffer.begin(), mSynthesisBuffer.end(), FrequencyBin{}); const size_t bin_count{minz(STFT_HALF_SIZE+1, - (((STFT_HALF_SIZE+1)<<MixerFracBits) - (MixerFracOne>>1) - 1)/mPitchShiftI + 1)}; + (((STFT_HALF_SIZE+1)<<MixerFracBits) - MixerFracHalf - 1)/mPitchShiftI + 1)}; for(size_t k{0u};k < bin_count;k++) { - const size_t j{(k*mPitchShiftI + (MixerFracOne>>1)) >> MixerFracBits}; + const size_t j{(k*mPitchShiftI + MixerFracHalf) >> MixerFracBits}; /* If more than two bins end up together, use the target frequency * bin for the one with the dominant magnitude. There might be a |