]> git.sesse.net Git - ffmpeg/blobdiff - libswscale/yuv2rgb.c
Do not return -1 from void functions.
[ffmpeg] / libswscale / yuv2rgb.c
index d75c517e08d934d493f4eb00ad63113e1ccdea8a..b90f78c1fb6d167ab08388d0204e1ea3d395ca2a 100644 (file)
@@ -1,8 +1,7 @@
 /*
- * yuv2rgb.c, Software YUV to RGB coverter
+ * yuv2rgb.c, Software YUV to RGB converter
  *
  *  Copyright (C) 1999, Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *  All Rights Reserved.
  *
  *  Functions broken out from display_x11.c and several new modes
  *  added by HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
 #include "swscale.h"
 #include "swscale_internal.h"
 
-#ifdef HAVE_MLIB
-#include "yuv2rgb_mlib.c"
-#endif
-
 #define DITHER1XBPP // only for mmx
 
 const uint8_t  __attribute__((aligned(8))) dither_2x2_4[2][8]={
@@ -156,13 +151,9 @@ const uint8_t  __attribute__((aligned(8))) dither_8x8_220[8][8]={
 #ifdef HAVE_MMX
 
 /* hope these constant values are cache line aligned */
-static uint64_t attribute_used __attribute__((aligned(8))) mmx_00ffw   = 0x00ff00ff00ff00ffULL;
-static uint64_t attribute_used __attribute__((aligned(8))) mmx_redmask = 0xf8f8f8f8f8f8f8f8ULL;
-static uint64_t attribute_used __attribute__((aligned(8))) mmx_grnmask = 0xfcfcfcfcfcfcfcfcULL;
-
-static uint64_t attribute_used __attribute__((aligned(8))) M24A=   0x00FF0000FF0000FFULL;
-static uint64_t attribute_used __attribute__((aligned(8))) M24B=   0xFF0000FF0000FF00ULL;
-static uint64_t attribute_used __attribute__((aligned(8))) M24C=   0x0000FF0000FF0000ULL;
+DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw)   = 0x00ff00ff00ff00ffULL;
+DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
+DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
 
 // the volatile is required because gcc otherwise optimizes some writes away not knowing that these
 // are read in the asm block
@@ -171,14 +162,6 @@ static volatile uint64_t attribute_used __attribute__((aligned(8))) g5Dither;
 static volatile uint64_t attribute_used __attribute__((aligned(8))) g6Dither;
 static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither;
 
-static uint64_t __attribute__((aligned(8))) dither4[2]={
-    0x0103010301030103LL,
-    0x0200020002000200LL,};
-
-static uint64_t __attribute__((aligned(8))) dither8[2]={
-    0x0602060206020602LL,
-    0x0004000400040004LL,};
-
 #undef HAVE_MMX
 
 //MMX versions
@@ -197,7 +180,7 @@ static uint64_t __attribute__((aligned(8))) dither8[2]={
 #define RENAME(a) a ## _MMX2
 #include "yuv2rgb_template.c"
 
-#endif /* defined(ARCH_X86) */
+#endif /* HAVE_MMX */
 
 const int32_t Inverse_Table_6_9[8][4] = {
     {117504, 138453, 13954, 34903}, /* no sequence_display_extension */
@@ -285,8 +268,7 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic
             dst_2 += dst_delta;\
         }\
         if (c->dstW & 4) {\
-            int av_unused U, V;\
-            int Y;\
+            int av_unused Y, U, V;\
 
 #define EPILOG2()\
         }\
@@ -631,7 +613,13 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
         }
     }
 #endif
-#ifdef HAVE_MLIB
+#ifdef HAVE_VIS
+    {
+        SwsFunc t= yuv2rgb_init_vis(c);
+        if (t) return t;
+    }
+#endif
+#ifdef CONFIG_MLIB
     {
         SwsFunc t= yuv2rgb_init_mlib(c);
         if (t) return t;