aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-18 05:02:34 -0700
committerChris Robinson <[email protected]>2014-05-18 06:23:20 -0700
commita5631e05cc0273289cd5e2e86e554c9559cf2016 (patch)
tree46041845a14529fedfbce8ee7851f3a24c80d2f9 /Alc/mixer.c
parentcd53a4b74c8bb2b1f8add3f95493f595cea548f9 (diff)
Add a ALfilterState method to process multiple samples at once
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 32d4d308..8db0289e 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -96,20 +96,22 @@ static void DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter,
break;
case AF_LowPass:
- for(i = 0;i < numsamples;i++)
- dst[i] = ALfilterState_processSingle(lpfilter, src[i]);
+ ALfilterState_process(lpfilter, dst, src, numsamples);
break;
-
case AF_HighPass:
- for(i = 0;i < numsamples;i++)
- dst[i] = ALfilterState_processSingle(hpfilter, src[i]);
+ ALfilterState_process(hpfilter, dst, src, numsamples);
break;
case AF_BandPass:
- for(i = 0;i < numsamples;i++)
- dst[i] = ALfilterState_processSingle(hpfilter,
- ALfilterState_processSingle(lpfilter, src[i])
- );
+ for(i = 0;i < numsamples;)
+ {
+ ALfloat temp[64];
+ ALuint todo = minu(64, numsamples-i);
+
+ ALfilterState_process(lpfilter, temp, src, todo);
+ ALfilterState_process(hpfilter, dst, temp, todo);
+ i += todo;
+ }
break;
}
}