aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c15
-rw-r--r--Alc/mixer.c8
-rw-r--r--Alc/mixer_c.c4
-rw-r--r--Alc/mixer_defs.h18
-rw-r--r--Alc/mixer_inc.c10
-rw-r--r--Alc/mixer_neon.c4
-rw-r--r--Alc/mixer_sse.c4
7 files changed, 31 insertions, 32 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b0e9ea24..384042c3 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -465,10 +465,9 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext)
src->Direct.Mix.Hrtf.Params.Delay[c]);
}
}
- ALSource->Hrtf.Counter = 0;
+ src->Direct.Mix.Hrtf.State.Counter = 0;
src->Direct.Mix.Hrtf.Params.IrSize = GetHrtfIrSize(Device->Hrtf);
- src->Direct.Mix.Hrtf.State = &ALSource->Hrtf;
src->DryMix = SelectHrtfMixer();
}
else
@@ -873,7 +872,7 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext)
}
/* Check to see if the HRIR is already moving. */
- if(ALSource->Hrtf.Moving)
+ if(src->Direct.Mix.Hrtf.State.Moving)
{
/* Calculate the normalized HRTF transition factor (delta). */
delta = CalcHrtfDelta(src->Direct.Mix.Hrtf.Params.Gain, DryGain,
@@ -882,13 +881,14 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext)
* coefficients, target delays, steppping values, and counter. */
if(delta > 0.001f)
{
- ALSource->Hrtf.Counter = GetMovingHrtfCoeffs(Device->Hrtf,
+ ALuint counter = GetMovingHrtfCoeffs(Device->Hrtf,
ev, az, DryGain, delta,
- ALSource->Hrtf.Counter,
+ src->Direct.Mix.Hrtf.State.Counter,
src->Direct.Mix.Hrtf.Params.Coeffs[0],
src->Direct.Mix.Hrtf.Params.Delay[0],
src->Direct.Mix.Hrtf.Params.CoeffStep,
src->Direct.Mix.Hrtf.Params.DelayStep);
+ src->Direct.Mix.Hrtf.State.Counter = counter;
src->Direct.Mix.Hrtf.Params.Gain = DryGain;
src->Direct.Mix.Hrtf.Params.Dir[0] = Position[0];
src->Direct.Mix.Hrtf.Params.Dir[1] = Position[1];
@@ -901,8 +901,8 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext)
GetLerpedHrtfCoeffs(Device->Hrtf, ev, az, DryGain,
src->Direct.Mix.Hrtf.Params.Coeffs[0],
src->Direct.Mix.Hrtf.Params.Delay[0]);
- ALSource->Hrtf.Counter = 0;
- ALSource->Hrtf.Moving = AL_TRUE;
+ src->Direct.Mix.Hrtf.State.Counter = 0;
+ src->Direct.Mix.Hrtf.State.Moving = AL_TRUE;
src->Direct.Mix.Hrtf.Params.Gain = DryGain;
src->Direct.Mix.Hrtf.Params.Dir[0] = Position[0];
src->Direct.Mix.Hrtf.Params.Dir[1] = Position[1];
@@ -910,7 +910,6 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext)
}
src->Direct.Mix.Hrtf.Params.IrSize = GetHrtfIrSize(Device->Hrtf);
- src->Direct.Mix.Hrtf.State = &ALSource->Hrtf;
src->DryMix = SelectHrtfMixer();
}
else
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 36a08ccd..22c5aad7 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -411,12 +411,12 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
Source->BuffersPlayed = BuffersPlayed;
Source->position = DataPosInt;
Source->position_fraction = DataPosFrac;
- Source->Hrtf.Offset += OutPos;
+ src->Direct.Mix.Hrtf.State.Offset += OutPos;
if(State == AL_PLAYING)
- Source->Hrtf.Counter = maxu(Source->Hrtf.Counter, OutPos) - OutPos;
+ src->Direct.Mix.Hrtf.State.Counter = maxu(src->Direct.Mix.Hrtf.State.Counter, OutPos) - OutPos;
else
{
- Source->Hrtf.Counter = 0;
- Source->Hrtf.Moving = AL_FALSE;
+ src->Direct.Mix.Hrtf.State.Counter = 0;
+ src->Direct.Mix.Hrtf.State.Moving = AL_FALSE;
}
}
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c
index 393096db..6b21e67a 100644
--- a/Alc/mixer_c.c
+++ b/Alc/mixer_c.c
@@ -82,7 +82,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
#undef SUFFIX
-void MixDirect_C(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
+void MixDirect_C(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
@@ -108,7 +108,7 @@ void MixDirect_C(const DirectParams *params, const ALfloat *restrict data, ALuin
}
-void MixSend_C(const SendParams *params, const ALfloat *restrict data,
+void MixSend_C(SendParams *params, const ALfloat *restrict data,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h
index f8968a0a..878db968 100644
--- a/Alc/mixer_defs.h
+++ b/Alc/mixer_defs.h
@@ -16,18 +16,18 @@ void Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALflo
/* C mixers */
-void MixDirect_Hrtf_C(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
-void MixDirect_C(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
-void MixSend_C(const struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
+void MixDirect_Hrtf_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
+void MixDirect_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
+void MixSend_C(struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
/* SSE mixers */
-void MixDirect_Hrtf_SSE(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
-void MixDirect_SSE(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
-void MixSend_SSE(const struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
+void MixDirect_Hrtf_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
+void MixDirect_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
+void MixSend_SSE(struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
/* Neon mixers */
-void MixDirect_Hrtf_Neon(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
-void MixDirect_Neon(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
-void MixSend_Neon(const struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
+void MixDirect_Hrtf_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
+void MixDirect_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
+void MixSend_Neon(struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint);
#endif /* MIXER_DEFS_H */
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c
index 7f70d247..c9c9bd6b 100644
--- a/Alc/mixer_inc.c
+++ b/Alc/mixer_inc.c
@@ -30,7 +30,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
ALfloat left, ALfloat right);
-void MixDirect_Hrtf(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
+void MixDirect_Hrtf(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer;
@@ -41,10 +41,10 @@ void MixDirect_Hrtf(const DirectParams *params, const ALfloat *restrict data, AL
const ALfloat (*restrict CoeffStep)[2] = params->Mix.Hrtf.Params.CoeffStep;
const ALfloat (*restrict TargetCoeffs)[2] = params->Mix.Hrtf.Params.Coeffs[srcchan];
const ALuint *restrict TargetDelay = params->Mix.Hrtf.Params.Delay[srcchan];
- ALfloat *restrict History = params->Mix.Hrtf.State->History[srcchan];
- ALfloat (*restrict Values)[2] = params->Mix.Hrtf.State->Values[srcchan];
- ALint Counter = maxu(params->Mix.Hrtf.State->Counter, OutPos) - OutPos;
- ALuint Offset = params->Mix.Hrtf.State->Offset + OutPos;
+ ALfloat *restrict History = params->Mix.Hrtf.State.History[srcchan];
+ ALfloat (*restrict Values)[2] = params->Mix.Hrtf.State.Values[srcchan];
+ ALint Counter = maxu(params->Mix.Hrtf.State.Counter, OutPos) - OutPos;
+ ALuint Offset = params->Mix.Hrtf.State.Offset + OutPos;
ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2];
ALuint Delay[2];
ALfloat left, right;
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c
index 674181df..448eadd3 100644
--- a/Alc/mixer_neon.c
+++ b/Alc/mixer_neon.c
@@ -77,7 +77,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
#undef SUFFIX
-void MixDirect_Neon(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
+void MixDirect_Neon(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
@@ -114,7 +114,7 @@ void MixDirect_Neon(const DirectParams *params, const ALfloat *restrict data, AL
}
-void MixSend_Neon(const SendParams *params, const ALfloat *restrict data,
+void MixSend_Neon(SendParams *params, const ALfloat *restrict data,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c
index 9b04e8b5..c9296d3d 100644
--- a/Alc/mixer_sse.c
+++ b/Alc/mixer_sse.c
@@ -140,7 +140,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
#undef SUFFIX
-void MixDirect_SSE(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
+void MixDirect_SSE(DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;
@@ -177,7 +177,7 @@ void MixDirect_SSE(const DirectParams *params, const ALfloat *restrict data, ALu
}
-void MixSend_SSE(const SendParams *params, const ALfloat *restrict data,
+void MixSend_SSE(SendParams *params, const ALfloat *restrict data,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer;