aboutsummaryrefslogtreecommitdiffstats
path: root/alc/mixer/defs.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-07-31 10:09:43 -0700
committerChris Robinson <[email protected]>2019-07-31 10:09:43 -0700
commit471f905fbd5f665148d2e9f40aca7ee6b1bead7b (patch)
tree8bbb7b45512e114dfa9aa2560c7854390b4bb014 /alc/mixer/defs.h
parenta0aa5bc80a5c38f4ba92e38f924f4141344da819 (diff)
Use enums for the resampler and mixer template tags
Diffstat (limited to 'alc/mixer/defs.h')
-rw-r--r--alc/mixer/defs.h56
1 files changed, 27 insertions, 29 deletions
diff --git a/alc/mixer/defs.h b/alc/mixer/defs.h
index 3e5d1125..0cd4162a 100644
--- a/alc/mixer/defs.h
+++ b/alc/mixer/defs.h
@@ -1,46 +1,44 @@
#ifndef MIXER_DEFS_H
#define MIXER_DEFS_H
-#include "AL/alc.h"
#include "AL/al.h"
#include "alcmain.h"
-#include "alu.h"
#include "alspan.h"
-
-
-struct MixGains;
-struct MixHrtfFilter;
-struct HrtfState;
-struct DirectHrtfState;
-
-
-struct CTag { };
-struct SSETag { };
-struct SSE2Tag { };
-struct SSE3Tag { };
-struct SSE4Tag { };
-struct NEONTag { };
-
-struct CopyTag { };
-struct PointTag { };
-struct LerpTag { };
-struct CubicTag { };
-struct BSincTag { };
-
-template<typename TypeTag, typename InstTag>
+#include "alu.h"
+#include "hrtf.h"
+
+
+enum InstSetType {
+ CTag,
+ SSETag,
+ SSE2Tag,
+ SSE3Tag,
+ SSE4Tag,
+ NEONTag
+};
+
+enum ResampleType {
+ CopyTag,
+ PointTag,
+ LerpTag,
+ CubicTag,
+ BSincTag
+};
+
+template<ResampleType TypeTag, InstSetType InstTag>
const ALfloat *Resample_(const InterpState *state, const ALfloat *RESTRICT src, ALsizei frac, ALint increment, ALfloat *RESTRICT dst, ALsizei dstlen);
-template<typename InstTag>
+template<InstSetType InstTag>
void Mix_(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer, ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos, const ALsizei BufferSize);
-template<typename InstTag>
+template<InstSetType InstTag>
void MixRow_(FloatBufferLine &OutBuffer, const ALfloat *Gains, const al::span<const FloatBufferLine> InSamples, const ALsizei InPos, const ALsizei BufferSize);
-template<typename InstTag>
+template<InstSetType InstTag>
void MixHrtf_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const ALfloat *InSamples, float2 *AccumSamples, const ALsizei OutPos, const ALsizei IrSize, MixHrtfFilter *hrtfparams, const ALsizei BufferSize);
-template<typename InstTag>
+template<InstSetType InstTag>
void MixHrtfBlend_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const ALfloat *InSamples, float2 *AccumSamples, const ALsizei OutPos, const ALsizei IrSize, const HrtfFilter *oldparams, MixHrtfFilter *newparams, const ALsizei BufferSize);
-template<typename InstTag>
+template<InstSetType InstTag>
void MixDirectHrtf_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const al::span<const FloatBufferLine> InSamples, float2 *AccumSamples, DirectHrtfState *State, const ALsizei BufferSize);
/* Vectorized resampler helpers */