summaryrefslogtreecommitdiffstats
path: root/Alc/mixer_inc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-09-11 06:32:42 -0700
committerChris Robinson <[email protected]>2012-09-11 06:32:42 -0700
commit4c5cb2189b56808767e755d140b2246ee19ff39c (patch)
tree7ca5c2eac755641edfcc4d5943e038d9a6b2b113 /Alc/mixer_inc.c
parent98ff6f990af1ad3159c5d9a2209b7b6de36d2130 (diff)
Use a non-interleaved DryBuffer
Diffstat (limited to 'Alc/mixer_inc.c')
-rw-r--r--Alc/mixer_inc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c
index f60ade65..db0941f0 100644
--- a/Alc/mixer_inc.c
+++ b/Alc/mixer_inc.c
@@ -41,7 +41,7 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params,
{
const ALint *RESTRICT DelayStep = params->Hrtf.DelayStep;
const ALuint IrSize = GetHrtfIrSize(Device->Hrtf);
- ALfloat (*RESTRICT DryBuffer)[MaxChannels];
+ ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE];
ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks;
ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.CoeffStep;
ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Coeffs[srcchan];
@@ -103,8 +103,8 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params,
Offset++;
ApplyCoeffsStep(Offset, Values, IrSize, Coeffs, CoeffStep, left, right);
- DryBuffer[OutPos][FrontLeft] += Values[Offset&HRIR_MASK][0];
- DryBuffer[OutPos][FrontRight] += Values[Offset&HRIR_MASK][1];
+ DryBuffer[FrontLeft][OutPos] += Values[Offset&HRIR_MASK][0];
+ DryBuffer[FrontRight][OutPos] += Values[Offset&HRIR_MASK][1];
OutPos++;
Counter--;
@@ -123,8 +123,8 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params,
Offset++;
ApplyCoeffs(Offset, Values, IrSize, Coeffs, left, right);
- DryBuffer[OutPos][FrontLeft] += Values[Offset&HRIR_MASK][0];
- DryBuffer[OutPos][FrontRight] += Values[Offset&HRIR_MASK][1];
+ DryBuffer[FrontLeft][OutPos] += Values[Offset&HRIR_MASK][0];
+ DryBuffer[FrontRight][OutPos] += Values[Offset&HRIR_MASK][1];
OutPos++;
}
@@ -147,7 +147,7 @@ void MixDirect(ALsource *Source, ALCdevice *Device, DirectParams *params,
const ALfloat *RESTRICT data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
- ALfloat (*RESTRICT DryBuffer)[MaxChannels];
+ ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE];
ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks;
ALIGN(16) ALfloat DrySend[MaxChannels];
ALuint pos;
@@ -167,13 +167,12 @@ void MixDirect(ALsource *Source, ALCdevice *Device, DirectParams *params,
for(c = 0;c < MaxChannels;c++)
ClickRemoval[c] -= data[pos]*DrySend[c];
}
- for(pos = 0;pos < BufferSize;pos++)
+ for(c = 0;c < MaxChannels;c++)
{
- for(c = 0;c < MaxChannels;c++)
- DryBuffer[OutPos][c] += data[pos]*DrySend[c];
- OutPos++;
+ for(pos = 0;pos < BufferSize;pos++)
+ DryBuffer[c][OutPos+pos] += data[pos]*DrySend[c];
}
- if(OutPos == SamplesToDo)
+ if(OutPos+pos == SamplesToDo)
{
for(c = 0;c < MaxChannels;c++)
PendingClicks[c] += data[pos]*DrySend[c];