[MPlayer-dev-eng] [Patch] mpcodec: Use XXX_INLINE defines for inline asm

Matt Oliver protogonoi at gmail.com
Fri Nov 7 13:33:40 CET 2014


This patch is based on one supplied to FFmpeg devel. Currently the mpcodec
code uses pre-processor defines such as HAVE_MMX for inline asm, given
mplayer and ffmpeg have a HAVE_MMX_INLINE define specific for inline asm
then the preprocessors can be changed to the _INLINE variants which were
made for this purpose.

This allows for proper compilation on architectures where things like MMX
are available but inline asm isnt and is required for compiling mpcodec
with compilers that dont support inline asm (such as msvc as used by
FFmpeg).

This patch updates all sections in mpcodecs not just those used by FFmpeg
in order to keep everything consistent. Let me know what you think.
-------------- next part --------------
Index: libmpcodecs/ad_ffmpeg.c
===================================================================
--- libmpcodecs/ad_ffmpeg.c	(revision 37324)
+++ libmpcodecs/ad_ffmpeg.c	(working copy)
@@ -225,7 +225,7 @@
 {
     size_t s, c, o = 0;
 
-#if HAVE_NEON
+#if HAVE_NEON_INLINE
     if (nb_channels == 2 && bps == 4) {
         const unsigned char *src0 = src[0];
         const unsigned char *src1 = src[1];
Index: libmpcodecs/dec_video.c
===================================================================
--- libmpcodecs/dec_video.c	(revision 37324)
+++ libmpcodecs/dec_video.c	(working copy)
@@ -429,9 +429,9 @@
 
     // some codecs are broken, and doesn't restore MMX state :(
     // it happens usually with broken/damaged files.
-    if (HAVE_AMD3DNOW && gCpuCaps.has3DNow) {
+    if (HAVE_AMD3DNOW_INLINE && gCpuCaps.has3DNow) {
         __asm__ volatile ("femms\n\t":::"memory");
-    } else if (HAVE_MMX && gCpuCaps.hasMMX) {
+    } else if (HAVE_MMX_INLINE && gCpuCaps.hasMMX) {
         __asm__ volatile ("emms\n\t":::"memory");
     }
 
Index: libmpcodecs/pullup.c
===================================================================
--- libmpcodecs/pullup.c	(revision 37324)
+++ libmpcodecs/pullup.c	(working copy)
@@ -27,7 +27,7 @@
 
 
 #if ARCH_X86
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
 {
     int ret;
@@ -785,7 +785,7 @@
         c->comb = licomb_y;
         c->var = var_y;
 #if ARCH_X86
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
         if (c->cpu & PULLUP_CPU_MMX) {
             c->diff = diff_y_mmx;
             c->comb = licomb_y_mmx;
Index: libmpcodecs/vf_ass.c
===================================================================
--- libmpcodecs/vf_ass.c	(revision 37324)
+++ libmpcodecs/vf_ass.c	(working copy)
@@ -61,7 +61,7 @@
 /* map 0 - 0xFF -> 0 - 0x10101 */
 #define MAP_24BIT(v) RSHIFT(0x10203 * (v), 8)
 
-#if HAVE_SSE4
+#if HAVE_SSE4_INLINE
 
 DECLARE_ASM_CONST(16, uint32_t, sse_int32_80h[4])
     = { 0x80, 0x80, 0x80, 0x80 };
@@ -68,7 +68,7 @@
 DECLARE_ASM_CONST(16, uint32_t, sse_int32_map_factor[4])
     = { 0x102, 0x102, 0x102, 0x102 };
 
-#endif // HAVE_SSE4
+#endif // HAVE_SSE4_INLINE
 
 static const struct vf_priv_s {
     int outh, outw;
@@ -205,7 +205,7 @@
     }
 }
 
-#if HAVE_SSE4
+#if HAVE_SSE4_INLINE
 
 static void render_frame_yuv422_sse4(vf_instance_t *vf)
 {
@@ -316,7 +316,7 @@
     }
 }
 
-#endif // HAVE_SSE4
+#endif // HAVE_SSE4_INLINE
 
 static void prepare_buffer_420p(vf_instance_t *vf)
 {
@@ -345,7 +345,7 @@
         }
     }
 
-#if HAVE_SSE4
+#if HAVE_SSE4_INLINE
     // for render_frame_yuv420p_sse4
     if (gCpuCaps.hasSSE4 && outw % 32 == 0) {
         for (i = 0; i < outh; i += 2) {
@@ -365,7 +365,7 @@
             }
         }
     }
-#endif // HAVE_SSE4
+#endif // HAVE_SSE4_INLINE
 }
 
 static void render_frame_yuv420p(vf_instance_t *vf)
