[Mplayer-cvslog] CVS: main/libmpcodecs vd_raw.c,1.5,1.6

Richard Felker CVS rfelker at mplayerhq.hu
Fri May 3 21:45:45 CEST 2002


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

Modified Files:
	vd_raw.c 
Log Message:
fixed raw i420/iyuv to some extent, so that cb/cr channels are no
longer reversed. this should make it possible for bttv users to
play/record video (-tv outfmt=i420) once again without bogus colors.


Index: vd_raw.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_raw.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vd_raw.c	29 Apr 2002 16:03:37 -0000	1.5
+++ vd_raw.c	3 May 2002 19:45:43 -0000	1.6
@@ -65,10 +65,14 @@
 	mpi->stride[0]=mpi->width;
         if(mpi->bpp == 12 && mpi->flags&MP_IMGFLAG_YUV) {
             // Support for some common Planar YUV formats
-            mpi->planes[2]=data+mpi->width*mpi->height;
-            mpi->stride[2]=mpi->width/2;
-            mpi->planes[1]=data+5*mpi->width*mpi->height/4;
-            mpi->stride[1]=mpi->width/2;
+            int cb=2, cr=1;
+            if (sh->format == IMGFMT_IYUV || sh->format == IMGFMT_I420) {
+                cb=1; cr=2;
+            }
+            mpi->planes[cb]=data+mpi->width*mpi->height;
+            mpi->stride[cb]=mpi->width/2;
+            mpi->planes[cr]=data+5*mpi->width*mpi->height/4;
+            mpi->stride[cr]=mpi->width/2;
        	}
     } else {
 	mpi->planes[0]=data;




More information about the MPlayer-cvslog mailing list