[FFmpeg-soc] [PATCH] Add fade filter to libavfilter

Michael Niedermayer michaelni at gmx.at
Wed Mar 31 23:19:09 CEST 2010


On Wed, Mar 31, 2010 at 01:23:29AM -0400, Brandon Mintern wrote:
> On Wed, Mar 31, 2010 at 12:43 AM, Brandon Mintern <bmintern at gmail.com> wrote:
> > I am happy to present my first-ever open source code contribution, a
> > "fade" filter for libavfilter!
> [snip]
[...]

> +static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
> +{
> +    FadeContext *fade = link->dst->priv;
> +    AVFilterPicRef *in  = link->cur_pic;
> +    AVFilterPicRef *out = link->dst->outputs[0]->outpic;
> +    uint8_t *inrow, *outrow;
> +    int i, j, plane;
> +
> +    /* luma plane */
> +    inrow  = in-> data[0] + y * in-> linesize[0];
> +    outrow = out->data[0] + y * out->linesize[0];
> +    for(i = 0; i < h; i ++) {
> +        for(j = 0; j < link->w; j ++)
> +            outrow[j] = (uint8_t) ((float) inrow[j] * fade->fade_factor + 0.5);

please avoid floats, it makes regression testing unneccesarily hard
Its probably ok to use floats/doubles in init, but it feels wrong
at the pixel level

anyway, real review and approval left to vitor or bobby

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

Avoid a single point of failure, be that a person or equipment.
-------------- 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-soc/attachments/20100331/f0166153/attachment.pgp>


More information about the FFmpeg-soc mailing list