[Mplayer-cvslog] CVS: main/libmpcodecs vf_rectangle.c,1.6,1.7
Arpi of Ize
arpi at mplayerhq.hu
Fri Jan 3 13:53:51 CET 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv8081
Modified Files:
vf_rectangle.c
Log Message:
better image/plane copy
based on patch by Michael Halcrow <mah69 at email.byu.edu>
Index: vf_rectangle.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_rectangle.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vf_rectangle.c 14 Oct 2002 20:51:18 -0000 1.6
+++ vf_rectangle.c 3 Jan 2003 12:53:48 -0000 1.7
@@ -66,19 +66,26 @@
static int
put_image(struct vf_instance_s* vf, mp_image_t* mpi){
mp_image_t* dmpi;
- unsigned int bpp;
+ unsigned int bpp = mpi->bpp / 8;
unsigned int x, y, w, h;
dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP,
MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
mpi->w, mpi->h);
- bpp = dmpi->bpp / 8;
- memcpy(dmpi->planes[0], mpi->planes[0], dmpi->stride[0] * bpp * mpi->height);
- memcpy(dmpi->planes[1], mpi->planes[1], dmpi->stride[1] * mpi->chroma_height);
- memcpy(dmpi->planes[2], mpi->planes[2], dmpi->stride[2] * mpi->chroma_height);
+
+ memcpy_pic(dmpi->planes[0],mpi->planes[0],mpi->w*bpp, mpi->h,
+ dmpi->stride[0],mpi->stride[0]);
+ if(mpi->flags&MP_IMGFLAG_PLANAR && mpi->flags&MP_IMGFLAG_YUV){
+ memcpy_pic(dmpi->planes[1],mpi->planes[1],
+ mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
+ dmpi->stride[1],mpi->stride[1]);
+ memcpy_pic(dmpi->planes[2],mpi->planes[2],
+ mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
+ dmpi->stride[2],mpi->stride[2]);
+ }
/* Draw the rectangle */
- mp_msg(MSGT_VFILTER,MSGL_INFO, "rectangle: -vop crop=%d:%d:%d:%d \n", vf->priv->w, vf->priv->h, vf->priv->x, vf->priv->y);
+ mp_msg(MSGT_VFILTER,MSGL_INFO, "rectangle: -vop rectangle=%d:%d:%d:%d \n", vf->priv->w, vf->priv->h, vf->priv->x, vf->priv->y);
if (vf->priv->x < 0)
x = 0;
More information about the MPlayer-cvslog
mailing list