aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_sse.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/mixer_sse.c')
-rw-r--r--Alc/mixer_sse.c45
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 = &params->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