[MPlayer-cvslog] r21903 - trunk/libmpdemux/demux_gif.c

reimar subversion at mplayerhq.hu
Sat Jan 13 12:44:36 CET 2007


Author: reimar
Date: Sat Jan 13 12:44:36 2007
New Revision: 21903

Modified:
   trunk/libmpdemux/demux_gif.c

Log:
Simplify gif demuxer by using memcpy_pic


Modified: trunk/libmpdemux/demux_gif.c
==============================================================================
--- trunk/libmpdemux/demux_gif.c	(original)
+++ trunk/libmpdemux/demux_gif.c	Sat Jan 13 12:44:36 2007
@@ -17,6 +17,7 @@
 #include "stheader.h"
 
 #include <gif_lib.h>
+#include "libvo/fastmemcpy.h"
 typedef struct {
   int current_pts;
   unsigned char *palette;
@@ -125,6 +126,7 @@
     int t = FFMAX(FFMIN(gif->Image.Top, priv->h), 0);
     int w = FFMAX(FFMIN(gif->Image.Width, priv->w - l), 0);
     int h = FFMAX(FFMIN(gif->Image.Height, priv->h - t), 0);
+    unsigned char *dest = dp->buffer + priv->w * t + l;
 
     // copy the palette
     for (y = 0; y < cnt; y++) {
@@ -134,14 +136,7 @@
 	priv->palette[(y * 4) + 3] = 0;
     }
 
-    for (y = 0; y < h; y++) {
-      unsigned char *drow = dp->buffer;
-      unsigned char *gbuf = buf + (y * gif->Image.Width);
-
-      drow += priv->w * (y + t) + l;
-
-      memcpy(drow, gbuf, w);
-    }
+    memcpy_pic(dest, buf, w, h, priv->w, gif->Image.Width);
   }
 
   free(buf);



More information about the MPlayer-cvslog mailing list