aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-20 01:24:02 -0700
committerChris Robinson <[email protected]>2019-08-20 01:24:02 -0700
commit4883091f5de278b7469790efa466df5d93d465b0 (patch)
tree7dd447dabb62fecce1248e9f1e3462731a1f6f57 /alc
parent8fd90334a13608a781e36fc830cd79bf746edd42 (diff)
Rename the Mix function input for clarity
Diffstat (limited to 'alc')
-rw-r--r--alc/alu.h2
-rw-r--r--alc/mixer/defs.h4
-rw-r--r--alc/mixer/mixer_c.cpp8
-rw-r--r--alc/mixer/mixer_neon.cpp14
-rw-r--r--alc/mixer/mixer_sse.cpp14
5 files changed, 22 insertions, 20 deletions
diff --git a/alc/alu.h b/alc/alu.h
index c63e33fd..eba9ee0e 100644
--- a/alc/alu.h
+++ b/alc/alu.h
@@ -314,7 +314,7 @@ struct ALvoice {
};
-using MixerFunc = void(*)(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer,
+using MixerFunc = void(*)(const ALfloat *InSamples, const al::span<FloatBufferLine> OutBuffer,
ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
const ALsizei BufferSize);
using RowMixerFunc = void(*)(const al::span<float> OutBuffer, const al::span<const float> Gains,
diff --git a/alc/mixer/defs.h b/alc/mixer/defs.h
index adaed8f5..1e5e68bb 100644
--- a/alc/mixer/defs.h
+++ b/alc/mixer/defs.h
@@ -30,7 +30,9 @@ 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<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);
+void Mix_(const float *InSamples, const al::span<FloatBufferLine> OutBuffer, float *CurrentGains,
+ const float *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+ const ALsizei BufferSize);
template<InstSetType InstTag>
void MixRow_(const al::span<float> OutBuffer, const al::span<const float> Gains,
const float *InSamples, const size_t InStride);
diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp
index dd094040..8b5c0f41 100644
--- a/alc/mixer/mixer_c.cpp
+++ b/alc/mixer/mixer_c.cpp
@@ -142,8 +142,8 @@ void MixDirectHrtf_<CTag>(FloatBufferLine &LeftOut, FloatBufferLine &RightOut,
template<>
-void Mix_<CTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer,
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+void Mix_<CTag>(const float *InSamples, const al::span<FloatBufferLine> OutBuffer,
+ float *CurrentGains, const float *TargetGains, const ALsizei Counter, const ALsizei OutPos,
const ALsizei BufferSize)
{
ASSUME(BufferSize > 0);
@@ -163,7 +163,7 @@ void Mix_<CTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer,
ALfloat step_count{0.0f};
for(;pos < minsize;pos++)
{
- dst[pos] += data[pos] * (gain + step*step_count);
+ dst[pos] += InSamples[pos] * (gain + step*step_count);
step_count += 1.0f;
}
if(pos == Counter)
@@ -178,7 +178,7 @@ void Mix_<CTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer,
if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD))
continue;
for(;pos < BufferSize;pos++)
- dst[pos] += data[pos]*gain;
+ dst[pos] += InSamples[pos]*gain;
}
}
diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp
index 829d4ea1..b80f8cf8 100644
--- a/alc/mixer/mixer_neon.cpp
+++ b/alc/mixer/mixer_neon.cpp
@@ -189,8 +189,8 @@ void MixDirectHrtf_<NEONTag>(FloatBufferLine &LeftOut, FloatBufferLine &RightOut
template<>
-void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer,
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+void Mix_<NEONTag>(const float *InSamples, const al::span<FloatBufferLine> OutBuffer,
+ float *CurrentGains, const float *TargetGains, const ALsizei Counter, const ALsizei OutPos,
const ALsizei BufferSize)
{
ASSUME(BufferSize > 0);
@@ -223,7 +223,7 @@ void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffe
ALsizei todo{minsize >> 2};
do {
- const float32x4_t val4 = vld1q_f32(&data[pos]);
+ const float32x4_t val4 = vld1q_f32(&InSamples[pos]);
float32x4_t dry4 = vld1q_f32(&dst[pos]);
dry4 = vmlaq_f32(dry4, val4, vmlaq_f32(gain4, step4, step_count4));
step_count4 = vaddq_f32(step_count4, four4);
@@ -239,7 +239,7 @@ void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffe
/* Mix with applying left over gain steps that aren't aligned multiples of 4. */
for(;pos < minsize;pos++)
{
- dst[pos] += data[pos]*(gain + step*step_count);
+ dst[pos] += InSamples[pos]*(gain + step*step_count);
step_count += 1.0f;
}
if(pos == Counter)
@@ -251,7 +251,7 @@ void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffe
/* Mix until pos is aligned with 4 or the mix is done. */
minsize = mini(BufferSize, (pos+3)&~3);
for(;pos < minsize;pos++)
- dst[pos] += data[pos]*gain;
+ dst[pos] += InSamples[pos]*gain;
}
++CurrentGains;
++TargetGains;
@@ -263,7 +263,7 @@ void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffe
ALsizei todo{(BufferSize-pos) >> 2};
const float32x4_t gain4 = vdupq_n_f32(gain);
do {
- const float32x4_t val4 = vld1q_f32(&data[pos]);
+ const float32x4_t val4 = vld1q_f32(&InSamples[pos]);
float32x4_t dry4 = vld1q_f32(&dst[pos]);
dry4 = vmlaq_f32(dry4, val4, gain4);
vst1q_f32(&dst[pos], dry4);
@@ -271,7 +271,7 @@ void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffe
} while(--todo);
}
for(;pos < BufferSize;pos++)
- dst[pos] += data[pos]*gain;
+ dst[pos] += InSamples[pos]*gain;
}
}
diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp
index b3454898..bd0042a1 100644
--- a/alc/mixer/mixer_sse.cpp
+++ b/alc/mixer/mixer_sse.cpp
@@ -145,8 +145,8 @@ void MixDirectHrtf_<SSETag>(FloatBufferLine &LeftOut, FloatBufferLine &RightOut,
template<>
-void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer,
- ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos,
+void Mix_<SSETag>(const float *InSamples, const al::span<FloatBufferLine> OutBuffer,
+ float *CurrentGains, const float *TargetGains, const ALsizei Counter, const ALsizei OutPos,
const ALsizei BufferSize)
{
ASSUME(BufferSize > 0);
@@ -173,7 +173,7 @@ void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer
__m128 step_count4{_mm_setr_ps(0.0f, 1.0f, 2.0f, 3.0f)};
ALsizei todo{minsize >> 2};
do {
- const __m128 val4{_mm_load_ps(&data[pos])};
+ const __m128 val4{_mm_load_ps(&InSamples[pos])};
__m128 dry4{_mm_load_ps(&dst[pos])};
#define MLA4(x, y, z) _mm_add_ps(x, _mm_mul_ps(y, z))
/* dry += val * (gain + step*step_count) */
@@ -192,7 +192,7 @@ void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer
/* Mix with applying left over gain steps that aren't aligned multiples of 4. */
for(;pos < minsize;pos++)
{
- dst[pos] += data[pos]*(gain + step*step_count);
+ dst[pos] += InSamples[pos]*(gain + step*step_count);
step_count += 1.0f;
}
if(pos == Counter)
@@ -204,7 +204,7 @@ void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer
/* Mix until pos is aligned with 4 or the mix is done. */
minsize = mini(BufferSize, (pos+3)&~3);
for(;pos < minsize;pos++)
- dst[pos] += data[pos]*gain;
+ dst[pos] += InSamples[pos]*gain;
}
++CurrentGains;
++TargetGains;
@@ -216,7 +216,7 @@ void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer
ALsizei todo{(BufferSize-pos) >> 2};
const __m128 gain4{_mm_set1_ps(gain)};
do {
- const __m128 val4{_mm_load_ps(&data[pos])};
+ const __m128 val4{_mm_load_ps(&InSamples[pos])};
__m128 dry4{_mm_load_ps(&dst[pos])};
dry4 = _mm_add_ps(dry4, _mm_mul_ps(val4, gain4));
_mm_store_ps(&dst[pos], dry4);
@@ -224,7 +224,7 @@ void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer
} while(--todo);
}
for(;pos < BufferSize;pos++)
- dst[pos] += data[pos]*gain;
+ dst[pos] += InSamples[pos]*gain;
}
}