Use restrict instead of RESTRICT
This commit is contained in:
@@ -130,7 +130,7 @@ static __inline void aluNormalize(ALfloat *inVector)
|
||||
}
|
||||
}
|
||||
|
||||
static __inline ALvoid aluMatrixVector(ALfloat *vector, ALfloat w, ALfloat (*RESTRICT matrix)[4])
|
||||
static __inline ALvoid aluMatrixVector(ALfloat *vector, ALfloat w, ALfloat (*restrict matrix)[4])
|
||||
{
|
||||
ALfloat temp[4] = {
|
||||
vector[0], vector[1], vector[2], w
|
||||
@@ -589,7 +589,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
|
||||
/* Transform source to listener space (convert to head relative) */
|
||||
if(ALSource->HeadRelative == AL_FALSE)
|
||||
{
|
||||
ALfloat (*RESTRICT Matrix)[4] = ALContext->Listener->Params.Matrix;
|
||||
ALfloat (*restrict Matrix)[4] = ALContext->Listener->Params.Matrix;
|
||||
/* Transform source vectors */
|
||||
aluMatrixVector(Position, 1.0f, Matrix);
|
||||
aluMatrixVector(Direction, 0.0f, Matrix);
|
||||
@@ -941,17 +941,17 @@ static __inline ALubyte aluF2UB(ALfloat val)
|
||||
{ return aluF2B(val)+128; }
|
||||
|
||||
#define DECL_TEMPLATE(T, func) \
|
||||
static int Write_##T(ALCdevice *device, T *RESTRICT buffer, \
|
||||
static int Write_##T(ALCdevice *device, T *restrict buffer, \
|
||||
ALuint SamplesToDo) \
|
||||
{ \
|
||||
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = device->DryBuffer; \
|
||||
ALfloat (*restrict DryBuffer)[BUFFERSIZE] = device->DryBuffer; \
|
||||
ALuint numchans = ChannelsFromDevFmt(device->FmtChans); \
|
||||
const ALuint *offsets = device->ChannelOffsets; \
|
||||
ALuint i, j; \
|
||||
\
|
||||
for(j = 0;j < MaxChannels;j++) \
|
||||
{ \
|
||||
T *RESTRICT out; \
|
||||
T *restrict out; \
|
||||
\
|
||||
if(offsets[j] == INVALID_OFFSET) \
|
||||
continue; \
|
||||
|
||||
+3
-3
@@ -178,8 +178,8 @@ static __inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offse
|
||||
|
||||
#define DECL_TEMPLATE(func) \
|
||||
static void Process##func(ALchorusState *state, ALuint SamplesToDo, \
|
||||
const ALfloat *RESTRICT SamplesIn, \
|
||||
ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) \
|
||||
const ALfloat *restrict SamplesIn, \
|
||||
ALfloat (*restrict SamplesOut)[BUFFERSIZE]) \
|
||||
{ \
|
||||
const ALint mask = state->BufferLength-1; \
|
||||
ALint offset = state->offset; \
|
||||
@@ -235,7 +235,7 @@ DECL_TEMPLATE(Sinusoid)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
static ALvoid ALchorusState_Process(ALchorusState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALchorusState_Process(ALchorusState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
if(state->waveform == AL_CHORUS_WAVEFORM_TRIANGLE)
|
||||
ProcessTriangle(state, SamplesToDo, SamplesIn, SamplesOut);
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ static ALvoid ALdedicatedState_Update(ALdedicatedState *state, ALCdevice *device
|
||||
state->gains[LFE] = Gain;
|
||||
}
|
||||
|
||||
static ALvoid ALdedicatedState_Process(ALdedicatedState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALdedicatedState_Process(ALdedicatedState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
const ALfloat *gains = state->gains;
|
||||
ALuint i, c;
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ static ALvoid ALdistortionState_Update(ALdistortionState *state, ALCdevice *Devi
|
||||
state->bandpass.a[2] = 1.0f - alpha;
|
||||
}
|
||||
|
||||
static ALvoid ALdistortionState_Process(ALdistortionState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALdistortionState_Process(ALdistortionState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
const ALfloat fc = state->edge_coeff;
|
||||
float oversample_buffer[64][4];
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ static ALvoid ALechoState_Update(ALechoState *state, ALCdevice *Device, const AL
|
||||
ComputeAngleGains(Device, atan2f(+lrpan, 0.0f), (1.0f-dirGain)*F_PI, gain, state->Gain[1]);
|
||||
}
|
||||
|
||||
static ALvoid ALechoState_Process(ALechoState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALechoState_Process(ALechoState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
const ALuint mask = state->BufferLength-1;
|
||||
const ALuint tap1 = state->Tap[0].delay;
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ static ALvoid ALequalizerState_Update(ALequalizerState *state, ALCdevice *device
|
||||
}
|
||||
}
|
||||
|
||||
static ALvoid ALequalizerState_Process(ALequalizerState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALequalizerState_Process(ALequalizerState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
ALuint base;
|
||||
ALuint it;
|
||||
|
||||
+3
-3
@@ -178,8 +178,8 @@ static __inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offse
|
||||
|
||||
#define DECL_TEMPLATE(func) \
|
||||
static void Process##func(ALflangerState *state, ALuint SamplesToDo, \
|
||||
const ALfloat *RESTRICT SamplesIn, \
|
||||
ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) \
|
||||
const ALfloat *restrict SamplesIn, \
|
||||
ALfloat (*restrict SamplesOut)[BUFFERSIZE]) \
|
||||
{ \
|
||||
const ALint mask = state->BufferLength-1; \
|
||||
ALint offset = state->offset; \
|
||||
@@ -235,7 +235,7 @@ DECL_TEMPLATE(Sinusoid)
|
||||
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
static ALvoid ALflangerState_Process(ALflangerState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALflangerState_Process(ALflangerState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
if(state->waveform == AL_FLANGER_WAVEFORM_TRIANGLE)
|
||||
ProcessTriangle(state, SamplesToDo, SamplesIn, SamplesOut);
|
||||
|
||||
+3
-3
@@ -89,8 +89,8 @@ static __inline ALfloat hpFilter1P(FILTER *iir, ALfloat input)
|
||||
|
||||
#define DECL_TEMPLATE(func) \
|
||||
static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \
|
||||
const ALfloat *RESTRICT SamplesIn, \
|
||||
ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) \
|
||||
const ALfloat *restrict SamplesIn, \
|
||||
ALfloat (*restrict SamplesOut)[BUFFERSIZE]) \
|
||||
{ \
|
||||
const ALuint step = state->step; \
|
||||
ALuint index = state->index; \
|
||||
@@ -179,7 +179,7 @@ static ALvoid ALmodulatorState_Update(ALmodulatorState *state, ALCdevice *Device
|
||||
}
|
||||
}
|
||||
|
||||
static ALvoid ALmodulatorState_Process(ALmodulatorState *state, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALmodulatorState_Process(ALmodulatorState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
switch(state->Waveform)
|
||||
{
|
||||
|
||||
+11
-11
@@ -309,7 +309,7 @@ static __inline ALfloat EarlyDelayLineOut(ALreverbState *State, ALuint index)
|
||||
|
||||
// Given an input sample, this function produces four-channel output for the
|
||||
// early reflections.
|
||||
static __inline ALvoid EarlyReflection(ALreverbState *State, ALfloat in, ALfloat *RESTRICT out)
|
||||
static __inline ALvoid EarlyReflection(ALreverbState *State, ALfloat in, ALfloat *restrict out)
|
||||
{
|
||||
ALfloat d[4], v, f[4];
|
||||
|
||||
@@ -380,7 +380,7 @@ static __inline ALfloat LateLowPassInOut(ALreverbState *State, ALuint index, ALf
|
||||
|
||||
// Given four decorrelated input samples, this function produces four-channel
|
||||
// output for the late reverb.
|
||||
static __inline ALvoid LateReverb(ALreverbState *State, const ALfloat *RESTRICT in, ALfloat *RESTRICT out)
|
||||
static __inline ALvoid LateReverb(ALreverbState *State, const ALfloat *restrict in, ALfloat *restrict out)
|
||||
{
|
||||
ALfloat d[4], f[4];
|
||||
|
||||
@@ -451,7 +451,7 @@ static __inline ALvoid LateReverb(ALreverbState *State, const ALfloat *RESTRICT
|
||||
|
||||
// Given an input sample, this function mixes echo into the four-channel late
|
||||
// reverb.
|
||||
static __inline ALvoid EAXEcho(ALreverbState *State, ALfloat in, ALfloat *RESTRICT late)
|
||||
static __inline ALvoid EAXEcho(ALreverbState *State, ALfloat in, ALfloat *restrict late)
|
||||
{
|
||||
ALfloat out, feed;
|
||||
|
||||
@@ -485,7 +485,7 @@ static __inline ALvoid EAXEcho(ALreverbState *State, ALfloat in, ALfloat *RESTRI
|
||||
|
||||
// Perform the non-EAX reverb pass on a given input sample, resulting in
|
||||
// four-channel output.
|
||||
static __inline ALvoid VerbPass(ALreverbState *State, ALfloat in, ALfloat *RESTRICT out)
|
||||
static __inline ALvoid VerbPass(ALreverbState *State, ALfloat in, ALfloat *restrict out)
|
||||
{
|
||||
ALfloat feed, late[4], taps[4];
|
||||
|
||||
@@ -524,7 +524,7 @@ static __inline ALvoid VerbPass(ALreverbState *State, ALfloat in, ALfloat *RESTR
|
||||
|
||||
// Perform the EAX reverb pass on a given input sample, resulting in four-
|
||||
// channel output.
|
||||
static __inline ALvoid EAXVerbPass(ALreverbState *State, ALfloat in, ALfloat *RESTRICT early, ALfloat *RESTRICT late)
|
||||
static __inline ALvoid EAXVerbPass(ALreverbState *State, ALfloat in, ALfloat *restrict early, ALfloat *restrict late)
|
||||
{
|
||||
ALfloat feed, taps[4];
|
||||
|
||||
@@ -563,9 +563,9 @@ static __inline ALvoid EAXVerbPass(ALreverbState *State, ALfloat in, ALfloat *RE
|
||||
|
||||
// This processes the standard reverb state, given the input samples and an
|
||||
// output buffer.
|
||||
static ALvoid ALreverbState_ProcessStandard(ALreverbState *State, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALreverbState_ProcessStandard(ALreverbState *State, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
ALfloat (*RESTRICT out)[4] = State->ReverbSamples;
|
||||
ALfloat (*restrict out)[4] = State->ReverbSamples;
|
||||
ALuint index, c;
|
||||
|
||||
/* Process reverb for these samples. */
|
||||
@@ -585,10 +585,10 @@ static ALvoid ALreverbState_ProcessStandard(ALreverbState *State, ALuint Samples
|
||||
|
||||
// This processes the EAX reverb state, given the input samples and an output
|
||||
// buffer.
|
||||
static ALvoid ALreverbState_ProcessEax(ALreverbState *State, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALreverbState_ProcessEax(ALreverbState *State, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
ALfloat (*RESTRICT early)[4] = State->EarlySamples;
|
||||
ALfloat (*RESTRICT late)[4] = State->ReverbSamples;
|
||||
ALfloat (*restrict early)[4] = State->EarlySamples;
|
||||
ALfloat (*restrict late)[4] = State->ReverbSamples;
|
||||
ALuint index, c;
|
||||
|
||||
/* Process reverb for these samples. */
|
||||
@@ -613,7 +613,7 @@ static ALvoid ALreverbState_ProcessEax(ALreverbState *State, ALuint SamplesToDo,
|
||||
}
|
||||
}
|
||||
|
||||
static ALvoid ALreverbState_Process(ALreverbState *State, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALreverbState_Process(ALreverbState *State, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])
|
||||
{
|
||||
if(State->IsEax)
|
||||
ALreverbState_ProcessEax(State, SamplesToDo, SamplesIn, SamplesOut);
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ static void SilenceData(ALfloat *dst, ALuint samples)
|
||||
}
|
||||
|
||||
|
||||
static void Filter2P(FILTER *filter, ALfloat *RESTRICT dst, const ALfloat *RESTRICT src,
|
||||
static void Filter2P(FILTER *filter, ALfloat *restrict dst, const ALfloat *restrict src,
|
||||
ALuint numsamples)
|
||||
{
|
||||
ALuint i;
|
||||
|
||||
+15
-15
@@ -16,7 +16,7 @@ static __inline ALfloat cubic32(const ALfloat *vals, ALuint frac)
|
||||
{ return cubic(vals[-1], vals[0], vals[1], vals[2], frac * (1.0f/FRACTIONONE)); }
|
||||
|
||||
void Resample_copy32_C(const ALfloat *data, ALuint frac,
|
||||
ALuint increment, ALfloat *RESTRICT OutBuffer, ALuint BufferSize)
|
||||
ALuint increment, ALfloat *restrict OutBuffer, ALuint BufferSize)
|
||||
{
|
||||
(void)frac;
|
||||
assert(increment==FRACTIONONE);
|
||||
@@ -25,7 +25,7 @@ void Resample_copy32_C(const ALfloat *data, ALuint frac,
|
||||
|
||||
#define DECL_TEMPLATE(Sampler) \
|
||||
void Resample_##Sampler##_C(const ALfloat *data, ALuint frac, \
|
||||
ALuint increment, ALfloat *RESTRICT OutBuffer, ALuint BufferSize) \
|
||||
ALuint increment, ALfloat *restrict OutBuffer, ALuint BufferSize) \
|
||||
{ \
|
||||
ALuint pos = 0; \
|
||||
ALuint i; \
|
||||
@@ -47,10 +47,10 @@ DECL_TEMPLATE(cubic32)
|
||||
#undef DECL_TEMPLATE
|
||||
|
||||
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint IrSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
const ALfloat (*RESTRICT CoeffStep)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
const ALfloat (*restrict CoeffStep)[2],
|
||||
ALfloat left, ALfloat right)
|
||||
{
|
||||
ALuint c;
|
||||
@@ -64,9 +64,9 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint IrSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
ALfloat left, ALfloat right)
|
||||
{
|
||||
ALuint c;
|
||||
@@ -83,12 +83,12 @@ 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(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
|
||||
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
|
||||
{
|
||||
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = params->OutBuffer;
|
||||
ALfloat *RESTRICT ClickRemoval = params->ClickRemoval;
|
||||
ALfloat *RESTRICT PendingClicks = params->PendingClicks;
|
||||
ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer;
|
||||
ALfloat *restrict ClickRemoval = params->ClickRemoval;
|
||||
ALfloat *restrict PendingClicks = params->PendingClicks;
|
||||
ALfloat DrySend;
|
||||
ALuint pos;
|
||||
ALuint c;
|
||||
@@ -109,13 +109,13 @@ void MixDirect_C(const DirectParams *params, const ALfloat *RESTRICT data, ALuin
|
||||
}
|
||||
|
||||
|
||||
void MixSend_C(const SendParams *params, const ALfloat *RESTRICT data,
|
||||
void MixSend_C(const SendParams *params, const ALfloat *restrict data,
|
||||
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
|
||||
{
|
||||
ALeffectslot *Slot = params->Slot;
|
||||
ALfloat (*RESTRICT WetBuffer)[BUFFERSIZE] = Slot->WetBuffer;
|
||||
ALfloat *RESTRICT WetClickRemoval = Slot->ClickRemoval;
|
||||
ALfloat *RESTRICT WetPendingClicks = Slot->PendingClicks;
|
||||
ALfloat (*restrict WetBuffer)[BUFFERSIZE] = Slot->WetBuffer;
|
||||
ALfloat *restrict WetClickRemoval = Slot->ClickRemoval;
|
||||
ALfloat *restrict WetPendingClicks = Slot->PendingClicks;
|
||||
ALfloat WetSend = params->Gain;
|
||||
ALuint pos;
|
||||
|
||||
|
||||
+11
-11
@@ -9,23 +9,23 @@ struct DirectParams;
|
||||
struct SendParams;
|
||||
|
||||
/* C resamplers */
|
||||
void Resample_copy32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
|
||||
void Resample_point32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
|
||||
void Resample_lerp32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
|
||||
void Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
|
||||
void Resample_copy32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
|
||||
void Resample_point32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
|
||||
void Resample_lerp32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
|
||||
void Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
|
||||
|
||||
|
||||
/* 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(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);
|
||||
|
||||
/* 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(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);
|
||||
|
||||
/* Neon mixers */
|
||||
void MixDirect_Hrtf_Neon(const struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
|
||||
void MixDirect_Hrtf_Neon(const struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint);
|
||||
|
||||
#endif /* MIXER_DEFS_H */
|
||||
|
||||
+15
-15
@@ -18,30 +18,30 @@
|
||||
#define MixDirect_Hrtf MERGE2(MixDirect_Hrtf_,SUFFIX)
|
||||
|
||||
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint irSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
const ALfloat (*RESTRICT CoeffStep)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
const ALfloat (*restrict CoeffStep)[2],
|
||||
ALfloat left, ALfloat right);
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint irSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
ALfloat left, ALfloat right);
|
||||
|
||||
|
||||
void MixDirect_Hrtf(const DirectParams *params, const ALfloat *RESTRICT data, ALuint srcchan,
|
||||
void MixDirect_Hrtf(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
|
||||
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
|
||||
{
|
||||
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = params->OutBuffer;
|
||||
ALfloat *RESTRICT ClickRemoval = params->ClickRemoval;
|
||||
ALfloat *RESTRICT PendingClicks = params->PendingClicks;
|
||||
ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer;
|
||||
ALfloat *restrict ClickRemoval = params->ClickRemoval;
|
||||
ALfloat *restrict PendingClicks = params->PendingClicks;
|
||||
const ALuint IrSize = params->Hrtf.Params.IrSize;
|
||||
const ALint *RESTRICT DelayStep = params->Hrtf.Params.DelayStep;
|
||||
const ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.Params.CoeffStep;
|
||||
const ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Params.Coeffs[srcchan];
|
||||
const ALuint *RESTRICT TargetDelay = params->Hrtf.Params.Delay[srcchan];
|
||||
ALfloat *RESTRICT History = params->Hrtf.State->History[srcchan];
|
||||
ALfloat (*RESTRICT Values)[2] = params->Hrtf.State->Values[srcchan];
|
||||
const ALint *restrict DelayStep = params->Hrtf.Params.DelayStep;
|
||||
const ALfloat (*restrict CoeffStep)[2] = params->Hrtf.Params.CoeffStep;
|
||||
const ALfloat (*restrict TargetCoeffs)[2] = params->Hrtf.Params.Coeffs[srcchan];
|
||||
const ALuint *restrict TargetDelay = params->Hrtf.Params.Delay[srcchan];
|
||||
ALfloat *restrict History = params->Hrtf.State->History[srcchan];
|
||||
ALfloat (*restrict Values)[2] = params->Hrtf.State->Values[srcchan];
|
||||
ALint Counter = maxu(params->Hrtf.State->Counter, OutPos) - OutPos;
|
||||
ALuint Offset = params->Hrtf.State->Offset + OutPos;
|
||||
ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2];
|
||||
|
||||
+5
-5
@@ -10,10 +10,10 @@
|
||||
#include "alu.h"
|
||||
|
||||
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint IrSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
const ALfloat (*RESTRICT CoeffStep)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
const ALfloat (*restrict CoeffStep)[2],
|
||||
ALfloat left, ALfloat right)
|
||||
{
|
||||
ALuint c;
|
||||
@@ -27,9 +27,9 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint IrSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
ALfloat left, ALfloat right)
|
||||
{
|
||||
ALuint c;
|
||||
|
||||
+13
-13
@@ -14,10 +14,10 @@
|
||||
#include "mixer_defs.h"
|
||||
|
||||
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint IrSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
const ALfloat (*RESTRICT CoeffStep)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
const ALfloat (*restrict CoeffStep)[2],
|
||||
ALfloat left, ALfloat right)
|
||||
{
|
||||
const __m128 lrlr = { left, right, left, right };
|
||||
@@ -76,9 +76,9 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2],
|
||||
static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
|
||||
const ALuint IrSize,
|
||||
ALfloat (*RESTRICT Coeffs)[2],
|
||||
ALfloat (*restrict Coeffs)[2],
|
||||
ALfloat left, ALfloat right)
|
||||
{
|
||||
const __m128 lrlr = { left, right, left, right };
|
||||
@@ -133,12 +133,12 @@ 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(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan,
|
||||
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
|
||||
{
|
||||
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = params->OutBuffer;
|
||||
ALfloat *RESTRICT ClickRemoval = params->ClickRemoval;
|
||||
ALfloat *RESTRICT PendingClicks = params->PendingClicks;
|
||||
ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer;
|
||||
ALfloat *restrict ClickRemoval = params->ClickRemoval;
|
||||
ALfloat *restrict PendingClicks = params->PendingClicks;
|
||||
ALfloat DrySend;
|
||||
ALuint pos;
|
||||
ALuint c;
|
||||
@@ -171,13 +171,13 @@ void MixDirect_SSE(const DirectParams *params, const ALfloat *RESTRICT data, ALu
|
||||
}
|
||||
|
||||
|
||||
void MixSend_SSE(const SendParams *params, const ALfloat *RESTRICT data,
|
||||
void MixSend_SSE(const SendParams *params, const ALfloat *restrict data,
|
||||
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
|
||||
{
|
||||
ALeffectslot *Slot = params->Slot;
|
||||
ALfloat (*RESTRICT WetBuffer)[BUFFERSIZE] = Slot->WetBuffer;
|
||||
ALfloat *RESTRICT WetClickRemoval = Slot->ClickRemoval;
|
||||
ALfloat *RESTRICT WetPendingClicks = Slot->PendingClicks;
|
||||
ALfloat (*restrict WetBuffer)[BUFFERSIZE] = Slot->WetBuffer;
|
||||
ALfloat *restrict WetClickRemoval = Slot->ClickRemoval;
|
||||
ALfloat *restrict WetPendingClicks = Slot->PendingClicks;
|
||||
const ALfloat WetGain = params->Gain;
|
||||
__m128 gain;
|
||||
ALuint pos;
|
||||
|
||||
+4
-5
@@ -95,7 +95,6 @@ SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_REVISION}")
|
||||
|
||||
SET(EXPORT_DECL "")
|
||||
SET(ALIGN_DECL "")
|
||||
SET(RESTRICT_DECL "")
|
||||
|
||||
|
||||
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
|
||||
@@ -104,13 +103,13 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("int *restrict foo;
|
||||
int main() {return 0;}" HAVE_RESTRICT)
|
||||
IF(HAVE_RESTRICT)
|
||||
SET(RESTRICT_DECL "restrict")
|
||||
ELSE()
|
||||
IF(NOT HAVE_RESTRICT)
|
||||
CHECK_C_SOURCE_COMPILES("int *__restrict foo;
|
||||
int main() {return 0;}" HAVE___RESTRICT)
|
||||
IF(HAVE___RESTRICT)
|
||||
SET(RESTRICT_DECL "__restrict")
|
||||
ADD_DEFINITIONS(-Drestrict=__restrict)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-Drestrict=)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ struct ALeffectStateVtable {
|
||||
ALvoid (*const Destruct)(ALeffectState *state);
|
||||
ALboolean (*const DeviceUpdate)(ALeffectState *state, ALCdevice *device);
|
||||
ALvoid (*const Update)(ALeffectState *state, ALCdevice *device, const ALeffectslot *slot);
|
||||
ALvoid (*const Process)(ALeffectState *state, ALuint samplesToDo, const ALfloat *RESTRICT samplesIn, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE]);
|
||||
ALvoid (*const Process)(ALeffectState *state, ALuint samplesToDo, const ALfloat *restrict samplesIn, ALfloat (*restrict samplesOut)[BUFFERSIZE]);
|
||||
ALeffectStateFactory *(*const getCreator)(void);
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ static ALboolean T##_ALeffectState_DeviceUpdate(ALeffectState *state, ALCdevice
|
||||
{ return T##_DeviceUpdate(STATIC_UPCAST(T, ALeffectState, state), device); } \
|
||||
static ALvoid T##_ALeffectState_Update(ALeffectState *state, ALCdevice *device, const ALeffectslot *slot) \
|
||||
{ T##_Update(STATIC_UPCAST(T, ALeffectState, state), device, slot); } \
|
||||
static ALvoid T##_ALeffectState_Process(ALeffectState *state, ALuint samplesToDo, const ALfloat *RESTRICT samplesIn, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE]) \
|
||||
static ALvoid T##_ALeffectState_Process(ALeffectState *state, ALuint samplesToDo, const ALfloat *restrict samplesIn, ALfloat (*restrict samplesOut)[BUFFERSIZE]) \
|
||||
{ T##_Process(STATIC_UPCAST(T, ALeffectState, state), samplesToDo, samplesIn, samplesOut); } \
|
||||
static ALeffectStateFactory* T##_ALeffectState_getCreator(void) \
|
||||
{ return T##_getCreator(); } \
|
||||
|
||||
@@ -31,14 +31,14 @@ struct DirectParams;
|
||||
struct SendParams;
|
||||
|
||||
typedef void (*ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment,
|
||||
ALfloat *RESTRICT dst, ALuint dstlen);
|
||||
ALfloat *restrict dst, ALuint dstlen);
|
||||
|
||||
typedef ALvoid (*DryMixerFunc)(const struct DirectParams *params,
|
||||
const ALfloat *RESTRICT data, ALuint srcchan,
|
||||
const ALfloat *restrict data, ALuint srcchan,
|
||||
ALuint OutPos, ALuint SamplesToDo,
|
||||
ALuint BufferSize);
|
||||
typedef ALvoid (*WetMixerFunc)(const struct SendParams *params,
|
||||
const ALfloat *RESTRICT data,
|
||||
const ALfloat *restrict data,
|
||||
ALuint OutPos, ALuint SamplesToDo,
|
||||
ALuint BufferSize);
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ static ALvoid ALnoneState_Update(ALnoneState *state, ALCdevice *device, const AL
|
||||
(void)device;
|
||||
(void)slot;
|
||||
}
|
||||
static ALvoid ALnoneState_Process(ALnoneState *state, ALuint samplesToDo, const ALfloat *RESTRICT samplesIn, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE])
|
||||
static ALvoid ALnoneState_Process(ALnoneState *state, ALuint samplesToDo, const ALfloat *restrict samplesIn, ALfloat (*restrict samplesOut)[BUFFERSIZE])
|
||||
{
|
||||
(void)state;
|
||||
(void)samplesToDo;
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
#define align(x) aligned(x)
|
||||
#endif
|
||||
|
||||
/* Define to the appropriate 'restrict' keyword */
|
||||
#define RESTRICT ${RESTRICT_DECL}
|
||||
|
||||
/* Define if we have the C11 aligned_alloc function */
|
||||
#cmakedefine HAVE_ALIGNED_ALLOC
|
||||
|
||||
|
||||
Reference in New Issue
Block a user