diff options
author | Chris Robinson <[email protected]> | 2014-06-06 01:52:53 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-06-06 07:15:22 -0700 |
commit | 6d1622dc68073e08dff6149280096f8f1d9a0a2e (patch) | |
tree | 8f400ce980a7c191dbab223c0a4268118bdebe15 /Alc/mixer_defs.h | |
parent | fc0be88c0f8d3d8887edd2afac915840f4e3f5e4 (diff) |
Move InitiatePositionArrays to mixer_defs.h
Diffstat (limited to 'Alc/mixer_defs.h')
-rw-r--r-- | Alc/mixer_defs.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h index 94e0b24f..caa06c25 100644 --- a/Alc/mixer_defs.h +++ b/Alc/mixer_defs.h @@ -4,6 +4,7 @@ #include "AL/alc.h" #include "AL/al.h" #include "alMain.h" +#include "alu.h" struct MixGains; struct MixGainMono; @@ -43,6 +44,20 @@ void MixSend_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data, ALuint BufferSize); /* SSE resamplers */ +inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, ALuint size) +{ + ALuint i; + + pos_arr[0] = 0; + frac_arr[0] = frac; + for(i = 1;i < size;i++) + { + ALuint frac_tmp = frac_arr[i-1] + increment; + pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS); + frac_arr[i] = frac_tmp&FRACTIONMASK; + } +} + const ALfloat *Resample_lerp32_SSE2(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); const ALfloat *Resample_lerp32_SSE41(const ALfloat *src, ALuint frac, ALuint increment, |