EEDI2
From Avisynth wiki
		
		
		
| Abstract | |
|---|---|
| Author | tritical, HolyWu, Asd-g | 
| Version | v1.0.0 | 
| Download | EEDI2-1.0.0.7z | 
| Category | Deinterlacing | 
| License | GPLv2 | 
| Discussion | Doom9 Thread | 
| Contents | 
Description
EEDI2 (Enhanced Edge Directed Interpolation) resizes an image by 2x in the vertical direction by copying the existing image to 2*y(n) and interpolating the missing field. It is intended for edge-directed interpolation for deinterlacing (i.e. not really made for resizing a normal image, but can do that as well).
Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
-  Supported color formats: Y8, YV12, YV16, YV24
- AviSynth+: all planar formats (8/10/12/14/16-bit, Y/YUV/RGB with or without alpha) are supported.
 
- *** vc_redist.x86.exe is required for EEDI2-x86
- *** vc_redist.x64.exe is required for EEDI2-x64
Syntax and Parameters
- EEDI2 (clip, int "mthresh", int "lthresh", int "vthresh", int "estr", int "dstr", int "maxd", int "field", int "map", int "nt", int "pp")
- clip    =   
 - Input clip to process. It must be in 8..16-bit planar format with or without alpha.
 
 
- clip    =   
- int  mthresh = 10 
 
- int  lthresh = 20 
 
- int  vthresh = 20 
 - These all control edge detection used for building the initial edge map.  
- mthresh is the edge magnitude threshold... its range is from 0 to 255, lower values will detect weaker edges.
- lthresh is the laplacian threshold... its range is 0 to 510, lower values will detect weaker lines.
- vthresh is the variance threshold... its range is 0 to a large number, lower values will detect weaker edges.
 
- Use the "map" option to tweak these settings as needed.
 
- These all control edge detection used for building the initial edge map.  
 
- int  mthresh = 10 
- int  estr = 2 
 
- int  dstr = 4 
 - These are used for dilation and erosion of the edge map. 
- estr sets the required number of edge pixels (<=) in a 3x3 area, in which the center pixel has been detected as an edge pixel, for the center pixel to be removed from the edge map.
- dstr sets the required number of edge pixels (>=) in a 3x3 area, in which the center pixel has not been detected as an edge pixel, for the center pixel to be added to the edge map.
 
- Use the "map" option to tweak these settings as needed.
 
- These are used for dilation and erosion of the edge map. 
 
- int  estr = 2 
- int  maxd = 24 
 - Sets the maximum pixel search distance for determining the interpolation direction.
- Larger values will be able to connect edges and lines of smaller slope but can lead to artifacts. Sometimes using a smaller maxd will give better results than a larger setting. The maximum possible value for maxd is 29.
 
 
- int  maxd = 24 
- int  field = -1 
 - Controls which field in the resized image the original image will be copied too.
- When using AviSynth's internal parity value top field first (tff) = 1 and bottom field first (bff) = 0. Possible options:
- -2 = alternates each frame, uses AviSynth's internal parity value to start
- -1 = uses AviSynth's internal parity value
- 0 = bottom field
- 1 = top field
- 2 = alternates each frame, starts with bottom
- 3 = alternates each frame, starts with top
 
 
 
- int  field = -1 
- int  map = 0 
 - Allows one of three possible maps to be shown.  Possible settings:
- 0 - no map
- 1 - edge map (edge pixels will be set to 255 and non-edge pixels will be set to 0.)
- 2 - original scale direction map
- 3 - 2x scale direction map
 
 
- Allows one of three possible maps to be shown.  Possible settings:
 
- int  map = 0 
- int  nt = 50 
 - Defines a noise threshold between pixels in the sliding vectors, this is used to set initial starting values.
- Lower values should reduce artifacts but sacrifice edge reconstruction... while higher values should improve edge reconstruction but lead to more artifacts. The possible range of values is 0 to 256.
 
 
- int  nt = 50 
- int  pp = 1 
 - Enables two optional post-processing modes aimed at reducing artifacts by identifying problems areas and then using plain vertical linear interpolation in those parts. The possible settings are:
- 0 - no post-processing
- 1 - check for spatial consistency of final interpolation directions
- 2 - check for junctions and corners
- 3 - do both 1 and 2
 
- Using the pp modes will slow down processing and can cause some loss of edge directedness.
 
- Enables two optional post-processing modes aimed at reducing artifacts by identifying problems areas and then using plain vertical linear interpolation in those parts. The possible settings are:
 
- int  pp = 1 
Examples
EEDI2 with default settings:
AviSource("blah.avi") EEDI2(mthresh=10, lthresh=20, vthresh=20, estr=2, dstr=4, maxd=24, field=-1, map=0, nt=50, pp=1)
Changelog
   06/18/2020  v1.0.0
       - Initial release; port of the VapourSynth plugin
       - 8-16bit all planar colorspace support
       - Dropped YUY2 colorspace
   06/07/2006  v0.9.2
       + various internal changes to help reduce artifacts around repeated
         patterns and to improve construction of lines/edges with small slope
       - Changed map from bool to int
       - Changed default maxd value from 12 to 24
       - Changed default pp value from 0 to 1
       - a few minor bugfixes
   04/03/2006  v0.9.1
       + Added pp parameter and pp modes 1, 2, and 3
       - A few minor internal changes
       - Fixed some documentation errors (field parameter)
       - do a vi.SetFieldBased(false) in constructor
       - fixed a bug causing reads past the last line and incorrect interpolation
         of the very top or very bottom line in some cases
   11/29/2005  v0.9
       - Initial release
Archived Downloads
| Version | Download | Mirror | 
|---|---|---|
| v0.9.2 (x86_x64) | EEDI2_092_32_64.7z | EEDI2_092_32_64.7z /// MediaFire | 
| v0.9.2 | EEDI2v092.zip | 
- x86/x84 version compiled by Groucho2004.
External Links
- GitHub - Source code repository (v0.9.2).
- GitHub - Source code repository (v1.0.0).
- GitHub - Source code repository (VapourSynth).
- Doom9 Forum - EEDI2 for VapourSynth.
- GitHub - HandBrake's EEDI2 port with nicely commented source code: eedi2.c, eedi2.h
Back to External Filters ←
