summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-13 11:44:36 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-13 11:44:36 +0000
commit16c183be836660300d0b0db875ce5a3c93c279bd (patch)
treebc622e0a01856343261b8e288158240a52cfefa6 /libmpdemux
parentd359f1537cd8ef9b7b0d22b001a196a47c012bc7 (diff)
downloadmpv-16c183be836660300d0b0db875ce5a3c93c279bd.tar.bz2
mpv-16c183be836660300d0b0db875ce5a3c93c279bd.tar.xz
Simplify gif demuxer by using memcpy_pic
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21903 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_gif.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libmpdemux/demux_gif.c b/libmpdemux/demux_gif.c
index af1087f5ab..8c5b1ce3a4 100644
--- a/libmpdemux/demux_gif.c
+++ b/libmpdemux/demux_gif.c
@@ -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 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
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 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
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);