From f56dddfa735d5a085bce737fb417ae233049e7d8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 9 Sep 2012 00:53:54 -0700 Subject: Implement MixDirect_SSE separately from the C and Neon versions --- Alc/mixer_sse.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'Alc/mixer_sse.c') 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 -- cgit v1.2.3