[Mplayer-cvslog] CVS: main/libmpcodecs vd.c,1.3,1.4

Arpi of Ize arpi at mplayer.dev.hu
Fri Mar 1 01:20:13 CET 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv24603

Modified Files:
	vd.c 
Log Message:
fixed stride for packed formats, more detailed printf at image allocation

Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vd.c	28 Feb 2002 01:43:06 -0000	1.3
+++ vd.c	1 Mar 2002 00:20:11 -0000	1.4
@@ -80,14 +80,20 @@
       if(!(mpi->flags&(MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_DIRECT)) 
          && mpi->type>MP_IMGTYPE_EXPORT){
           // non-direct and not yet allocaed image. allocate it!
-	  printf("*** Allocating mp_image_t, %d bytes\n",mpi->bpp*mpi->width*mpi->height/8);
+	  printf("*** Allocating mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n",
+	          mpi->width,mpi->height,mpi->bpp,
+		  (mpi->flags&MP_IMGFLAG_YUV)?"YUV":"RGB",
+		  (mpi->flags&MP_IMGFLAG_PLANAR)?"planar":"packed",
+	          mpi->bpp*mpi->width*mpi->height/8);
 	  mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*mpi->height/8);
-	  if(!mpi->stride[0]) mpi->stride[0]=mpi->width;
 	  if(mpi->flags&MP_IMGFLAG_PLANAR){
 	      // YV12/I420. feel free to add other planar formats here...
+	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width;
 	      if(!mpi->stride[1]) mpi->stride[1]=mpi->stride[2]=mpi->width/2;
 	      mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height;
 	      mpi->planes[2]=mpi->planes[1]+mpi->width*mpi->height/4;
+	  } else {
+	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8;
 	  }
 	  mpi->flags|=MP_IMGFLAG_ALLOCATED;
       }




More information about the MPlayer-cvslog mailing list