[MPlayer-dev-eng] [RFC][PATCH v2] Add support for 12-bit color mode.

Diego Biurrun diego at biurrun.de
Sat Apr 3 10:54:54 CEST 2010


On Fri, Mar 19, 2010 at 01:52:42AM +0100, Janusz Krzysztofik wrote:
> 
> The patch extends mplayer with RGB12 aka RGB444 pixel format handling. 
> It works for me with fbdev and fbdev2, selecting required color conversion 
> filters automatically. It also works with directfb when provided with "-vf 
> format=bgr12" option. I wasn't able to get correct results using sdl, 
> neither with qtopia (incorrect collors) nor fbcon (not working at all) 
> drivers. I haven't tested the x11 output driver modifications.

If you give detailed testing instructions, perhaps somebody else can.

> --- trunk.orig/libvo/osd.c	2010-02-26 02:40:23.000000000 +0100
> +++ trunk/libvo/osd.c	2010-03-19 01:01:29.000000000 +0100
> @@ -329,6 +329,38 @@ void vo_draw_alpha_init(void){
>  
> +void vo_draw_alpha_rgb12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
> +}
> +
>  void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){


vo_draw_alpha_rgb12() looks very similar to vo_draw_alpha_rgb15() and
vo_draw_alpha_rgb16().  Ideally this should be refactored in some way.

> --- trunk.orig/libvo/vo_fbdev.c	2010-03-18 21:43:44.000000000 +0100
> +++ trunk/libvo/vo_fbdev.c	2010-03-19 01:01:29.000000000 +0100
> @@ -521,6 +521,13 @@ static void set_bpp(struct fb_var_screen
>          p->green.offset = 5;
>          p->blue.length  = 5;
>          break;
> +    case 12:
> +        p->red.offset = 8;
> +        p->green.length = 4;
> +        p->red.length = 4;
> +        p->green.offset = 4;
> +        p->blue.length = 4;
> +        break;

Please keep the = vertically aligned like the surrounding code does.

> @@ -700,7 +707,7 @@ static int fb_preinit(int reset)
>  
>      if (vo_dbpp) {
> -        if (vo_dbpp != 15 && vo_dbpp != 16 && vo_dbpp != 24 && vo_dbpp != 32) {
> +        if (vo_dbpp != 12 && vo_dbpp != 15 && vo_dbpp != 16 && vo_dbpp != 24 && vo_dbpp != 32) {

Please break overly long lines.

Diego



More information about the MPlayer-dev-eng mailing list