[FFmpeg-devel] [PATCH] add fieldorder video filter

Mark Himsley mark at mdsh.com
Sun Apr 3 11:25:14 CEST 2011


On 02/04/2011 17:28, Michael Niedermayer wrote:
> On Fri, Apr 01, 2011 at 07:31:41PM +0100, Mark Himsley wrote:
> [...]
>> +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
>> +{
>> +    AVFilterContext   *ctx        = inlink->dst;
>> +    FieldOrderContext *fieldorder = ctx->priv;
>> +    AVFilterLink      *outlink    = ctx->outputs[0];
>> +
>> +    AVFilterBufferRef *inpicref   = inlink->cur_buf;
>> +
>> +    /** can only do slices if filter is doing nothing,
>> +     *  because this filter has to read from pixels outside of the slice */
>> +    if (   !inpicref->video->interlaced
>> +        || inpicref->video->top_field_first == fieldorder->dst_tff) {
>> +        avfilter_draw_slice(outlink, y, h, slice_dir);
>> +    }
>> +}
> 
> I dont see this problem, a slice from 16..32 can just be output to
> 15..31
> its maybe not the easiest thing, requireing some corner cases to be
> handeld but it can be done.
> 
> Of course this isnt needed to get the patch approved. its fine as is
> If you dont want to work on the more generic slice support

Thank you, I hadn't considered changing the output slice height.

As you said, there are many corner cases: including the possibility of
slices arriving in non-sequential orders (I'm assume that if an input
slice of lines 0..15 has arrived before input slice 16..31 then the
output slice 15..30 can read from lines within both input slices 0..15
and 16..31).

I would like to think about that in the future.

-- 
Mark


More information about the ffmpeg-devel mailing list