[MPlayer-cvslog] r31144 - in trunk/libmpcodecs: img_format.c mp_image.c

reimar subversion at mplayerhq.hu
Sun May 9 02:18:26 CEST 2010


Author: reimar
Date: Sun May  9 02:18:26 2010
New Revision: 31144

Log:
Handle Y8/Y800 formats more similar to other YUV formats.

Modified:
   trunk/libmpcodecs/img_format.c
   trunk/libmpcodecs/mp_image.c

Modified: trunk/libmpcodecs/img_format.c
==============================================================================
--- trunk/libmpcodecs/img_format.c	Sun May  9 02:16:46 2010	(r31143)
+++ trunk/libmpcodecs/img_format.c	Sun May  9 02:18:26 2010	(r31144)
@@ -151,13 +151,18 @@ int mp_get_chroma_shift(int format, int 
         xs = 0;
         ys = 1;
         break;
+    case IMGFMT_Y8:
+    case IMGFMT_Y800:
+        xs = 31;
+        ys = 31;
+        break;
     default:
         err = 1;
         break;
     }
     if (x_shift) *x_shift = xs;
     if (y_shift) *y_shift = ys;
-    bpp = 8 + (16 >> (xs + ys));
+    bpp = 8 + ((16 >> xs) >> ys);
     if (format == IMGFMT_420A)
         bpp += 8;
     bpp *= bpp_factor;

Modified: trunk/libmpcodecs/mp_image.c
==============================================================================
--- trunk/libmpcodecs/mp_image.c	Sun May  9 02:16:46 2010	(r31143)
+++ trunk/libmpcodecs/mp_image.c	Sun May  9 02:18:26 2010	(r31144)
@@ -153,8 +153,7 @@ void mp_image_setfmt(mp_image_t* mpi,uns
     case IMGFMT_Y800:
     case IMGFMT_Y8:
 	/* they're planar ones, but for easier handling use them as packed */
-//	mpi->flags|=MP_IMGFLAG_PLANAR;
-	mpi->bpp=8;
+	mpi->flags&=~MP_IMGFLAG_PLANAR;
 	mpi->num_planes=1;
 	return;
     case IMGFMT_UYVY:


More information about the MPlayer-cvslog mailing list