[FFmpeg-devel] [PATCH] imgconvert: add macro pixdesc_has_alpha for checking if a pixel format has an alpha component

Michael Niedermayer michaelni at gmx.at
Fri Mar 9 18:04:26 CET 2012


On Fri, Mar 09, 2012 at 05:16:41PM +0100, Stefano Sabatini wrote:
> On date Thursday 2012-03-08 17:01:28 +0100, Michael Niedermayer encoded:
> > On Thu, Mar 08, 2012 at 02:44:47PM +0100, Stefano Sabatini wrote:
> > > Reduce redundancy and simplify.
> > > ---
> > >  libavcodec/imgconvert.c |   21 ++++++---------------
> > >  1 files changed, 6 insertions(+), 15 deletions(-)
> > > 
> > > diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
> > > index 058a0d5..0d1ce3f 100644
> > > --- a/libavcodec/imgconvert.c
> > > +++ b/libavcodec/imgconvert.c
> > > @@ -55,9 +55,12 @@
> > >  #define deinterlace_line         deinterlace_line_c
> > >  #endif
> > >  
> > > +#define pixdesc_has_alpha(pix_desc)                                     \
> > > +    (pix_desc->nb_components == 2 || pix_desc->nb_components == 4       \
> > > +     || pix_desc->flags & PIX_FMT_PAL)
> > 
> > does this match is_alpha for all pix fmts ?
> 
> These are the alpha formats, after and before:

LGTM then

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

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- 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/20120309/b64b02e6/attachment.asc>


More information about the ffmpeg-devel mailing list