Yadif

Abstract

author: Fizick (Alexander Balakhnin)
version: 1.7
download: http://avisynth.org.ru/
category: Deinterlacing & Pulldown Removal
requirements:YV12, YUY2 color formats
license: GPL

Port of YADIF (Yet Another DeInterlacing Filter) from MPlayer by Michael Niedermayer (http://www.mplayerhq.hu). It check pixels of previous, current and next frames to re-create the missed field by some local adaptive method (edge-directed interpolation) and uses spatial check to prevent most artifacts.

Syntax and parameters

Yadif (clip, int "mode", int "order", bool "planar", int "opt")

mode = 0 : temporal and spatial interlacing check (default).

= 1 : double framerate (bob), temporal and spatial interlacing check.

= 2 : skips spatial interlacing check.

= 3 : double framerate (bob), skips spatial interlacing check.

order = -1 : field order as Avisynth assumes (default).

= 0 : Bottom field first.

= 1 : Top field first.

planar = false : usual Avisynth pixel format (default).

= true : flag (ignored for YV12) for (hacked) planar YUY2 color format of input and output clips, compatible with Interleaved2planar and Planar2Interleaved functions from RemoveGrain (SSETools) plugin by Kassandro (for excluding of several conversions).

opt = -1 : CPU optimization - auto (default).

= 0 : slow C version.

= 1 : Integer SSE.

= 2 : SSE2.

= 3 : SSSE3 (some).

Features and limitations

Implemented as Avisynth C-plugin (not regular Avisynth plugin).
Must be loaded with Load_Stdcall_plugin("yadif.dll") or LoadCplugin("yadif.dll") (not LoadPlugin !). Do not use autoloading. (Note: in Avisynth v2.5.7-2.5.8 there is no need in explicit loading of Avisynth_c.dll by user for such plugins.)

Tested in Avisynth v2.5.7, v2.5.8 (probably works with v2.5.6 and above).

Field parity of source clip must be properly set (use AssumeTFF, AssumeBFF).

Very fast. Assembler SSEMMX optimization from Mplayer (compiled with MinGW GCC). Also SSE2 (some SSSE3) from ffdshow-tryout (fixed).

YV12 planar, YUY2 (both usual and planar) color formats only.

Discussion

http://forum.doom9.org/showthread.php?t=124284

License

This plugin is free software released under the GNU GPL license v2 (see file gpl.txt). If you redistribute binary DLL file, then you must also redistribute source code files, gpl.txt license, and please do no forget this documentation file.

Revisions

Version 0.1 (03.04.2007)

Version 0.2 (04.04.2007)

Version 0.3 (06.04.2007)

Version 0.4 (11.04.2007)

Version 0.5 (17.04.2007)

Version 0.6 (07.05.2007)

Version 0.7 (31.05.2007)

Version 0.8 (17.06.2007)

Version 0.9 (22.07.2007)

Version 1.1 (06.08.2009)

Version 1.2 (07.08.2009)

Version 1.3 (12.08.2009)

Version 1.4 (13.08.2009)

Version 1.5 (16.08.2009)

Version 1.6 (25.08.2009)

Version 1.7 (08.10.2009)

Download Yadif version 1.7