[FFmpeg-devel] [misc-filters PATCH 2/5] Add color source.

Stefano Sabatini stefano.sabatini-lala
Thu Jul 1 23:12:02 CEST 2010


On date Thursday 2010-07-01 13:26:07 +0200, Michael Niedermayer encoded:
> On Wed, Jun 30, 2010 at 01:42:12AM +0200, Stefano Sabatini wrote:
> [...]
> > +static int color_config_props(AVFilterLink *inlink)
> > +{
> > +    AVFilterContext *ctx = inlink->src;
> > +    ColorContext *priv = ctx->priv;
> > +    uint8_t rgba_color[4];
> > +    uint8_t rgba_map[4];
> > +    int i, is_packed_rgb = 1;
> > +    const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format];
> > +
> > +    switch (inlink->format) {
> > +    case PIX_FMT_ARGB:
> > +        rgba_map[ALPHA] = 0; rgba_map[RED] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE] = 3;
> > +        break;
> > +    case PIX_FMT_ABGR:
> > +        rgba_map[ALPHA] = 0; rgba_map[BLUE] = 1; rgba_map[GREEN] = 2; rgba_map[RED] = 3;
> > +        break;
> > +    case PIX_FMT_RGBA:
> > +    case PIX_FMT_RGB24:
> > +        rgba_map[RED] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE] = 2; rgba_map[ALPHA] = 3;
> > +        break;
> > +    case PIX_FMT_BGRA:
> > +    case PIX_FMT_BGR24:
> > +        rgba_map[BLUE] = 0; rgba_map[GREEN] = 1; rgba_map[RED] = 2; rgba_map[ALPHA] = 3;
> > +        break;
> > +    default:
> > +        is_packed_rgb = 0;
> > +    }
> 
> looks like a duplicate

Updated, depends on the refactoring patches just posted. Also
documentation added.

Regards.
-- 
FFmpeg = Free and Faithful Multipurpose Ponderous Elfic Gorilla



More information about the ffmpeg-devel mailing list