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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Apr 2 20:32:13 CEST 2010


On Fri, Mar 19, 2010 at 01:52:42AM +0100, Janusz Krzysztofik wrote:
> diff -upr trunk.orig/libmpcodecs/vf_tile.c trunk/libmpcodecs/vf_tile.c
> --- trunk.orig/libmpcodecs/vf_tile.c	2010-02-26 02:39:46.000000000 +0100
> +++ trunk/libmpcodecs/vf_tile.c	2010-03-19 01:01:29.000000000 +0100
> @@ -202,12 +202,14 @@ static void uninit(struct vf_instance *v
>  static int query_format(struct vf_instance *vf, unsigned int fmt)
>  {
>  	switch (fmt) {
> -        /* rgb 15 -> 32 bit */
> +        /* rgb 12 -> 32 bit */
> +        case IMGFMT_RGB12:
>          case IMGFMT_RGB15:
>  	case IMGFMT_RGB16:
>  	case IMGFMT_RGB24:
>          case IMGFMT_RGB32:
> -        /* bgr 15 -> 32 bit */
> +        /* bgr 12 -> 32 bit */
> +	case IMGFMT_BGR12:

These two comments do not really make sense, I'd say the should
be something like "bgr X -> 32 bit" instead of the specific value
"12" or "15".

> +		register unsigned int a=src[x]>>4;
> +                dst[x]=(a<<8)|(a<<4)|a;

Please keep the indentation consistent, you used tabs for the
upper line and spaces for everything else (unless it contradicts
the surrounding code I'm in favour of using spaces).
And for completeness I think the new formats should also be added to
codec-cfg.c.
Otherwise I think it is ok to be applied, very thorough work (even
though it would be nicer if more was tested successfully, though
it's very likely that e.g. SDL is just broken).



More information about the MPlayer-dev-eng mailing list