diff options
author | Chris Robinson <[email protected]> | 2018-01-19 20:10:31 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-19 20:10:31 -0800 |
commit | ab2295b68f19212ce34cf2b56e81ee80186310f9 (patch) | |
tree | c4036feba34a32a9ec348622459313d04893c19f /Alc/mixer.c | |
parent | 940c6146e832b2226876f3d8fdc3369974ed16e9 (diff) |
Store 8-bit sample types directly as unsigned byte
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 8 |
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); |