[FFmpeg-devel] [PATCH 1/2] libavfilter: Add new tinterlace mode

Stefano Sabatini stefasab at gmail.com
Fri Apr 27 23:07:05 CEST 2012


On date Friday 2012-04-27 22:44:38 +0200, Stefano Sabatini encoded:
> On date Thursday 2012-04-26 21:35:37 +0100, Stuart Morris encoded:
[...]
> > +    switch (tinterlace->mode) {
> > +    case 6: /* re-interlace preserving image height, double frame rate 
> > +             * Output mix of current and next frame */
> > +        tff = next->video->top_field_first;
> > +        out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
> > +        avfilter_copy_buffer_ref_props(out, next);
> > +        out->video->interlaced = 1;
> > +
> > +        /* write odd frame second field lines into the second field of the new frame */
> > +        copy_picture_field(out->data, out->linesize,
> > +                           cur->data, cur->linesize,
> > +                           inlink->format, inlink->w, inlink->h,
> > +                           tff ? FIELD_LOWER : FIELD_UPPER, 1, tff ? FIELD_LOWER : FIELD_UPPER);
> > +        /* write even frame first field lines into the first field of the new frame */
> > +        copy_picture_field(out->data, out->linesize,
> > +                           next->data, next->linesize,
> > +                           inlink->format, inlink->w, inlink->h,
> > +                           tff ? FIELD_UPPER : FIELD_LOWER, 1, tff ? FIELD_UPPER : FIELD_LOWER);
> > +                           
> > +        avfilter_start_frame(outlink, out);
> > +        avfilter_draw_slice(outlink, 0, outlink->h, 1);
> > +        avfilter_end_frame(outlink);
> > +        break;    
> 
> Missing avfilter_unref_buffer()?

Replying to myself, no.

But as Michael noted, this could be moved to the switch block above.
-- 
FFmpeg = Fundamental & Fiendish Marvellous Perennial Elected Goblin


More information about the ffmpeg-devel mailing list