diff options
author | Chris Robinson <[email protected]> | 2019-02-21 02:57:39 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-02-21 02:57:39 -0800 |
commit | 4b4041319d6e3b32529b901641166052e37d56d4 (patch) | |
tree | 1baaf7a07718283827a735998e87679b2893676e /Alc/effects/fshifter.cpp | |
parent | 7e00f646d9bd79bdeb9b9435288c273db55f7c41 (diff) |
Pass the number of input channels to EffectState::process
Diffstat (limited to 'Alc/effects/fshifter.cpp')
-rw-r--r-- | Alc/effects/fshifter.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/effects/fshifter.cpp b/Alc/effects/fshifter.cpp index 5c808a4b..21d3a706 100644 --- a/Alc/effects/fshifter.cpp +++ b/Alc/effects/fshifter.cpp @@ -83,7 +83,7 @@ struct ALfshifterState final : public EffectState { ALboolean deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) override; - void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override; + void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], const ALsizei numInput, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], const ALsizei numOutput) override; DEF_NEWDEL(ALfshifterState) }; @@ -138,15 +138,15 @@ void ALfshifterState::update(const ALCcontext *context, const ALeffectslot *slot ComputePanGains(target.Main, coeffs, slot->Params.Gain, mTargetGains); } -void ALfshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) +void ALfshifterState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], const ALsizei /*numInput*/, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], const ALsizei numOutput) { static constexpr complex_d complex_zero{0.0, 0.0}; ALfloat *RESTRICT BufferOut = mBufferOut; ALsizei j, k, base; - for(base = 0;base < SamplesToDo;) + for(base = 0;base < samplesToDo;) { - const ALsizei todo{mini(HIL_SIZE-mCount, SamplesToDo-base)}; + const ALsizei todo{mini(HIL_SIZE-mCount, samplesToDo-base)}; ASSUME(todo > 0); @@ -154,7 +154,7 @@ void ALfshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT Samp k = mCount; for(j = 0;j < todo;j++,k++) { - mInFIFO[k] = SamplesIn[0][base+j]; + mInFIFO[k] = samplesIn[0][base+j]; mOutdata[base+j] = mOutFIFO[k-FIFO_LATENCY]; } mCount += todo; @@ -187,19 +187,19 @@ void ALfshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT Samp } /* Process frequency shifter using the analytic signal obtained. */ - for(k = 0;k < SamplesToDo;k++) + for(k = 0;k < samplesToDo;k++) { double phase = mPhase * ((1.0/FRACTIONONE) * al::MathDefs<double>::Tau()); BufferOut[k] = static_cast<float>(mOutdata[k].real()*std::cos(phase) + - mOutdata[k].imag()*std::sin(phase)*mLdSign); + mOutdata[k].imag()*std::sin(phase)*mLdSign); mPhase += mPhaseStep; mPhase &= FRACTIONMASK; } /* Now, mix the processed sound data to the output. */ - MixSamples(BufferOut, NumChannels, SamplesOut, mCurrentGains, mTargetGains, - maxi(SamplesToDo, 512), 0, SamplesToDo); + MixSamples(BufferOut, numOutput, samplesOut, mCurrentGains, mTargetGains, + maxi(samplesToDo, 512), 0, samplesToDo); } } // namespace |