diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 7 | ||||
-rw-r--r-- | Alc/ALu.c | 55 | ||||
-rw-r--r-- | Alc/mixer.c | 3 | ||||
-rw-r--r-- | Alc/mixer_c.c | 2 | ||||
-rw-r--r-- | Alc/mixer_defs.h | 12 | ||||
-rw-r--r-- | Alc/mixer_inc.c | 2 | ||||
-rw-r--r-- | Alc/mixer_neon.c | 2 | ||||
-rw-r--r-- | Alc/mixer_sse.c | 2 |
8 files changed, 19 insertions, 66 deletions
@@ -1607,7 +1607,6 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) enum DevFmtType oldType; ALCuint oldFreq; FPUCtl oldMode; - ALuint i; // Check for attributes if(device->Type == Loopback) @@ -1844,12 +1843,6 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) aluInitPanning(device); - for(i = 0;i < MaxChannels;i++) - { - device->ClickRemoval[i] = 0.0f; - device->PendingClicks[i] = 0.0f; - } - V(device->Synth,update)(device); device->Hrtf = NULL; @@ -309,8 +309,6 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext) DirectChannels = ALSource->DirectChannels; src->Direct.OutBuffer = Device->DryBuffer; - src->Direct.ClickRemoval = Device->ClickRemoval; - src->Direct.PendingClicks = Device->PendingClicks; for(i = 0;i < NumSends;i++) { ALeffectslot *Slot = ALSource->Send[i].Slot; @@ -659,8 +657,6 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext) RoomRolloffBase = ALSource->RoomRolloffFactor; src->Direct.OutBuffer = Device->DryBuffer; - src->Direct.ClickRemoval = Device->ClickRemoval; - src->Direct.PendingClicks = Device->PendingClicks; for(i = 0;i < NumSends;i++) { ALeffectslot *Slot = ALSource->Send[i].Slot; @@ -1254,52 +1250,17 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) device->SamplesDone %= device->Frequency; ALCdevice_Unlock(device); - /* Click-removal. Could do better; this only really handles immediate - * changes between updates where a predictive sample could be - * generated. Delays caused by effects and HRTF aren't caught. */ - if(device->FmtChans == DevFmtStereo) + if(device->Bs2b) { - /* Assumes the first two channels are FrontLeft and FrontRight */ - for(c = 0;c < 2;c++) - { - ALfloat offset = device->ClickRemoval[c]; - if(offset < (1.0f/32768.0f)) - offset = 0.0f; - else for(i = 0;i < SamplesToDo;i++) - { - device->DryBuffer[c][i] += offset; - offset -= offset * (1.0f/256.0f); - } - device->ClickRemoval[c] = offset + device->PendingClicks[c]; - device->PendingClicks[c] = 0.0f; - } - if(device->Bs2b) + /* Apply binaural/crossfeed filter */ + for(i = 0;i < SamplesToDo;i++) { float samples[2]; - for(i = 0;i < SamplesToDo;i++) - { - samples[0] = device->DryBuffer[FrontLeft][i]; - samples[1] = device->DryBuffer[FrontRight][i]; - bs2b_cross_feed(device->Bs2b, samples); - device->DryBuffer[FrontLeft][i] = samples[0]; - device->DryBuffer[FrontRight][i] = samples[1]; - } - } - } - else - { - for(c = 0;c < MaxChannels;c++) - { - ALfloat offset = device->ClickRemoval[c]; - if(offset < (1.0f/32768.0f)) - offset = 0.0f; - else for(i = 0;i < SamplesToDo;i++) - { - device->DryBuffer[c][i] += offset; - offset -= offset * (1.0f/256.0f); - } - device->ClickRemoval[c] = offset + device->PendingClicks[c]; - device->PendingClicks[c] = 0.0f; + samples[0] = device->DryBuffer[FrontLeft][i]; + samples[1] = device->DryBuffer[FrontRight][i]; + bs2b_cross_feed(device->Bs2b, samples); + device->DryBuffer[FrontLeft][i] = samples[0]; + device->DryBuffer[FrontRight][i] = samples[1]; } } diff --git a/Alc/mixer.c b/Alc/mixer.c index 96acb3e8..ae6b324f 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -331,8 +331,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo) DoFilter(&directparms->LpFilter[chan], SrcData, ResampledData, DstBufferSize); - src->DryMix(directparms, SrcData, chan, OutPos, - SamplesToDo, DstBufferSize); + src->DryMix(directparms, SrcData, chan, OutPos, DstBufferSize); } for(j = 0;j < Device->NumAuxSends;j++) diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index e83655e6..a4028beb 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -83,7 +83,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], void MixDirect_C(DirectParams *params, const ALfloat *restrict data, ALuint srcchan, - ALuint OutPos, ALuint UNUSED(SamplesToDo), ALuint BufferSize) + ALuint OutPos, ALuint BufferSize) { ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer; ALuint Counter = maxu(params->Counter, OutPos) - OutPos; diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h index 878db968..34430517 100644 --- a/Alc/mixer_defs.h +++ b/Alc/mixer_defs.h @@ -16,18 +16,18 @@ 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,ALuint); -void MixDirect_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint); +void MixDirect_Hrtf_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); +void MixDirect_C(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); void MixSend_C(struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); /* SSE mixers */ -void MixDirect_Hrtf_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint); -void MixDirect_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint); +void MixDirect_Hrtf_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); +void MixDirect_SSE(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); void MixSend_SSE(struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); /* Neon mixers */ -void MixDirect_Hrtf_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint); -void MixDirect_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint,ALuint); +void MixDirect_Hrtf_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); +void MixDirect_Neon(struct DirectParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); void MixSend_Neon(struct SendParams*,const ALfloat*restrict,ALuint,ALuint,ALuint); #endif /* MIXER_DEFS_H */ diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index c28c2e97..93118423 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -24,7 +24,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], void MixDirect_Hrtf(DirectParams *params, const ALfloat *restrict data, ALuint srcchan, - ALuint OutPos, ALuint UNUSED(SamplesToDo), ALuint BufferSize) + ALuint OutPos, ALuint BufferSize) { ALfloat (*restrict DryBuffer)[BUFFERSIZE] = params->OutBuffer; const ALuint IrSize = params->Mix.Hrtf.Params.IrSize; diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c index 15703226..35dfd1f1 100644 --- a/Alc/mixer_neon.c +++ b/Alc/mixer_neon.c @@ -78,7 +78,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], void MixDirect_Neon(DirectParams *params, const ALfloat *restrict data, ALuint srcchan, - ALuint OutPos, ALuint UNUSED(SamplesToDo), ALuint BufferSize) + ALuint OutPos, ALuint BufferSize) { ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer; ALuint Counter = maxu(params->Counter, OutPos) - OutPos; diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index 52785086..38435dac 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -141,7 +141,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], void MixDirect_SSE(DirectParams *params, const ALfloat *restrict data, ALuint srcchan, - ALuint OutPos, ALuint UNUSED(SamplesToDo), ALuint BufferSize) + ALuint OutPos, ALuint BufferSize) { ALfloat (*restrict OutBuffer)[BUFFERSIZE] = params->OutBuffer; ALuint Counter = maxu(params->Counter, OutPos) - OutPos; |