README.txt
author Ryan C. Gordon <icculus@icculus.org>
Tue, 15 May 2018 01:04:11 -0400
changeset 11987 0c284754e25b
parent 10890 a2ec89f77e6b
permissions -rw-r--r--
audio: converting int32 to/from float shouldn't use doubles.

The concern is that a massive int sample, like 0x7FFFFFFF, won't fit in a
float32, which doesn't have enough bits to hold a whole number this large,
just to divide it to get a value between 0 and 1.
Previously we would convert to double, to get more bits, do the division, and
cast back to a float, but this is expensive.

Casting to double is more accurate, but it's 2x to 3x slower. Shifting out
the least significant byte of an int32, so it'll definitely fit in a float,
and dividing by 0x7FFFFF is still accurate to about 5 decimal places, and the
difference doesn't appear to be perceptable.
slouken@9025
     1
slouken@9025
     2
                         Simple DirectMedia Layer
slouken@9025
     3
slouken@9025
     4
                                  (SDL)
slouken@9025
     5
slouken@9025
     6
                                Version 2.0
slouken@9025
     7
slouken@9025
     8
---
icculus@10890
     9
https://www.libsdl.org/
slouken@9025
    10
slouken@9025
    11
Simple DirectMedia Layer is a cross-platform development library designed
slouken@9025
    12
to provide low level access to audio, keyboard, mouse, joystick, and graphics
slouken@9025
    13
hardware via OpenGL and Direct3D. It is used by video playback software,
slouken@9025
    14
emulators, and popular games including Valve's award winning catalog
slouken@9025
    15
and many Humble Bundle games.
slouken@9025
    16
slouken@9025
    17
More extensive documentation is available in the docs directory, starting
slouken@9025
    18
with README.md
slouken@9025
    19
slouken@9025
    20
Enjoy!
slouken@9025
    21
	Sam Lantinga				(slouken@libsdl.org)