diff options
Diffstat (limited to 'Alc/mixer_inc.c')
-rw-r--r-- | Alc/mixer_inc.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index 97266d40..17be5cde 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -18,30 +18,28 @@ #define MixDirect_Hrtf MERGE2(MixDirect_Hrtf_,SUFFIX) -static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2], - const ALuint irSize, - ALfloat (*RESTRICT Coeffs)[2], - const ALfloat (*RESTRICT CoeffStep)[2], - ALfloat left, ALfloat right); -static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2], - const ALuint irSize, - ALfloat (*RESTRICT Coeffs)[2], - ALfloat left, ALfloat right); - - -void MixDirect_Hrtf(const DirectParams *params, const ALfloat *RESTRICT data, ALuint srcchan, +static inline void ApplyCoeffsStep(const ALuint irSize, + ALfloat (*restrict Coeffs)[2], + const ALfloat (*restrict CoeffStep)[2]); +static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint irSize, + ALfloat (*restrict Coeffs)[2], + ALfloat left, ALfloat right); + + +void MixDirect_Hrtf(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) { - ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = params->OutBuffer; - ALfloat *RESTRICT ClickRemoval = params->ClickRemoval; - ALfloat *RESTRICT PendingClicks = params->PendingClicks; + ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer; + ALfloat *restrict ClickRemoval = params->ClickRemoval; + ALfloat *restrict PendingClicks = params->PendingClicks; const ALuint IrSize = params->Hrtf.Params.IrSize; - const ALint *RESTRICT DelayStep = params->Hrtf.Params.DelayStep; - const ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.Params.CoeffStep; - const ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Params.Coeffs[srcchan]; - const ALuint *RESTRICT TargetDelay = params->Hrtf.Params.Delay[srcchan]; - ALfloat *RESTRICT History = params->Hrtf.State->History[srcchan]; - ALfloat (*RESTRICT Values)[2] = params->Hrtf.State->Values[srcchan]; + const ALint *restrict DelayStep = params->Hrtf.Params.DelayStep; + const ALfloat (*restrict CoeffStep)[2] = params->Hrtf.Params.CoeffStep; + const ALfloat (*restrict TargetCoeffs)[2] = params->Hrtf.Params.Coeffs[srcchan]; + const ALuint *restrict TargetDelay = params->Hrtf.Params.Delay[srcchan]; + ALfloat *restrict History = params->Hrtf.State->History[srcchan]; + ALfloat (*restrict Values)[2] = params->Hrtf.State->Values[srcchan]; ALint Counter = maxu(params->Hrtf.State->Counter, OutPos) - OutPos; ALuint Offset = params->Hrtf.State->Offset + OutPos; ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2]; @@ -92,9 +90,10 @@ void MixDirect_Hrtf(const DirectParams *params, const ALfloat *RESTRICT data, AL Values[(Offset+IrSize)&HRIR_MASK][1] = 0.0f; Offset++; - ApplyCoeffsStep(Offset, Values, IrSize, Coeffs, CoeffStep, left, right); + ApplyCoeffs(Offset, Values, IrSize, Coeffs, left, right); DryBuffer[FrontLeft][OutPos] += Values[Offset&HRIR_MASK][0]; DryBuffer[FrontRight][OutPos] += Values[Offset&HRIR_MASK][1]; + ApplyCoeffsStep(IrSize, Coeffs, CoeffStep); OutPos++; Counter--; |