aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-18 10:35:11 -0700
committerChris Robinson <[email protected]>2014-05-18 10:35:11 -0700
commit9317ec59b99af1b598de1c302470113a77da966d (patch)
tree0d88df602051872f4741e68457f340eecfbb28f4 /Alc
parentc9083d04fabb2cfc0622a8ec36f892355a025df5 (diff)
Don't pass the SendParams to the wet-path mixer
Diffstat (limited to 'Alc')
-rw-r--r--Alc/mixer.c4
-rw-r--r--Alc/mixer_c.c14
-rw-r--r--Alc/mixer_defs.h15
-rw-r--r--Alc/mixer_neon.c14
-rw-r--r--Alc/mixer_sse.c14
5 files changed, 31 insertions, 30 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index e5ee4a45..e90bb482 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -374,7 +374,9 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DoFilters(&sendparms->LpFilter[chan], &sendparms->HpFilter[chan],
SrcData, ResampledData, DstBufferSize,
sendparms->Filters[chan]);
- src->WetMix(sendparms, SrcData, OutPos, DstBufferSize);
+ src->WetMix(sendparms->OutBuffer, SrcData, &sendparms->Gain,
+ maxu(sendparms->Counter, OutPos) - OutPos,
+ OutPos, DstBufferSize);
}
}
/* Update positions */
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c
index 700b326b..4cc76a0f 100644
--- a/Alc/mixer_c.c
+++ b/Alc/mixer_c.c
@@ -121,17 +121,15 @@ void MixDirect_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
}
-void MixSend_C(SendParams *params, const ALfloat *restrict data,
- ALuint OutPos, ALuint BufferSize)
+void MixSend_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
+ MixGainMono *Gain, ALuint Counter, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALfloat WetSend, Step;
{
ALuint pos = 0;
- WetSend = params->Gain.Current;
- Step = params->Gain.Step;
+ WetSend = Gain->Current;
+ Step = Gain->Step;
if(Step != 1.0f && Counter > 0)
{
for(;pos < BufferSize && pos < Counter;pos++)
@@ -140,8 +138,8 @@ void MixSend_C(SendParams *params, const ALfloat *restrict data,
WetSend *= Step;
}
if(pos == Counter)
- WetSend = params->Gain.Target;
- params->Gain.Current = WetSend;
+ WetSend = Gain->Target;
+ Gain->Current = WetSend;
}
if(!(WetSend > GAIN_SILENCE_THRESHOLD))
diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h
index 8f5375f4..b19a847c 100644
--- a/Alc/mixer_defs.h
+++ b/Alc/mixer_defs.h
@@ -5,9 +5,8 @@
#include "AL/al.h"
#include "alMain.h"
-struct SendParams;
-
struct MixGains;
+struct MixGainMono;
struct HrtfParams;
struct HrtfState;
@@ -27,7 +26,9 @@ void MixDirect_Hrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *
void MixDirect_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
struct MixGains *Gains, ALuint Counter, ALuint OutPos,
ALuint BufferSize);
-void MixSend_C(struct SendParams*,const ALfloat*restrict,ALuint,ALuint);
+void MixSend_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
+ struct MixGainMono *Gain, ALuint Counter, ALuint OutPos,
+ ALuint BufferSize);
/* SSE mixers */
void MixDirect_Hrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
@@ -37,7 +38,9 @@ void MixDirect_Hrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat
void MixDirect_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
struct MixGains *Gains, ALuint Counter, ALuint OutPos,
ALuint BufferSize);
-void MixSend_SSE(struct SendParams*,const ALfloat*restrict,ALuint,ALuint);
+void MixSend_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
+ struct MixGainMono *Gain, ALuint Counter, ALuint OutPos,
+ ALuint BufferSize);
/* Neon mixers */
void MixDirect_Hrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
@@ -47,6 +50,8 @@ void MixDirect_Hrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloa
void MixDirect_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
struct MixGains *Gains, ALuint Counter, ALuint OutPos,
ALuint BufferSize);
-void MixSend_Neon(struct SendParams*,const ALfloat*restrict,ALuint,ALuint);
+void MixSend_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
+ struct MixGainMono *Gain, ALuint Counter, ALuint OutPos,
+ ALuint BufferSize);
#endif /* MIXER_DEFS_H */
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c
index 1fc56e53..6a0421a5 100644
--- a/Alc/mixer_neon.c
+++ b/Alc/mixer_neon.c
@@ -118,18 +118,16 @@ void MixDirect_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *da
}
-void MixSend_Neon(SendParams *params, const ALfloat *restrict data,
- ALuint OutPos, ALuint BufferSize)
+void MixSend_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
+ MixGainMono *Gain, ALuint Counter, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALfloat WetGain, Step;
float32x4_t gain;
{
ALuint pos = 0;
- WetGain = params->Gain.Current;
- Step = params->Gain.Step;
+ WetGain = Gain->Current;
+ Step = Gain->Step;
if(Step != 1.0f && Counter > 0)
{
for(;pos < BufferSize && pos < Counter;pos++)
@@ -138,8 +136,8 @@ void MixSend_Neon(SendParams *params, const ALfloat *restrict data,
WetGain *= Step;
}
if(pos == Counter)
- WetGain = params->Gain.Target;
- params->Gain.Current = WetGain;
+ WetGain = Gain->Target;
+ Gain->Current = WetGain;
for(;pos < BufferSize && (pos&3) != 0;pos++)
OutBuffer[0][OutPos+pos] += data[pos]*WetGain;
}
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c
index 21234f0f..d26866a9 100644
--- a/Alc/mixer_sse.c
+++ b/Alc/mixer_sse.c
@@ -202,18 +202,16 @@ void MixDirect_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *dat
}
-void MixSend_SSE(SendParams *params, const ALfloat *restrict data,
- ALuint OutPos, ALuint BufferSize)
+void MixSend_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
+ MixGainMono *Gain, ALuint Counter, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALfloat WetGain, Step;
__m128 gain, step;
{
ALuint pos = 0;
- WetGain = params->Gain.Current;
- Step = params->Gain.Step;
+ WetGain = Gain->Current;
+ Step = Gain->Step;
if(Step != 1.0f && Counter > 0)
{
if(BufferSize-pos > 3 && Counter-pos > 3)
@@ -241,8 +239,8 @@ void MixSend_SSE(SendParams *params, const ALfloat *restrict data,
WetGain *= Step;
}
if(pos == Counter)
- WetGain = params->Gain.Target;
- params->Gain.Current = WetGain;
+ WetGain = Gain->Target;
+ Gain->Current = WetGain;
for(;pos < BufferSize && (pos&3) != 0;pos++)
OutBuffer[0][OutPos+pos] += data[pos]*WetGain;
}