Repository: libretro/libretro-common Branch: master Commit: e2e3eccfd245 Files: 434 Total size: 4.4 MB Directory structure: gitextract_6fnfu5rl/ ├── .gitignore ├── Makefile.test ├── audio/ │ ├── audio_mix.c │ ├── audio_mixer.c │ ├── conversion/ │ │ ├── float_to_s16.c │ │ ├── float_to_s16_neon.S │ │ ├── float_to_s16_neon.c │ │ ├── mono_to_stereo_float.c │ │ ├── s16_to_float.c │ │ ├── s16_to_float_neon.S │ │ ├── s16_to_float_neon.c │ │ └── stereo_to_mono_float.c │ ├── dsp_filter.c │ ├── dsp_filters/ │ │ ├── BassBoost.dsp │ │ ├── ChipTune-Lowpass.dsp │ │ ├── ChipTuneEnhance.dsp │ │ ├── Chorus.dsp │ │ ├── Crystalizer.dsp │ │ ├── EQ.dsp │ │ ├── Echo.dsp │ │ ├── EchoReverb.dsp │ │ ├── HighShelfDampen.dsp │ │ ├── IIR.dsp │ │ ├── LowPassCPS.dsp │ │ ├── Makefile │ │ ├── Mono.dsp │ │ ├── Panning.dsp │ │ ├── Phaser.dsp │ │ ├── Reverb.dsp │ │ ├── Tremolo.dsp │ │ ├── Vibrato.dsp │ │ ├── WahWah.dsp │ │ ├── chorus.c │ │ ├── configure │ │ ├── crystalizer.c │ │ ├── echo.c │ │ ├── eq.c │ │ ├── fft/ │ │ │ ├── fft.c │ │ │ └── fft.h │ │ ├── iir.c │ │ ├── link.T │ │ ├── panning.c │ │ ├── phaser.c │ │ ├── reverb.c │ │ ├── tremolo.c │ │ ├── vibrato.c │ │ └── wahwah.c │ └── resampler/ │ ├── audio_resampler.c │ └── drivers/ │ ├── nearest_resampler.c │ ├── sinc_resampler.c │ └── sinc_resampler_neon.S ├── cdrom/ │ └── cdrom.c ├── compat/ │ ├── compat_fnmatch.c │ ├── compat_getopt.c │ ├── compat_ifaddrs.c │ ├── compat_posix_string.c │ ├── compat_snprintf.c │ ├── compat_strcasestr.c │ ├── compat_strl.c │ ├── compat_strldup.c │ ├── compat_vscprintf.c │ └── fopen_utf8.c ├── crt/ │ ├── include/ │ │ └── string.h │ └── string.c ├── dynamic/ │ └── dylib.c ├── encodings/ │ ├── encoding_base64.c │ ├── encoding_crc32.c │ └── encoding_utf.c ├── features/ │ └── features_cpu.c ├── file/ │ ├── archive_file.c │ ├── archive_file_7z.c │ ├── archive_file_zlib.c │ ├── archive_file_zstd.c │ ├── config_file.c │ ├── config_file_userdata.c │ ├── file_path.c │ ├── file_path_io.c │ ├── nbio/ │ │ ├── nbio_intf.c │ │ ├── nbio_linux.c │ │ ├── nbio_stdio.c │ │ ├── nbio_unixmmap.c │ │ └── nbio_windowsmmap.c │ └── retro_dirent.c ├── formats/ │ ├── bmp/ │ │ ├── rbmp.c │ │ └── rbmp_encode.c │ ├── cdfs/ │ │ └── cdfs.c │ ├── image_texture.c │ ├── image_transfer.c │ ├── jpeg/ │ │ └── rjpeg.c │ ├── json/ │ │ └── rjson.c │ ├── libchdr/ │ │ ├── libchdr_bitstream.c │ │ ├── libchdr_cdrom.c │ │ ├── libchdr_chd.c │ │ ├── libchdr_flac.c │ │ ├── libchdr_flac_codec.c │ │ ├── libchdr_huffman.c │ │ ├── libchdr_lzma.c │ │ ├── libchdr_zlib.c │ │ └── libchdr_zstd.c │ ├── logiqx_dat/ │ │ └── logiqx_dat.c │ ├── m3u/ │ │ └── m3u_file.c │ ├── png/ │ │ ├── rpng.c │ │ ├── rpng_encode.c │ │ └── rpng_internal.h │ ├── tga/ │ │ └── rtga.c │ ├── wav/ │ │ └── rwav.c │ ├── webp/ │ │ └── rwebp.c │ └── xml/ │ └── rxml.c ├── gfx/ │ ├── gl_capabilities.c │ └── scaler/ │ ├── pixconv.c │ ├── scaler.c │ ├── scaler_filter.c │ └── scaler_int.c ├── glsym/ │ ├── README.md │ ├── glgen.py │ ├── glsym_es2.c │ ├── glsym_es3.c │ ├── glsym_gl.c │ ├── rglgen.c │ ├── rglgen.py │ └── xglgen.py ├── hash/ │ └── lrc_hash.c ├── include/ │ ├── array/ │ │ ├── rbuf.h │ │ └── rhmap.h │ ├── audio/ │ │ ├── audio_mix.h │ │ ├── audio_mixer.h │ │ ├── audio_resampler.h │ │ ├── conversion/ │ │ │ ├── dual_mono.h │ │ │ ├── float_to_s16.h │ │ │ └── s16_to_float.h │ │ └── dsp_filter.h │ ├── boolean.h │ ├── cdrom/ │ │ └── cdrom.h │ ├── clamping.h │ ├── compat/ │ │ ├── apple_compat.h │ │ ├── fnmatch.h │ │ ├── fopen_utf8.h │ │ ├── getopt.h │ │ ├── ifaddrs.h │ │ ├── intrinsics.h │ │ ├── msvc/ │ │ │ └── stdint.h │ │ ├── msvc.h │ │ ├── posix_string.h │ │ ├── strcasestr.h │ │ ├── strl.h │ │ └── zlib/ │ │ ├── zconf.h │ │ └── zlib.h │ ├── defines/ │ │ ├── cocoa_defines.h │ │ ├── d3d_defines.h │ │ ├── gx_defines.h │ │ ├── ps3_defines.h │ │ ├── ps4_defines.h │ │ └── psp_defines.h │ ├── dynamic/ │ │ └── dylib.h │ ├── encodings/ │ │ ├── base64.h │ │ ├── crc32.h │ │ ├── utf.h │ │ └── win32.h │ ├── fastcpy.h │ ├── features/ │ │ └── features_cpu.h │ ├── file/ │ │ ├── archive_file.h │ │ ├── config_file.h │ │ ├── config_file_userdata.h │ │ ├── file_path.h │ │ └── nbio.h │ ├── filters.h │ ├── formats/ │ │ ├── cdfs.h │ │ ├── image.h │ │ ├── logiqx_dat.h │ │ ├── m3u_file.h │ │ ├── rbmp.h │ │ ├── rjpeg.h │ │ ├── rjson.h │ │ ├── rjson_helpers.h │ │ ├── rpng.h │ │ ├── rtga.h │ │ ├── rwav.h │ │ ├── rwebp.h │ │ └── rxml.h │ ├── gfx/ │ │ ├── gl_capabilities.h │ │ ├── math/ │ │ │ ├── matrix_3x3.h │ │ │ ├── matrix_4x4.h │ │ │ ├── vector_2.h │ │ │ ├── vector_3.h │ │ │ └── vector_4.h │ │ ├── scaler/ │ │ │ ├── filter.h │ │ │ ├── pixconv.h │ │ │ ├── scaler.h │ │ │ └── scaler_int.h │ │ └── video_frame.h │ ├── glsym/ │ │ ├── glsym.h │ │ ├── glsym_es2.h │ │ ├── glsym_es3.h │ │ ├── glsym_gl.h │ │ ├── rglgen.h │ │ ├── rglgen_headers.h │ │ ├── rglgen_private_headers.h │ │ └── switch/ │ │ ├── nx_gl.h │ │ └── nx_glsym.h │ ├── libchdr/ │ │ ├── bitstream.h │ │ ├── cdrom.h │ │ ├── chd.h │ │ ├── chdconfig.h │ │ ├── coretypes.h │ │ ├── flac.h │ │ ├── huffman.h │ │ ├── libchdr_zlib.h │ │ ├── libchdr_zstd.h │ │ ├── lzma.h │ │ └── minmax.h │ ├── libco.h │ ├── libretro.h │ ├── libretro_d3d.h │ ├── libretro_d3d11.h │ ├── libretro_d3d12.h │ ├── libretro_dspfilter.h │ ├── libretro_gskit_ps2.h │ ├── libretro_vulkan.h │ ├── lists/ │ │ ├── dir_list.h │ │ ├── file_list.h │ │ ├── linked_list.h │ │ ├── nested_list.h │ │ └── string_list.h │ ├── lrc_hash.h │ ├── math/ │ │ ├── complex.h │ │ ├── float_minmax.h │ │ └── fxp.h │ ├── media/ │ │ └── media_detect_cd.h │ ├── memalign.h │ ├── memmap.h │ ├── net/ │ │ ├── net_compat.h │ │ ├── net_http.h │ │ ├── net_http_parse.h │ │ ├── net_ifinfo.h │ │ ├── net_socket.h │ │ └── net_socket_ssl.h │ ├── playlists/ │ │ └── label_sanitization.h │ ├── queues/ │ │ ├── fifo_queue.h │ │ ├── generic_queue.h │ │ ├── message_queue.h │ │ └── task_queue.h │ ├── retro_assert.h │ ├── retro_atomic.h │ ├── retro_common.h │ ├── retro_common_api.h │ ├── retro_dirent.h │ ├── retro_endianness.h │ ├── retro_environment.h │ ├── retro_inline.h │ ├── retro_math.h │ ├── retro_miscellaneous.h │ ├── retro_spsc.h │ ├── retro_timers.h │ ├── rthreads/ │ │ ├── async_job.h │ │ ├── rthreads.h │ │ └── tpool.h │ ├── streams/ │ │ ├── chd_stream.h │ │ ├── file_stream.h │ │ ├── file_stream_transforms.h │ │ ├── interface_stream.h │ │ ├── memory_stream.h │ │ ├── network_stream.h │ │ ├── rzip_stream.h │ │ ├── stdin_stream.h │ │ └── trans_stream.h │ ├── string/ │ │ └── stdstring.h │ ├── time/ │ │ └── rtime.h │ ├── utils/ │ │ └── md5.h │ ├── vfs/ │ │ ├── vfs.h │ │ ├── vfs_implementation.h │ │ ├── vfs_implementation_cdrom.h │ │ └── vfs_implementation_saf.h │ └── vulkan/ │ └── vulkan_symbol_wrapper.h ├── libco/ │ ├── aarch64.c │ ├── amd64.c │ ├── armeabi.c │ ├── fiber.c │ ├── genode.cpp │ ├── libco.c │ ├── ppc.c │ ├── ps2.c │ ├── ps3.S │ ├── psp1.c │ ├── psp2.c │ ├── scefiber.c │ ├── sjlj.c │ ├── ucontext.c │ └── x86.c ├── lists/ │ ├── dir_list.c │ ├── file_list.c │ ├── linked_list.c │ ├── nested_list.c │ ├── string_list.c │ └── vector_list.c ├── media/ │ └── media_detect_cd.c ├── memmap/ │ ├── memalign.c │ └── memmap.c ├── net/ │ ├── cacert.h │ ├── net_compat.c │ ├── net_http.c │ ├── net_http_parse.c │ ├── net_ifinfo.c │ ├── net_socket.c │ ├── net_socket_ssl_bear.c │ └── net_socket_ssl_mbed.c ├── playlists/ │ └── label_sanitization.c ├── queues/ │ ├── fifo_queue.c │ ├── generic_queue.c │ ├── message_queue.c │ ├── retro_spsc.c │ └── task_queue.c ├── rthreads/ │ ├── ctr_pthread.h │ ├── gx_pthread.h │ ├── psp_pthread.h │ ├── rthreads.c │ ├── tpool.c │ └── xenon_sdl_threads.c ├── samples/ │ ├── atomic/ │ │ ├── retro_atomic_extern_c_linkage/ │ │ │ ├── Makefile │ │ │ └── retro_atomic_extern_c_linkage_test.cpp │ │ └── retro_atomic_test/ │ │ ├── Makefile │ │ └── retro_atomic_test.c │ ├── compat/ │ │ ├── fnmatch/ │ │ │ ├── Makefile │ │ │ └── compat_fnmatch_test.c │ │ └── snprintf/ │ │ ├── Makefile │ │ └── snprintf_test.c │ ├── core_options/ │ │ ├── README.md │ │ ├── example_categories/ │ │ │ ├── conversion_scripts/ │ │ │ │ ├── core_option_regex.py │ │ │ │ └── v1_to_v2_converter.py │ │ │ ├── libretro_core_options.h │ │ │ └── libretro_core_options_intl.h │ │ ├── example_default/ │ │ │ ├── libretro_core_options.h │ │ │ └── libretro_core_options_intl.h │ │ ├── example_hide_option/ │ │ │ ├── libretro_core_options.h │ │ │ └── libretro_core_options_intl.h │ │ └── example_translation/ │ │ ├── .github/ │ │ │ └── workflows/ │ │ │ ├── crowdin_initial_setup.yml │ │ │ ├── crowdin_source_upload.yml │ │ │ └── crowdin_translation_sync.yml │ │ ├── instructions.txt │ │ ├── intl/ │ │ │ ├── .gitignore │ │ │ ├── activate.py │ │ │ ├── core_option_regex.py │ │ │ ├── core_option_translation.py │ │ │ ├── crowdin.yaml │ │ │ ├── crowdin_prep.py │ │ │ ├── crowdin_source_upload.py │ │ │ ├── crowdin_translate.py │ │ │ ├── crowdin_translation_download.py │ │ │ ├── download_workflow.py │ │ │ ├── initial_sync.py │ │ │ ├── remove_initial_cycle.py │ │ │ ├── upload_workflow.py │ │ │ └── v1_to_v2_converter.py │ │ ├── libretro_core_options.h │ │ └── libretro_core_options_intl.h │ ├── encodings/ │ │ └── base64/ │ │ ├── Makefile │ │ └── unbase64_test.c │ ├── file/ │ │ ├── archive_file/ │ │ │ ├── Makefile │ │ │ └── archive_zip_test.c │ │ ├── archive_zstd/ │ │ │ ├── Makefile │ │ │ └── archive_zstd_test.c │ │ ├── config_file/ │ │ │ ├── Makefile │ │ │ └── config_file_test.c │ │ ├── file_path/ │ │ │ ├── Makefile │ │ │ ├── fill_pathname_test.c │ │ │ └── path_resolve_realpath_test.c │ │ ├── nbio/ │ │ │ ├── Makefile │ │ │ └── nbio_test.c │ │ ├── vfs/ │ │ │ ├── Makefile │ │ │ └── vfs_read_overflow_test.c │ │ └── vfs_cdrom/ │ │ ├── Makefile │ │ └── cdrom_cuesheet_overflow_test.c │ ├── formats/ │ │ ├── bmp/ │ │ │ ├── Makefile │ │ │ └── rbmp_test.c │ │ ├── cdfs/ │ │ │ ├── Makefile │ │ │ └── cdfs_dir_record_test.c │ │ ├── json/ │ │ │ ├── Makefile │ │ │ └── rjson_test.c │ │ ├── png/ │ │ │ ├── Makefile │ │ │ ├── rpng_chunk_overflow_test.c │ │ │ ├── rpng_roundtrip_test.c │ │ │ └── rpng_test.c │ │ ├── tga/ │ │ │ ├── Makefile │ │ │ └── rtga_test.c │ │ └── xml/ │ │ ├── Makefile │ │ └── rxml_test.c │ ├── net/ │ │ ├── Makefile │ │ ├── net_http_parse_test.c │ │ ├── net_http_test.c │ │ ├── net_ifinfo_test.c │ │ └── udp-test.c │ ├── queues/ │ │ ├── retro_spsc_test/ │ │ │ ├── Makefile │ │ │ └── retro_spsc_test.c │ │ └── task_queue_title_error_test/ │ │ ├── Makefile │ │ └── task_queue_title_error_test.c │ ├── rthreads/ │ │ └── tpool_wait_test/ │ │ ├── Makefile │ │ └── tpool_wait_test.c │ ├── streams/ │ │ ├── chd/ │ │ │ ├── Makefile │ │ │ └── chd_meta_overflow_test.c │ │ └── rzip/ │ │ ├── Makefile │ │ ├── rzip.c │ │ └── rzip_chunk_size_test.c │ └── string/ │ ├── strlcpy_append/ │ │ ├── Makefile │ │ └── strlcpy_append_test.c │ └── word_wrap_overflow_test/ │ ├── Makefile │ └── word_wrap_overflow_test.c ├── streams/ │ ├── chd_stream.c │ ├── file_stream.c │ ├── file_stream_transforms.c │ ├── interface_stream.c │ ├── memory_stream.c │ ├── network_stream.c │ ├── rzip_stream.c │ ├── stdin_stream.c │ ├── trans_stream.c │ ├── trans_stream_pipe.c │ └── trans_stream_zlib.c ├── string/ │ └── stdstring.c ├── test/ │ ├── formats/ │ │ └── test_rpng.c │ ├── hash/ │ │ └── test_hash.c │ ├── lists/ │ │ └── test_linked_list.c │ ├── queues/ │ │ └── test_generic_queue.c │ ├── string/ │ │ └── test_stdstring.c │ └── utils/ │ └── test_utils.c ├── time/ │ └── rtime.c ├── utils/ │ ├── md5.c │ └── sha1.c ├── vfs/ │ ├── saf/ │ │ └── src/ │ │ └── com/ │ │ └── libretro/ │ │ └── common/ │ │ └── vfs/ │ │ └── VfsImplementationSaf.java │ ├── vfs_implementation.c │ ├── vfs_implementation_cdrom.c │ ├── vfs_implementation_saf.c │ ├── vfs_implementation_smb.c │ ├── vfs_implementation_smb.h │ └── vfs_implementation_uwp.cpp └── vulkan/ └── vulkan_symbol_wrapper.c ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ glsm/ *.[od] *.dll *.so *.dylib *.exe ================================================ FILE: Makefile.test ================================================ OBJDIR = ../obj-unix TEST_UNIT_CFLAGS = $(CFLAGS) -Iinclude $(LDFLAGS) -lcheck $(LIBCHECK_CFLAGS) -Werror -Wdeclaration-after-statement -fsanitize=address -fsanitize=undefined -ftest-coverage -fprofile-arcs -ggdb TEST_GENERIC_QUEUE = test/queues/test_generic_queue TEST_GENERIC_QUEUE_SRC = test/queues/test_generic_queue.c queues/generic_queue.c TEST_LINKED_LIST = test/lists/test_linked_list TEST_LINKED_LIST_SRC = test/lists/test_linked_list.c lists/linked_list.c TEST_STDSTRING = test/string/test_stdstring TEST_STDSTRING_SRC = test/string/test_stdstring.c string/stdstring.c encodings/encoding_utf.c \ compat/compat_strl.c TEST_UTILS = test/utils/test_utils TEST_UTILS_SRC = test/utils/test_utils.c utils/md5.c encodings/encoding_crc32.c \ streams/file_stream.c vfs/vfs_implementation.c file/file_path.c \ compat/compat_strl.c time/rtime.c string/stdstring.c encodings/encoding_utf.c TEST_HASH = test/hash/test_hash TEST_HASH_SRC = test/hash/test_hash.c hash/lrc_hash.c \ streams/file_stream.c vfs/vfs_implementation.c file/file_path.c \ compat/compat_strl.c time/rtime.c string/stdstring.c encodings/encoding_utf.c TEST_RPNG = test/formats/test_rpng TEST_RPNG_SRC = test/formats/test_rpng.c formats/png/rpng.c \ streams/trans_stream.c streams/trans_stream_zlib.c \ streams/trans_stream_pipe.c TEST_RPNG_LIBS = -lz all: # Build and execute tests in order, to avoid coverage file collision # string $(CC) $(TEST_UNIT_CFLAGS) $(TEST_STDSTRING_SRC) -o $(TEST_STDSTRING) $(TEST_STDSTRING) lcov -c -d . -o `dirname $(TEST_STDSTRING)`/coverage.info # utils $(CC) $(TEST_UNIT_CFLAGS) $(TEST_UTILS_SRC) -o $(TEST_UTILS) $(TEST_UTILS) lcov -c -d . -o `dirname $(TEST_UTILS)`/coverage.info # utils $(CC) $(TEST_UNIT_CFLAGS) $(TEST_HASH_SRC) -o $(TEST_HASH) $(TEST_HASH) lcov -c -d . -o `dirname $(TEST_HASH)`/coverage.info # list $(CC) $(TEST_UNIT_CFLAGS) $(TEST_LINKED_LIST_SRC) -o $(TEST_LINKED_LIST) $(TEST_LINKED_LIST) lcov -c -d . -o `dirname $(TEST_LINKED_LIST)`/coverage.info # queue $(CC) $(TEST_UNIT_CFLAGS) $(TEST_GENERIC_QUEUE_SRC) -o $(TEST_GENERIC_QUEUE) $(TEST_GENERIC_QUEUE) lcov -c -d . -o `dirname $(TEST_GENERIC_QUEUE)`/coverage.info # rpng $(CC) $(TEST_UNIT_CFLAGS) $(TEST_RPNG_SRC) $(TEST_RPNG_LIBS) -o $(TEST_RPNG) $(TEST_RPNG) lcov -c -d . -o `dirname $(TEST_RPNG)`/coverage.info lcov -o test/coverage.info \ -a test/utils/coverage.info \ -a test/string/coverage.info \ -a test/lists/coverage.info \ -a test/queues/coverage.info \ -a test/formats/coverage.info genhtml -o test/coverage/ test/coverage.info clean: rm -f *.gcda *.gcno ================================================ FILE: audio/audio_mix.c ================================================ /* Copyright (C) 2010-2020 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (audio_mix.c). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #if defined(__SSE2__) #include #elif defined(__ALTIVEC__) #include #endif #include #include