aboutsummaryrefslogtreecommitdiffstats
path: root/core/mixer
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-02-23 18:48:02 -0800
committerChris Robinson <[email protected]>2021-02-23 18:48:02 -0800
commit5647aa4042ec64667cd2ba384e30769daa606ab4 (patch)
tree82e42a8a9bc8248d1126a8f4ef1aa8c53cf8b023 /core/mixer
parent25d25f9a8004ede46349f80225e13feff6a0748c (diff)
Adjust the bsinc filter table packing
Now each scale's filter and phase delta are interleaved for each phase index, followed by the scale and scale+phase delta for each phase index. This ensures no holes in the filter coefficients for the fast bsinc resampler for a given run, while keeping the scale deltas in the same vicinity for the non-fast bsinc resampler.
Diffstat (limited to 'core/mixer')
-rw-r--r--core/mixer/mixer_c.cpp6
-rw-r--r--core/mixer/mixer_neon.cpp6
-rw-r--r--core/mixer/mixer_sse.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/core/mixer/mixer_c.cpp b/core/mixer/mixer_c.cpp
index 8c2c60c5..f82f7dd1 100644
--- a/core/mixer/mixer_c.cpp
+++ b/core/mixer/mixer_c.cpp
@@ -38,9 +38,9 @@ inline float do_bsinc(const InterpState &istate, const float *RESTRICT vals, con
const uint pi{frac >> FracPhaseBitDiff};
const float pf{static_cast<float>(frac & (FracPhaseDiffOne-1)) * (1.0f/FracPhaseDiffOne)};
- const float *RESTRICT fil{istate.bsinc.filter + m*pi*4};
+ const float *RESTRICT fil{istate.bsinc.filter + m*pi*2};
const float *RESTRICT phd{fil + m};
- const float *RESTRICT scd{phd + m};
+ const float *RESTRICT scd{fil + BSincPhaseCount*2*m};
const float *RESTRICT spd{scd + m};
// Apply the scale and phase interpolated filter.
@@ -58,7 +58,7 @@ inline float do_fastbsinc(const InterpState &istate, const float *RESTRICT vals,
const uint pi{frac >> FracPhaseBitDiff};
const float pf{static_cast<float>(frac & (FracPhaseDiffOne-1)) * (1.0f/FracPhaseDiffOne)};
- const float *RESTRICT fil{istate.bsinc.filter + m*pi*4};
+ const float *RESTRICT fil{istate.bsinc.filter + m*pi*2};
const float *RESTRICT phd{fil + m};
// Apply the phase interpolated filter.
diff --git a/core/mixer/mixer_neon.cpp b/core/mixer/mixer_neon.cpp
index 8cd7e610..a3afdc6b 100644
--- a/core/mixer/mixer_neon.cpp
+++ b/core/mixer/mixer_neon.cpp
@@ -131,9 +131,9 @@ float *Resample_<BSincTag,NEONTag>(const InterpState *state, float *RESTRICT src
float32x4_t r4{vdupq_n_f32(0.0f)};
{
const float32x4_t pf4{vdupq_n_f32(pf)};
- const float *RESTRICT fil{filter + m*pi*4};
+ const float *RESTRICT fil{filter + m*pi*2};
const float *RESTRICT phd{fil + m};
- const float *RESTRICT scd{phd + m};
+ const float *RESTRICT scd{fil + BSincPhaseCount*2*m};
const float *RESTRICT spd{scd + m};
size_t td{m >> 2};
size_t j{0u};
@@ -177,7 +177,7 @@ float *Resample_<FastBSincTag,NEONTag>(const InterpState *state, float *RESTRICT
float32x4_t r4{vdupq_n_f32(0.0f)};
{
const float32x4_t pf4{vdupq_n_f32(pf)};
- const float *RESTRICT fil{filter + m*pi*4};
+ const float *RESTRICT fil{filter + m*pi*2};
const float *RESTRICT phd{fil + m};
size_t td{m >> 2};
size_t j{0u};
diff --git a/core/mixer/mixer_sse.cpp b/core/mixer/mixer_sse.cpp
index ba53d0a5..2a11601c 100644
--- a/core/mixer/mixer_sse.cpp
+++ b/core/mixer/mixer_sse.cpp
@@ -96,9 +96,9 @@ float *Resample_<BSincTag,SSETag>(const InterpState *state, float *RESTRICT src,
__m128 r4{_mm_setzero_ps()};
{
const __m128 pf4{_mm_set1_ps(pf)};
- const float *RESTRICT fil{filter + m*pi*4};
+ const float *RESTRICT fil{filter + m*pi*2};
const float *RESTRICT phd{fil + m};
- const float *RESTRICT scd{phd + m};
+ const float *RESTRICT scd{fil + BSincPhaseCount*2*m};
const float *RESTRICT spd{scd + m};
size_t td{m >> 2};
size_t j{0u};
@@ -143,7 +143,7 @@ float *Resample_<FastBSincTag,SSETag>(const InterpState *state, float *RESTRICT
__m128 r4{_mm_setzero_ps()};
{
const __m128 pf4{_mm_set1_ps(pf)};
- const float *RESTRICT fil{filter + m*pi*4};
+ const float *RESTRICT fil{filter + m*pi*2};
const float *RESTRICT phd{fil + m};
size_t td{m >> 2};
size_t j{0u};