[Mplayer-cvslog] CVS: main dec_video.c,1.37,1.38
Arpi of Ize
arpi at mplayer.dev.hu
Mon Sep 24 23:07:15 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv11759
Modified Files:
dec_video.c
Log Message:
rle 15,16bpp support (palette conversion)
Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- dec_video.c 24 Sep 2001 20:21:53 -0000 1.37
+++ dec_video.c 24 Sep 2001 21:07:12 -0000 1.38
@@ -357,6 +357,24 @@
case VFM_RLE: {
int bpp=((out_fmt&255)+7)/8; // RGB only
sh_video->our_out_buffer = memalign(64,sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!!
+ if(bpp==2){ // 15 or 16 bpp ==> palette conversion!
+ unsigned int* pal=(unsigned int*)(((char*)sh_video->bih)+40);
+ //int cols=(sh_video->bih->biSize-40)/4;
+ int cols=1<<(sh_video->bih->biBitCount);
+ int i;
+ if(cols>256) cols=256;
+ printf("RLE: converting palette for %d colors.\n",cols);
+ for(i=0;i<cols;i++){
+ unsigned int c=pal[i];
+ unsigned int b=c&255;
+ unsigned int g=(c>>8)&255;
+ unsigned int r=(c>>16)&255;
+ if((out_fmt&255)==15)
+ pal[i]=((r>>3)<<10)|((g>>3)<<5)|((b>>3));
+ else
+ pal[i]=((r>>3)<<11)|((g>>2)<<5)|((b>>3));
+ }
+ }
break;
}
}
More information about the MPlayer-cvslog
mailing list