[FFmpeg-devel] [PATCH] colorbalance filter

Clément Bœsch ubitux at gmail.com
Mon Apr 15 16:42:38 CEST 2013


On Mon, Apr 15, 2013 at 02:35:43PM +0000, Paul B Mahol wrote:
[...]
> > It's a simple LUT table, so you can add a direct path easily.
> >
> >> +    return ff_filter_frame(ctx->outputs[0], buf);
> >> +}
> >> +
> >> +static const AVFilterPad colorbalance_inputs[] = {
> >> +    {
> >> +        .name           = "default",
> >> +        .type           = AVMEDIA_TYPE_VIDEO,
> >> +        .filter_frame   = filter_frame,
> >
> >> +        .needs_writable = 1,
> >
> > ...and then avoid the need for this.
> 
> Isn't point of that to not write additional code with no any gain.
> 

If the frame is read-only, needs_writable will indeed allocate a new frame
for you, but it will also copy the whole data of each planes. But your
filter is designed to override every data of the frame, so it's
meaningless to ask for a copy of the data. That's what the direct path is
for, avoid the data copy when the frame is read-only.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130415/940a7279/attachment.asc>


More information about the ffmpeg-devel mailing list