@@ -417,7 +417,7 @@
     }
 }
 
-#if HAVE_SSE4
+#if HAVE_SSE4_INLINE
 
 #define CHECK_16_ALPHA \
     "cmpl   $-1,     0(%[alpha], %[j], 1) \n\t" \
@@ -560,7 +560,7 @@
 #undef MAP_16_ALPHA
 #undef MUL_ALPHA
 
-#endif // HAVE_SSE4
+#endif // HAVE_SSE4_INLINE
 
 static void clean_buffer(vf_instance_t *vf)
 {
@@ -628,7 +628,7 @@
         vf->priv->draw_image = draw_image_yuv;
         vf->priv->render_frame = render_frame_yuv420p;
         vf->priv->prepare_buffer = prepare_buffer_420p;
-#if HAVE_SSE4
+#if HAVE_SSE4_INLINE
         if (gCpuCaps.hasSSE4 && outw % 32 == 0)
             vf->priv->render_frame = render_frame_yuv420p_sse4;
 #endif
@@ -641,7 +641,7 @@
         vf->priv->draw_image = draw_image_yuv;
         vf->priv->render_frame = render_frame_yuv422;
         vf->priv->prepare_buffer = prepare_buffer_422;
-#if HAVE_SSE4
+#if HAVE_SSE4_INLINE
         if (gCpuCaps.hasSSE4 && outw % 8 == 0)
             vf->priv->render_frame = render_frame_yuv422_sse4;
 #endif
Index: libmpcodecs/vf_decimate.c
===================================================================
--- libmpcodecs/vf_decimate.c	(revision 37324)
+++ libmpcodecs/vf_decimate.c	(working copy)
@@ -37,7 +37,7 @@
     int max, last, cnt;
 };
 
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
+#if HAVE_MMX_INLINE && HAVE_EBX_AVAILABLE
 static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
 {
     volatile short out[4];
@@ -182,7 +182,7 @@
     p->frac = 0.33;
     if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac);
     diff = diff_C;
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
+#if HAVE_MMX_INLINE && HAVE_EBX_AVAILABLE
     if(gCpuCaps.hasMMX) diff = diff_MMX;
 #endif
     return 1;
Index: libmpcodecs/vf_divtc.c
===================================================================
--- libmpcodecs/vf_divtc.c	(revision 37324)
+++ libmpcodecs/vf_divtc.c	(working copy)
@@ -52,7 +52,7 @@
  * diff_MMX and diff_C stolen from vf_decimate.c
  */
 
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
+#if HAVE_MMX_INLINE && HAVE_EBX_AVAILABLE
 static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
    {
    volatile short out[4];
@@ -703,7 +703,7 @@
       goto nomem;
 
    diff = diff_C;
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
+#if HAVE_MMX_INLINE && HAVE_EBX_AVAILABLE
    if(gCpuCaps.hasMMX) diff = diff_MMX;
 #endif
 
Index: libmpcodecs/vf_eq.c
===================================================================
--- libmpcodecs/vf_eq.c	(revision 37324)
+++ libmpcodecs/vf_eq.c	(working copy)
@@ -44,7 +44,7 @@
   0
 };
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
                     int w, int h, int brightness, int contrast)
 {
@@ -227,7 +227,7 @@
         vf->uninit=uninit;
 
         process = process_C;
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
         if(gCpuCaps.hasMMX) process = process_MMX;
 #endif
 
Index: libmpcodecs/vf_eq2.c
===================================================================
--- libmpcodecs/vf_eq2.c	(revision 37324)
+++ libmpcodecs/vf_eq2.c	(working copy)
@@ -120,7 +120,7 @@
   par->lut_clean = 1;
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static
 void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
   unsigned w, unsigned h, unsigned dstride, unsigned sstride)
