diff options
author | Chris Robinson <[email protected]> | 2017-02-23 16:44:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-23 16:44:59 -0800 |
commit | c2a79f0f7b1d8f9a868e3411797005cefcebafa1 (patch) | |
tree | 3d133c8c88bfd1f87375b22afe3b2abee83e4ede /Alc/effects | |
parent | 08948079e93cbb7321be5715df36f54c5e6be3b7 (diff) |
Remove CalcXYZCoeffs and inline CalcAngleCoeffs
Diffstat (limited to 'Alc/effects')
-rw-r--r-- | Alc/effects/chorus.c | 4 | ||||
-rw-r--r-- | Alc/effects/dedicated.c | 10 | ||||
-rw-r--r-- | Alc/effects/echo.c | 4 | ||||
-rw-r--r-- | Alc/effects/flanger.c | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index 63d0ca01..a44f9262 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -136,9 +136,9 @@ static ALvoid ALchorusState_update(ALchorusState *state, const ALCdevice *Device state->delay = fastf2i(props->Chorus.Delay * frequency); /* Gains for left and right sides */ - CalcXYZCoeffs(-1.0f, 0.0f, 0.0f, 0.0f, coeffs); + CalcAngleCoeffs(-F_PI_2, 0.0f, 0.0f, coeffs); ComputePanningGains(Device->Dry, coeffs, Slot->Params.Gain, state->Gain[0]); - CalcXYZCoeffs( 1.0f, 0.0f, 0.0f, 0.0f, coeffs); + CalcAngleCoeffs( F_PI_2, 0.0f, 0.0f, coeffs); ComputePanningGains(Device->Dry, coeffs, Slot->Params.Gain, state->Gain[1]); phase = props->Chorus.Phase; diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c index 818cbb6b..93c7416e 100644 --- a/Alc/effects/dedicated.c +++ b/Alc/effects/dedicated.c @@ -98,7 +98,7 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice * else { ALfloat coeffs[MAX_AMBI_COEFFS]; - CalcXYZCoeffs(0.0f, 0.0f, -1.0f, 0.0f, coeffs); + CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); STATIC_CAST(ALeffectState,state)->OutBuffer = device->Dry.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->Dry.NumChannels; @@ -109,16 +109,18 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice * static ALvoid ALdedicatedState_process(ALdedicatedState *state, ALuint SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels) { - const ALfloat *gains = state->gains; ALuint i, c; + SamplesIn = ASSUME_ALIGNED(SamplesIn, 16); + SamplesOut = ASSUME_ALIGNED(SamplesOut, 16); for(c = 0;c < NumChannels;c++) { - if(!(fabsf(gains[c]) > GAIN_SILENCE_THRESHOLD)) + const ALfloat gain = state->gains[c]; + if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD)) continue; for(i = 0;i < SamplesToDo;i++) - SamplesOut[c][i] += SamplesIn[0][i] * gains[c]; + SamplesOut[c][i] += SamplesIn[0][i] * gain; } } diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index 4a11d811..07eba9eb 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -134,11 +134,11 @@ static ALvoid ALechoState_update(ALechoState *state, const ALCdevice *Device, co gain = Slot->Params.Gain; /* First tap panning */ - CalcXYZCoeffs(-lrpan, 0.0f, 0.0f, spread, coeffs); + CalcAngleCoeffs(-F_PI_2*lrpan, 0.0f, spread, coeffs); ComputePanningGains(Device->Dry, coeffs, gain, state->Gain[0]); /* Second tap panning */ - CalcXYZCoeffs( lrpan, 0.0f, 0.0f, spread, coeffs); + CalcAngleCoeffs( F_PI_2*lrpan, 0.0f, spread, coeffs); ComputePanningGains(Device->Dry, coeffs, gain, state->Gain[1]); } diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index 1575212b..2a5d230c 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -136,9 +136,9 @@ static ALvoid ALflangerState_update(ALflangerState *state, const ALCdevice *Devi state->delay = fastf2i(props->Flanger.Delay * frequency); /* Gains for left and right sides */ - CalcXYZCoeffs(-1.0f, 0.0f, 0.0f, 0.0f, coeffs); + CalcAngleCoeffs(-F_PI_2, 0.0f, 0.0f, coeffs); ComputePanningGains(Device->Dry, coeffs, Slot->Params.Gain, state->Gain[0]); - CalcXYZCoeffs( 1.0f, 0.0f, 0.0f, 0.0f, coeffs); + CalcAngleCoeffs( F_PI_2, 0.0f, 0.0f, coeffs); ComputePanningGains(Device->Dry, coeffs, Slot->Params.Gain, state->Gain[1]); phase = props->Flanger.Phase; |