diff options
author | Chris Robinson <[email protected]> | 2020-10-19 07:55:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-10-19 07:55:25 -0700 |
commit | cdc15a4783e61dd1a838f25dd668e19b28449b19 (patch) | |
tree | 57d47a584467c465d7d0ebe2a893f3f5b540ef08 /alc/mixer/mixer_sse.cpp | |
parent | d6686bceb0d77d32cb496ef44f373a464ffd3fe3 (diff) |
Use constexpr variables in place of some macros
Diffstat (limited to 'alc/mixer/mixer_sse.cpp')
-rw-r--r-- | alc/mixer/mixer_sse.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp index d2e021ff..85cddcae 100644 --- a/alc/mixer/mixer_sse.cpp +++ b/alc/mixer/mixer_sse.cpp @@ -20,8 +20,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}; #define MLA4(x, y, z) _mm_add_ps(x, _mm_mul_ps(y, z)) @@ -86,9 +86,8 @@ const float *Resample_<BSincTag,SSETag>(const InterpState *state, const float *R 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. __m128 r4{_mm_setzero_ps()}; @@ -133,9 +132,8 @@ const float *Resample_<FastBSincTag,SSETag>(const InterpState *state, const floa 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. __m128 r4{_mm_setzero_ps()}; |