Pass some DirectParams as function parameters

This commit is contained in:
Chris Robinson 2014-05-18 07:54:51 -07:00
parent bd2721dc7a
commit 29b5dae6aa
7 changed files with 40 additions and 29 deletions

View File

@ -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++)

View File

@ -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;

View File

@ -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 */

View File

@ -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++;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);