diff options
-rw-r--r-- | Alc/ALu.c | 16 | ||||
-rw-r--r-- | Alc/mixer_c.c | 8 | ||||
-rw-r--r-- | Alc/mixer_sse.c | 8 | ||||
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 2 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 12 |
5 files changed, 23 insertions, 23 deletions
@@ -943,9 +943,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) slot_end = slot + ctx->ActiveEffectSlotCount; while(slot != slot_end) { - for(c = 0;c < SamplesToDo;c++) + for(i = 0;i < SamplesToDo;i++) { - (*slot)->WetBuffer[c] += (*slot)->ClickRemoval[0]; + (*slot)->WetBuffer[0][i] += (*slot)->ClickRemoval[0]; (*slot)->ClickRemoval[0] -= (*slot)->ClickRemoval[0] * (1.0f/256.0f); } (*slot)->ClickRemoval[0] += (*slot)->PendingClicks[0]; @@ -955,10 +955,10 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ALeffectState_Update((*slot)->EffectState, device, *slot); ALeffectState_Process((*slot)->EffectState, SamplesToDo, - (*slot)->WetBuffer, device->DryBuffer); + (*slot)->WetBuffer[0], device->DryBuffer); for(i = 0;i < SamplesToDo;i++) - (*slot)->WetBuffer[i] = 0.0f; + (*slot)->WetBuffer[0][i] = 0.0f; slot++; } @@ -969,9 +969,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) slot = &device->DefaultSlot; if(*slot != NULL) { - for(c = 0;c < SamplesToDo;c++) + for(i = 0;i < SamplesToDo;i++) { - (*slot)->WetBuffer[c] += (*slot)->ClickRemoval[0]; + (*slot)->WetBuffer[0][i] += (*slot)->ClickRemoval[0]; (*slot)->ClickRemoval[0] -= (*slot)->ClickRemoval[0] * (1.0f/256.0f); } (*slot)->ClickRemoval[0] += (*slot)->PendingClicks[0]; @@ -981,10 +981,10 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ALeffectState_Update((*slot)->EffectState, device, *slot); ALeffectState_Process((*slot)->EffectState, SamplesToDo, - (*slot)->WetBuffer, device->DryBuffer); + (*slot)->WetBuffer[0], device->DryBuffer); for(i = 0;i < SamplesToDo;i++) - (*slot)->WetBuffer[i] = 0.0f; + (*slot)->WetBuffer[0][i] = 0.0f; } ALCdevice_Unlock(device); diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index baef411d..cab3f8af 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -115,9 +115,9 @@ void MixSend_C(SendParams *params, const ALfloat *RESTRICT data, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) { ALeffectslot *Slot = params->Slot; - ALfloat *WetBuffer = Slot->WetBuffer; - ALfloat *WetClickRemoval = Slot->ClickRemoval; - ALfloat *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; @@ -128,7 +128,7 @@ void MixSend_C(SendParams *params, const ALfloat *RESTRICT data, } for(pos = 0;pos < BufferSize;pos++) { - WetBuffer[OutPos] += data[pos] * WetSend; + WetBuffer[0][OutPos] += data[pos] * WetSend; OutPos++; } if(OutPos == SamplesToDo) diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index 47a6e705..d06455dd 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -320,7 +320,7 @@ void MixSend_SSE(SendParams *params, const ALfloat *RESTRICT data, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) { ALeffectslot *Slot = params->Slot; - ALfloat *RESTRICT WetBuffer = Slot->WetBuffer; + ALfloat (*RESTRICT WetBuffer)[BUFFERSIZE] = Slot->WetBuffer; ALfloat *RESTRICT WetClickRemoval = Slot->ClickRemoval; ALfloat *RESTRICT WetPendingClicks = Slot->PendingClicks; const ALfloat WetGain = params->Gain; @@ -333,12 +333,12 @@ void MixSend_SSE(SendParams *params, const ALfloat *RESTRICT data, for(pos = 0;pos < BufferSize-3;pos+=4) { const __m128 val4 = _mm_load_ps(&data[pos]); - __m128 wet4 = _mm_load_ps(&WetBuffer[OutPos+pos]); + __m128 wet4 = _mm_load_ps(&WetBuffer[0][OutPos+pos]); wet4 = _mm_add_ps(wet4, _mm_mul_ps(val4, gain)); - _mm_store_ps(&WetBuffer[OutPos+pos], wet4); + _mm_store_ps(&WetBuffer[0][OutPos+pos], wet4); } for(;pos < BufferSize;pos++) - WetBuffer[OutPos+pos] += data[pos] * WetGain; + WetBuffer[0][OutPos+pos] += data[pos] * WetGain; if(OutPos+pos == SamplesToDo) WetPendingClicks[0] += data[pos] * WetGain; } diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index cfa61a5f..6f4e5c10 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -26,7 +26,7 @@ typedef struct ALeffectslot volatile ALenum NeedsUpdate; ALeffectState *EffectState; - ALIGN(16) ALfloat WetBuffer[BUFFERSIZE]; + ALIGN(16) ALfloat WetBuffer[1][BUFFERSIZE]; ALfloat ClickRemoval[1]; ALfloat PendingClicks[1]; diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index e3a626a1..4cfef68b 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -572,7 +572,7 @@ ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *e ALenum InitEffectSlot(ALeffectslot *slot) { - ALint i; + ALint i, c; if(!(slot->EffectState=NoneCreate())) return AL_OUT_OF_MEMORY; @@ -580,12 +580,12 @@ ALenum InitEffectSlot(ALeffectslot *slot) slot->Gain = 1.0; slot->AuxSendAuto = AL_TRUE; slot->NeedsUpdate = AL_FALSE; - for(i = 0;i < BUFFERSIZE;i++) - slot->WetBuffer[i] = 0.0f; - for(i = 0;i < 1;i++) + for(c = 0;c < 1;c++) { - slot->ClickRemoval[i] = 0.0f; - slot->PendingClicks[i] = 0.0f; + for(i = 0;i < BUFFERSIZE;i++) + slot->WetBuffer[c][i] = 0.0f; + slot->ClickRemoval[c] = 0.0f; + slot->PendingClicks[c] = 0.0f; } slot->ref = 0; |