From 0e7e8d26f0a96a364a9a195cbb7ac1099756f4b5 Mon Sep 17 00:00:00 2001 From: get <45425365+Minty-Meeo@users.noreply.github.com> Date: Fri, 31 Mar 2023 20:11:13 -0500 Subject: [PATCH] Restore Dolphin-Specific SoundTouch modifications --- Externals/soundtouch/BPMDetect.cpp | 5 ++-- Externals/soundtouch/STTypes.h | 45 +++++++++++++++--------------- Externals/soundtouch/cpu_detect.h | 2 ++ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Externals/soundtouch/BPMDetect.cpp b/Externals/soundtouch/BPMDetect.cpp index 4c11a2e9e4..e09815f595 100644 --- a/Externals/soundtouch/BPMDetect.cpp +++ b/Externals/soundtouch/BPMDetect.cpp @@ -47,8 +47,6 @@ // //////////////////////////////////////////////////////////////////////////////// -#define _USE_MATH_DEFINES - #include #include #include @@ -85,7 +83,8 @@ static const double XCORR_DECAY_TIME_CONSTANT = 30.0; /// Data overlap factor for beat detection algorithm static const int OVERLAP_FACTOR = 4; -static const double TWOPI = (2 * M_PI); +#define PI 3.14159265358979323846 +#define TWOPI (2 * PI) //////////////////////////////////////////////////////////////////////////////// diff --git a/Externals/soundtouch/STTypes.h b/Externals/soundtouch/STTypes.h index 71dd0ebd11..2141d6b0ab 100644 --- a/Externals/soundtouch/STTypes.h +++ b/Externals/soundtouch/STTypes.h @@ -32,37 +32,36 @@ #ifndef STTypes_H #define STTypes_H -typedef unsigned int uint; -typedef unsigned long ulong; - -// Patch for MinGW: on Win64 long is 32-bit -#ifdef _WIN64 - typedef unsigned long long ulongptr; -#else - typedef ulong ulongptr; -#endif - - -// Helper macro for aligning pointer up to next 16-byte boundary -#define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 ) - - #if (defined(__GNUC__) && !defined(ANDROID)) // In GCC, include soundtouch_config.h made by config scritps. // Skip this in Android compilation that uses GCC but without configure scripts. - #include "soundtouch_config.h" + //#include "soundtouch_config.h" #endif namespace soundtouch { + typedef unsigned int uint; + typedef unsigned long ulong; + + // Patch for MinGW: on Win64 long is 32-bit + #ifdef _WIN64 + typedef unsigned long long ulongptr; + #else + typedef ulong ulongptr; + #endif + + + // Helper macro for aligning pointer up to next 16-byte boundary + #define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 ) + /// Max allowed number of channels #define SOUNDTOUCH_MAX_CHANNELS 16 /// Activate these undef's to overrule the possible sampletype /// setting inherited from some other header file: - //#undef SOUNDTOUCH_INTEGER_SAMPLES - //#undef SOUNDTOUCH_FLOAT_SAMPLES + #undef SOUNDTOUCH_INTEGER_SAMPLES + #undef SOUNDTOUCH_FLOAT_SAMPLES /// If following flag is defined, always uses multichannel processing /// routines also for mono and stero sound. This is for routine testing @@ -94,8 +93,8 @@ namespace soundtouch /// However, if you still prefer to select the sample format here /// also in GNU environment, then please #undef the INTEGER_SAMPLE /// and FLOAT_SAMPLE defines first as in comments above. - //#define SOUNDTOUCH_INTEGER_SAMPLES 1 //< 16bit integer samples - #define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples + #define SOUNDTOUCH_INTEGER_SAMPLES 1 //< 16bit integer samples + //#define SOUNDTOUCH_FLOAT_SAMPLES 1 //< 32bit float samples #endif @@ -106,7 +105,7 @@ namespace soundtouch /// routines compiled for whatever reason, you may disable these optimizations /// to make the library compile. - #define SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS 1 + //#define SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS 1 /// In GNU environment, allow the user to override this setting by /// giving the following switch to the configure script: @@ -124,7 +123,7 @@ namespace soundtouch // If defined, allows the SIMD-optimized routines to skip unevenly aligned // memory offsets that can cause performance penalty in some SIMD implementations. // Causes slight compromise in sound quality. - // #define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION 1 + #define SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION 1 #ifdef SOUNDTOUCH_INTEGER_SAMPLES @@ -169,7 +168,7 @@ namespace soundtouch } // define ST_NO_EXCEPTION_HANDLING switch to disable throwing std exceptions: -// #define ST_NO_EXCEPTION_HANDLING 1 + #define ST_NO_EXCEPTION_HANDLING 1 #ifdef ST_NO_EXCEPTION_HANDLING // Exceptions disabled. Throw asserts instead if enabled. #include diff --git a/Externals/soundtouch/cpu_detect.h b/Externals/soundtouch/cpu_detect.h index 0cdc22356f..145712225f 100644 --- a/Externals/soundtouch/cpu_detect.h +++ b/Externals/soundtouch/cpu_detect.h @@ -44,6 +44,8 @@ #define SUPPORT_SSE 0x0008 #define SUPPORT_SSE2 0x0010 +using namespace soundtouch; + /// Checks which instruction set extensions are supported by the CPU. /// /// \return A bitmask of supported extensions, see SUPPORT_... defines.