From e52171e1df77b095201204cec4546a12757769d2 Mon Sep 17 00:00:00 2001 From: arpi Date: Mon, 24 Sep 2001 21:07:12 +0000 Subject: [PATCH] rle 15,16bpp support (palette conversion) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1950 b3059339-0415-0410-9bf9-f77b7e298cf2 --- dec_video.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dec_video.c b/dec_video.c index 333602e3ac..76937e5b91 100644 --- a/dec_video.c +++ b/dec_video.c @@ -357,6 +357,24 @@ switch(sh_video->codec->driver){ 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>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; } }