diff options
author | Chris Robinson <[email protected]> | 2017-01-16 07:45:07 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-01-16 08:06:25 -0800 |
commit | cbb796bf31cd3acfba0ce35e71a51d03e7e26021 (patch) | |
tree | 0264bcb03f58e8dee89ee383d61da0bf4e7469d1 /Alc/mixer_inc.c | |
parent | 9f23d17333c8faaa0a2b7a86df33c41874a929a5 (diff) |
Use ALsizei for sizes and offsets with the mixer
Unsigned 32-bit offsets actually have some potential overhead on 64-bit targets
for pointer/array accesses due to rules on integer wrapping. No idea how much
impact it has in practice, but it's nice to be correct about it.
Diffstat (limited to 'Alc/mixer_inc.c')
-rw-r--r-- | Alc/mixer_inc.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index 25dc2b58..38b0242e 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -12,28 +12,28 @@ #define MAX_UPDATE_SAMPLES 128 -static inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint irSize, +static inline void ApplyCoeffsStep(ALsizei Offset, ALfloat (*restrict Values)[2], + const ALsizei 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, +static inline void ApplyCoeffs(ALsizei Offset, ALfloat (*restrict Values)[2], + const ALsizei irSize, ALfloat (*restrict Coeffs)[2], ALfloat left, ALfloat right); -void MixHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx, - const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos, - const ALuint IrSize, const MixHrtfParams *hrtfparams, HrtfState *hrtfstate, - ALuint BufferSize) +void MixHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALsizei lidx, ALsizei ridx, + const ALfloat *data, ALsizei Counter, ALsizei Offset, ALsizei OutPos, + const ALsizei IrSize, const MixHrtfParams *hrtfparams, HrtfState *hrtfstate, + ALsizei BufferSize) { ALfloat (*Coeffs)[2] = hrtfparams->Current->Coeffs; - ALuint Delay[2] = { hrtfparams->Current->Delay[0], hrtfparams->Current->Delay[1] }; + ALsizei Delay[2] = { hrtfparams->Current->Delay[0], hrtfparams->Current->Delay[1] }; ALfloat out[MAX_UPDATE_SAMPLES][2]; ALfloat left, right; - ALuint minsize; - ALuint pos, i; + ALsizei minsize; + ALsizei pos, i; pos = 0; if(Counter == 0) @@ -42,7 +42,7 @@ void MixHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx minsize = minu(BufferSize, Counter); while(pos < minsize) { - ALuint todo = minu(minsize-pos, MAX_UPDATE_SAMPLES); + ALsizei todo = mini(minsize-pos, MAX_UPDATE_SAMPLES); for(i = 0;i < todo;i++) { @@ -90,7 +90,7 @@ skip_stepping: Delay[1] >>= HRTFDELAY_BITS; while(pos < BufferSize) { - ALuint todo = minu(BufferSize-pos, MAX_UPDATE_SAMPLES); + ALsizei todo = mini(BufferSize-pos, MAX_UPDATE_SAMPLES); for(i = 0;i < todo;i++) { @@ -115,18 +115,18 @@ skip_stepping: } } -void MixDirectHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx, - const ALfloat *data, ALuint Offset, const ALuint IrSize, +void MixDirectHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALsizei lidx, ALsizei ridx, + const ALfloat *data, ALsizei Offset, const ALsizei IrSize, ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2], - ALuint BufferSize) + ALsizei BufferSize) { ALfloat out[MAX_UPDATE_SAMPLES][2]; ALfloat insample; - ALuint pos, i; + ALsizei pos, i; for(pos = 0;pos < BufferSize;) { - ALuint todo = minu(BufferSize-pos, MAX_UPDATE_SAMPLES); + ALsizei todo = mini(BufferSize-pos, MAX_UPDATE_SAMPLES); for(i = 0;i < todo;i++) { |