[Mplayer-cvslog] CVS: main/libmpcodecs vd.c,1.26,1.27

Arpi of Ize arpi at mplayer.dev.hu
Sun Mar 24 20:01:04 CET 2002


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

Modified Files:
	vd.c 
Log Message:
UV vs VU fix

Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- vd.c	22 Mar 2002 22:14:01 -0000	1.26
+++ vd.c	24 Mar 2002 19:01:01 -0000	1.27
@@ -245,7 +245,7 @@
 // Note: buffer allocation may be moved to mpcodecs_config_vo() later...
 mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h){
   mp_image_t* mpi=NULL;
-  int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_STRIDE)?((w+15)&(~15)):w;
+  int w2=w; //(mp_imgflag&MP_IMGFLAG_ACCEPT_STRIDE)?((w+15)&(~15)):w;
   // Note: we should call libvo first to check if it supports direct rendering
   // and if not, then fallback to software buffers:
   switch(mp_imgtype){
@@ -301,8 +301,15 @@
 	      // 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;
+	      if(mpi->flags&MP_IMGFLAG_SWAPPED){
+	          // I420/IYUV  (Y,U,V)
+	          mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height;
+	          mpi->planes[2]=mpi->planes[1]+(mpi->width>>1)*(mpi->height>>1);
+	      } else {
+	          // YV12,YVU9  (Y,V,U)
+	          mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
+	          mpi->planes[1]=mpi->planes[2]+(mpi->width>>1)*(mpi->height>>1);
+	      }
 	  } else {
 	      if(!mpi->stride[0]) mpi->stride[0]=mpi->width*mpi->bpp/8;
 	  }




More information about the MPlayer-cvslog mailing list