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

Michael Niedermayer michaelni
Wed Mar 25 13:43:01 CET 2009


On Wed, Mar 25, 2009 at 09:24:49AM +0100, Reimar D?ffinger wrote:
> 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.

that might cause uninitalized errors in valgrind that might hide real errors
it might also lead to random behavior when the whole pal is stored


> 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.

agree

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090325/cc5df4a1/attachment.pgp>



More information about the ffmpeg-devel mailing list