summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-04-30 09:33:00 -0700
committerChris Robinson <[email protected]>2012-04-30 09:33:00 -0700
commit010a66487d9b92f21d5b41c2d5956d8b79b58324 (patch)
tree3f4111c11cac98ce76e93d706328dddae0d8712d /Alc
parentaed35fd811f7aa5f1a9d2edb499e43d490ede96e (diff)
Use 2 chained one-pole filters for the wet path
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c5
-rw-r--r--Alc/mixer.c12
2 files changed, 8 insertions, 9 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 2777b0fe..d3965dfd 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -308,8 +308,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Direct.iirFilter.coeff = lpCoeffCalc(DryGainHF, cw);
for(i = 0;i < NumSends;i++)
{
- /* We use a one-pole filter, so we need to take the squared gain */
- ALfloat a = lpCoeffCalc(WetGainHF[i]*WetGainHF[i], cw);
+ ALfloat a = lpCoeffCalc(WetGainHF[i], cw);
ALSource->Params.Send[i].iirFilter.coeff = a;
}
}
@@ -762,7 +761,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Direct.iirFilter.coeff = lpCoeffCalc(DryGainHF, cw);
for(i = 0;i < NumSends;i++)
{
- ALfloat a = lpCoeffCalc(WetGainHF[i]*WetGainHF[i], cw);
+ ALfloat a = lpCoeffCalc(WetGainHF[i], cw);
ALSource->Params.Send[i].iirFilter.coeff = a;
}
}
diff --git a/Alc/mixer.c b/Alc/mixer.c
index e925a5e8..75ede3dc 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -350,16 +350,16 @@ static void MixSend_##sampler(ALsource *Source, ALuint sendidx, \
\
if(OutPos == 0) \
{ \
- value = sampler(data + pos*NumChannels + i, NumChannels,frac); \
+ value = sampler(data + pos*NumChannels + i, NumChannels, frac); \
\
- value = lpFilter1PC(WetFilter, i, value); \
+ value = lpFilter2PC(WetFilter, i, value); \
WetClickRemoval[0] -= value * WetSend; \
} \
for(BufferIdx = 0;BufferIdx < BufferSize;BufferIdx++) \
{ \
- value = sampler(data + pos*NumChannels + i, NumChannels,frac); \
+ value = sampler(data + pos*NumChannels + i, NumChannels, frac); \
\
- value = lpFilter1P(WetFilter, i, value); \
+ value = lpFilter2P(WetFilter, i, value); \
WetBuffer[OutPos] += value * WetSend; \
\
frac += increment; \
@@ -369,9 +369,9 @@ static void MixSend_##sampler(ALsource *Source, ALuint sendidx, \
} \
if(OutPos == SamplesToDo) \
{ \
- value = sampler(data + pos*NumChannels + i, NumChannels,frac); \
+ value = sampler(data + pos*NumChannels + i, NumChannels, frac); \
\
- value = lpFilter1PC(WetFilter, i, value); \
+ value = lpFilter2PC(WetFilter, i, value); \
WetPendingClicks[0] += value * WetSend; \
} \
OutPos -= BufferSize; \