Pass some DirectParams as function parameters
This commit is contained in:
parent
bd2721dc7a
commit
29b5dae6aa
@ -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++)
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 = ¶ms->Mix.Hrtf.Params[srcchan];
|
||||
HrtfState *hrtfstate = ¶ms->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++;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user