[FFmpeg-devel] [PATCH] swscale alpha channel support

Reimar Döffinger Reimar.Doeffinger
Wed Mar 25 09:24:49 CET 2009


On Wed, Mar 25, 2009 at 08:25:39AM +0100, C?dric Schieli wrote:
>          case PIX_FMT_RGB4_BYTE:
> -            r= (i>>3    )*255;
> +            a= (i>>4    )*17;
> +            r= ((i>>3)&1)*255;
>              g= ((i>>1)&3)*85;
>              b= (i&1     )*255;
>              break;
>          case PIX_FMT_BGR4_BYTE:
> -            b= (i>>3    )*255;
> +            a= (i>>4    )*17;
> +            b= ((i>>3)&1)*255;


??? the changes to r and b seem right, but what are you calculating for
a?
Just const int a = 255 should do it.
Also instead of those r,b changes it would make more sense to let the loop
only run to 16 for PIX_FMT_RGB4_BYTE and PIX_FMT_BGR4_BYTE.
And actually for now you could just add
pal[i] |= 0xff000000;
and change nothing else at all, but I don't know what Michael prefers.



More information about the ffmpeg-devel mailing list