@@ -289,7 +289,7 @@
   if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
     par->adjust = NULL;
   }
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
   else if (par->g == 1.0 && gCpuCaps.hasMMX) {
     par->adjust = &affine_1d_MMX;
   }
Index: libmpcodecs/vf_filmdint.c
===================================================================
--- libmpcodecs/vf_filmdint.c	(revision 37324)
+++ libmpcodecs/vf_filmdint.c	(working copy)
@@ -449,7 +449,7 @@
                     int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
-#if !HAVE_AMD3DNOW
+#if !HAVE_AMD3DNOW_INLINE
     mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_3dnow: internal error\n");
 #else
     static const unsigned long long ones = 0x0101010101010101ull;
@@ -478,7 +478,7 @@
                    int lines, struct vf_priv_s *p, struct frame_stats *s)
 {
     struct metrics tm;
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
     mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_mmx2: internal error\n");
 #else
     static const unsigned long long ones = 0x0101010101010101ull;
@@ -607,7 +607,7 @@
 dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
                     long cos, int ds, int ss, int w, int t)
 {
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
     mp_msg(MSGT_VFILTER, MSGL_FATAL, "dint_copy_line_mmx2: internal error\n");
     return 0;
 #else
@@ -1438,10 +1438,10 @@
     }
     if (p->mmx2 > 2)
         p->mmx2 = 0;
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
     p->mmx2 = 0;
 #endif
-#if !HAVE_AMD3DNOW
+#if !HAVE_AMD3DNOW_INLINE
     p->mmx2 &= 1;
 #endif
     p->thres.odd  = p->thres.even;
Index: libmpcodecs/vf_fspp.c
===================================================================
--- libmpcodecs/vf_fspp.c	(revision 37324)
+++ libmpcodecs/vf_fspp.c	(working copy)
@@ -101,7 +101,7 @@
 };
 
 
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
 
 //This func reads from 1 slice, 1 and clears 0 & 1
 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
@@ -177,7 +177,7 @@
 #define row_idct_s row_idct_c
 #define row_fdct_s row_fdct_c
 
-#else /* HAVE_MMX */
+#else /* HAVE_MMX_INLINE */
 
 //This func reads from 1 slice, 1 and clears 0 & 1
 static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long src_stride, long width, long height, long log2_scale)
@@ -404,7 +404,7 @@
 #define column_fidct_s column_fidct_mmx
 #define row_idct_s row_idct_mmx
 #define row_fdct_s row_fdct_mmx
-#endif // HAVE_MMX
+#endif // HAVE_MMX_INLINE
 
 static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src,
                    int dst_stride, int src_stride,
@@ -563,10 +563,10 @@
         }
     }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
     if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
     return vf_next_put_image(vf,dmpi, pts);
@@ -707,7 +707,7 @@
 #define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
 #define DESCALE(x,n)  (((x) + (1 << ((n)-1))) >> n)
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 
 DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_382683433)=FIX64(0.382683433, 14);
 DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_541196100)=FIX64(0.541196100, 14);
@@ -728,7 +728,7 @@
 DECLARE_ASM_CONST(8, uint64_t, MM_DESCALE_RND)=C64(4);
 DECLARE_ASM_CONST(8, uint64_t, MM_2)=C64(2);
 
