|
@@ -0,0 +1,161 @@
|
|
|
|
+diff --git a/libmpeg2/convert/rgb.c b/libmpeg2/convert/rgb.c
|
|
|
|
+index 8863b0b..e266557 100644
|
|
|
|
+--- a/libmpeg2/convert/rgb.c
|
|
|
|
++++ b/libmpeg2/convert/rgb.c
|
|
|
|
+@@ -499,7 +499,7 @@ static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp,
|
|
|
|
+ int convert420 = 0;
|
|
|
|
+ int rgb_stride_min = ((bpp + 7) >> 3) * seq->width;
|
|
|
|
+
|
|
|
|
+-#ifdef ARCH_X86
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && defined(ARCH_X86)
|
|
|
|
+ if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) {
|
|
|
|
+ convert420 = 0;
|
|
|
|
+ copy = mpeg2convert_rgb_mmxext (order, bpp, seq);
|
|
|
|
+diff --git a/libmpeg2/convert/rgb_mmx.c b/libmpeg2/convert/rgb_mmx.c
|
|
|
|
+index 912291c..c29b0ef 100644
|
|
|
|
+--- a/libmpeg2/convert/rgb_mmx.c
|
|
|
|
++++ b/libmpeg2/convert/rgb_mmx.c
|
|
|
|
+@@ -25,7 +25,7 @@
|
|
|
|
+
|
|
|
|
+ #include "config.h"
|
|
|
|
+
|
|
|
|
+-#ifdef ARCH_X86
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && defined(ARCH_X86)
|
|
|
|
+
|
|
|
|
+ #include <stdio.h>
|
|
|
|
+ #include <stdlib.h>
|
|
|
|
+diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c
|
|
|
|
+index 9b24610..b667b34 100644
|
|
|
|
+--- a/libmpeg2/cpu_accel.c
|
|
|
|
++++ b/libmpeg2/cpu_accel.c
|
|
|
|
+@@ -29,7 +29,7 @@
|
|
|
|
+ #include "attributes.h"
|
|
|
|
+ #include "mpeg2_internal.h"
|
|
|
|
+
|
|
|
|
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && (defined(ARCH_X86) || defined(ARCH_X86_64))
|
|
|
|
+ static inline uint32_t arch_accel (uint32_t accel)
|
|
|
|
+ {
|
|
|
|
+ if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT))
|
|
|
|
+@@ -253,7 +253,7 @@ static inline uint32_t arch_accel (uint32_t accel)
|
|
|
|
+
|
|
|
|
+ uint32_t mpeg2_detect_accel (uint32_t accel)
|
|
|
|
+ {
|
|
|
|
+-#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && (defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC))
|
|
|
|
+ accel = arch_accel (accel);
|
|
|
|
+ #endif
|
|
|
|
+ return accel;
|
|
|
|
+diff --git a/libmpeg2/cpu_state.c b/libmpeg2/cpu_state.c
|
|
|
|
+index 2f2f64a..c005783 100644
|
|
|
|
+--- a/libmpeg2/cpu_state.c
|
|
|
|
++++ b/libmpeg2/cpu_state.c
|
|
|
|
+@@ -29,14 +29,14 @@
|
|
|
|
+ #include "mpeg2.h"
|
|
|
|
+ #include "attributes.h"
|
|
|
|
+ #include "mpeg2_internal.h"
|
|
|
|
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && (defined(ARCH_X86) || defined(ARCH_X86_64))
|
|
|
|
+ #include "mmx.h"
|
|
|
|
+ #endif
|
|
|
|
+
|
|
|
|
+ void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
|
|
|
|
+ void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
|
|
|
|
+
|
|
|
|
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && (defined(ARCH_X86) || defined(ARCH_X86_64))
|
|
|
|
+ static void state_restore_mmx (cpu_state_t * state)
|
|
|
|
+ {
|
|
|
|
+ emms ();
|
|
|
|
+@@ -115,7 +115,7 @@ static void state_restore_altivec (cpu_state_t * state)
|
|
|
|
+
|
|
|
|
+ void mpeg2_cpu_state_init (uint32_t accel)
|
|
|
|
+ {
|
|
|
|
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && (defined(ARCH_X86) || defined(ARCH_X86_64))
|
|
|
|
+ if (accel & MPEG2_ACCEL_X86_MMX) {
|
|
|
|
+ mpeg2_cpu_state_restore = state_restore_mmx;
|
|
|
|
+ }
|
|
|
|
+diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c
|
|
|
|
+index 81c57e0..2e7e0c7 100644
|
|
|
|
+--- a/libmpeg2/idct.c
|
|
|
|
++++ b/libmpeg2/idct.c
|
|
|
|
+@@ -235,7 +235,7 @@ static void mpeg2_idct_add_c (const int last, int16_t * block,
|
|
|
|
+
|
|
|
|
+ void mpeg2_idct_init (uint32_t accel)
|
|
|
|
+ {
|
|
|
|
+-#ifdef ARCH_X86
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && defined(ARCH_X86)
|
|
|
|
+ if (accel & MPEG2_ACCEL_X86_SSE2) {
|
|
|
|
+ mpeg2_idct_copy = mpeg2_idct_copy_sse2;
|
|
|
|
+ mpeg2_idct_add = mpeg2_idct_add_sse2;
|
|
|
|
+diff --git a/libmpeg2/idct_mmx.c b/libmpeg2/idct_mmx.c
|
|
|
|
+index 50f8f18..227ec84 100644
|
|
|
|
+--- a/libmpeg2/idct_mmx.c
|
|
|
|
++++ b/libmpeg2/idct_mmx.c
|
|
|
|
+@@ -23,7 +23,7 @@
|
|
|
|
+
|
|
|
|
+ #include "config.h"
|
|
|
|
+
|
|
|
|
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && defined(ARCH_X86)
|
|
|
|
+
|
|
|
|
+ #include <inttypes.h>
|
|
|
|
+
|
|
|
|
+diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c
|
|
|
|
+index 7aed113..7d01059 100644
|
|
|
|
+--- a/libmpeg2/motion_comp.c
|
|
|
|
++++ b/libmpeg2/motion_comp.c
|
|
|
|
+@@ -33,7 +33,7 @@ mpeg2_mc_t mpeg2_mc;
|
|
|
|
+
|
|
|
|
+ void mpeg2_mc_init (uint32_t accel)
|
|
|
|
+ {
|
|
|
|
+-#ifdef ARCH_X86
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && defined(ARCH_X86)
|
|
|
|
+ if (accel & MPEG2_ACCEL_X86_MMXEXT)
|
|
|
|
+ mpeg2_mc = mpeg2_mc_mmxext;
|
|
|
|
+ else if (accel & MPEG2_ACCEL_X86_3DNOW)
|
|
|
|
+diff --git a/libmpeg2/motion_comp_mmx.c b/libmpeg2/motion_comp_mmx.c
|
|
|
|
+index fc265f4..292431d 100644
|
|
|
|
+--- a/libmpeg2/motion_comp_mmx.c
|
|
|
|
++++ b/libmpeg2/motion_comp_mmx.c
|
|
|
|
+@@ -23,7 +23,7 @@
|
|
|
|
+
|
|
|
|
+ #include "config.h"
|
|
|
|
+
|
|
|
|
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
|
|
|
|
++#if (defined(__clang__) || !defined(_MSC_VER)) && defined(ARCH_X86)
|
|
|
|
+
|
|
|
|
+ #include <inttypes.h>
|
|
|
|
+
|
|
|
|
+diff --git a/libvo/video_out_dx.c b/libvo/video_out_dx.c
|
|
|
|
+index 36de68a..ce61c1c 100644
|
|
|
|
+--- a/libvo/video_out_dx.c
|
|
|
|
++++ b/libvo/video_out_dx.c
|
|
|
|
+@@ -82,7 +82,7 @@ static void update_overlay (dx_instance_t * instance)
|
|
|
|
+ dwFlags, &ddofx);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+-static long FAR PASCAL event_procedure (HWND hwnd, UINT message,
|
|
|
|
++static LRESULT FAR PASCAL event_procedure (HWND hwnd, UINT message,
|
|
|
|
+ WPARAM wParam, LPARAM lParam)
|
|
|
|
+ {
|
|
|
|
+ RECT rect_window;
|
|
|
|
+@@ -92,7 +92,7 @@ static long FAR PASCAL event_procedure (HWND hwnd, UINT message,
|
|
|
|
+ switch (message) {
|
|
|
|
+
|
|
|
|
+ case WM_WINDOWPOSCHANGED:
|
|
|
|
+- instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA);
|
|
|
|
++ instance = (dx_instance_t *) GetWindowLongPtr (hwnd, GWLP_USERDATA);
|
|
|
|
+
|
|
|
|
+ /* update the window position and size */
|
|
|
|
+ point_window.x = 0;
|
|
|
|
+@@ -173,7 +173,7 @@ static int create_window (dx_instance_t * instance)
|
|
|
|
+ /* store a directx_instance pointer into the window local storage
|
|
|
|
+ * (for later use in event_handler).
|
|
|
|
+ * We need to use SetWindowLongPtr when it is available in mingw */
|
|
|
|
+- SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance);
|
|
|
|
++ SetWindowLongPtr (instance->window, GWLP_USERDATA, (LONG) instance);
|
|
|
|
+
|
|
|
|
+ ShowWindow (instance->window, SW_SHOW);
|
|
|
|
+
|