aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-04-03 03:52:23 -0700
committerChris Robinson <[email protected]>2020-04-03 03:52:23 -0700
commit11305975629176e032548bba53207a36f55d9dc7 (patch)
tree0d6725a51a81aafd42502127e89cade19198a103 /alc
parentd9225083b4c7fe84d7a4bbde31801be4e51f6f61 (diff)
Use structs for the mixer and resampler tags
Diffstat (limited to 'alc')
-rw-r--r--alc/alu.cpp20
-rw-r--r--alc/converter.cpp3
-rw-r--r--alc/mixer/defs.h30
-rw-r--r--alc/mixer/mixer_c.cpp8
-rw-r--r--alc/mixer/mixer_neon.cpp5
-rw-r--r--alc/mixer/mixer_sse.cpp4
-rw-r--r--alc/mixer/mixer_sse2.cpp3
-rw-r--r--alc/mixer/mixer_sse41.cpp3
-rw-r--r--alc/voice.cpp9
9 files changed, 61 insertions, 24 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index 18973942..b8befd03 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -82,6 +82,26 @@
#include "bsinc_tables.h"
+struct CTag;
+#ifdef HAVE_SSE
+struct SSETag;
+#endif
+#ifdef HAVE_SSE2
+struct SSE2Tag;
+#endif
+#ifdef HAVE_SSE4_1
+struct SSE4Tag;
+#endif
+#ifdef HAVE_NEON
+struct NEONTag;
+#endif
+struct CopyTag;
+struct PointTag;
+struct LerpTag;
+struct CubicTag;
+struct BSincTag;
+struct FastBSincTag;
+
static_assert(!(MAX_RESAMPLER_PADDING&1) && MAX_RESAMPLER_PADDING >= BSINC_POINTS_MAX,
"MAX_RESAMPLER_PADDING is not a multiple of two, or is too small");
diff --git a/alc/converter.cpp b/alc/converter.cpp
index 38b8bedb..f20a348e 100644
--- a/alc/converter.cpp
+++ b/alc/converter.cpp
@@ -14,6 +14,9 @@
#include "fpu_ctrl.h"
#include "mixer/defs.h"
+struct CTag;
+struct CopyTag;
+
namespace {
diff --git a/alc/mixer/defs.h b/alc/mixer/defs.h
index a624509a..6e270fb4 100644
--- a/alc/mixer/defs.h
+++ b/alc/mixer/defs.h
@@ -11,42 +11,24 @@ union InterpState;
struct MixHrtfFilter;
-enum InstSetType {
- CTag,
- SSETag,
- SSE2Tag,
- SSE3Tag,
- SSE4Tag,
- NEONTag
-};
-
-enum ResampleType {
- CopyTag,
- PointTag,
- LerpTag,
- CubicTag,
- BSincTag,
- FastBSincTag
-};
-
-template<ResampleType TypeTag, InstSetType InstTag>
+template<typename TypeTag, typename InstTag>
const float *Resample_(const InterpState *state, const float *RESTRICT src, ALuint frac,
ALuint increment, const al::span<float> dst);
-template<InstSetType InstTag>
+template<typename InstTag>
void Mix_(const al::span<const float> InSamples, const al::span<FloatBufferLine> OutBuffer,
float *CurrentGains, const float *TargetGains, const size_t Counter, const size_t OutPos);
-template<InstSetType InstTag>
+template<typename InstTag>
void MixRow_(const al::span<float> OutBuffer, const al::span<const float> Gains,
const float *InSamples, const size_t InStride);
-template<InstSetType InstTag>
+template<typename InstTag>
void MixHrtf_(const float *InSamples, float2 *AccumSamples, const ALuint IrSize,
const MixHrtfFilter *hrtfparams, const size_t BufferSize);
-template<InstSetType InstTag>
+template<typename InstTag>
void MixHrtfBlend_(const float *InSamples, float2 *AccumSamples, const ALuint IrSize,
const HrtfFilter *oldparams, const MixHrtfFilter *newparams, const size_t BufferSize);
-template<InstSetType InstTag>
+template<typename InstTag>
void MixDirectHrtf_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut,
const al::span<const FloatBufferLine> InSamples, float2 *AccumSamples, DirectHrtfState *State,
const size_t BufferSize);
diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp
index d27186fd..716f2c4d 100644
--- a/alc/mixer/mixer_c.cpp
+++ b/alc/mixer/mixer_c.cpp
@@ -10,6 +10,14 @@
#include "defs.h"
#include "hrtfbase.h"
+struct CTag;
+struct CopyTag;
+struct PointTag;
+struct LerpTag;
+struct CubicTag;
+struct BSincTag;
+struct FastBSincTag;
+
namespace {
diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp
index 055715f3..760ac58e 100644
--- a/alc/mixer/mixer_neon.cpp
+++ b/alc/mixer/mixer_neon.cpp
@@ -13,6 +13,11 @@
#include "bsinc_defs.h"
#include "hrtfbase.h"
+struct NEONTag;
+struct LerpTag;
+struct BSincTag;
+struct FastBSincTag;
+
namespace {
diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp
index 8c52d85f..3ec14541 100644
--- a/alc/mixer/mixer_sse.cpp
+++ b/alc/mixer/mixer_sse.cpp
@@ -13,6 +13,10 @@
#include "defs.h"
#include "hrtfbase.h"
+struct SSETag;
+struct BSincTag;
+struct FastBSincTag;
+
namespace {
diff --git a/alc/mixer/mixer_sse2.cpp b/alc/mixer/mixer_sse2.cpp
index bb9b65f2..3558b55e 100644
--- a/alc/mixer/mixer_sse2.cpp
+++ b/alc/mixer/mixer_sse2.cpp
@@ -26,6 +26,9 @@
#include "alu.h"
#include "defs.h"
+struct SSE2Tag;
+struct LerpTag;
+
template<>
const float *Resample_<LerpTag,SSE2Tag>(const InterpState*, const float *RESTRICT src, ALuint frac,
diff --git a/alc/mixer/mixer_sse41.cpp b/alc/mixer/mixer_sse41.cpp
index 1f483887..b5aebe7d 100644
--- a/alc/mixer/mixer_sse41.cpp
+++ b/alc/mixer/mixer_sse41.cpp
@@ -27,6 +27,9 @@
#include "alu.h"
#include "defs.h"
+struct SSE4Tag;
+struct LerpTag;
+
template<>
const float *Resample_<LerpTag,SSE4Tag>(const InterpState*, const float *RESTRICT src, ALuint frac,
diff --git a/alc/voice.cpp b/alc/voice.cpp
index 64e0bde4..493687ae 100644
--- a/alc/voice.cpp
+++ b/alc/voice.cpp
@@ -63,6 +63,15 @@
#include "threads.h"
#include "vector.h"
+struct CTag;
+#ifdef HAVE_SSE
+struct SSETag;
+#endif
+#ifdef HAVE_NEON
+struct NEONTag;
+#endif
+struct CopyTag;
+
static_assert((BUFFERSIZE-1)/MAX_PITCH > 0, "MAX_PITCH is too large for BUFFERSIZE!");
static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE,