diff options
author | Chris Robinson <[email protected]> | 2017-03-31 06:54:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-03-31 06:54:46 -0700 |
commit | ac8b4aa5f66db68609459a9444c2a7083b2e8f28 (patch) | |
tree | d4f05d86836bcfba85fdb8accee4a95034fbad2d /Alc | |
parent | 9fb07101dc0ab5b7f2785584b4c29e18232ba99c (diff) |
Convert integer samples to float using a power-of-2 divisor
This should cut down on unnecessary quantization noise (however minor) for 8-
and 16-bit samples. Unfortunately a power-of-2 multiple can't be used as easily
for converting float samples to integer, due to integer types having a non-
power-of-2 maximum amplitude (it'd require more per-sample clamping).
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/mixer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index b8f4b91f..88dbde88 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -283,10 +283,10 @@ void aluInitMixer(void) static inline ALfloat Sample_ALbyte(ALbyte val) -{ return val * (1.0f/127.0f); } +{ return val * (1.0f/128.0f); } static inline ALfloat Sample_ALshort(ALshort val) -{ return val * (1.0f/32767.0f); } +{ return val * (1.0f/32768.0f); } static inline ALfloat Sample_ALfloat(ALfloat val) { return val; } |