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

Michael Niedermayer michaelni at gmx.at
Fri Apr 27 21:52:19 CEST 2012


On Thu, Apr 26, 2012 at 09:35:37PM +0100, Stuart Morris wrote:
> This new mode is useful for generating frames for interlaced video displays.
> Typically interlaced video displays have no form of field synchronisation.
> This new mode guarantees correct field order without any requirement for
> field synchronisation.
> 
> ---
>  libavfilter/vf_tinterlace.c |   33 +++++++++++++++++++++++++++++++--
>  1 files changed, 31 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 libavfilter/vf_tinterlace.c
> 
> diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
> old mode 100644
> new mode 100755
> index 8407d1f..0f79708
> --- a/libavfilter/vf_tinterlace.c
> +++ b/libavfilter/vf_tinterlace.c
> @@ -68,9 +68,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
>      if (args) {
>          n = sscanf(args, "%d", &tinterlace->mode);
>  
> -        if (n != 1 || tinterlace->mode < 0 || tinterlace->mode > 5) {
> +        if (n != 1 || tinterlace->mode < 0 || tinterlace->mode > 6) {
>              av_log(ctx, AV_LOG_ERROR,
> -                   "Invalid mode '%s', use an integer between 0 and 5\n", args);
> +                   "Invalid mode '%s', use an integer between 0 and 6\n", args);
>              return AVERROR(EINVAL);
>          }
>      }
> @@ -257,12 +257,41 @@ static void end_frame(AVFilterLink *inlink)
>          avfilter_unref_buffer(tinterlace->next);
>          tinterlace->next = NULL;
>          break;
> +    case 6: /* re-interlace preserving image height, double frame rate 
> +             * Output current frame first */
> +        out = avfilter_ref_buffer(cur, AV_PERM_READ);
> +        break;
>      }
>  
>      avfilter_start_frame(outlink, out);
>      avfilter_draw_slice(outlink, 0, outlink->h, 1);
>      avfilter_end_frame(outlink);
>  
> +    switch (tinterlace->mode) {

please move this in the switch above instead of creating a second
switch. Or did i miss a reason why this isnt possible ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120427/8b6da4fd/attachment.asc>


More information about the ffmpeg-devel mailing list