changeset 22225:345d2866dfcf

add IMGFMT_RGB8 palette init code what moron actually added init code just for half of the formats?!
author michael
date Sat, 17 Feb 2007 11:34:25 +0000
parents 79967c519e43
children 1b1286436771
files libmpcodecs/vf_scale.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Sat Feb 17 11:04:13 2007 +0000
+++ b/libmpcodecs/vf_scale.c	Sat Feb 17 11:34:25 2007 +0000
@@ -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;