diff options
-rw-r--r-- | Alc/effects/autowah.c | 2 | ||||
-rw-r--r-- | Alc/effects/chorus.c | 4 | ||||
-rw-r--r-- | Alc/effects/compressor.c | 2 | ||||
-rw-r--r-- | Alc/effects/dedicated.c | 2 | ||||
-rw-r--r-- | Alc/effects/distortion.c | 2 | ||||
-rw-r--r-- | Alc/effects/echo.c | 4 | ||||
-rw-r--r-- | Alc/effects/equalizer.c | 2 | ||||
-rw-r--r-- | Alc/effects/flanger.c | 4 | ||||
-rw-r--r-- | Alc/effects/modulator.c | 2 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 19 | ||||
-rw-r--r-- | Alc/mixer_c.c | 4 | ||||
-rw-r--r-- | Alc/mixer_sse.c | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 2 |
13 files changed, 28 insertions, 25 deletions
diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c index 298eb7f0..ffec3c9c 100644 --- a/Alc/effects/autowah.c +++ b/Alc/effects/autowah.c @@ -155,7 +155,7 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALuint SamplesToDo, for(kt = 0;kt < MaxChannels;kt++) { ALfloat gain = state->Gain[kt]; - if(!(gain > 0.00001f)) + if(!(gain > GAIN_SILENCE_THRESHOLD)) continue; for(it = 0;it < td;it++) diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index ba664268..8fc82a7f 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -203,14 +203,14 @@ static void Process##func(ALchorusState *state, ALuint SamplesToDo, \ for(kt = 0;kt < MaxChannels;kt++) \ { \ ALfloat gain = state->Gain[0][kt]; \ - if(gain > 0.00001f) \ + if(gain > GAIN_SILENCE_THRESHOLD) \ { \ for(it = 0;it < td;it++) \ SamplesOut[kt][it+base] += temps[it][0] * gain; \ } \ \ gain = state->Gain[1][kt]; \ - if(gain > 0.00001f) \ + if(gain > GAIN_SILENCE_THRESHOLD) \ { \ for(it = 0;it < td;it++) \ SamplesOut[kt][it+base] += temps[it][1] * gain; \ diff --git a/Alc/effects/compressor.c b/Alc/effects/compressor.c index 6c3ab425..46673f45 100644 --- a/Alc/effects/compressor.c +++ b/Alc/effects/compressor.c @@ -117,7 +117,7 @@ static ALvoid ALcompressorState_process(ALcompressorState *state, ALuint Samples for(kt = 0;kt < MaxChannels;kt++) { ALfloat gain = state->Gain[kt] * envgain * 2.0f; - if(!(gain > 0.00001f)) + if(!(gain > GAIN_SILENCE_THRESHOLD)) continue; for(it = 0;it < td;it++) diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c index 2aa08953..5a9842fa 100644 --- a/Alc/effects/dedicated.c +++ b/Alc/effects/dedicated.c @@ -78,7 +78,7 @@ static ALvoid ALdedicatedState_process(ALdedicatedState *state, ALuint SamplesTo for(c = 0;c < MaxChannels;c++) { - if(!(gains[c] > 0.00001f)) + if(!(gains[c] > GAIN_SILENCE_THRESHOLD)) continue; for(i = 0;i < SamplesToDo;i++) diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index 768d1ee2..9a18ad46 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -169,7 +169,7 @@ static ALvoid ALdistortionState_process(ALdistortionState *state, ALuint Samples for(kt = 0;kt < MaxChannels;kt++) { ALfloat gain = state->Gain[kt]; - if(!(gain > 0.00001f)) + if(!(gain > GAIN_SILENCE_THRESHOLD)) continue; for(it = 0;it < td;it++) diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index 8a457162..a9110e35 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -148,14 +148,14 @@ static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const for(k = 0;k < MaxChannels;k++) { ALfloat gain = state->Gain[0][k]; - if(gain > 0.00001f) + if(gain > GAIN_SILENCE_THRESHOLD) { for(i = 0;i < td;i++) SamplesOut[k][i+base] += temps[i][0] * gain; } gain = state->Gain[1][k]; - if(gain > 0.00001f) + if(gain > GAIN_SILENCE_THRESHOLD) { for(i = 0;i < td;i++) SamplesOut[k][i+base] += temps[i][1] * gain; diff --git a/Alc/effects/equalizer.c b/Alc/effects/equalizer.c index 3fd0b0f7..b7bfa0a2 100644 --- a/Alc/effects/equalizer.c +++ b/Alc/effects/equalizer.c @@ -154,7 +154,7 @@ static ALvoid ALequalizerState_process(ALequalizerState *state, ALuint SamplesTo for(kt = 0;kt < MaxChannels;kt++) { ALfloat gain = state->Gain[kt]; - if(!(gain > 0.00001f)) + if(!(gain > GAIN_SILENCE_THRESHOLD)) continue; for(it = 0;it < td;it++) diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index 6b1a84ad..0107afed 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -203,14 +203,14 @@ static void Process##func(ALflangerState *state, ALuint SamplesToDo, \ for(kt = 0;kt < MaxChannels;kt++) \ { \ ALfloat gain = state->Gain[0][kt]; \ - if(gain > 0.00001f) \ + if(gain > GAIN_SILENCE_THRESHOLD) \ { \ for(it = 0;it < td;it++) \ SamplesOut[kt][it+base] += temps[it][0] * gain; \ } \ \ gain = state->Gain[1][kt]; \ - if(gain > 0.00001f) \ + if(gain > GAIN_SILENCE_THRESHOLD) \ { \ for(it = 0;it < td;it++) \ SamplesOut[kt][it+base] += temps[it][1] * gain; \ diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index a77a42df..b71070f5 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -102,7 +102,7 @@ static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \ for(k = 0;k < MaxChannels;k++) \ { \ ALfloat gain = state->Gain[k]; \ - if(!(gain > 0.00001f)) \ + if(!(gain > GAIN_SILENCE_THRESHOLD)) \ continue; \ \ for(i = 0;i < td;i++) \ diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 261a1f7f..4c65e0a6 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -575,11 +575,11 @@ static ALvoid ALreverbState_processStandard(ALreverbState *State, ALuint Samples for(c = 0;c < MaxChannels;c++) { ALfloat gain = State->Gain[c]; - if(gain > 0.00001f) - { - for(index = 0;index < SamplesToDo;index++) - SamplesOut[c][index] += gain * out[index][c&3]; - } + if(!(gain > GAIN_SILENCE_THRESHOLD)) + continue; + + for(index = 0;index < SamplesToDo;index++) + SamplesOut[c][index] += gain * out[index][c&3]; } } @@ -595,15 +595,16 @@ static ALvoid ALreverbState_processEax(ALreverbState *State, ALuint SamplesToDo, for(c = 0;c < MaxChannels;c++) { - ALfloat earlyGain = State->Early.PanGain[c]; - ALfloat lateGain = State->Late.PanGain[c]; + ALfloat earlyGain, lateGain; - if(earlyGain > 0.00001f) + earlyGain = State->Early.PanGain[c]; + if(earlyGain > GAIN_SILENCE_THRESHOLD) { for(index = 0;index < SamplesToDo;index++) SamplesOut[c][index] += earlyGain*early[index][c&3]; } - if(lateGain > 0.00001f) + lateGain = State->Late.PanGain[c]; + if(lateGain > GAIN_SILENCE_THRESHOLD) { for(index = 0;index < SamplesToDo;index++) SamplesOut[c][index] += lateGain*late[index][c&3]; diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index 168aa43f..da3f8318 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -96,7 +96,7 @@ void MixDirect_C(const DirectParams *params, const ALfloat *restrict data, ALuin for(c = 0;c < MaxChannels;c++) { DrySend = params->Gains[srcchan][c]; - if(!(DrySend > 0.00001f)) + if(!(DrySend > GAIN_SILENCE_THRESHOLD)) continue; if(OutPos == 0) @@ -119,7 +119,7 @@ void MixSend_C(const SendParams *params, const ALfloat *restrict data, ALuint pos; WetSend = params->Gain; - if(!(WetSend > 0.00001f)) + if(!(WetSend > GAIN_SILENCE_THRESHOLD)) return; if(OutPos == 0) diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index cd8ea299..56a4bdae 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -154,7 +154,7 @@ void MixDirect_SSE(const DirectParams *params, const ALfloat *restrict data, ALu for(c = 0;c < MaxChannels;c++) { DrySend = params->Gains[srcchan][c]; - if(!(DrySend > 0.00001f)) + if(!(DrySend > GAIN_SILENCE_THRESHOLD)) continue; if(OutPos == 0) @@ -188,7 +188,7 @@ void MixSend_SSE(const SendParams *params, const ALfloat *restrict data, ALuint pos; WetGain = params->Gain; - if(!(WetGain > 0.00001f)) + if(!(WetGain > GAIN_SILENCE_THRESHOLD)) return; if(OutPos == 0) diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 076abea6..7327d85b 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -43,6 +43,8 @@ typedef ALvoid (*WetMixerFunc)(const struct SendParams *params, ALuint BufferSize); +#define GAIN_SILENCE_THRESHOLD (0.00001f) + #define SPEEDOFSOUNDMETRESPERSEC (343.3f) #define AIRABSORBGAINHF (0.99426f) /* -0.05dB */ |