diff options
author | Chris Robinson <[email protected]> | 2016-09-06 13:21:11 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-09-06 13:21:11 -0700 |
commit | 1d9d1958db4b14da654a3bc3f362582829596c75 (patch) | |
tree | 0cba33071b023c1eb6985f478f2eecfdd7890aef | |
parent | 9cbe02fd850b9ecc4a227c7553004ca3203a5ed0 (diff) |
Make the SelectMixer function sharable
-rw-r--r-- | Alc/bformatdec.c | 4 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 16 | ||||
-rw-r--r-- | Alc/mixer.c | 18 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 2 |
4 files changed, 14 insertions, 26 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c index 056eb7f5..0722c061 100644 --- a/Alc/bformatdec.c +++ b/Alc/bformatdec.c @@ -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]); diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index bdb7ae73..ef25c076 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -37,22 +37,8 @@ * 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 MixerFunc MixSamples = Mix_C; static alonce_flag mixfunc_inited = AL_ONCE_FLAG_INIT; static void init_mixfunc(void) diff --git a/Alc/mixer.c b/Alc/mixer.c index bbf70153..2736920e 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -61,36 +61,36 @@ 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; -static inline HrtfMixerFunc SelectHrtfMixer(void) +MixerFunc SelectMixer(void) { #ifdef HAVE_SSE if((CPUCapFlags&CPU_CAP_SSE)) - return MixHrtf_SSE; + return Mix_SSE; #endif #ifdef HAVE_NEON if((CPUCapFlags&CPU_CAP_NEON)) - return MixHrtf_Neon; + return Mix_Neon; #endif - return MixHrtf_C; + return Mix_C; } -static inline MixerFunc SelectMixer(void) +static inline HrtfMixerFunc SelectHrtfMixer(void) { #ifdef HAVE_SSE if((CPUCapFlags&CPU_CAP_SSE)) - return Mix_SSE; + return MixHrtf_SSE; #endif #ifdef HAVE_NEON if((CPUCapFlags&CPU_CAP_NEON)) - return Mix_Neon; + return MixHrtf_Neon; #endif - return Mix_C; + return MixHrtf_C; } static inline ResamplerFunc SelectResampler(enum Resampler resampler) diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index d236c58b..3d1a4986 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -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 |