summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-05-31 14:54:14 +0000
committerjstebbins <[email protected]>2011-05-31 14:54:14 +0000
commit3e09b2c654368291bee42e4529f78504e27b1ddd (patch)
treeac04f3b23f4d43da2849a9cb08ec415b78978e8d /contrib
parent85026f6eab963252b2ff14d5e551c0084534f1ad (diff)
Add patch to disable SSE in mpeg2dec for mingw64
This allows use of mpeg2dec with mingw64. From what I've read, disabling sse in mpeg2dec will result in about 10% speed penalty. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4014 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib')
-rw-r--r--contrib/mpeg2dec/P00-mingw-disable-sse.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/mpeg2dec/P00-mingw-disable-sse.patch b/contrib/mpeg2dec/P00-mingw-disable-sse.patch
new file mode 100644
index 000000000..ee23632b9
--- /dev/null
+++ b/contrib/mpeg2dec/P00-mingw-disable-sse.patch
@@ -0,0 +1,30 @@
+Index: libmpeg2/cpu_accel.c
+===================================================================
+--- mpeg2dec/libmpeg2/cpu_accel.c (revision 1205)
++++ mpeg2dec/libmpeg2/cpu_accel.c (working copy)
+@@ -111,7 +111,13 @@
+
+ cpuid (0x80000000, eax, ebx, ecx, edx);
+ if (eax < 0x80000001) /* no extended capabilities */
+- return accel;
++ {
++#if defined(__x86_64__)
++ // SSE code is broken on mingw64, so disable it.
++ accel &= ~(MPEG2_ACCEL_X86_SSE2|MPEG2_ACCEL_X86_SSE3);
++#endif
++ return accel;
++ }
+
+ cpuid (0x80000001, eax, ebx, ecx, edx);
+
+@@ -120,6 +126,10 @@
+
+ if (AMD && (edx & 0x00400000)) /* AMD MMX extensions */
+ accel |= MPEG2_ACCEL_X86_MMXEXT;
++#if defined(__x86_64__)
++ // SSE code is broken on mingw64, so disable it.
++ accel &= ~(MPEG2_ACCEL_X86_SSE2|MPEG2_ACCEL_X86_SSE3);
++#endif
+ }
+ #endif /* ACCEL_DETECT */
+