aboutsummaryrefslogtreecommitdiffstats
path: root/alc/mixer/mixer_neon.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-10-19 07:55:25 -0700
committerChris Robinson <[email protected]>2020-10-19 07:55:25 -0700
commitcdc15a4783e61dd1a838f25dd668e19b28449b19 (patch)
tree57d47a584467c465d7d0ebe2a893f3f5b540ef08 /alc/mixer/mixer_neon.cpp
parentd6686bceb0d77d32cb496ef44f373a464ffd3fe3 (diff)
Use constexpr variables in place of some macros
Diffstat (limited to 'alc/mixer/mixer_neon.cpp')
-rw-r--r--alc/mixer/mixer_neon.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp
index 9d21b1c5..2573e791 100644
--- a/alc/mixer/mixer_neon.cpp
+++ b/alc/mixer/mixer_neon.cpp
@@ -21,8 +21,8 @@ struct FastBSincTag;
namespace {
-#define FRAC_PHASE_BITDIFF (FRACTIONBITS - BSINC_PHASE_BITS)
-#define FRAC_PHASE_DIFFONE (1<<FRAC_PHASE_BITDIFF)
+constexpr ALuint FracPhaseBitDiff{FRACTIONBITS - BSincPhaseBits};
+constexpr ALuint FracPhaseDiffOne{1 << FracPhaseBitDiff};
inline void ApplyCoeffs(float2 *RESTRICT Values, const uint_fast32_t IrSize,
const HrirArray &Coeffs, const float left, const float right)
@@ -114,9 +114,8 @@ const float *Resample_<BSincTag,NEONTag>(const InterpState *state, const float *
for(float &out_sample : dst)
{
// Calculate the phase index and factor.
- const ALuint pi{frac >> FRAC_PHASE_BITDIFF};
- const float pf{static_cast<float>(frac & (FRAC_PHASE_DIFFONE-1)) *
- (1.0f/FRAC_PHASE_DIFFONE)};
+ const ALuint pi{frac >> FracPhaseBitDiff};
+ const float pf{static_cast<float>(frac & (FracPhaseDiffOne-1)) * (1.0f/FracPhaseDiffOne)};
// Apply the scale and phase interpolated filter.
float32x4_t r4{vdupq_n_f32(0.0f)};
@@ -160,9 +159,8 @@ const float *Resample_<FastBSincTag,NEONTag>(const InterpState *state,
for(float &out_sample : dst)
{
// Calculate the phase index and factor.
- const ALuint pi{frac >> FRAC_PHASE_BITDIFF};
- const float pf{static_cast<float>(frac & (FRAC_PHASE_DIFFONE-1)) *
- (1.0f/FRAC_PHASE_DIFFONE)};
+ const ALuint pi{frac >> FracPhaseBitDiff};
+ const float pf{static_cast<float>(frac & (FracPhaseDiffOne-1)) * (1.0f/FracPhaseDiffOne)};
// Apply the phase interpolated filter.
float32x4_t r4{vdupq_n_f32(0.0f)};