Store some more HRTF info in the DirectParams struct

This commit is contained in:
Chris Robinson
2012-10-14 10:57:11 -07:00
parent 5ac0a93fba
commit 0b679167c9
3 changed files with 14 additions and 5 deletions
+6
View File
@@ -384,6 +384,9 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
}
ALSource->Hrtf.Counter = 0;
ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf);
ALSource->Params.Direct.hrtfState = &ALSource->Hrtf;
}
else
{
@@ -815,6 +818,9 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Direct.Hrtf.Dir[1] = Position[1];
ALSource->Params.Direct.Hrtf.Dir[2] = Position[2];
}
ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf);
ALSource->Params.Direct.hrtfState = &ALSource->Hrtf;
}
else
{
+6 -5
View File
@@ -36,20 +36,21 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params,
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = Device->DryBuffer;
ALfloat *RESTRICT ClickRemoval = Device->ClickRemoval;
ALfloat *RESTRICT PendingClicks = Device->PendingClicks;
const ALuint IrSize = GetHrtfIrSize(Device->Hrtf);
const ALuint IrSize = params->Hrtf.IrSize;
const ALint *RESTRICT DelayStep = params->Hrtf.DelayStep;
ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.CoeffStep;
ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Coeffs[srcchan];
ALuint *RESTRICT TargetDelay = params->Hrtf.Delay[srcchan];
ALfloat *RESTRICT History = Source->Hrtf.History[srcchan];
ALfloat (*RESTRICT Values)[2] = Source->Hrtf.Values[srcchan];
ALint Counter = maxu(Source->Hrtf.Counter, OutPos) - OutPos;
ALuint Offset = Source->Hrtf.Offset + OutPos;
ALfloat *RESTRICT History = params->hrtfState->History[srcchan];
ALfloat (*RESTRICT Values)[2] = params->hrtfState->Values[srcchan];
ALint Counter = maxu(params->hrtfState->Counter, OutPos) - OutPos;
ALuint Offset = params->hrtfState->Offset + OutPos;
ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2];
ALuint Delay[2];
ALfloat left, right;
ALuint pos;
ALuint c;
(void)Source;
pos = 0;
for(c = 0;c < IrSize;c++)
+2
View File
@@ -43,10 +43,12 @@ typedef struct HrtfParams {
ALIGN(16) ALfloat CoeffStep[HRIR_LENGTH][2];
ALuint Delay[MaxChannels][2];
ALint DelayStep[2];
ALuint IrSize;
} HrtfParams;
typedef struct DirectParams {
HrtfParams Hrtf;
HrtfState *hrtfState;
/* A mixing matrix. First subscript is the channel number of the input data
* (regardless of channel configuration) and the second is the channel