diff options
author | Chris Robinson <[email protected]> | 2019-07-31 10:46:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-07-31 10:46:33 -0700 |
commit | 151ff51e7d7b8265cac804f3b754a87924902090 (patch) | |
tree | 8908296e7e18da690b7d139fcb03d9977907230f | |
parent | d1f72624a749bd9c2a17ddeb303703a78f53d4a5 (diff) |
Don't templatize HrirArray
-rw-r--r-- | alc/alu.h | 2 | ||||
-rw-r--r-- | alc/hrtf.cpp | 4 | ||||
-rw-r--r-- | alc/hrtf.h | 14 | ||||
-rw-r--r-- | alc/mixer/hrtfbase.h | 4 | ||||
-rw-r--r-- | alc/mixer/mixer_c.cpp | 2 | ||||
-rw-r--r-- | alc/mixer/mixer_neon.cpp | 2 | ||||
-rw-r--r-- | alc/mixer/mixer_sse.cpp | 2 |
7 files changed, 14 insertions, 16 deletions
@@ -98,7 +98,7 @@ enum { struct MixHrtfFilter { - const HrirArray<ALfloat> *Coeffs; + const HrirArray *Coeffs; ALsizei Delay[2]; ALfloat Gain; ALfloat GainStep; diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp index 786c4c5d..8130288a 100644 --- a/alc/hrtf.cpp +++ b/alc/hrtf.cpp @@ -216,7 +216,7 @@ IdxBlend CalcAzIndex(ALsizei azcount, ALfloat az) * and azimuth in radians. The coefficients are normalized. */ void GetHrtfCoeffs(const HrtfEntry *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat distance, - ALfloat spread, HrirArray<ALfloat> &coeffs, ALsizei (&delays)[2]) + ALfloat spread, HrirArray &coeffs, ALsizei (&delays)[2]) { const ALfloat dirfact{1.0f - (spread / al::MathDefs<float>::Tau())}; @@ -348,7 +348,7 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALuin const ALdouble xover_norm{400.0 / Hrtf->sampleRate}; BandSplitterR<double> splitter{xover_norm}; - auto tmpres = al::vector<HrirArray<ALdouble>>(NumChannels); + auto tmpres = al::vector<std::array<std::array<ALdouble,2>,HRIR_LENGTH>>(NumChannels); auto tmpfilt = al::vector<std::array<ALdouble,HRIR_LENGTH*4>>(3); for(size_t c{0u};c < AmbiCount;++c) { @@ -63,17 +63,15 @@ struct EnumeratedHrtf { using float2 = std::array<float,2>; - -template<typename T> -using HrirArray = std::array<std::array<T,2>,HRIR_LENGTH>; +using HrirArray = std::array<float2,HRIR_LENGTH>; struct HrtfState { alignas(16) std::array<ALfloat,HRTF_HISTORY_LENGTH> History; - alignas(16) HrirArray<ALfloat> Values; + alignas(16) HrirArray Values; }; struct HrtfFilter { - alignas(16) HrirArray<ALfloat> Coeffs; + alignas(16) HrirArray Coeffs; ALsizei Delay[2]; ALfloat Gain; }; @@ -82,8 +80,8 @@ struct DirectHrtfState { /* HRTF filter state for dry buffer content */ ALsizei IrSize{0}; struct ChanData { - alignas(16) HrirArray<ALfloat> Values; - alignas(16) HrirArray<ALfloat> Coeffs; + alignas(16) HrirArray Values; + alignas(16) HrirArray Coeffs; }; al::FlexArray<ChanData> Chan; @@ -108,7 +106,7 @@ al::vector<EnumeratedHrtf> EnumerateHrtf(const char *devname); HrtfEntry *GetLoadedHrtf(HrtfHandle *handle); void GetHrtfCoeffs(const HrtfEntry *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat distance, - ALfloat spread, HrirArray<ALfloat> &coeffs, ALsizei (&delays)[2]); + ALfloat spread, HrirArray &coeffs, ALsizei (&delays)[2]); /** * Produces HRTF filter coefficients for decoding B-Format, given a set of diff --git a/alc/mixer/hrtfbase.h b/alc/mixer/hrtfbase.h index a76bd62e..3c8208f3 100644 --- a/alc/mixer/hrtfbase.h +++ b/alc/mixer/hrtfbase.h @@ -9,7 +9,7 @@ using ApplyCoeffsT = void(ALsizei Offset, float2 *RESTRICT Values, const ALsizei irSize, - const HrirArray<ALfloat> &Coeffs, const ALfloat left, const ALfloat right); + const HrirArray &Coeffs, const ALfloat left, const ALfloat right); template<ApplyCoeffsT &ApplyCoeffs> inline void MixHrtfBase(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, @@ -20,7 +20,7 @@ inline void MixHrtfBase(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, ASSUME(IrSize >= 4); ASSUME(BufferSize > 0); - const auto &Coeffs = *hrtfparams->Coeffs; + const HrirArray &Coeffs = *hrtfparams->Coeffs; const ALfloat gainstep{hrtfparams->GainStep}; const ALfloat gain{hrtfparams->Gain}; diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp index 3513cf2b..765b03fa 100644 --- a/alc/mixer/mixer_c.cpp +++ b/alc/mixer/mixer_c.cpp @@ -104,7 +104,7 @@ const ALfloat *Resample_<BSincTag,CTag>(const InterpState *state, const ALfloat static inline void ApplyCoeffs(ALsizei /*Offset*/, float2 *RESTRICT Values, const ALsizei IrSize, - const HrirArray<ALfloat> &Coeffs, const ALfloat left, const ALfloat right) + const HrirArray &Coeffs, const ALfloat left, const ALfloat right) { ASSUME(IrSize >= 2); for(ALsizei c{0};c < IrSize;++c) diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp index fa487d97..b4ca61d7 100644 --- a/alc/mixer/mixer_neon.cpp +++ b/alc/mixer/mixer_neon.cpp @@ -136,7 +136,7 @@ const ALfloat *Resample_<BSincTag,NEONTag>(const InterpState *state, const ALflo static inline void ApplyCoeffs(ALsizei /*Offset*/, float2 *RESTRICT Values, const ALsizei IrSize, - const HrirArray<ALfloat> &Coeffs, const ALfloat left, const ALfloat right) + const HrirArray &Coeffs, const ALfloat left, const ALfloat right) { ASSUME(IrSize >= 2); diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp index 516dabac..b52ef256 100644 --- a/alc/mixer/mixer_sse.cpp +++ b/alc/mixer/mixer_sse.cpp @@ -75,7 +75,7 @@ const ALfloat *Resample_<BSincTag,SSETag>(const InterpState *state, const ALfloa static inline void ApplyCoeffs(ALsizei Offset, float2 *RESTRICT Values, const ALsizei IrSize, - const HrirArray<ALfloat> &Coeffs, const ALfloat left, const ALfloat right) + const HrirArray &Coeffs, const ALfloat left, const ALfloat right) { const __m128 lrlr{_mm_setr_ps(left, right, left, right)}; |