diff options
-rw-r--r-- | Alc/mixer_c.c | 8 | ||||
-rw-r--r-- | Alc/mixer_inc.c | 20 | ||||
-rw-r--r-- | Alc/mixer_neon.c | 8 | ||||
-rw-r--r-- | Alc/mixer_sse.c | 45 |
4 files changed, 58 insertions, 23 deletions
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index 5cb5acb4..aecf03a5 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -36,14 +36,6 @@ static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2], } -static __inline void ApplyValue(ALfloat *RESTRICT Output, ALfloat value, const ALfloat *DrySend) -{ - ALuint c; - for(c = 0;c < MaxChannels;c++) - Output[c] += value*DrySend[c]; -} - - #define SUFFIX C #include "mixer_inc.c" #undef SUFFIX diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index ff12026b..359662cc 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -30,10 +30,9 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2 static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2], ALfloat (*RESTRICT Coeffs)[2], ALfloat left, ALfloat right); -static __inline void ApplyValue(ALfloat *RESTRICT Output, ALfloat value, - const ALfloat *DrySend); +#ifndef NO_MIXDIRECT_HRTF void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params, const ALfloat *RESTRICT data, ALuint srcchan, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) @@ -149,8 +148,9 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params, Coeffs[0][1] * right; } } +#endif - +#ifndef NO_MIXDIRECT void MixDirect(ALsource *Source, ALCdevice *Device, DirectParams *params, const ALfloat *RESTRICT data, ALuint srcchan, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) @@ -176,22 +176,26 @@ void MixDirect(ALsource *Source, ALCdevice *Device, DirectParams *params, if(OutPos == 0) { value = lpFilter2PC(DryFilter, srcchan, data[pos]); - ApplyValue(ClickRemoval, -value, DrySend); + for(c = 0;c < MaxChannels;c++) + ClickRemoval[c] -= value*DrySend[c]; } for(pos = 0;pos < BufferSize;pos++) { value = lpFilter2P(DryFilter, srcchan, data[pos]); - ApplyValue(DryBuffer[OutPos], value, DrySend); + for(c = 0;c < MaxChannels;c++) + DryBuffer[OutPos][c] += value*DrySend[c]; OutPos++; } if(OutPos == SamplesToDo) { value = lpFilter2PC(DryFilter, srcchan, data[pos]); - ApplyValue(PendingClicks, value, DrySend); + for(c = 0;c < MaxChannels;c++) + PendingClicks[c] += value*DrySend[c]; } } +#endif - +#ifndef NO_MIXSEND void MixSend(SendParams *params, const ALfloat *RESTRICT data, ALuint srcchan, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) { @@ -229,6 +233,8 @@ void MixSend(SendParams *params, const ALfloat *RESTRICT data, ALuint srcchan, WetPendingClicks[0] += value * WetSend; } } +#endif + #undef MixSend #undef MixDirect diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c index 4824c597..f7a9fed5 100644 --- a/Alc/mixer_neon.c +++ b/Alc/mixer_neon.c @@ -54,14 +54,6 @@ static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2], } -static __inline void ApplyValue(ALfloat *RESTRICT Output, ALfloat value, const ALfloat *DrySend) -{ - ALuint c; - for(c = 0;c < MaxChannels;c++) - Output[c] += value*DrySend[c]; -} - - #define SUFFIX Neon #include "mixer_inc.c" #undef SUFFIX diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index 2824beb4..101b296e 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -9,6 +9,9 @@ #include "alMain.h" #include "alu.h" +#include "alSource.h" +#include "mixer_defs.h" + static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2], ALfloat (*RESTRICT Coeffs)[2], @@ -76,6 +79,48 @@ static __inline void ApplyValue(ALfloat *RESTRICT Output, ALfloat value, const A } +void MixDirect_SSE(ALsource *Source, ALCdevice *Device, DirectParams *params, + const ALfloat *RESTRICT data, ALuint srcchan, + ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) +{ + ALfloat (*RESTRICT DryBuffer)[MaxChannels]; + ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks; + ALIGN(16) ALfloat DrySend[MaxChannels]; + FILTER *DryFilter; + ALuint pos; + ALfloat value; + ALuint c; + (void)Source; + + DryBuffer = Device->DryBuffer; + ClickRemoval = Device->ClickRemoval; + PendingClicks = Device->PendingClicks; + DryFilter = ¶ms->iirFilter; + + for(c = 0;c < MaxChannels;c++) + DrySend[c] = params->Gains[srcchan][c]; + + pos = 0; + if(OutPos == 0) + { + value = lpFilter2PC(DryFilter, srcchan, data[pos]); + ApplyValue(ClickRemoval, -value, DrySend); + } + for(pos = 0;pos < BufferSize;pos++) + { + value = lpFilter2P(DryFilter, srcchan, data[pos]); + ApplyValue(DryBuffer[OutPos], value, DrySend); + OutPos++; + } + if(OutPos == SamplesToDo) + { + value = lpFilter2PC(DryFilter, srcchan, data[pos]); + ApplyValue(PendingClicks, value, DrySend); + } +} +#define NO_MIXDIRECT + + #define SUFFIX SSE #include "mixer_inc.c" #undef SUFFIX |