Bug 1758562 [wpt PR 33115] - Disable first-tier cache for OOFs in nested multicol...
[gecko.git] / media / libsoundtouch / moz-libsoundtouch.patch
blobdc2ea6380433cee9c02a96717acb45c71c320702
1 diff -u /src/cpu_detect_x86.cpp /src/cpu_detect_x86.cpp
2 --- /src/cpu_detect_x86.cpp
3 +++ /src/cpu_detect_x86.cpp
4 @@ -44,9 +44,8 @@
7 #if defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
9 - #if defined(__GNUC__) && defined(__i386__)
10 - // gcc
11 + #if defined(__GNUC__) && defined(HAVE_CPUID_H)
12 + // gcc and clang
13 #include "cpuid.h"
14 #elif defined(_M_IX86)
15 // windows non-gcc
16 @@ -97,18 +96,7 @@
18 uint res = 0;
20 -#if defined(__GNUC__)
21 - // GCC version of cpuid. Requires GCC 4.3.0 or later for __cpuid intrinsic support.
22 - uint eax, ebx, ecx, edx; // unsigned int is the standard type. uint is defined by the compiler and not guaranteed to be portable.
24 - // Check if no cpuid support.
25 - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; // always disable extensions.
27 - if (edx & bit_MMX) res = res | SUPPORT_MMX;
28 - if (edx & bit_SSE) res = res | SUPPORT_SSE;
29 - if (edx & bit_SSE2) res = res | SUPPORT_SSE2;
31 -#else
32 +#if !defined(__GNUC__)
33 // Window / VS version of cpuid. Notice that Visual Studio 2005 or later required
34 // for __cpuid intrinsic support.
35 int reg[4] = {-1};
36 @@ -121,7 +109,19 @@
37 if ((unsigned int)reg[3] & bit_MMX) res = res | SUPPORT_MMX;
38 if ((unsigned int)reg[3] & bit_SSE) res = res | SUPPORT_SSE;
39 if ((unsigned int)reg[3] & bit_SSE2) res = res | SUPPORT_SSE2;
40 +#elif defined(HAVE_CPUID_H)
41 + // GCC version of cpuid. Requires GCC 4.3.0 or later for __cpuid intrinsic support.
42 + uint eax, ebx, ecx, edx; // unsigned int is the standard type. uint is defined by the compiler and not guaranteed to be portable.
44 + // Check if no cpuid support.
45 + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; // always disable extensions.
47 + if (edx & bit_MMX) res = res | SUPPORT_MMX;
48 + if (edx & bit_SSE) res = res | SUPPORT_SSE;
49 + if (edx & bit_SSE2) res = res | SUPPORT_SSE2;
50 +#else
51 + // Compatible with GCC but no cpuid.h.
52 + return 0;
53 #endif
55 return res & ~_dwDisabledISA;
56 diff -u /src/STTypes.h /src/STTypes.h
57 --- /src/STTypes.h
58 +++ /src/STTypes.h
59 @@ -54,12 +54,17 @@
60 #define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 )
63 -#if (defined(__GNUC__) && !defined(ANDROID))
64 - // In GCC, include soundtouch_config.h made by config scritps.
65 - // Skip this in Android compilation that uses GCC but without configure scripts.
66 - #include "soundtouch_config.h"
67 -#endif
68 +#include "soundtouch_config.h"
70 +#if defined(WIN32)
71 +#if defined(BUILDING_SOUNDTOUCH)
72 +#define SOUNDTOUCH_API __declspec(dllexport)
73 +#else
74 +#define SOUNDTOUCH_API __declspec(dllimport)
75 +#endif
76 +#else
77 +#define SOUNDTOUCH_API
78 +#endif
80 namespace soundtouch
82 diff -u /src/SoundTouch.h /src/SoundTouch.h
83 --- /src/SoundTouch.h
84 +++ /src/SoundTouch.h
85 @@ -141,7 +141,7 @@
86 /// tempo/pitch/rate/samplerate settings.
87 #define SETTING_NOMINAL_OUTPUT_SEQUENCE 7
89 -class SoundTouch : public FIFOProcessor
90 +class SOUNDTOUCH_API SoundTouch : public FIFOProcessor
92 private:
93 /// Rate transposer class instance
94 diff -u /src/FIRFilter.cpp /src/FIRFilter.cpp
95 --- /src/FIRFilter.cpp
96 +++ /src/FIRFilter.cpp
97 @@ -291,9 +296,11 @@
99 FIRFilter * FIRFilter::newInstance()
101 +#if defined(SOUNDTOUCH_ALLOW_MMX) || defined(SOUNDTOUCH_ALLOW_SSE)
102 uint uExtensions;
104 uExtensions = detectCPUextensions();
105 +#endif
107 // Check if MMX/SSE instruction set extensions supported by CPU
109 diff -u /src/TDStretch.cpp /src/TDStretch.cpp
110 --- /src/TDStretch.cpp
111 +++ /src/TDStretch.cpp
112 @@ -624,9 +624,11 @@
114 TDStretch * TDStretch::newInstance()
116 +#if defined(SOUNDTOUCH_ALLOW_MMX) || defined(SOUNDTOUCH_ALLOW_SSE)
117 uint uExtensions;
119 uExtensions = detectCPUextensions();
120 +#endif
122 // Check if MMX/SSE instruction set extensions supported by CPU
124 diff -u /src/AAFilter.cpp /src/AAFilter.cpp
125 --- /src/AAFilter.cpp
126 +++ /src/AAFilter.cpp
127 @@ -42,7 +42,7 @@
129 using namespace soundtouch;
131 -#define PI 3.14159265358979323846
132 +#define PI M_PI
133 #define TWOPI (2 * PI)
135 // define this to save AA filter coefficients to a file