[Mplayer-cvslog] CVS: main/libmpcodecs mp_image.h,1.14,1.15

Alex Beregszaszi alex at mplayerhq.hu
Thu Jul 11 21:08:25 CEST 2002


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

Modified Files:
	mp_image.h 
Log Message:
better support for rgb/bgr formats

Index: mp_image.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/mp_image.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- mp_image.h	27 Jun 2002 17:35:37 -0000	1.14
+++ mp_image.h	11 Jul 2002 19:08:23 -0000	1.15
@@ -71,15 +71,19 @@
 	return;
     }
     mpi->num_planes=1;
-    if( (out_fmt&IMGFMT_RGB_MASK) == IMGFMT_RGB ){
-	mpi->bpp=((out_fmt&255)+7)&(~7);
-	if(out_fmt==IMGFMT_RGB1) mpi->bpp=1;
+    if (IMGFMT_IS_RGB(out_fmt)) {
+	if (IMGFMT_RGB_DEPTH(out_fmt) < 8)
+	    mpi->bpp = IMGFMT_RGB_DEPTH(out_fmt);
+	else
+	    mpi->bpp=(IMGFMT_RGB_DEPTH(out_fmt)+7)&(~7);
 	return;
     }
-    if( (out_fmt&IMGFMT_BGR_MASK) == IMGFMT_BGR ){
-	mpi->bpp=((out_fmt&255)+7)&(~7);
+    if (IMGFMT_IS_BGR(out_fmt)) {
+	if (IMGFMT_BGR_DEPTH(out_fmt) < 8)
+	    mpi->bpp = IMGFMT_BGR_DEPTH(out_fmt);
+	else
+	    mpi->bpp=(IMGFMT_BGR_DEPTH(out_fmt)+7)&(~7);
 	mpi->flags|=MP_IMGFLAG_SWAPPED;
-	if(out_fmt==IMGFMT_BGR1) mpi->bpp=1;
 	return;
     }
     mpi->flags|=MP_IMGFLAG_YUV;




More information about the MPlayer-cvslog mailing list