summaryrefslogtreecommitdiff
path: root/third_party/libopenjpeg20/0012-mct_sse.patch
blob: 9bc2e6f0dc6d551580e0235e23d2c6b02ffd50cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git a/third_party/libopenjpeg20/mct.c b/third_party/libopenjpeg20/mct.c
index b79d4b87c..81ec223d8 100644
--- a/third_party/libopenjpeg20/mct.c
+++ b/third_party/libopenjpeg20/mct.c
@@ -37,13 +37,16 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifdef __SSE__
+#if defined(__SSE__) && !defined(_M_IX86) && !defined(__i386)
+#define USE_SSE
 #include <xmmintrin.h>
 #endif
-#ifdef __SSE2__
+#if defined(__SSE2__) && !defined(_M_IX86) && !defined(__i386)
+#define USE_SSE2
 #include <emmintrin.h>
 #endif
-#ifdef __SSE4_1__
+#if defined(__SSE4_1__) && !defined(_M_IX86) && !defined(__i386)
+#define USE_SSE4
 #include <smmintrin.h>
 #endif
 
@@ -72,7 +75,7 @@ const OPJ_FLOAT64 * opj_mct_get_mct_norms_real()
 /* <summary> */
 /* Forward reversible MCT. */
 /* </summary> */
-#ifdef __SSE2__
+#ifdef USE_SSE2
 void opj_mct_encode(
     OPJ_INT32* OPJ_RESTRICT c0,
     OPJ_INT32* OPJ_RESTRICT c1,
@@ -141,7 +144,7 @@ void opj_mct_encode(
 /* <summary> */
 /* Inverse reversible MCT. */
 /* </summary> */
-#ifdef __SSE2__
+#ifdef USE_SSE2
 void opj_mct_decode(
     OPJ_INT32* OPJ_RESTRICT c0,
     OPJ_INT32* OPJ_RESTRICT c1,
@@ -209,7 +212,7 @@ OPJ_FLOAT64 opj_mct_getnorm(OPJ_UINT32 compno)
 /* <summary> */
 /* Forward irreversible MCT. */
 /* </summary> */
-#ifdef __SSE4_1__
+#ifdef USE_SSE4
 void opj_mct_encode_real(
     OPJ_INT32* OPJ_RESTRICT c0,
     OPJ_INT32* OPJ_RESTRICT c1,
@@ -389,7 +392,7 @@ void opj_mct_decode_real(
     OPJ_SIZE_T n)
 {
     OPJ_UINT32 i;
-#ifdef __SSE__
+#ifdef USE_SSE
     __m128 vrv, vgu, vgv, vbu;
     vrv = _mm_set1_ps(1.402f);
     vgu = _mm_set1_ps(0.34413f);