[FFmpeg-cvslog] r29003 - trunk/libswscale/rgb2rgb_template.c

michael subversion
Thu Mar 19 16:02:45 CET 2009


Author: michael
Date: Thu Mar 19 16:02:44 2009
New Revision: 29003

Log:
Revert
	Date: Wed Mar 18 23:11:50 2009
	New Revision: 28996

	Log:
	Fix libswscale compilation on non-x86, hopefully without breaking MinGW64 again.

This change was non optimal, correct would have been to revert the offending commits
if no time was available to find a clean fix.

Modified:
   trunk/libswscale/rgb2rgb_template.c

Modified: trunk/libswscale/rgb2rgb_template.c
==============================================================================
--- trunk/libswscale/rgb2rgb_template.c	Thu Mar 19 15:04:14 2009	(r29002)
+++ trunk/libswscale/rgb2rgb_template.c	Thu Mar 19 16:02:44 2009	(r29003)
@@ -1339,12 +1339,7 @@ static inline void RENAME(rgb16to32)(con
 
 static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size)
 {
-#if HAVE_MMX
-    x86_reg
-#else
-    long
-#endif
-        idx = 15 - src_size;
+    x86_reg idx = 15 - src_size;
     const uint8_t *s = src-idx;
     uint8_t *d = dst-idx;
 #if HAVE_MMX
@@ -1481,11 +1476,10 @@ static inline void RENAME(yuvPlanartoyuy
                                            long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
 {
     long y;
-    const long chromWidth= width>>1;
+    const x86_reg chromWidth= width>>1;
     for (y=0; y<height; y++)
     {
 #if HAVE_MMX
-        x86_reg cw = chromWidth;
 //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
         __asm__ volatile(
         "xor                 %%"REG_a", %%"REG_a"   \n\t"
@@ -1517,7 +1511,7 @@ static inline void RENAME(yuvPlanartoyuy
         "add                        $8, %%"REG_a"   \n\t"
         "cmp                        %4, %%"REG_a"   \n\t"
         " jb                        1b              \n\t"
-        ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (cw)
+        ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth)
         : "%"REG_a
         );
 #else
@@ -1634,11 +1628,10 @@ static inline void RENAME(yuvPlanartouyv
                                            long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
 {
     long y;
-    const long chromWidth= width>>1;
+    const x86_reg chromWidth= width>>1;
     for (y=0; y<height; y++)
     {
 #if HAVE_MMX
-        x86_reg cw = chromWidth;
 //FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
         __asm__ volatile(
         "xor                %%"REG_a", %%"REG_a"    \n\t"
@@ -1670,7 +1663,7 @@ static inline void RENAME(yuvPlanartouyv
         "add                       $8, %%"REG_a"    \n\t"
         "cmp                       %4, %%"REG_a"    \n\t"
         " jb                       1b               \n\t"
-        ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (cw)
+        ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "g" (chromWidth)
         : "%"REG_a
         );
 #else
@@ -1765,11 +1758,10 @@ static inline void RENAME(yuy2toyv12)(co
                                       long lumStride, long chromStride, long srcStride)
 {
     long y;
-    const long chromWidth= width>>1;
+    const x86_reg chromWidth= width>>1;
     for (y=0; y<height; y+=2)
     {
 #if HAVE_MMX
-        x86_reg cw = chromWidth;
         __asm__ volatile(
         "xor                 %%"REG_a", %%"REG_a"   \n\t"
         "pcmpeqw                 %%mm7, %%mm7       \n\t"
@@ -1818,7 +1810,7 @@ static inline void RENAME(yuy2toyv12)(co
         "add                        $8, %%"REG_a"   \n\t"
         "cmp                        %4, %%"REG_a"   \n\t"
         " jb                        1b              \n\t"
-        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (cw)
+        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
         : "memory", "%"REG_a
         );
 
@@ -1848,7 +1840,7 @@ static inline void RENAME(yuy2toyv12)(co
         "cmp                        %4, %%"REG_a"   \n\t"
         " jb                        1b              \n\t"
 
-        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (cw)
+        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
         : "memory", "%"REG_a
         );
 #else
@@ -1952,7 +1944,7 @@ static inline void RENAME(planar2x)(cons
 
         );
 #else
-        const long mmxSize=1;
+        const x86_reg mmxSize=1;
 #endif
         dst[0        ]= (3*src[0] +   src[srcStride])>>2;
         dst[dstStride]= (  src[0] + 3*src[srcStride])>>2;
@@ -2004,11 +1996,10 @@ static inline void RENAME(uyvytoyv12)(co
                                       long lumStride, long chromStride, long srcStride)
 {
     long y;
-    const long chromWidth= width>>1;
+    const x86_reg chromWidth= width>>1;
     for (y=0; y<height; y+=2)
     {
 #if HAVE_MMX
-        x86_reg cw = chromWidth;
         __asm__ volatile(
         "xor                 %%"REG_a", %%"REG_a"   \n\t"
         "pcmpeqw             %%mm7, %%mm7   \n\t"
@@ -2057,7 +2048,7 @@ static inline void RENAME(uyvytoyv12)(co
         "add                    $8, %%"REG_a"   \n\t"
         "cmp                    %4, %%"REG_a"   \n\t"
         " jb                    1b          \n\t"
-        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (cw)
+        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
         : "memory", "%"REG_a
         );
 
@@ -2087,7 +2078,7 @@ static inline void RENAME(uyvytoyv12)(co
         "cmp                    %4, %%"REG_a"   \n\t"
         " jb                    1b          \n\t"
 
-        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (cw)
+        ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "g" (chromWidth)
         : "memory", "%"REG_a
         );
 #else
@@ -2132,9 +2123,8 @@ static inline void RENAME(rgb24toyv12)(c
                                        long lumStride, long chromStride, long srcStride)
 {
     long y;
-    const long chromWidth= width>>1;
+    const x86_reg chromWidth= width>>1;
 #if HAVE_MMX
-    x86_reg cw = chromWidth;
     for (y=0; y<height-2; y+=2)
     {
         long i;
@@ -2358,7 +2348,7 @@ static inline void RENAME(rgb24toyv12)(c
         "movd                    %%mm0, (%3, %%"REG_a") \n\t"
         "add                        $4, %%"REG_a"       \n\t"
         " js                        1b                  \n\t"
-        : : "r" (src+cw*6), "r" (src+srcStride+cw*6), "r" (udst+cw), "r" (vdst+cw), "g" (-cw)
+        : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth)
         : "%"REG_a, "%"REG_d
         );
 
@@ -2511,7 +2501,8 @@ static inline void RENAME(vu9_to_vu12)(c
                                        long srcStride1, long srcStride2,
                                        long dstStride1, long dstStride2)
 {
-    long x,y,w,h;
+    x86_reg y;
+    long x,w,h;
     w=width/2; h=height/2;
 #if HAVE_MMX
     __asm__ volatile(
@@ -2614,6 +2605,7 @@ static inline void RENAME(yvu9_to_yuy2)(
                                         long srcStride1, long srcStride2,
                                         long srcStride3, long dstStride)
 {
+    x86_reg x;
     long y,w,h;
     w=width/2; h=height;
     for (y=0;y<h;y++){
@@ -2621,8 +2613,8 @@ static inline void RENAME(yvu9_to_yuy2)(
     const uint8_t* up=src2+srcStride2*(y>>2);
     const uint8_t* vp=src3+srcStride3*(y>>2);
     uint8_t* d=dst+dstStride*y;
+    x=0;
 #if HAVE_MMX
-    x86_reg x = 0;
     for (;x<w-7;x+=8)
     {
         __asm__ volatile(
@@ -2676,8 +2668,6 @@ static inline void RENAME(yvu9_to_yuy2)(
         : "r"(yp), "r" (up), "r"(vp), "r"(d)
         :"memory");
     }
-#else
-    long x = 0;
 #endif
     for (; x<w; x++)
     {




More information about the ffmpeg-cvslog mailing list