Simple Directmedia Layer
Find a file
Sam Lantinga afefcbfeba Fixed bug 3876 - Resampling of certain sounds adds heavy distortion
Simon Hug

Patch that adds [-1, 1] clamping to the scalar audio type conversions.

This may come from the SDL_Convert_F32_to_X_Scalar functions. They don't clamp the float value to [-1, 1] and when they cast it to the target integer it may be too large or too small for the type and get truncated, causing horrible noise.

The attached patch throws clamping in, but I don't know if that's the preferred way to fix this. For x86 (without SSE) the compiler (I tested MSVC) seems to throw a horrible amount of x87 code in it. It's a bit better with SSE, but probably still quite the performance hit. And SSE2 uses a branchless approach with maxss and minss.
2017-10-18 19:30:47 -07:00
acinclude
android-project Android Studio code analyzer fixes 2017-10-13 19:55:07 -07:00
build-scripts Updated config.guess and config.sub, added config.sub.patch for NaCl and Emscripten build support 2017-09-09 08:03:23 -07:00
cmake
debian Updated version to 2.0.7 2017-10-12 08:08:04 -07:00
docs
include Added audio stream conversion functions: 2017-10-18 15:54:05 -07:00
src
test Added min/max macros for the sized SDL datatypes 2017-10-16 14:39:56 -07:00
VisualC
VisualC-WinRT
visualtest Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
Xcode
Xcode-iOS
.hgignore
Android.mk
autogen.sh
BUGS.txt
cmake_uninstall.cmake.in
CMakeLists.txt
configure
configure.in
COPYING.txt Updated copyright for 2017 2017-01-01 18:33:28 -08:00
CREDITS.txt
INSTALL.txt
Makefile.in vulkan: Initial Vulkan support! 2017-08-27 22:15:57 -04:00
Makefile.minimal Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
Makefile.pandora
Makefile.psp
Makefile.wiz
README-SDL.txt
README.txt
sdl2-config.cmake.in
sdl2-config.in
sdl2.m4
sdl2.pc.in
SDL2.spec.in
SDL2Config.cmake
TODO.txt
VisualC.html
WhatsNew.txt

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting
with README.md

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)