Decomb Plugin for Avisynth
(Version for Avisynth 2.5/2.6)


Introduction

This package of plugin functions for Avisynth provides the means for removing combing artifacts from telecined progressive streams, interlaced streams, and mixtures thereof. Functions can be combined to implement inverse telecine (IVTC) for both NTSC and PAL streams.

The term "combing" is used as a general term versus "interlacing" because interlacing is usually associated with nonprogressive streams. What look like interlacing artifacts can be seen on telecined progressive streams, so I use the term combing to refer to all such artifacts, regardless of the type of the stream.

The package automatically adapts to any telecine/capture patterns, e.g., 3:2 NTSC or 1:1 PAL, and mixtures thereof, although if you want to decimate the recovered progressive stream, you have to specify the desired decimation ratio. The recovery process is completely modeless (patternless) and does not rely on any fixed telecine patterns or phasing. None of the functions introduce a delay in the audio or video streams.

For most applications, there are no parameters to set. Some capture cards require a field swap after the recovery process and the Telecide function allows this to be specified.

The algorithm is an adaptive one that operates in three steps:

  1. Progressive frames are recovered through field matching.

  2. The resulting frames are tested to determine if they are combed. (Some source stream problems can cause combed frames to come through step 1. See the help file in the distribution for full details.) If a frame is not combed, it is passed through untouched.

  3. Frames that are detected as combed are smart deinterlaced. The deinterlacing is adaptive, i.e., only the portions of a frame that are combed will be deinterlaced. This means that full detail is retained in static picture areas.

I'd like to thank Thomas Daniel for his valuable assistance during the development of this software. He made several valuable suggestions, pointed out useful resources, performed torture testing on very difficult streams, ran head-to-head tests against other available decombing software, and helped me to understand the world of anime.

Members of the forum at doom9.org provided much help and encouragment.

Usage guidelines and syntax descriptions are provided in the help file contained in the distribution ZIP file.

Note that this version of Decomb requires Avisynth version 2.5 or greater! It will not work with earlier versions. This version of Decomb supports both YUY2 and YV12 color spaces.


The latest release of Decomb is version 5. This version significantly changes the interface and functionality. For those users that remain more comfortable with version 4, I have retained links to that version. But I recommend upgrading and learning the new interface!


Version 5.2.4 [Source code]

Version 5.2.3 [Source code]

Version 5.2.2 [Source code]

Version 5.2.1 [Source code]

Version 4.10 beta 4 [Source code]

Version 5.2.4 is now compatible with Avisynth 2.6.

Version 5.2.3 corrects deficiencies in Decimate's mode=2 operation.

Version 5.2.2 removes Telecide's order parameter. The field order is now picked up from Avisynth. Refer to the Decomb reference manual for details.

Version 5.2.1 modifies Decimate(). Modes 0, 1, and 3 now use the same windowed comparisons as does mode 2. Windowed comparisons produce more accurate and reliable decimation.

Version 5.1.1 properly restores the multimedia state (emms opcodes). This fixes some instances of green frames, etc.

Version 5.1.0 adds a separate threshold for backward matching. It also adds low-level speedups and an IsCombed() utility function, both contributed by Klaus Post.

Version 5.0.0 is a major rewrite, so describing the changes and improvements here would be tedious. Please refer to the extensive documentation included with the new release.

Version 4.10 beta 4 fixes several problems in Telecide/Decimate hinting that affected Decimate's mode=1 and mode=3 behavior.

Version 4.10 beta 2 makes the following changes:

  1. Improved deinterlacing for YV12 (less residual combing at a given 'dthreshold').

  2. Added 'map' option to Telecide and FieldDeinterlace. This option allows the deinterlacing motion map to be visualized.

  3. Added 'mthresh' option to Telecide. This option can significantly reduce the processing burden of postprocessing. It defines a "goodness of match" criterion for frames coming out of the field matching process; postprocessing is applied only to those frames whose field match falls below a threshold of goodness.

  4. Renamed Telecide's 'x' manual override to 'v' and added an 'f' override (for specifying video and film sections).

  5. Revised the meaning of the 'chroma' option for Telecide and FieldDeinterlace. Now, chroma is always deinterlaced when a frame is detected as combed. The chroma option now determines only whether chroma combing is included in deciding whether a frame is combed (full=false). Often, luma/chroma crosstalk can appear as interlacing and falsely trigger deinterlacing. The chroma option is now defaulted to false to avoid this.

  6. Fixed a problem in YUY2 which caused Telecide to erroneously report whether a pattern override occurs.

  7. Telecide now accepts mod 2 width for input instead of mod 4.

  8. 'gthresh' now defaults to 25. 'theshold' defaults to 20. 'dthreshold' defaults to 7.

Version 4.06 beta 7 improves the speed of Telecide() for YV12, and relaxes the width restriction from multiple of 4 to multiple of 2.

Version 4.06 beta 6 fixes FieldDeinterlace(chroma=true), which produced artifacts.

[up to home page]