yadif: Only build inline Asm with gcc/clang

This commit is contained in:
Jan Schmidt 2020-01-19 14:50:12 +11:00 committed by GStreamer Merge Bot
parent ef37446460
commit 1986d4f942
2 changed files with 11 additions and 2 deletions

View File

@ -116,7 +116,7 @@ FILTER}
#endif #endif
void yadif_filter (GstYadif * yadif, int parity, int tff); void yadif_filter (GstYadif * yadif, int parity, int tff);
#ifdef HAVE_CPU_X86_64 #if HAVE_CPU_X86_64 && (defined(__GNUC__) || defined(__clang__))
void filter_line_x86_64 (guint8 * dst, void filter_line_x86_64 (guint8 * dst,
guint8 * prev, guint8 * cur, guint8 * next, guint8 * prev, guint8 * cur, guint8 * next,
int w, int prefs, int mrefs, int parity, int mode); int w, int prefs, int mrefs, int parity, int mode);
@ -146,7 +146,7 @@ yadif_filter (GstYadif * yadif, int parity, int tff)
guint8 *next = next_data + y * refs; guint8 *next = next_data + y * refs;
guint8 *dst = dest_data + y * refs; guint8 *dst = dest_data + y * refs;
int mode = ((y == 1) || (y + 2 == h)) ? 2 : yadif->mode; int mode = ((y == 1) || (y + 2 == h)) ? 2 : yadif->mode;
#if HAVE_CPU_X86_64 #if HAVE_CPU_X86_64 && (defined(__GNUC__) || defined(__clang__))
if (0) { if (0) {
filter_line_c (dst, prev, cur, next, w, filter_line_c (dst, prev, cur, next, w,
y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode); y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);

View File

@ -23,14 +23,22 @@
#include <glib.h> #include <glib.h>
#if HAVE_CPU_X86_64 #if HAVE_CPU_X86_64
/* The inline asm is not MSVC compatible */
#if defined(__GNUC__) || defined(__clang__)
typedef struct xmm_reg typedef struct xmm_reg
{ {
guint64 a, b; guint64 a, b;
} xmm_reg; } xmm_reg;
typedef gint64 x86_reg; typedef gint64 x86_reg;
#if defined(_MSC_VER)
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
#define DECLARE_ASM_CONST(n,t,v) static const __declspec(align(n)) t v
#else
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v #define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v
#endif
#if defined(__APPLE__) #if defined(__APPLE__)
# define EXTERN_PREFIX "_" # define EXTERN_PREFIX "_"
@ -105,3 +113,4 @@ filter_line_x86_64 (guint8 * dst,
} }
#endif #endif
#endif