-#else /* !HAVE_MMX */
+#else /* !HAVE_MMXEXT_INLINE */
 
 typedef int32_t int_simd16_t;
 static const int16_t FIX_0_382683433=FIX(0.382683433, 14);
@@ -743,7 +743,7 @@
 
 #endif
 
-#if !HAVE_MMX
+#if !HAVE_MMXEXT_INLINE
 
 static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt)
 {
@@ -868,7 +868,7 @@
     }
 }
 
-#else /* HAVE_MMX */
+#else /* HAVE_MMX_INLINE */
 
 static void column_fidct_mmx(int16_t* thr_adr,  int16_t *data,  int16_t *output,  int cnt)
 {
@@ -1605,9 +1605,9 @@
         );
 }
 
-#endif // HAVE_MMX
+#endif // HAVE_MMX_INLINE
 
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
 
 static void row_idct_c(int16_t* workspace,
                        int16_t* output_adr, int output_stride, int cnt)
@@ -1672,7 +1672,7 @@
     }
 }
 
-#else /* HAVE_MMX */
+#else /* HAVE_MMX_INLINE */
 
 static void row_idct_mmx (int16_t* workspace,
                           int16_t* output_adr,  int output_stride,  int cnt)
@@ -1876,9 +1876,9 @@
         );
 }
 
-#endif // HAVE_MMX
+#endif // HAVE_MMX_INLINE
 
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
 
 static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int cnt)
 {
@@ -1941,7 +1941,7 @@
     }
 }
 
-#else /* HAVE_MMX */
+#else /* HAVE_MMX_INLINE */
 
 static void row_fdct_mmx(int16_t *data,  const uint8_t *pixels,  int line_size,  int cnt)
 {
@@ -2121,4 +2121,4 @@
         : "%"REG_d);
 }
 
-#endif // HAVE_MMX
+#endif // HAVE_MMX_INLINE
Index: libmpcodecs/vf_gradfun.c
===================================================================
--- libmpcodecs/vf_gradfun.c	(revision 37324)
+++ libmpcodecs/vf_gradfun.c	(working copy)
@@ -93,7 +93,7 @@
     }
 }
 
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
 static void filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc,
                              int width, int thresh, const uint16_t *dithers)
 {
@@ -142,7 +142,7 @@
 }
 #endif
 
-#if HAVE_SSSE3
+#if HAVE_SSSE3_INLINE
 static void filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc,
                               int width, int thresh, const uint16_t *dithers)
 {
@@ -188,9 +188,9 @@
         :"memory"
     );
 }
-#endif // HAVE_SSSE3
+#endif // HAVE_SSSE3_INLINE
 
-#if HAVE_SSE2 && HAVE_6REGS
+#if HAVE_SSE2_INLINE && HAVE_6REGS
 #define BLURV(load)\
     intptr_t x = -2*width;\
     __asm__ volatile(\
@@ -233,7 +233,7 @@
         BLURV("movdqa");
     }
 }
-#endif // HAVE_6REGS && HAVE_SSE2
+#endif // HAVE_6REGS && HAVE_SSE2_INLINE
 
 static void filter(struct vf_priv_s *ctx, uint8_t *dst, uint8_t *src,
                    int width, int height, int dstride, int sstride, int r)
@@ -387,15 +387,15 @@
 
     vf->priv->blur_line = blur_line_c;
     vf->priv->filter_line = filter_line_c;
-#if HAVE_SSE2 && HAVE_6REGS
+#if HAVE_SSE2_INLINE && HAVE_6REGS
     if (gCpuCaps.hasSSE2)
         vf->priv->blur_line = blur_line_sse2;
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
     if (gCpuCaps.hasMMX2)
         vf->priv->filter_line = filter_line_mmx2;
 #endif
-#if HAVE_SSSE3
+#if HAVE_SSSE3_INLINE
     if (gCpuCaps.hasSSSE3)
         vf->priv->filter_line = filter_line_ssse3;
 #endif
