]> git.sesse.net Git - ffmpeg/blobdiff - libswscale/swscale.c
Change MODE_* to 1<<c so several can be set at the same time.
[ffmpeg] / libswscale / swscale.c
index d1803591ee707482bc6f849a0fb7c624c81d6eff..139bc55e5f211819e9ba8a3f84e7527955a28c5a 100644 (file)
@@ -38,7 +38,7 @@
 */
 
 /*
-tested special converters (most are tested actually, but i did not write it down ...)
+tested special converters (most are tested actually, but I did not write it down ...)
  YV12 -> BGR16
  YV12 -> YV12
  BGR15 -> BGR16
@@ -69,9 +69,9 @@ untested special converters
 #endif
 #include "swscale.h"
 #include "swscale_internal.h"
-#include "x86_cpu.h"
-#include "bswap.h"
 #include "rgb2rgb.h"
+#include "libavutil/x86_cpu.h"
+#include "libavutil/bswap.h"
 #include "libavcodec/opt.h"
 
 #undef MOVNTQ
@@ -362,16 +362,6 @@ const char *sws_format_name(enum PixelFormat format)
     }
 }
 
-#if defined(ARCH_X86) && defined (CONFIG_GPL)
-void in_asm_used_var_warning_killer()
-{
-    volatile int i= bF8+bFC+w10+
-    bm00001111+bm00000111+bm11111000+b16Mask+g16Mask+r16Mask+b15Mask+g15Mask+r15Mask+
-    ff_M24A+ff_M24B+ff_M24C+w02 + b5Dither+g5Dither+r5Dither+g6Dither+ff_dither4[0]+ff_dither8[0]+bm01010101;
-    if (i) i=0;
-}
-#endif
-
 static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
                                int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
                                uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW)
@@ -913,14 +903,12 @@ static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **l
 #include "swscale_template.c"
 #endif
 
-#ifdef ARCH_POWERPC
 #ifdef COMPILE_ALTIVEC
 #undef RENAME
 #define HAVE_ALTIVEC
 #define RENAME(a) a ## _altivec
 #include "swscale_template.c"
 #endif
-#endif //ARCH_POWERPC
 
 #if defined(ARCH_X86)
 
@@ -1401,14 +1389,14 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
     // End
         "9:                                             \n\t"
 //        "int $3                                         \n\t"
-        "lea                         0b, %0             \n\t"
-        "lea                         1b, %1             \n\t"
-        "lea                         2b, %2             \n\t"
+        "lea                 " LOCAL_MANGLE(0b) ", %0   \n\t"
+        "lea                 " LOCAL_MANGLE(1b) ", %1   \n\t"
+        "lea                 " LOCAL_MANGLE(2b) ", %2   \n\t"
         "dec                         %1                 \n\t"
         "dec                         %2                 \n\t"
         "sub                         %0, %1             \n\t"
         "sub                         %0, %2             \n\t"
-        "lea                         9b, %3             \n\t"
+        "lea                 " LOCAL_MANGLE(9b) ", %3   \n\t"
         "sub                         %0, %3             \n\t"
 
 
@@ -1439,14 +1427,14 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
     // End
         "9:                                             \n\t"
 //        "int                       $3                   \n\t"
-        "lea                         0b, %0             \n\t"
-        "lea                         1b, %1             \n\t"
-        "lea                         2b, %2             \n\t"
+        "lea                 " LOCAL_MANGLE(0b) ", %0   \n\t"
+        "lea                 " LOCAL_MANGLE(1b) ", %1   \n\t"
+        "lea                 " LOCAL_MANGLE(2b) ", %2   \n\t"
         "dec                         %1                 \n\t"
         "dec                         %2                 \n\t"
         "sub                         %0, %1             \n\t"
         "sub                         %0, %2             \n\t"
-        "lea                         9b, %3             \n\t"
+        "lea                 " LOCAL_MANGLE(9b) ", %3   \n\t"
         "sub                         %0, %3             \n\t"
 
 
@@ -1860,8 +1848,8 @@ static int gray16swap(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
     int y=      srcSliceY;
     int height= srcSliceH;
     int i, j;
-    uint16_t *srcPtr= src[0];
-    uint16_t *dstPtr= dst[0] + dstStride[0]*y/2;
+    uint16_t *srcPtr= (uint16_t*)src[0];
+    uint16_t *dstPtr= (uint16_t*)(dst[0] + dstStride[0]*y/2);
     for (i=0; i<height; i++)
     {
         for (j=0; j<length; j++) dstPtr[j] = bswap_16(srcPtr[j]);
@@ -2395,16 +2383,16 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
     //try to avoid drawing green stuff between the right end and the stride end
     for (i=0; i<c->vChrBufSize; i++) memset(c->chrPixBuf[i], 64, (VOF+1)*2);
 
-    assert(2*VOF == VOFW);
+    assert(2*VOFW == VOF);
 
     ASSERT(c->chrDstH <= dstH)
 
     if (flags&SWS_PRINT_INFO)
     {
 #ifdef DITHER1XBPP
-        char *dither= " dithered";
+        const char *dither= " dithered";
 #else
-        char *dither= "";
+        const char *dither= "";
 #endif
         if (flags&SWS_FAST_BILINEAR)
             av_log(c, AV_LOG_INFO, "FAST_BILINEAR scaler, ");
@@ -2554,7 +2542,7 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
             int v= av_clip_uint8(((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128);
             pal[i]= y + (u<<8) + (v<<16);
         }
-        src2[1]= pal;
+        src2[1]= (uint8_t*)pal;
     }
 
     // copy strides, so they can safely be modified