aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-01-23 11:21:03 -0800
committerChris Robinson <[email protected]>2019-01-23 11:21:03 -0800
commitd3842a632da8542ac0c8fbdff39dc3d4a25c1a16 (patch)
tree0ea1ff2d63f72c3fd70b90e177f77d77b86897b4 /Alc/mixer
parent23179d0bcdd27d2b5ab5ddf0e38b180e2d6969e6 (diff)
Use template declarations for the normal mixing functions
Diffstat (limited to 'Alc/mixer')
-rw-r--r--Alc/mixer/defs.h19
-rw-r--r--Alc/mixer/mixer_c.cpp12
-rw-r--r--Alc/mixer/mixer_neon.cpp12
-rw-r--r--Alc/mixer/mixer_sse.cpp12
4 files changed, 25 insertions, 30 deletions
diff --git a/Alc/mixer/defs.h b/Alc/mixer/defs.h
index 4b1e0303..03955b59 100644
--- a/Alc/mixer/defs.h
+++ b/Alc/mixer/defs.h
@@ -29,6 +29,10 @@ struct BSincTag { };
template<typename TypeTag, typename InstTag>
const ALfloat *Resample_(const InterpState *state, const ALfloat *RESTRICT src, ALsizei frac, ALint increment, ALfloat *RESTRICT dst, ALsizei dstlen);
+template<typename InstTag>
+void Mix_(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE], ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos, const ALsizei BufferSize);
+template<typename InstTag>
+void MixRow_(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE], const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize);
/* C mixers */
void MixHrtf_C(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
@@ -43,11 +47,6 @@ void MixHrtfBlend_C(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
void MixDirectHrtf_C(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
const ALfloat (*data)[BUFFERSIZE], DirectHrtfState *State,
const ALsizei NumChans, const ALsizei BufferSize);
-void Mix_C(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter,
- const ALsizei OutPos, const ALsizei BufferSize);
-void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
- const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize);
/* SSE mixers */
void MixHrtf_SSE(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
@@ -62,11 +61,6 @@ void MixHrtfBlend_SSE(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
void MixDirectHrtf_SSE(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
const ALfloat (*data)[BUFFERSIZE], DirectHrtfState *State,
const ALsizei NumChans, const ALsizei BufferSize);
-void Mix_SSE(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter,
- const ALsizei OutPos, const ALsizei BufferSize);
-void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
- const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize);
/* Vectorized resampler helpers */
inline void InitiatePositionArrays(ALsizei frac, ALint increment, ALsizei *RESTRICT frac_arr, ALsizei *RESTRICT pos_arr, ALsizei size)
@@ -94,10 +88,5 @@ void MixHrtfBlend_Neon(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
void MixDirectHrtf_Neon(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut,
const ALfloat (*data)[BUFFERSIZE], DirectHrtfState *State,
const ALsizei NumChans, const ALsizei BufferSize);
-void Mix_Neon(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter,
- const ALsizei OutPos, const ALsizei BufferSize);
-void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
- const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize);
#endif /* MIXER_DEFS_H */
diff --git a/Alc/mixer/mixer_c.cpp b/Alc/mixer/mixer_c.cpp
index 5f9f45a2..6b1cc495 100644
--- a/Alc/mixer/mixer_c.cpp
+++ b/Alc/mixer/mixer_c.cpp
@@ -131,9 +131,10 @@ static inline void ApplyCoeffs(ALsizei Offset, ALfloat (&Values)[HRIR_LENGTH][2]
#include "hrtf_inc.cpp"
-void Mix_C(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter,
- const ALsizei OutPos, const ALsizei BufferSize)
+template<>
+void Mix_<CTag>(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
+ ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+ const ALsizei BufferSize)
{
ASSUME(OutChans > 0);
ASSUME(BufferSize > 0);
@@ -176,8 +177,9 @@ void Mix_C(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUF
* transform. And as the matrices are more or less static once set up, no
* stepping is necessary.
*/
-void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
- const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize)
+template<>
+void MixRow_<CTag>(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
+ const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize)
{
ASSUME(InChans > 0);
ASSUME(BufferSize > 0);
diff --git a/Alc/mixer/mixer_neon.cpp b/Alc/mixer/mixer_neon.cpp
index d9eac59c..978ea8d3 100644
--- a/Alc/mixer/mixer_neon.cpp
+++ b/Alc/mixer/mixer_neon.cpp
@@ -170,9 +170,10 @@ static inline void ApplyCoeffs(ALsizei Offset, ALfloat (&Values)[HRIR_LENGTH][2]
#include "hrtf_inc.cpp"
-void Mix_Neon(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter,
- const ALsizei OutPos, const ALsizei BufferSize)
+template<>
+void Mix_<NEONTag>(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
+ ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+ const ALsizei BufferSize)
{
ASSUME(OutChans > 0);
ASSUME(BufferSize > 0);
@@ -255,8 +256,9 @@ void Mix_Neon(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[
}
}
-void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
- const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize)
+template<>
+void MixRow_<NEONTag>(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
+ const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize)
{
ASSUME(InChans > 0);
ASSUME(BufferSize > 0);
diff --git a/Alc/mixer/mixer_sse.cpp b/Alc/mixer/mixer_sse.cpp
index ec0fbfc5..adb0287d 100644
--- a/Alc/mixer/mixer_sse.cpp
+++ b/Alc/mixer/mixer_sse.cpp
@@ -149,9 +149,10 @@ static inline void ApplyCoeffs(ALsizei Offset, ALfloat (&Values)[HRIR_LENGTH][2]
#include "hrtf_inc.cpp"
-void Mix_SSE(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter,
- const ALsizei OutPos, const ALsizei BufferSize)
+template<>
+void Mix_<SSETag>(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE],
+ ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+ const ALsizei BufferSize)
{
ASSUME(OutChans > 0);
ASSUME(BufferSize > 0);
@@ -231,8 +232,9 @@ void Mix_SSE(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[B
}
}
-void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
- const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize)
+template<>
+void MixRow_<SSETag>(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE],
+ const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize)
{
ASSUME(InChans > 0);
ASSUME(BufferSize > 0);