]> git.sesse.net Git - mlt/blobdiff - src/modules/xine/deinterlace.c
Fix some compile warnings raised by clang.
[mlt] / src / modules / xine / deinterlace.c
index 60139e00c27a8dcf3556529a6006223c9c452c95..eddbb69132df023def8e183cfd24237d457e824c 100644 (file)
@@ -36,6 +36,7 @@
 #include "xineutils.h"
 
 #define xine_fast_memcpy memcpy
+#define xine_fast_memmove memmove
 
 /*
    DeinterlaceFieldBob algorithm
@@ -46,7 +47,7 @@
 static void deinterlace_bob_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
     int width, int height )
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
   int Line;
   uint64_t *YVal1;
   uint64_t *YVal2;
@@ -65,8 +66,8 @@ static void deinterlace_bob_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
   uint64_t qwEdgeDetect;
   uint64_t qwThreshold;
 
-  static mmx_t YMask = {ub:{0xff,0,0xff,0,0xff,0,0xff,0}};
-  static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
+  static mmx_t YMask = {.ub={0xff,0,0xff,0,0xff,0,0xff,0}};
+  static mmx_t Mask = {.ub={0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
 
   qwEdgeDetect = EdgeDetect;
   qwEdgeDetect += (qwEdgeDetect << 48) + (qwEdgeDetect << 32) + (qwEdgeDetect << 16);
@@ -190,7 +191,7 @@ static void deinterlace_bob_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
 static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
     int width, int height )
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
 
   int Line;
   uint64_t *YVal1;
@@ -216,8 +217,8 @@ static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
   uint64_t qwTemporalTolerance;
   uint64_t qwThreshold;
 
-  static mmx_t YMask = {ub:{0xff,0,0xff,0,0xff,0,0xff,0}};
-  static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
+  static mmx_t YMask = {.ub={0xff,0,0xff,0,0xff,0,0xff,0}};
+  static mmx_t Mask = {.ub={0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
 
 
   // Make sure we have all the data we need.
@@ -389,7 +390,7 @@ static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
 static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
     int width, int height )
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
   int Line;
   int  LoopCtr;
   uint64_t *L1;                                        // ptr to Line1, of 3
@@ -401,7 +402,7 @@ static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
   uint8_t* pOddLines = psrc[0]+width;
   uint8_t* pPrevLines;
 
-  static mmx_t ShiftMask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
+  static mmx_t ShiftMask = {.ub={0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
 
   int LineLength = width;
   int SourcePitch = width * 2;
@@ -552,7 +553,7 @@ static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
 static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
     int width, int height )
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
   int Line;
   uint64_t *YVal1;
   uint64_t *YVal3;
@@ -565,7 +566,7 @@ static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
 
   int n;
 
-  static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
+  static mmx_t Mask = {.ub={0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
 
   /*
    * copy first even line no matter what, and the first odd line if we're
@@ -633,7 +634,7 @@ static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
 static void deinterlace_linearblend_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
     int width, int height )
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
   int Line;
   uint64_t *YVal1;
   uint64_t *YVal2;
@@ -644,7 +645,7 @@ static void deinterlace_linearblend_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
   int n;
 
   /* Copy first line */
-  xine_fast_memcpy(pdst, psrc[0], LineLength);
+  xine_fast_memmove(pdst, psrc[0], LineLength);
 
   for (Line = 1; Line < height - 1; ++Line)
   {
@@ -694,7 +695,7 @@ static void deinterlace_linearblend_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
   }
 
   /* Copy last line */
-  xine_fast_memcpy(pdst + Line * LineLength,
+  xine_fast_memmove(pdst + Line * LineLength,
                    psrc[0] + Line * LineLength, LineLength);
 
   /* clear out the MMX registers ready for doing floating point
@@ -753,7 +754,7 @@ static void deinterlace_linearblend_yuv( uint8_t *pdst, uint8_t *psrc[],
 
 static int check_for_mmx(void)
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef USE_MMX
 static int config_flags = -1;
 
   if ( config_flags == -1 )
@@ -784,7 +785,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[],
       if( check_for_mmx() )
         deinterlace_bob_yuv_mmx(pdst,psrc,width,height);
       else /* FIXME: provide an alternative? */
-        xine_fast_memcpy(pdst,psrc[0],width*height);
+        deinterlace_linearblend_yuv(pdst,psrc,width,height);
       break;
     case DEINTERLACE_WEAVE:
       if( check_for_mmx() )
@@ -793,7 +794,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[],
           xine_fast_memcpy(pdst,psrc[0],width*height);
       }
       else /* FIXME: provide an alternative? */
-        xine_fast_memcpy(pdst,psrc[0],width*height);
+        deinterlace_linearblend_yuv(pdst,psrc,width,height);
       break;
     case DEINTERLACE_GREEDY:
       if( check_for_mmx() )
@@ -802,13 +803,13 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[],
           xine_fast_memcpy(pdst,psrc[0],width*height);
       }
       else /* FIXME: provide an alternative? */
-        xine_fast_memcpy(pdst,psrc[0],width*height);
+        deinterlace_linearblend_yuv(pdst,psrc,width,height);
       break;
     case DEINTERLACE_ONEFIELD:
       if( check_for_mmx() )
         deinterlace_onefield_yuv_mmx(pdst,psrc,width,height);
       else /* FIXME: provide an alternative? */
-        xine_fast_memcpy(pdst,psrc[0],width*height);
+        deinterlace_linearblend_yuv(pdst,psrc,width,height);
       break;
     case DEINTERLACE_ONEFIELDXV:
       lprintf("ONEFIELDXV must be handled by the video driver.\n");
@@ -820,7 +821,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[],
         deinterlace_linearblend_yuv(pdst,psrc,width,height);
       break;
     default:
-      lprintf("unknow method %d.\n",method);
+      lprintf("unknown method %d.\n",method);
       break;
   }
 }
@@ -845,8 +846,8 @@ int deinterlace_yuv_supported ( int method )
   return 0;
 }
 
-char *deinterlace_methods[] = {
-  "none", 
+const char *deinterlace_methods[] = {
+  "none",
   "bob",
   "weave",
   "greedy",