Index: libmpcodecs/vf_halfpack.c
===================================================================
--- libmpcodecs/vf_halfpack.c	(revision 37324)
+++ libmpcodecs/vf_halfpack.c	(working copy)
@@ -38,7 +38,7 @@
 	struct SwsContext *ctx;
 };
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
 		     int dststride, int srcstride[3],
 		     int w, int h)
@@ -238,7 +238,7 @@
 	if (args) sscanf(args, "%d", &vf->priv->field);
 
 	halfpack = halfpack_C;
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 	if(gCpuCaps.hasMMX) halfpack = halfpack_MMX;
 #endif
 	return 1;
Index: libmpcodecs/vf_ilpack.c
===================================================================
--- libmpcodecs/vf_ilpack.c	(revision 37324)
+++ libmpcodecs/vf_ilpack.c	(working copy)
@@ -78,7 +78,7 @@
     }
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
     unsigned char *u, unsigned char *v, int w,
     int av_unused us, int av_unused vs)
@@ -420,7 +420,7 @@
     pack_nn = pack_nn_C;
     pack_li_0 = pack_li_0_C;
     pack_li_1 = pack_li_1_C;
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX) {
         pack_nn = pack_nn_MMX;
 #if HAVE_EBX_AVAILABLE
Index: libmpcodecs/vf_ivtc.c
===================================================================
--- libmpcodecs/vf_ivtc.c	(revision 37324)
+++ libmpcodecs/vf_ivtc.c	(working copy)
@@ -58,7 +58,7 @@
     F_SHOW
 };
 
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
+#if HAVE_MMX_INLINE && HAVE_EBX_AVAILABLE
 static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
 {
     int i;
@@ -534,7 +534,7 @@
     p->first = 1;
     if (args) sscanf(args, "%d", &p->drop);
     block_diffs = block_diffs_C;
-#if HAVE_MMX && HAVE_EBX_AVAILABLE
+#if HAVE_MMX_INLINE && HAVE_EBX_AVAILABLE
     if(gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
 #endif
     return 1;
Index: libmpcodecs/vf_noise.c
===================================================================
--- libmpcodecs/vf_noise.c	(revision 37324)
+++ libmpcodecs/vf_noise.c	(working copy)
@@ -147,7 +147,7 @@
 
 /***************************************************************************/
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
         x86_reg mmx_len= len&(~7);
         noise+=shift;
@@ -176,7 +176,7 @@
 #endif
 
 //duplicate of previous except movntq
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
         x86_reg mmx_len= len&(~7);
         noise+=shift;
@@ -218,7 +218,7 @@
 
 /***************************************************************************/
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
         x86_reg mmx_len= len&(~7);
 
@@ -358,10 +358,10 @@
 
         vf_clone_mpi_attributes(dmpi, mpi);
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
         if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
         if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -449,13 +449,13 @@
     }
 
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX){
         lineNoise= lineNoise_MMX;
         lineNoiseAvg= lineNoiseAvg_MMX;
     }
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
     if(gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2;
 //    if(gCpuCaps.hasMMX) lineNoiseAvg= lineNoiseAvg_MMX2;
 #endif
Index: libmpcodecs/vf_pp7.c
===================================================================
--- libmpcodecs/vf_pp7.c	(revision 37324)
+++ libmpcodecs/vf_pp7.c	(working copy)
@@ -155,7 +155,7 @@
     }
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void dctB_mmx(int16_t *dst, int16_t *src){
     __asm__ volatile (
         "movq  (%0), %%mm0      \n\t"
@@ -397,10 +397,10 @@
         memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
     }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
     if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -464,7 +464,7 @@
         case 2: requantize= mediumthresh_c; break;
     }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX){
         dctB= dctB_mmx;
     }
Index: libmpcodecs/vf_scale.c
===================================================================
--- libmpcodecs/vf_scale.c	(revision 37324)
+++ libmpcodecs/vf_scale.c	(working copy)
@@ -599,7 +599,7 @@
         static int firstTime=1;
         *flags=0;
 
