[FFmpeg-devel] [PATCH] colorbalance filter

Paul B Mahol onemda at gmail.com
Mon Apr 15 16:52:33 CEST 2013


On 4/15/13, Clement Boesch <ubitux at gmail.com> wrote:
> 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.

Ugh, how i missed that? ... thanks.

>
> [...]
>
> --
> Clement B.
>


More information about the ffmpeg-devel mailing list