aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-18 07:54:51 -0700
committerChris Robinson <[email protected]>2014-05-18 08:59:10 -0700
commit29b5dae6aa010224b2fd428530e1cd67d6d92e1a (patch)
tree544b4c9d9d82ad3e0e050aa12ad7dcd71101ff38
parentbd2721dc7a2bd3376e01ff32c18737a6fa38ff42 (diff)
Pass some DirectParams as function parameters
-rw-r--r--Alc/mixer.c4
-rw-r--r--Alc/mixer_c.c7
-rw-r--r--Alc/mixer_defs.h24
-rw-r--r--Alc/mixer_inc.c15
-rw-r--r--Alc/mixer_neon.c7
-rw-r--r--Alc/mixer_sse.c7
-rw-r--r--OpenAL32/Include/alu.h5
7 files changed, 40 insertions, 29 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 8db0289e..b50651c8 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -350,7 +350,9 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DoFilters(&directparms->LpFilter[chan], &directparms->HpFilter[chan],
SrcData, ResampledData, DstBufferSize,
directparms->Filters[chan]);
- src->DryMix(directparms, SrcData, chan, OutPos, DstBufferSize);
+ src->DryMix(directparms, directparms->OutBuffer, SrcData,
+ maxu(directparms->Counter, OutPos) - OutPos, chan,
+ OutPos, DstBufferSize);
}
for(j = 0;j < Device->NumAuxSends;j++)
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c
index 61769547..3db4f737 100644
--- a/Alc/mixer_c.c
+++ b/Alc/mixer_c.c
@@ -90,11 +90,10 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
#undef SUFFIX
-void MixDirect_C(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
- ALuint OutPos, ALuint BufferSize)
+void MixDirect_C(DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALfloat DrySend, Step;
ALuint c;
diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h
index a371e65a..c0a77f0f 100644
--- a/Alc/mixer_defs.h
+++ b/Alc/mixer_defs.h
@@ -16,18 +16,30 @@ void Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALflo
/* C mixers */
-void MixDirect_Hrtf_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
-void MixDirect_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
+void MixDirect_Hrtf_C(struct DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize);
+void MixDirect_C(struct DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize);
void MixSend_C(struct SendParams*,const ALfloat*restrict,ALuint,ALuint);
/* SSE mixers */
-void MixDirect_Hrtf_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
-void MixDirect_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
+void MixDirect_Hrtf_SSE(struct DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize);
+void MixDirect_SSE(struct DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize);
void MixSend_SSE(struct SendParams*,const ALfloat*restrict,ALuint,ALuint);
/* Neon mixers */
-void MixDirect_Hrtf_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
-void MixDirect_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
+void MixDirect_Hrtf_Neon(struct DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize);
+void MixDirect_Neon(struct DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize);
void MixSend_Neon(struct SendParams*,const ALfloat*restrict,ALuint,ALuint);
#endif /* MIXER_DEFS_H */
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c
index 6bc4eb9b..b75ddad3 100644
--- a/Alc/mixer_inc.c
+++ b/Alc/mixer_inc.c
@@ -25,14 +25,13 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
ALfloat left, ALfloat right);
-void MixDirect_Hrtf(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
- ALuint OutPos, ALuint BufferSize)
+void MixDirect_Hrtf(DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer;
const ALuint IrSize = params->Mix.Hrtf.IrSize;
const HrtfParams *hrtfparams = &params->Mix.Hrtf.Params[srcchan];
HrtfState *hrtfstate = &params->Mix.Hrtf.State[srcchan];
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALuint Offset = params->Offset + OutPos;
alignas(16) ALfloat Coeffs[HRIR_LENGTH][2];
ALuint Delay[2];
@@ -66,8 +65,8 @@ void MixDirect_Hrtf(DirectParams *params, const ALfloat *restrict data, ALuint s
Offset++;
ApplyCoeffsStep(Offset, hrtfstate->Values, IrSize, Coeffs, hrtfparams->CoeffStep, left, right);
- DryBuffer[FrontLeft][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][0];
- DryBuffer[FrontRight][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][1];
+ OutBuffer[FrontLeft][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][0];
+ OutBuffer[FrontRight][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][1];
OutPos++;
}
@@ -84,8 +83,8 @@ void MixDirect_Hrtf(DirectParams *params, const ALfloat *restrict data, ALuint s
Offset++;
ApplyCoeffs(Offset, hrtfstate->Values, IrSize, Coeffs, left, right);
- DryBuffer[FrontLeft][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][0];
- DryBuffer[FrontRight][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][1];
+ OutBuffer[FrontLeft][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][0];
+ OutBuffer[FrontRight][OutPos] += hrtfstate->Values[Offset&HRIR_MASK][1];
OutPos++;
}
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c
index cd3f4574..161c19c8 100644
--- a/Alc/mixer_neon.c
+++ b/Alc/mixer_neon.c
@@ -75,11 +75,10 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
#undef SUFFIX
-void MixDirect_Neon(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
- ALuint OutPos, ALuint BufferSize)
+void MixDirect_Neon(DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALfloat DrySend, Step;
float32x4_t gain;
ALuint c;
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c
index 250181fe..e33b3ef3 100644
--- a/Alc/mixer_sse.c
+++ b/Alc/mixer_sse.c
@@ -138,11 +138,10 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
#undef SUFFIX
-void MixDirect_SSE(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
- ALuint OutPos, ALuint BufferSize)
+void MixDirect_SSE(DirectParams *params,
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *restrict data,
+ ALuint Counter, ALuint srcchan, ALuint OutPos, ALuint BufferSize)
{
- ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
- ALuint Counter = maxu(params->Counter, OutPos) - OutPos;
ALfloat DrySend, Step;
__m128 gain, step;
ALuint c;
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index a3749ea1..4354c76e 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -116,8 +116,9 @@ typedef void (*ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment,
ALfloat *restrict dst, ALuint dstlen);
typedef ALvoid (*DryMixerFunc)(struct DirectParams *params,
- const ALfloat *restrict data, ALuint srcchan,
- ALuint OutPos, ALuint BufferSize);
+ ALfloat (*restrict OutBuffer)[BUFFERSIZE],
+ const ALfloat *restrict data, ALuint Counter,
+ ALuint srcchan, ALuint OutPos, ALuint BufferSize);
typedef ALvoid (*WetMixerFunc)(struct SendParams *params,
const ALfloat *restrict data,
ALuint OutPos, ALuint BufferSize);