[FFmpeg-cvslog] r28986 - trunk/libswscale/swscale.c

sdrik subversion
Tue Mar 17 20:53:37 CET 2009


Author: sdrik
Date: Tue Mar 17 20:53:36 2009
New Revision: 28986

Log:
Add a fillPlane function to fill a plane with one constant value

Modified:
   trunk/libswscale/swscale.c

Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	Tue Mar 17 20:51:52 2009	(r28985)
+++ trunk/libswscale/swscale.c	Tue Mar 17 20:53:36 2009	(r28986)
@@ -953,6 +953,15 @@ static inline void yuv2rgbXinC_full(SwsC
     }
 }
 
+static void fillPlane(uint8_t* plane, int stride, int width, int height, int y, uint8_t val){
+    int i;
+    uint8_t *ptr = plane + stride*y;
+    for (i=0; i<height; i++){
+        memset(ptr, val, width);
+        ptr += stride;
+    }
+}
+
 //Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
 //Plain C versions
 #if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL
@@ -1934,14 +1943,8 @@ static int planarCopy(SwsContext *c, uin
 
         if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0)
         {
-            if (!isGray(c->dstFormat)){
-                int i;
-                uint8_t *ptr = dst[plane] + dstStride[plane]*y;
-                for (i=0; i<height; i++){
-                    memset(ptr, 128, length);
-                    ptr += dstStride[plane];
-                }
-            }
+            if (!isGray(c->dstFormat))
+                fillPlane(dst[plane], dstStride[plane], length, height, y, 128);
         }
         else
         {




More information about the ffmpeg-cvslog mailing list