[FFmpeg-devel] [PATCH] Add pad filter

Stefano Sabatini stefano.sabatini-lala
Sun Nov 29 02:13:51 CET 2009


On date Friday 2009-11-27 02:42:59 +0100, Michael Niedermayer encoded:
> On Fri, Nov 27, 2009 at 01:09:28AM +0100, Stefano Sabatini wrote:
> [...]
> > +static void draw_slice(AVFilterLink *link, int y, int h)
[...]
> > +    }
> 
> a draw_rectangle() function could simplify above

Implemented and used.
 
> > +
> > +    y1 = y == 0 ? 0 : y + pad->y;
> > +    h1 = h;
> > +    if (y == 0)
> > +        h1 += pad->y;
> > +    if (y+h >= link->h)
> > +        h1 += pad->h - pad->y - link->h;
> > +
> > +    avfilter_draw_slice(link->dst->outputs[0], y1, h1);
> 
> this draw slice behaves quite odd, i would have expectd that slices didnt grow

Also this was wrong as it was misbehaving when in combination with
vflip, since the slices direction order wasn't respected.

Now the filter send slices with dimension not greater than those of
the input slice, and keep in consideration the slices direction (which
unfortunately complicates the code).

It seems to work with the random tests I performed, but I found other
problems not related with this patch (see the other mail), and in
combination with other filters vflip, crop, slicify.

Regards.
-- 
FFmpeg = Frenzy and Faboulous Mastodontic Purposeless Extroverse Gadget
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-pad-filter.patch
Type: text/x-diff
Size: 15016 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091129/d7e86884/attachment.patch>



More information about the ffmpeg-devel mailing list