-#if ARCH_X86
+#if ARCH_X86 && HAVE_MMX_INLINE
         if(gCpuCaps.hasMMX)
                 __asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
 #endif
Index: libmpcodecs/vf_spp.c
===================================================================
--- libmpcodecs/vf_spp.c	(revision 37324)
+++ libmpcodecs/vf_spp.c	(working copy)
@@ -153,7 +153,7 @@
         }
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void hardthresh_mmx(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){
         int bias= 0; //FIXME
         unsigned int threshold1;
@@ -334,7 +334,7 @@
         }
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
         int y;
 
@@ -512,10 +512,10 @@
             }
         }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
         if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
         if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -604,7 +604,7 @@
         case 1: requantize= softthresh_c; break;
     }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX){
         store_slice= store_slice_mmx;
         switch(vf->priv->mode&3){
Index: libmpcodecs/vf_tfields.c
===================================================================
--- libmpcodecs/vf_tfields.c	(revision 37324)
+++ libmpcodecs/vf_tfields.c	(working copy)
@@ -71,7 +71,7 @@
 		fast_memcpy(dest, src, w);
 }
 
-#if HAVE_AMD3DNOW
+#if HAVE_AMD3DNOW_INLINE
 static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
@@ -107,7 +107,7 @@
 }
 #endif
 
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
 static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
@@ -144,7 +144,7 @@
 }
 #endif
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 static void qpel_li_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
@@ -509,16 +509,16 @@
 	if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity);
 	qpel_li = qpel_li_C;
 	qpel_4tap = qpel_4tap_C;
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 	if(gCpuCaps.hasMMX) qpel_li = qpel_li_MMX;
 #if HAVE_EBX_AVAILABLE
 	if(gCpuCaps.hasMMX) qpel_4tap = qpel_4tap_MMX;
 #endif
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
 	if(gCpuCaps.hasMMX2) qpel_li = qpel_li_MMX2;
 #endif
-#if HAVE_AMD3DNOW
+#if HAVE_AMD3DNOW_INLINE
 	if(gCpuCaps.has3DNow) qpel_li = qpel_li_3DNOW;
 #endif
 	return 1;
Index: libmpcodecs/vf_unsharp.c
===================================================================
--- libmpcodecs/vf_unsharp.c	(revision 37324)
+++ libmpcodecs/vf_unsharp.c	(working copy)
@@ -193,11 +193,11 @@
 
     vf_clone_mpi_attributes(dmpi, mpi);
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX)
         __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
     if(gCpuCaps.hasMMX2)
         __asm__ volatile ("sfence\n\t");
 #endif
Index: libmpcodecs/vf_uspp.c
===================================================================
--- libmpcodecs/vf_uspp.c	(revision 37324)
+++ libmpcodecs/vf_uspp.c	(working copy)
@@ -295,10 +295,10 @@
         }
     }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
     if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
Index: libmpcodecs/vf_yadif.c
===================================================================
--- libmpcodecs/vf_yadif.c	(revision 37324)
+++ libmpcodecs/vf_yadif.c	(working copy)
@@ -76,7 +76,7 @@
     }
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 
 #define LOAD4(mem,dst) \
             "movd      "mem", "#dst" \n\t"\
@@ -289,7 +289,7 @@
 #undef CHECK2
 #undef FILTER
 
-#endif /* HAVE_MMX */
+#endif /* HAVE_MMX_INLINE */
 
 static void filter_line_c(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int refs, int parity){
     int x;
@@ -371,7 +371,7 @@
             }
         }
     }
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX2) __asm__ volatile("emms \n\t" : : : "memory");
 #endif
 }
@@ -508,7 +508,7 @@
     if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity);
 
     filter_line = filter_line_c;
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
     if(gCpuCaps.hasMMX2) filter_line = filter_line_mmx2;
 #endif
 


More information about the MPlayer-dev-eng mailing list