Update OpenAL Soft to 1.19.1.

This commit is contained in:
Alex Szpakowski
2018-12-31 15:47:52 -04:00
parent f06a3bc791
commit 1f9c102832
87 changed files with 4678 additions and 2971 deletions
+10 -12
View File
@@ -37,8 +37,8 @@ typedef struct ALdistortionState {
ALfloat Gain[MAX_OUTPUT_CHANNELS];
/* Effect parameters */
BiquadState lowpass;
BiquadState bandpass;
BiquadFilter lowpass;
BiquadFilter bandpass;
ALfloat attenuation;
ALfloat edge_coeff;
@@ -58,9 +58,6 @@ static void ALdistortionState_Construct(ALdistortionState *state)
{
ALeffectState_Construct(STATIC_CAST(ALeffectState, state));
SET_VTABLE2(ALdistortionState, ALeffectState, state);
BiquadState_clear(&state->lowpass);
BiquadState_clear(&state->bandpass);
}
static ALvoid ALdistortionState_Destruct(ALdistortionState *state)
@@ -68,8 +65,10 @@ static ALvoid ALdistortionState_Destruct(ALdistortionState *state)
ALeffectState_Destruct(STATIC_CAST(ALeffectState,state));
}
static ALboolean ALdistortionState_deviceUpdate(ALdistortionState *UNUSED(state), ALCdevice *UNUSED(device))
static ALboolean ALdistortionState_deviceUpdate(ALdistortionState *state, ALCdevice *UNUSED(device))
{
BiquadFilter_clear(&state->lowpass);
BiquadFilter_clear(&state->bandpass);
return AL_TRUE;
}
@@ -93,20 +92,19 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCcontex
/* Multiply sampling frequency by the amount of oversampling done during
* processing.
*/
BiquadState_setParams(&state->lowpass, BiquadType_LowPass, 1.0f,
BiquadFilter_setParams(&state->lowpass, BiquadType_LowPass, 1.0f,
cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth)
);
cutoff = props->Distortion.EQCenter;
/* Convert bandwidth in Hz to octaves. */
bandwidth = props->Distortion.EQBandwidth / (cutoff * 0.67f);
BiquadState_setParams(&state->bandpass, BiquadType_BandPass, 1.0f,
BiquadFilter_setParams(&state->bandpass, BiquadType_BandPass, 1.0f,
cutoff / (frequency*4.0f), calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth)
);
CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs);
ComputeDryPanGains(&device->Dry, coeffs, slot->Params.Gain * props->Distortion.Gain,
state->Gain);
ComputePanGains(&device->Dry, coeffs, slot->Params.Gain*props->Distortion.Gain, state->Gain);
}
static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels)
@@ -136,7 +134,7 @@ static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei Sample
* (which is fortunately first step of distortion). So combine three
* operations into the one.
*/
BiquadState_process(&state->lowpass, buffer[1], buffer[0], todo);
BiquadFilter_process(&state->lowpass, buffer[1], buffer[0], todo);
/* Second step, do distortion using waveshaper function to emulate
* signal processing during tube overdriving. Three steps of
@@ -155,7 +153,7 @@ static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei Sample
}
/* Third step, do bandpass filtering of distorted signal. */
BiquadState_process(&state->bandpass, buffer[1], buffer[0], todo);
BiquadFilter_process(&state->bandpass, buffer[1], buffer[0], todo);
todo >>= 2;
for(k = 0;k < NumChannels;k++)