aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 4a98ee8f..3f80434e 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -41,6 +41,20 @@
extern inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, ALuint size);
+static inline HrtfMixerFunc SelectHrtfMixer(void)
+{
+#ifdef HAVE_SSE
+ if((CPUCapFlags&CPU_CAP_SSE))
+ return MixHrtf_SSE;
+#endif
+#ifdef HAVE_NEON
+ if((CPUCapFlags&CPU_CAP_NEON))
+ return MixHrtf_Neon;
+#endif
+
+ return MixHrtf_C;
+}
+
static inline MixerFunc SelectMixer(void)
{
#ifdef HAVE_SSE
@@ -165,6 +179,7 @@ static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter
ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
{
MixerFunc Mix;
+ HrtfMixerFunc HrtfMix;
ResamplerFunc Resample;
ALbufferlistitem *BufferListItem;
ALuint DataPosInt, DataPosFrac;
@@ -203,6 +218,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
}
Mix = SelectMixer();
+ HrtfMix = SelectHrtfMixer();
Resample = ((increment == FRACTIONONE && DataPosFrac == 0) ?
Resample_copy32_C : SelectResampler(Resampler));
@@ -415,8 +431,13 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
Device->FilteredData, ResampledData, DstBufferSize,
parms->Filters[chan].ActiveType
);
- Mix(samples, parms->OutChannels, parms->OutBuffer, parms->Gains[chan],
- parms->Counter, OutPos, DstBufferSize);
+ if(!voice->IsHrtf)
+ Mix(samples, parms->OutChannels, parms->OutBuffer, parms->Gains[chan],
+ parms->Counter, OutPos, DstBufferSize);
+ else
+ HrtfMix(parms->OutBuffer, samples, parms->Counter, voice->Offset,
+ OutPos, parms->Hrtf.IrSize, &parms->Hrtf.Params[chan],
+ &parms->Hrtf.State[chan], DstBufferSize);
}
/* Only the first channel for B-Format buffers (W channel) goes to