Make the SelectMixer function sharable

This commit is contained in:
Chris Robinson
2016-09-06 13:21:11 -07:00
parent 9cbe02fd85
commit 1d9d1958db
4 changed files with 20 additions and 32 deletions
+2 -2
View File
@@ -161,7 +161,7 @@ static const ALfloat Ambi3DDecoder[8][FB_Max][MAX_AMBI_COEFFS] = {
static ALfloat Ambi3DEncoder[8][MAX_AMBI_COEFFS];
static inline RowMixerFunc SelectMixer(void)
static inline RowMixerFunc SelectRowMixer(void)
{
#ifdef HAVE_SSE
if((CPUCapFlags&CPU_CAP_SSE))
@@ -183,7 +183,7 @@ static void init_bformatdec(void)
{
ALuint i, j;
MixMatrixRow = SelectMixer();
MixMatrixRow = SelectRowMixer();
for(i = 0;i < COUNTOF(Ambi3DPoints);i++)
CalcDirectionCoeffs(Ambi3DPoints[i], 0.0f, Ambi3DEncoder[i]);
+1 -15
View File
@@ -37,23 +37,9 @@
* iteration. */
#define MAX_UPDATE_SAMPLES 256
static MixerFunc MixSamples = Mix_C;
static inline MixerFunc SelectMixer(void)
{
#ifdef HAVE_SSE
if((CPUCapFlags&CPU_CAP_SSE))
return Mix_SSE;
#endif
#ifdef HAVE_NEON
if((CPUCapFlags&CPU_CAP_NEON))
return Mix_Neon;
#endif
return Mix_C;
}
static alonce_flag mixfunc_inited = AL_ONCE_FLAG_INIT;
static void init_mixfunc(void)
{
+15 -15
View File
@@ -61,10 +61,24 @@ static_assert(MAX_PRE_SAMPLES >= 3, "MAX_PRE_SAMPLES must be at least 3!");
static_assert(MAX_POST_SAMPLES >= 4, "MAX_POST_SAMPLES must be at least 4!");
static HrtfMixerFunc MixHrtfSamples = MixHrtf_C;
static MixerFunc MixSamples = Mix_C;
static HrtfMixerFunc MixHrtfSamples = MixHrtf_C;
static ResamplerFunc ResampleSamples = Resample_point32_C;
MixerFunc SelectMixer(void)
{
#ifdef HAVE_SSE
if((CPUCapFlags&CPU_CAP_SSE))
return Mix_SSE;
#endif
#ifdef HAVE_NEON
if((CPUCapFlags&CPU_CAP_NEON))
return Mix_Neon;
#endif
return Mix_C;
}
static inline HrtfMixerFunc SelectHrtfMixer(void)
{
#ifdef HAVE_SSE
@@ -79,20 +93,6 @@ static inline HrtfMixerFunc SelectHrtfMixer(void)
return MixHrtf_C;
}
static inline MixerFunc SelectMixer(void)
{
#ifdef HAVE_SSE
if((CPUCapFlags&CPU_CAP_SSE))
return Mix_SSE;
#endif
#ifdef HAVE_NEON
if((CPUCapFlags&CPU_CAP_NEON))
return Mix_Neon;
#endif
return Mix_C;
}
static inline ResamplerFunc SelectResampler(enum Resampler resampler)
{
switch(resampler)
+2
View File
@@ -264,6 +264,8 @@ enum HrtfRequestMode {
void aluInitMixer(void);
MixerFunc SelectMixer(void);
/* aluInitRenderer
*
* Set up the appropriate panning method and mixing method given the device