[FFmpeg-devel] [PATCH]Make systematic palette opaque

Michael Niedermayer michaelni at gmx.at
Thu Dec 15 05:34:30 CET 2011


On Thu, Dec 15, 2011 at 01:48:33AM +0100, Clément Bœsch wrote:
> On Thu, Dec 15, 2011 at 01:14:34AM +0100, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > Whatever a systematic palette is, I don't think it should be transparent.
> >
> > Please comment, Carl Eugen
>
> > diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
> > index 6e97085..3847c53 100644
> > --- a/libavutil/imgutils.c
> > +++ b/libavutil/imgutils.c
> > @@ -175,7 +175,7 @@ int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt)
> >          default:
> >              return AVERROR(EINVAL);
> >          }
> > -        pal[i] = b + (g<<8) + (r<<16);
> > +        pal[i] = b + (g<<8) + (r<<16) + (0xFF<<24);
>
> Isn't this undefined for the MSB? 0xFFU<<24 should be ok, if anyone can
> confirm…

its defined in ANSI C but not C99 AFAIK.

but if someone wants to replace all by U or (-1)<<24 or whatever, i
wont object. I just doubt we will ever find a real world compiler to
produce less buggy code due to that change.


[...]

--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111215/79409ac2/attachment.asc>


More information about the ffmpeg-devel mailing list