]> granicus.if.org Git - handbrake/commitdiff
Add patch to disable SSE in mpeg2dec for mingw64
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 31 May 2011 14:54:14 +0000 (14:54 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 31 May 2011 14:54:14 +0000 (14:54 +0000)
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

contrib/mpeg2dec/P00-mingw-disable-sse.patch [new file with mode: 0644]

diff --git a/contrib/mpeg2dec/P00-mingw-disable-sse.patch b/contrib/mpeg2dec/P00-mingw-disable-sse.patch
new file mode 100644 (file)
index 0000000..ee23632
--- /dev/null
@@ -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 */