aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-19 20:10:31 -0800
committerChris Robinson <[email protected]>2018-01-19 20:10:31 -0800
commitab2295b68f19212ce34cf2b56e81ee80186310f9 (patch)
treec4036feba34a32a9ec348622459313d04893c19f /Alc
parent940c6146e832b2226876f3d8fdc3369974ed16e9 (diff)
Store 8-bit sample types directly as unsigned byte
Diffstat (limited to 'Alc')
-rw-r--r--Alc/mixer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index d1796da8..fe4bcd78 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -193,8 +193,8 @@ void aluInitMixer(void)
}
-static inline ALfloat Sample_ALbyte(ALbyte val)
-{ return val * (1.0f/128.0f); }
+static inline ALfloat Sample_ALubyte(ALubyte val)
+{ return (val-128) * (1.0f/128.0f); }
static inline ALfloat Sample_ALshort(ALshort val)
{ return val * (1.0f/32768.0f); }
@@ -219,7 +219,7 @@ static inline void Load_##T(ALfloat *restrict dst, const T *restrict src, \
dst[i] += Sample_##T(src[i*srcstep]); \
}
-DECL_TEMPLATE(ALbyte)
+DECL_TEMPLATE(ALubyte)
DECL_TEMPLATE(ALshort)
DECL_TEMPLATE(ALfloat)
DECL_TEMPLATE(ALmulaw)
@@ -233,7 +233,7 @@ static void LoadSamples(ALfloat *restrict dst, const ALvoid *restrict src, ALint
#define HANDLE_FMT(ET, ST) case ET: Load_##ST(dst, src, srcstep, samples); break
switch(srctype)
{
- HANDLE_FMT(FmtByte, ALbyte);
+ HANDLE_FMT(FmtUByte, ALubyte);
HANDLE_FMT(FmtShort, ALshort);
HANDLE_FMT(FmtFloat, ALfloat);
HANDLE_FMT(FmtMulaw, ALmulaw);