[MPlayer-cvslog] r22243 - trunk/libmpcodecs/vf_scale.c

michael subversion at mplayerhq.hu
Sat Feb 17 12:34:25 CET 2007


Author: michael
Date: Sat Feb 17 12:34:25 2007
New Revision: 22243

Modified:
   trunk/libmpcodecs/vf_scale.c

Log:
add IMGFMT_RGB8 palette init code what moron actually added init code just for half of the formats?!


Modified: trunk/libmpcodecs/vf_scale.c
==============================================================================
--- trunk/libmpcodecs/vf_scale.c	(original)
+++ trunk/libmpcodecs/vf_scale.c	Sat Feb 17 12:34:25 2007
@@ -249,6 +249,17 @@
 	vf->priv->palette=NULL;
     }
     switch(best){
+    case IMGFMT_RGB8: {
+      /* set 332 palette for 8 bpp */
+	int i;
+	vf->priv->palette=malloc(4*256);
+	for(i=0; i<256; i++){
+	    vf->priv->palette[4*i+0]=4*(i>>6)*21;
+	    vf->priv->palette[4*i+1]=4*((i>>3)&7)*9;
+	    vf->priv->palette[4*i+2]=4*((i&7)&7)*9;
+            vf->priv->palette[4*i+3]=0;
+	}
+	break; }
     case IMGFMT_BGR8: {
       /* set 332 palette for 8 bpp */
 	int i;
@@ -442,6 +453,8 @@
     case IMGFMT_411P: 
     case IMGFMT_BGR8: 
     case IMGFMT_RGB8: 
+    case IMGFMT_BG4B: 
+    case IMGFMT_RG4B: 
     {
 	unsigned int best=find_best_out(vf);
 	int flags;



More information about the MPlayer-cvslog mailing list