# Yadif

## Abstract

author: Fizick (Alexander Balakhnin)
version: 0.9
download: http://avisynth.org.ru/
category: Deinterlacing & Pulldown Removal
requirements: YUY2, Planar YV12 color format
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 artifactes.

## Syntax and parameters

`Yadif` (clip, int "mode", int "order")

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.

## 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 there is no need in explicit loading of Avisynth_c.dll by user for such plugins.)

Tested in Avisynth v2.5.7 (probaly 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).

YUY2, Planar YV12 color format only.

## Discussion

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

## License

This plugin is free software released under the GNU GPL license. See file gnu.txt.

## Revisions

Version 0.1 (03.04.2007)

- First version

Version 0.2 (04.04.2007)

- Fixed bug with wrong used parity.
- Added Bob mode=1,3.
- Added order parameter.

Version 0.3 (06.04.2007)

- Finally (?) fixed bug with wrong used parity.
- Set correct FPS for Bob modes.

Version 0.4 (11.04.2007)

- Finally (!) fixed bug with wrong used parity for TFF without AssumeTFF.
- Removed limitation on frames pitches equality.

Version 0.5 (17.04.2007)

- Fixed bug with very first and very last frames.

Version 0.6 (07.05.2007)

- Added YUY2 color format.

Version 0.7 (31.05.2007)

- Processing of first and last lines by spatial average or duplicate (requested by puddy).

Version 0.8 (17.06.2007)

- Probably fixed memory access bug (report by akapuma).

Version 0.9 (22.07.2007)

- Fixed memory access bug some width and height and YUY2 (report by ronnylov).

### Download Yadif version 0.9