[FFmpeg-devel] [PATCH] Add pad filter
Michael Niedermayer
michaelni
Wed Dec 23 05:30:12 CET 2009
On Mon, Dec 21, 2009 at 11:30:42PM +0100, Stefano Sabatini wrote:
> On date Sunday 2009-12-20 15:56:11 +0100, Artur Bodera encoded:
> > On Sat, Dec 12, 2009 at 6:43 PM, Michael Niedermayer <michaelni at gmx.at>wrote:
> >
> > >
> > > Besides this, we need regression tests for the filters, i plan to make
> > > this mandatory for every new filter now, too many bugs sliped through
> > > already.
> > > No reg test for a filter -> no approval.
> > >
> >
> >
> > Now I need why :-) This filter is eating up all my machine's memory as it
> > progresses with encoding. Forgot some garbage collection?
>
> Yes indeed, see what I was missing in end_frame().
>
> > btw: why none has commented on the vfilters + -pad[right|top|bottom|left]
> > bug ?
> > When trying to use any of the built-in padding modifiers together with
> > -vfilters, the resulting video is always garbled green-ish confetti.
>
> Those options are meant to be dropped soon (I'm considering to do that
> in the libavfilter repo as soon as we'll have the pad filter
> committed), so I'm simply ignoring those bugs.
>
> Attached an updated version, let me know if you find other problems
> with it.
>
[...]
> + pad->color[0] = RGB_TO_Y(rgba_color[0], rgba_color[1], rgba_color[2]);
> + pad->color[1] = RGB_TO_U(rgba_color[0], rgba_color[1], rgba_color[2], 0);
> + pad->color[2] = RGB_TO_V(rgba_color[0], rgba_color[1], rgba_color[2], 0);
> + pad->color[3] = rgba_color[3];
> +
> + for (plane = 0; plane < 4; plane++) {
> + int line_size;
> + int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
> +
> + pad->line_step[plane] = 1;
> + line_size = (pad->w >> hsub) * pad->line_step[plane];
> + pad->line[plane] = av_malloc(line_size);
> + memset(pad->line[plane], pad->color[plane], line_size);
> + }
for()
pad->line[0]= RGB_TO_Y(...
...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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-devel/attachments/20091223/04d145e5/attachment.pgp>
More information about the ffmpeg-devel
mailing list