aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-09-27 02:46:15 -0700
committerChris Robinson <[email protected]>2012-09-27 02:46:15 -0700
commit41b2c2f3bbd3a36be7272ceb7711a9bf97042e26 (patch)
tree7bc30e74fef89de90c9e34ffb55fa19b05367e07
parent68faef5b84c06c997e65027656f659e16671ba3a (diff)
Remove an unneeded parameter from the resampler
-rw-r--r--Alc/mixer.c2
-rw-r--r--Alc/mixer_c.c20
-rw-r--r--Alc/mixer_defs.h6
-rw-r--r--OpenAL32/Include/alu.h3
4 files changed, 13 insertions, 18 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index c3ed5d64..4658b33b 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -323,7 +323,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
/* Now resample, then filter and mix to the appropriate outputs. */
Source->Params.Resample(&SrcData[BufferPrePadding], DataPosFrac,
- increment, 1, ResampledData, DstBufferSize);
+ increment, ResampledData, DstBufferSize);
{
DirectParams *directparms = &Source->Params.Direct;
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c
index efa51b75..a85d3ee9 100644
--- a/Alc/mixer_c.c
+++ b/Alc/mixer_c.c
@@ -6,27 +6,23 @@
#include "alAuxEffectSlot.h"
-static __inline ALfloat point32(const ALfloat *vals, ALint step, ALint frac)
-{ return vals[0]; (void)step; (void)frac; }
-static __inline ALfloat lerp32(const ALfloat *vals, ALint step, ALint frac)
-{ return lerp(vals[0], vals[step], frac * (1.0f/FRACTIONONE)); }
-static __inline ALfloat cubic32(const ALfloat *vals, ALint step, ALint frac)
-{ return cubic(vals[-step], vals[0], vals[step], vals[step+step],
- frac * (1.0f/FRACTIONONE)); }
+static __inline ALfloat point32(const ALfloat *vals, ALint frac)
+{ return vals[0]; (void)frac; }
+static __inline ALfloat lerp32(const ALfloat *vals, ALint frac)
+{ return lerp(vals[0], vals[1], frac * (1.0f/FRACTIONONE)); }
+static __inline ALfloat cubic32(const ALfloat *vals, ALint frac)
+{ return cubic(vals[-1], vals[0], vals[1], vals[2], frac * (1.0f/FRACTIONONE)); }
#define DECL_TEMPLATE(Sampler) \
void Resample_##Sampler##_C(const ALfloat *data, ALuint frac, \
- ALuint increment, ALuint NumChannels, ALfloat *RESTRICT OutBuffer, \
- ALuint BufferSize) \
+ ALuint increment, ALfloat *RESTRICT OutBuffer, ALuint BufferSize) \
{ \
ALuint pos = 0; \
- ALfloat value; \
ALuint i; \
\
for(i = 0;i < BufferSize+1;i++) \
{ \
- value = Sampler(data + pos*NumChannels, NumChannels, frac); \
- OutBuffer[i] = value; \
+ OutBuffer[i] = Sampler(data + pos, frac); \
\
frac += increment; \
pos += frac>>FRACTIONBITS; \
diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h
index 1e9632a1..ecbd879a 100644
--- a/Alc/mixer_defs.h
+++ b/Alc/mixer_defs.h
@@ -10,9 +10,9 @@ struct DirectParams;
struct SendParams;
/* C resamplers */
-void Resample_point32_C(const ALfloat *src, ALuint frac, ALuint increment, ALuint NumChannels, ALfloat *RESTRICT dst, ALuint dstlen);
-void Resample_lerp32_C(const ALfloat *src, ALuint frac, ALuint increment, ALuint NumChannels, ALfloat *RESTRICT dst, ALuint dstlen);
-void Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALuint NumChannels, ALfloat *RESTRICT dst, ALuint dstlen);
+void Resample_point32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
+void Resample_lerp32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
+void Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen);
/* C mixers */
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 79ba8f7e..ef573d6f 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -80,8 +80,7 @@ struct ALbuffer;
struct DirectParams;
struct SendParams;
-typedef void (*ResamplerFunc)(const ALfloat *src, ALuint frac,
- ALuint increment, ALuint NumChannels,
+typedef void (*ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment,
ALfloat *RESTRICT dst, ALuint dstlen);
typedef ALvoid (*DryMixerFunc)(struct ALsource *self, ALCdevice *Device,