diff options
author | Chris Robinson <[email protected]> | 2012-09-09 00:53:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-09-09 00:53:54 -0700 |
commit | f56dddfa735d5a085bce737fb417ae233049e7d8 (patch) | |
tree | 051f20fc4deda1372820f7fbeabf3bd63e11b904 /Alc/mixer_sse.c | |
parent | 2bf1979d4a805e661bdd43258a5020c96cda1f80 (diff) |
Implement MixDirect_SSE separately from the C and Neon versions
Diffstat (limited to 'Alc/mixer_sse.c')
-rw-r--r-- | Alc/mixer_sse.c | 45 |
1 files changed, 45 insertions, 0 deletions
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 |