<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AmjadSONY</id>
		<title>Avisynth wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AmjadSONY"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Special:Contributions/AmjadSONY"/>
		<updated>2026-04-27T16:21:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php/File:Crt_display.avsi</id>
		<title>File:Crt display.avsi</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/File:Crt_display.avsi"/>
				<updated>2025-11-30T19:06:26Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: AmjadSONY uploaded a new version of &amp;amp;quot;File:Crt display.avsi&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Crt_display</id>
		<title>Crt display</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Crt_display"/>
				<updated>2025-11-30T18:53:48Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: add avs+ mod&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Adjustment_filters|Effects}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|1={{Author/cretindesalpes}}&lt;br /&gt;
|2=v1.0&lt;br /&gt;
|3=[http://ldesoras.free.fr/src/avs/crt-display-1.0.zip crt-display-1.0.zip] or avs+ only mod [[Media:Crt_display.avsi‎|Crt_display.avsi]]&lt;br /&gt;
|4=Effects&lt;br /&gt;
|5=&lt;br /&gt;
|6=[https://forum.doom9.org/showthread.php?t=170732 Doom9 Thread]}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
[[crt_display]] is a function that emulates a CRT display using aperture grille (Trinitron) or Cromaclear technologies. It is slow but gives interesting results. It implements various features like:&lt;br /&gt;
&lt;br /&gt;
*Works at any (non-integer) upscaling factor&lt;br /&gt;
*Various ways of adjusting the scanline thickness and beam shape&lt;br /&gt;
*Low-pass filtering of the input signal&lt;br /&gt;
*Specific gamma target&lt;br /&gt;
*Beam glow&lt;br /&gt;
*Optional colored phosphor effect and shadow mask&lt;br /&gt;
*Colors shift caused by beam misalignment&lt;br /&gt;
*Automatic contrast adjustment&lt;br /&gt;
*Halation&lt;br /&gt;
*Very large upscale is possible, showing the grid of phosphors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements==&lt;br /&gt;
* [x86] [[AviSynth+]] or [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater&lt;br /&gt;
* [x64] [[AviSynth+]]&lt;br /&gt;
* Supported color formats: [[RGB24]], [[RGB32]]&lt;br /&gt;
* [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|Progressive]] input only &lt;br /&gt;
&lt;br /&gt;
==== Required Plugins ====&lt;br /&gt;
Latest version of the following plugins are recommended unless stated otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Dither]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crt_display (clip src, float sw, float sh, float &amp;quot;voff&amp;quot;, float &amp;quot;ppp&amp;quot;,&lt;br /&gt;
\	float &amp;quot;cutoff&amp;quot;, float &amp;quot;scandist&amp;quot;, float &amp;quot;sharpv&amp;quot;, float &amp;quot;sharph&amp;quot;,&lt;br /&gt;
\	float &amp;quot;blurh&amp;quot;, float &amp;quot;glowgain&amp;quot;, float &amp;quot;glowh&amp;quot;, float &amp;quot;glowv&amp;quot;,&lt;br /&gt;
\	float &amp;quot;glowsens&amp;quot;, float &amp;quot;contrast&amp;quot;, float &amp;quot;gamma&amp;quot;, float &amp;quot;softclip&amp;quot;,&lt;br /&gt;
\	float &amp;quot;mix&amp;quot;, float &amp;quot;beamshape&amp;quot;, bool &amp;quot;phosphor&amp;quot;, bool &amp;quot;pgrid&amp;quot;,&lt;br /&gt;
\	float &amp;quot;vcs&amp;quot;, float &amp;quot;cromaclear&amp;quot;, float &amp;quot;maskpp&amp;quot;, float &amp;quot;gainb&amp;quot;,&lt;br /&gt;
\	float &amp;quot;halgain&amp;quot;, float &amp;quot;halrange&amp;quot;, string &amp;quot;pixel_type&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sw&lt;br /&gt;
	Horizontal scale factor.&lt;br /&gt;
&lt;br /&gt;
sh&lt;br /&gt;
	Vertical scale factor.&lt;br /&gt;
&lt;br /&gt;
voff&lt;br /&gt;
	Vertical centering of the scanlines.&lt;br /&gt;
	Set to 0, the scanlines are centered between two pixels. When set to&lt;br /&gt;
	0.5, the scanline are centered exactly on a pixel. Default is pixel-&lt;br /&gt;
	centered.&lt;br /&gt;
	This is a sensitive setting when the scale factor is a small integer.&lt;br /&gt;
	When sh = 3, it's recommended to set the value closer to 0 to make&lt;br /&gt;
	centered the dark gap between the scanlines.&lt;br /&gt;
&lt;br /&gt;
ppp&lt;br /&gt;
	Number of phosphor triads per source pixel.&lt;br /&gt;
	It is recommended to select a value that makes the phosphors aligned&lt;br /&gt;
	with destination pixels (for example 1 phosphor triad = 2 dest pix),&lt;br /&gt;
	in order to avoid moire patterns and beating.&lt;br /&gt;
&lt;br /&gt;
cutoff&lt;br /&gt;
	Cutoff frequency of the low-pass filter at the electronic level.&lt;br /&gt;
	Lowering it thinners 1-pixel wide details.&lt;br /&gt;
	Good values are between 0.8 and 1. Effect is disabled at 1.0.&lt;br /&gt;
&lt;br /&gt;
scandist&lt;br /&gt;
	Relative distance between two scanlines.&lt;br /&gt;
&lt;br /&gt;
sharpv&lt;br /&gt;
	Vertical sharpness of the scanlines.&lt;br /&gt;
	High sharpness makes the lines look thinner especially at low&lt;br /&gt;
	luminance and may reduce the overall contrast.&lt;br /&gt;
	Low sharpness thickens the lines and make them slightly blend.&lt;br /&gt;
	Use values between 0.5 and 2.0.&lt;br /&gt;
&lt;br /&gt;
sharph&lt;br /&gt;
	Horizontal beam focus.&lt;br /&gt;
	Use values between 0.5 and 2.0.&lt;br /&gt;
&lt;br /&gt;
blurh&lt;br /&gt;
	Amount of horizontal bluring to apply after the final resizing.&lt;br /&gt;
	Requires phosphor to be set. Set it to 0 to disable bluring.&lt;br /&gt;
	Sometimes with medium scale factors, when the individual phosphors&lt;br /&gt;
	have a size close to a single destination pixel, the display becomes&lt;br /&gt;
	incredibly messy. Blurring in the horizontal direction make the&lt;br /&gt;
	neighbour phophors slightly merge and reduce the gird artefacts.&lt;br /&gt;
	Moreover, it alows to amplify more the contrast with reduced&lt;br /&gt;
	color artefacts.&lt;br /&gt;
	Usually, values in range 1.0-2.0 give good results.&lt;br /&gt;
	The sweet spot can be very narrow, don't hesitate to try steps&lt;br /&gt;
	as small as 0.1. It's also very dependent from other settings,&lt;br /&gt;
	adjust it after other parameters have changed.&lt;br /&gt;
&lt;br /&gt;
glowgain&lt;br /&gt;
	Amount of glow left by the beam.&lt;br /&gt;
	Disabled when set to 0.&lt;br /&gt;
&lt;br /&gt;
glowh&lt;br /&gt;
	Width of the beam glow, in phosphor triads.&lt;br /&gt;
&lt;br /&gt;
glowv&lt;br /&gt;
	Height in scanlines of the beam glow.&lt;br /&gt;
&lt;br /&gt;
glowsens&lt;br /&gt;
	Glow sensitivity to light.&lt;br /&gt;
	With 1 the glow is uniform. Greater values will leave the dark spots&lt;br /&gt;
	intact and only make the bright spots glow.&lt;br /&gt;
&lt;br /&gt;
contrast&lt;br /&gt;
	Manual contrast amplification. The neutral value is 1.&lt;br /&gt;
	The value of 3 is generally good when the scaling factor is not high&lt;br /&gt;
	and the individual phosphors overlap. Use a slightly greater value&lt;br /&gt;
	when cromaclear is enable (should be 4).&lt;br /&gt;
	Contrast loss caused by thin scanlines or large phosphors is hard to&lt;br /&gt;
	recover.&lt;br /&gt;
	When unspecified, the contrast is set as high as possible depending&lt;br /&gt;
	on the other parameters.&lt;br /&gt;
&lt;br /&gt;
gamma&lt;br /&gt;
	Gamma of the emulated monitor. Typically 2.4 to 2.8 for CRT monitors.&lt;br /&gt;
	Default is the sRGB gamma (2.2).&lt;br /&gt;
&lt;br /&gt;
softclip&lt;br /&gt;
	Gently saturates the pixel values.&lt;br /&gt;
	Generally in range 0-1. Slightly reduces the overall contrast when&lt;br /&gt;
	pixel values are not clipping.&lt;br /&gt;
	Set to 0 for hard-clipping.&lt;br /&gt;
&lt;br /&gt;
mix&lt;br /&gt;
	Amount of CRT-emulated picture in the result. Does not bypass the&lt;br /&gt;
	gamma processing.&lt;br /&gt;
&lt;br /&gt;
beamshape&lt;br /&gt;
	Another way to sharpen the scanlines. The higher the value, the&lt;br /&gt;
	thinner the beam. Use values between 1 and 3. This gives control on&lt;br /&gt;
	the thickness of the beam at high luminance.&lt;br /&gt;
&lt;br /&gt;
phosphor&lt;br /&gt;
	Enable phosphor processing.&lt;br /&gt;
&lt;br /&gt;
pgrid&lt;br /&gt;
	Enables the black grid enclosing each phosphor, at the price of a&lt;br /&gt;
	higher calculation cost. Useful only for large scale factors, when&lt;br /&gt;
	individual phosphors are clearly visible.&lt;br /&gt;
	Requires phosphor processing.&lt;br /&gt;
&lt;br /&gt;
vcs&lt;br /&gt;
	Vertical color shift in scanline units, misaligning the red and blue&lt;br /&gt;
	beams.&lt;br /&gt;
	Realistic values are between -0.25 and +0.25. When set to 0, the beams&lt;br /&gt;
	are correctly aligned.&lt;br /&gt;
&lt;br /&gt;
cromaclear&lt;br /&gt;
	Implements the NEC's cromaclear variant of the aperture grille,&lt;br /&gt;
	combining it with a shadow mask. The value gives the amount of&lt;br /&gt;
	horizontal black grid to be mixed.&lt;br /&gt;
	May reduce the contrast.&lt;br /&gt;
&lt;br /&gt;
maskpp&lt;br /&gt;
	Number of cromaclear units per scanline. Same as ppp but vertically.&lt;br /&gt;
&lt;br /&gt;
gainb&lt;br /&gt;
	Manual contrast gain for the blue.&lt;br /&gt;
	For some reasons, the phosphor mix may generate a yellow tint in the&lt;br /&gt;
	high luminance ranges, depending on various parameters.&lt;br /&gt;
	Values ranging from 1.05 to 1.2 are generally enough to fix it without&lt;br /&gt;
	creating excessive blue tint in the darker colors.&lt;br /&gt;
	Use a test pattern to adjust the value.&lt;br /&gt;
&lt;br /&gt;
halgain&lt;br /&gt;
	Amount of halation.&lt;br /&gt;
	Keep it to a low value, typically in range 0.01-0.05.&lt;br /&gt;
	Disable it with 0.&lt;br /&gt;
&lt;br /&gt;
halrange&lt;br /&gt;
	Halation radius, in phosphor triad units.&lt;br /&gt;
&lt;br /&gt;
pixel_type&lt;br /&gt;
	Final RGB format. &amp;quot;RGB24&amp;quot; or &amp;quot;RGB32&amp;quot;.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
See examples in the Doom9 discussion thread.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v1.0         2014/06/05      - Initial release&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==External Links ==&lt;br /&gt;
*[https://forum.doom9.org/showthread.php?t=170732 Doom9 Forum] - crt_display discussion.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Effects|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2025-11-06T22:14:34Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: fix Preset typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.383s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[BWDIF]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-BWDIF/releases GitHub]&lt;br /&gt;
|For EdiMode modes &amp;quot;BWDIF+NNEDI3&amp;quot; and &amp;quot;BWDIF+EEDI3&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|For some new EdiMode modes and EdiExtPre.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than Preset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2025-11-06T22:09:32Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Source Match / Lossless */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.383s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[BWDIF]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-BWDIF/releases GitHub]&lt;br /&gt;
|For EdiMode modes &amp;quot;BWDIF+NNEDI3&amp;quot; and &amp;quot;BWDIF+EEDI3&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|For some new EdiMode modes and EdiExtPre.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than SourceMatch'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-07T06:21:17Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.383s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[BWDIF]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-BWDIF/releases GitHub]&lt;br /&gt;
|For EdiMode modes &amp;quot;BWDIF+NNEDI3&amp;quot; and &amp;quot;BWDIF+EEDI3&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|For some new EdiMode modes and EdiExtPre.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-02T18:29:36Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Optional Plugins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.382s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[BWDIF]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-BWDIF/releases GitHub]&lt;br /&gt;
|For EdiMode modes &amp;quot;BWDIF+NNEDI3&amp;quot; and &amp;quot;BWDIF+EEDI3&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|For some new EdiMode modes and EdiExtPre.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-02T18:21:38Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Optional Plugins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.382s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|for some new EdiMode modes and EdiExtPre&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-02T18:20:21Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Optional Plugins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.382s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/master/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|for some new EdiMode modes and EdiExtPre&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-02T18:19:24Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Optional Plugins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.382s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
|[[Vinverse_avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/master/avs%202.5%20and%20up/Vinverse_avsi.avsi GitHub]&lt;br /&gt;
|for some new EdiMode modes and EdiExtPre&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-02T18:00:37Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Core Plugins and Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.382s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/blob/05ef36cecde1de525fa194ab30c9cb4f17cf7240/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2022-03-02T17:51:27Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, Dogway, real.finder&lt;br /&gt;
| v3.382s&lt;br /&gt;
| 3=[https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2021-10-28T22:51:22Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. '''''They are intended to serve as a stopgap for plugins that not supporting true high bit depth yet so you shouldn't use them nowadays unless with some rare filters that work only with these High-bit-depth hacks'''''.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' (Stacked 16bit) aka Double Height, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB), hence the name &amp;quot;Double Height&amp;quot;. It's used in [[Dither tools]] and many others. (Sometimes in filters is referred as &amp;quot;lsb&amp;quot; only).&lt;br /&gt;
&lt;br /&gt;
*The '''Interleaved 16bit''' aka Double Width is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. It's used in [[https://www.videoartifact.com/hdr/ HDRCore]] and it was also used in [[flash3kyuu_deband]], [[LSMASHSource]] and other filters before they were updated to support 16bit planar (native HBD).&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns 16bit stacked (MSB and LSB stacked one on top of the other in a fake double height &amp;quot;8bit&amp;quot; stream).&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns 16bit interleaved (MSB and LSB interleaved together in a fake double width &amp;quot;8-bit&amp;quot; stream).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st examples of both Stacked and DoubleWidth below.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since Dfttest support HBD, but just for example&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[f3kdb]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## 16bit clip here&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[Hqdn3dY|Hqdn3d16Y]]()&lt;br /&gt;
 '''ConvertFromDoubleWidth'''()&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2021-10-28T22:50:52Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. '''They are intended to serve as a stopgap for plugins that not supporting true high bit depth yet so you shouldn't use them nowadays unless with some rare filters that work only with these High-bit-depth hacks'''.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' (Stacked 16bit) aka Double Height, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB), hence the name &amp;quot;Double Height&amp;quot;. It's used in [[Dither tools]] and many others. (Sometimes in filters is referred as &amp;quot;lsb&amp;quot; only).&lt;br /&gt;
&lt;br /&gt;
*The '''Interleaved 16bit''' aka Double Width is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. It's used in [[https://www.videoartifact.com/hdr/ HDRCore]] and it was also used in [[flash3kyuu_deband]], [[LSMASHSource]] and other filters before they were updated to support 16bit planar (native HBD).&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns 16bit stacked (MSB and LSB stacked one on top of the other in a fake double height &amp;quot;8bit&amp;quot; stream).&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns 16bit interleaved (MSB and LSB interleaved together in a fake double width &amp;quot;8-bit&amp;quot; stream).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st examples of both Stacked and DoubleWidth below.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since Dfttest support HBD, but just for example&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[f3kdb]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## 16bit clip here&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[Hqdn3dY|Hqdn3d16Y]]()&lt;br /&gt;
 '''ConvertFromDoubleWidth'''()&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2021-10-28T22:49:26Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap for plugins that not supporting true high bit depth yet so you shouldn't use then nowadays unless with some rare filters that work only with these High-bit-depth hacks.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' (Stacked 16bit) aka Double Height, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB), hence the name &amp;quot;Double Height&amp;quot;. It's used in [[Dither tools]] and many others. (Sometimes in filters is referred as &amp;quot;lsb&amp;quot; only).&lt;br /&gt;
&lt;br /&gt;
*The '''Interleaved 16bit''' aka Double Width is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. It's used in [[https://www.videoartifact.com/hdr/ HDRCore]] and it was also used in [[flash3kyuu_deband]], [[LSMASHSource]] and other filters before they were updated to support 16bit planar (native HBD).&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns 16bit stacked (MSB and LSB stacked one on top of the other in a fake double height &amp;quot;8bit&amp;quot; stream).&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns 16bit interleaved (MSB and LSB interleaved together in a fake double width &amp;quot;8-bit&amp;quot; stream).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st examples of both Stacked and DoubleWidth below.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since Dfttest support HBD, but just for example&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[f3kdb]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## 16bit clip here&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[Hqdn3dY|Hqdn3d16Y]]()&lt;br /&gt;
 '''ConvertFromDoubleWidth'''()&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/SMDegrain</id>
		<title>SMDegrain</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/SMDegrain"/>
				<updated>2021-04-15T04:09:38Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Optional */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Denoisers|Spatial-Temporal Denoisers|Deep_color_tools}}&lt;br /&gt;
{{Filter&lt;br /&gt;
| Caroliano, {{Author/Dogway}}, Real.Finder&lt;br /&gt;
| v3.1.2.110s&lt;br /&gt;
|&lt;br /&gt;
* [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/SMDegrain.avsi SMDegrain]&amp;lt;br/&amp;gt;&lt;br /&gt;
| 4=Spatial-Temporal Denoisers&lt;br /&gt;
| 7=[https://forum.videohelp.com/threads/369142-Simple-MDegrain-Mod-v3-0d-A-Quality-Denoising-Solution VideoHelp], [https://forum.doom9.org/showthread.php?t=163604 Doom9], [https://forum.doom9.org/showthread.php?t=174121 Doom9 mod] }}&lt;br /&gt;
&lt;br /&gt;
'''SMDegrain''', the Simple MDegrain Mod, is mainly a convenience function for using [[MVTools]]. It is not a magic function (the magic comes from mvtools), it just takes the repetitive code blocks needed for mvtools+mdegrain denoising and wraps them into this function.&lt;br /&gt;
&lt;br /&gt;
It has internal switches for interlaced or YUY2 content '''''(but you should not use it in avs 2.6 and avs+ and use YV16 instead)''''', saving you from writing long lines of code and preventing from possible mistakes. YUY2 is even automatically detected. Apart of that it adds some small and simple enhancements listed below, like easy prefilters, slightly better motion vectors (thanks to an internal TV-&amp;gt;PC luma expansion and the possibility of dark enhancement), easy nnedi3 subpixel accuracy, globals import/export, show panel, and contra-sharpening option.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* [[Zs_RF_Shared]]&lt;br /&gt;
* [[MVTools]] (mod versions recommended) and [[MaskTools2]] (it's not needed if TV_range set to false)&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
* [[Dither]] for lsb hack 16 bit processing (v1.26.5 or higher)&lt;br /&gt;
* [[RgTools]] and [[MedianBlur2]] for contrasharp=true or prefilter=1 or 2&lt;br /&gt;
* [[LSFmod]] for contrasharp &amp;gt; 0.0&lt;br /&gt;
* [[dfttest]] for prefilter=3&lt;br /&gt;
* [[nnedi3]] for subpixel=3&lt;br /&gt;
&amp;lt;strike&amp;gt;''Beware, tp7's plugin mods have no YUY2 support, require AviSynth 2.6a5 or latest Set's MT for v2.6, and Visual C++ 2012 Redistributable.''&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Aknowledgements==&lt;br /&gt;
Original '''SMDegrain()''' by Caroliano&lt;br /&gt;
&lt;br /&gt;
This function uses code from Didée, and cretindesalpes' creations, and has parts inspired by LaTo's functions (old readme, Show panel, etc) and Jawed's Killer() function, apart of relying on third-party tools for certain features.&lt;br /&gt;
&lt;br /&gt;
Special thanks go to: cretindesalpes, Didée, Gavino, Sagekilla, and MVtools people.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The benefit of using SMDegrain over directly calling MDegrain is:&lt;br /&gt;
* '''High bitdepth with lsb denoising''': This is the first wrapper function to support 32bit (16bit pipeline) MDegrain denoising.&lt;br /&gt;
* '''Higher temporal radius''' (tr&amp;gt;3): The [[MVTools]] mod (and hence this script) also allows for hack-free higher temporal radius.&lt;br /&gt;
* '''Contrasharpening''': The pretty much standarized sharpening method created by Didée is blended into the function, so you can easily use it in 16bit pipelines. An strength biased method is also possible. A ''CClip'' parameter is also supplied so you can choose another source to sharpen from, other than the default '''SMDegrain()''' input.&lt;br /&gt;
* '''YUY2 support''': It automatically and fully supports YUY2. (but that not important now after avs 2.6 and avs+)&lt;br /&gt;
* '''Interlaced support''': It supports interlaced sources with most parameters as well.&lt;br /&gt;
* '''Extended Subpixel Accuracy''': [[nnedi3]] is allowed as a subpixel filter, not necessary in most cases, but if you are quality mad try to set it on.&lt;br /&gt;
* '''Better Motion Vectors''': An internal conversion from TV levels (reduced values range) to PC levels (extended values range) is done to the clip the motion analysis will be performed on, so you can get better motion vectors (up to 16%)&lt;br /&gt;
* '''Prefilters''': An easy parameter to load generalist prefilters that perform well in most situations. It also accepts loading your personal prefiltered clips.&lt;br /&gt;
* '''Motion Filters''': New in version 3.0d. It will allow you to filter those parts where '''SMDegrain()''' couldn't find a matching block for denoising. One use for it would be spatial denoisers or deblockers since high-motion areas are prone to heavy blocking and artifacts.&lt;br /&gt;
* '''Global Motion Vector In/Out''': Reuse motion vectors globals for faster processing, or just use '''SMDegrain()''' as a shortcut for creating nice quality motion vectors.&lt;br /&gt;
* '''RefineMotion Option''' (MRecalculate): Slower, but sometimes a big quality boost.&lt;br /&gt;
* '''Show Panel''': Everything is off by default, but some settings change in context. Check what is happening behind the scenes and have a fast look at all your settings.&lt;br /&gt;
* '''Robust''': Everything of the above works with each other no problem (interoperability), also in the process some error proof, bugfixes and bug workarounds were implemented or at least warned so you know that most of what is done is reliable, bugs free and optimized. The general idea is to serve as an user friendly front end for vanilla mvtools2+mdegrain or as the original script creator entitled &amp;quot;To make your scripts shorter and less geeky&amp;quot;. Most parameters are turned off or defaulted to mvtools2 defaults and features are based on popular general conceived procedures.&lt;br /&gt;
&lt;br /&gt;
Parameters are arranged in 3 blocks.&lt;br /&gt;
*'''Basic''': For people who just need the most basic parameters because either they don't have the time, knowledge or interest into looking for complex settings. Or they are content with defaults (pretty much mvtools defaults)&lt;br /&gt;
*'''High Bit Depth (with lsb hack) ((you should not use it in avs+))''': There's not much to think about this. This just enables (default is disabled), high bit depth denoising. That is, more quality, but also needs more processing power hence slower.&lt;br /&gt;
*'''Advanced''': If you run into some problems, are nitpicking or just want to fine tune your settings according to the source, have a look at this block, it contains the rest and bulk of the function parameters.&lt;br /&gt;
&lt;br /&gt;
Temporal denoising is a widespread procedure for noise cleaning in most type of video sources. The only limitation for '''SMDegrain()''' being when there are (very) high levels of grain, in which case you would need to rely on more &amp;quot;creative&amp;quot; and source centric solutions (see [https://forum.doom9.org/showthread.php?p=1544619#post1544619 this] and ''prefilter'' notes), but those are the rare cases.&lt;br /&gt;
&lt;br /&gt;
To picture what the function does, a simple '''SMDegrain()''' call matches the next code (for SD resolutions):&lt;br /&gt;
&lt;br /&gt;
 super_search = Dither_Luma_Rebuild(S0=1.0,c=0.0625).MSuper(rfilter=4)&lt;br /&gt;
 &lt;br /&gt;
 bv2 = super_search.MAnalyse(isb = true,  delta = 2, overlap= 4)&lt;br /&gt;
 bv1 = super_search.MAnalyse(isb = true,  delta = 1, overlap= 4)&lt;br /&gt;
 fv1 = super_search.MAnalyse(isb = false, delta = 1, overlap= 4)&lt;br /&gt;
 fv2 = super_search.MAnalyse(isb = false, delta = 2, overlap= 4)&lt;br /&gt;
 &lt;br /&gt;
 MDegrain2(MSuper(levels=1), bv1, fv1, bv2, fv2, thSAD=300, thSADC=150)&lt;br /&gt;
&lt;br /&gt;
As you see no wizardry. The only changes made are the TV-&amp;gt;PC luma expansion (''Dither_Luma_Rebuild''(S0=1.0,c=0.0625) similar to ''color_yuv''(levels=&amp;quot;TV-&amp;gt;PC&amp;quot;)) so you have more range to detect motion vectors, the ''rfilter''=4 for a bit more quality super search, the changed default of ''overlap'' from 0 to 4 and ''thSAD'' and ''thSADC'' from 400 to 300 and 150 respectively for safer results. Nothing else. The problem is that as soon you want to change a little thing like say temporal radius it requires you to edit in more than a few places, so this is very annoying and so forth the main reason for '''SMDegrain()'''.&lt;br /&gt;
 &lt;br /&gt;
==Using the filter==&lt;br /&gt;
*Input can be YV12 or YUY2, and '''must''' be TV range (which is normal). It's also recommended to be in modulus 16 size (resolution multiple of 16), although not strictly necessary.&lt;br /&gt;
*Crop first (when not interlaced).&lt;br /&gt;
*Recommended to deblock if blocking is present, before crop (when cropping) and '''SMDegrain()'''. Or you can use ''prefilter''=3 which is also a good deblocker (dfttest) and let '''SMDegrain()''' clean the blocking for you.&lt;br /&gt;
*Default output mode(dithering) for ''lsb''=true (when non interlaced) is ordered dither (optimized for encoding), so it is not recommended to keep filtering non-edge areas of your source, you can instead use ''mode''=6 (error diffusion) or ''lsb_out''=true and keep filtering in 16bit&lt;br /&gt;
*Read the ''prefilter'' setting explanation for solutions to problematic sources&lt;br /&gt;
&lt;br /&gt;
==Ready-to-run Samples==&lt;br /&gt;
&lt;br /&gt;
I consider this a good starting point where to start tweaking, whether be it for quality or speed:&lt;br /&gt;
 SMDegrain(tr=2,thSAD=250,contrasharp=true,refinemotion=true,lsb=true)&lt;br /&gt;
 &lt;br /&gt;
A basic, fast, yet very functional call for light grain (mvtools2+masktools2 only needed)&lt;br /&gt;
 SMDegrain(tr=1,thSAD=300,contrasharp=true)&lt;br /&gt;
&lt;br /&gt;
A typical more worked call compatible with official mvtools2 (mvtools2+masktools2 only needed)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,interlaced=true,prefilter=1,contrasharp=true)&lt;br /&gt;
&lt;br /&gt;
Good compromise between speed and quality (denoising with high precision)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Similar to the previous example, the next is a personal preference. Turned all chroma off for safeness (chroma is rarely temporal-reliable enough) and speed.&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true,chroma=false,plane=0)&lt;br /&gt;
&lt;br /&gt;
This is a good example to show that interlaced YUY2 sources can be processed seamlessly.&lt;br /&gt;
 # mod4 (modulus 4) interlaced YUY2 source&lt;br /&gt;
 SMDegrain(tr=1,thSAD=250,interlaced=true,contrasharp=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
HD sources are detected automatically, and as so settings are optimized for speed; ''pel''=1, ''hpad''=0, ''vpad''=0, ''blksize''=32, ''overlap''=16, ''truemotion''=false&lt;br /&gt;
 # HD source (from 1100px wide or 600px high up)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb=true,chroma=false,plane=0)&lt;br /&gt;
&lt;br /&gt;
For dealing with dark scenes (you could also add ''truemotion''=false)&lt;br /&gt;
 SMDegrain(tr=3,thSAD=300,contrasharp=true,str=2.0,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Tackling a grainy source:&lt;br /&gt;
 pre=fluxsmootht(3).removegrain(11)&lt;br /&gt;
 SMDegrain(tr=6,thSAD=500,contrasharp=30,prefilter=pre,str=1.2,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Here 2 things are shown; how to work on a 16bit pipeline, and reference a prior state of the script for ''contrasharp''.&lt;br /&gt;
 sharp=last&lt;br /&gt;
 dfttest(tbsize=1,sigma=10,lsb=true)&lt;br /&gt;
 &lt;br /&gt;
 SMDegrain(tr=3,thSAD=300,CClip=sharp,lsb_in=true,lsb_out=true)&lt;br /&gt;
 &lt;br /&gt;
 LinearResize(854,480,lsb_in=true, mode=0)&lt;br /&gt;
&lt;br /&gt;
(Re)using motion vectors globals&lt;br /&gt;
 SMDegrain(tr=1,thSAD=400,prefilter=3,str=1.4,globals=3)    # Output vectors only&lt;br /&gt;
 MFlowFps(Super, bv1, fv1, num=60,den=1)&lt;br /&gt;
 &lt;br /&gt;
==Parameters==&lt;br /&gt;
{{FuncDef|SMDegrain}} (clip input, int &amp;quot;tr&amp;quot;, int &amp;quot;thSAD&amp;quot;, int &amp;quot;thSADC&amp;quot;, bool &amp;quot;RefineMotion&amp;quot;, val &amp;quot;contrasharp&amp;quot;, clip &amp;quot;CClip&amp;quot;, bool &amp;quot;interlaced&amp;quot;, int &amp;quot;plane&amp;quot;, int &amp;quot;Globals&amp;quot;, int &amp;quot;pel&amp;quot;, int &amp;quot;subpixel&amp;quot;, val &amp;quot;prefilter&amp;quot;, clip &amp;quot;mfilter&amp;quot;, int &amp;quot;blksize&amp;quot;, int &amp;quot;overlap&amp;quot;, int &amp;quot;search&amp;quot;, bool &amp;quot;truemotion&amp;quot;, int &amp;quot;limit&amp;quot;, int &amp;quot;limitc&amp;quot;, int &amp;quot;thSCD1&amp;quot;, int &amp;quot;thSCD2&amp;quot;, bool &amp;quot;chroma&amp;quot;, int &amp;quot;hpad&amp;quot;, int &amp;quot;vpad&amp;quot;, bool &amp;quot;lsb&amp;quot;, bool &amp;quot;lsb_in&amp;quot;, bool &amp;quot;lsb_out&amp;quot;, int &amp;quot;mode&amp;quot;, val &amp;quot;Show&amp;quot;, float &amp;quot;Str&amp;quot;, float &amp;quot;Amp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Basic===&lt;br /&gt;
&lt;br /&gt;
{{ParR|tr|int|2|1-128}}&lt;br /&gt;
:Temporal radius, selects the MDegrain to use. This can be considered the strength of the denoising. Higher is generally better, but also much slower and each extra frame gives less improvement.&lt;br /&gt;
:tr 4+ requires Dither's MVTools2 mod. Max 64 for interlaced.&lt;br /&gt;
&lt;br /&gt;
{{Par|thSAD|int|300}}&lt;br /&gt;
{{Par|thSADC|int|150}}&lt;br /&gt;
:&amp;quot;Sum of Absolute Differences&amp;quot; threshold. This is the spatial difference threshold where the motion search will consider whether to denoise given the formula: &lt;br /&gt;
::Denoise_Weight = max( 0, 1 - 2*blockSAD² / (thSAD² + blockSAD²) )&lt;br /&gt;
:This spatial difference will be compared in blocks (''blksize''). If your noise is not getting into consideration for the denoising try raising this value, or reduce its SAD with previous prefiltering. You can alternatively raise ''blksize'', which will likely even blocks SAD. Low values can result in staggered/blotchy denoising, large values can result in ghosting and artifacts. Values in the range 200~600 are usual.&lt;br /&gt;
:thSADC is the same logic applied to chroma planes, since there are less differences on the chroma planes it uses by default thSAD/2 for safer chroma results.&lt;br /&gt;
:'''Recommendation''': Use slightly greater values than you are used to in other mdegrain based functions since the internal clip for the motion search in SMDegrain() has the contrast increased.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Contrasharp|bool|False|True/False}}&lt;br /&gt;
{{ParR|Contrasharp|int|-|0-100}}&lt;br /&gt;
:Contrasharpening is a technique that compares the differences between the clip before blurring (original) and after blurring (filtered), and sharpens locally with consequent strength. By default the &amp;quot;sharp&amp;quot; clip is the input, the &amp;quot;after&amp;quot; clip is the denoised clip. Alternately, a &amp;quot;before&amp;quot; clip can be specified with ''CClip'' (See Advanced).&lt;br /&gt;
:*True: use Didée's Contrasharpening() function (ContraHD() for HD) which &amp;quot;Sharpens the denoised clip, but doesn't add more to any pixel than what was removed previously.&amp;quot; In the practice you will get a slightly sharper result than the source, which is welcome.&lt;br /&gt;
:*An integer: LSFmod() will be used instead. It will be much slower, but maybe better for certain sources. Its value will serve as a contrasharpening multiplier, use one around 50 for similar strength as Contrasharpening(). LSFmod is less-suitable for HD sources.&lt;br /&gt;
&lt;br /&gt;
{{Par|RefineMotion|bool|False}}&lt;br /&gt;
:Refines and recalculates motion data of previously estimated (by MAnalyse) motion vectors. Turn it on for better motion vectors, specially when dealing with ghosting issues, small details or lineart fading and whatnot.&lt;br /&gt;
:'''Caution''': It won't help much if you use a ''prefilter'' so strong that blurs too much or kills all the details you are aiming to protect in first place.&lt;br /&gt;
&lt;br /&gt;
{{ParR|plane|int|4|0-4}}&lt;br /&gt;
:Select the planes you wish to process:&lt;br /&gt;
:*0: luma only&lt;br /&gt;
:*1: chroma U&lt;br /&gt;
:*2: chroma V&lt;br /&gt;
:*3: both chromas&lt;br /&gt;
:*4: all (Default)&lt;br /&gt;
:'''Caution''': plane=1-4 can sometimes create chroma smearing. In such case I recommend denoising chroma planes in the spatial domain.&lt;br /&gt;
&lt;br /&gt;
{{Par|Interlaced|bool|False}}&lt;br /&gt;
:If you want to denoise an interlaced source set this parameter to true. Output will also be interlaced. If you pair this with ''lsb_out''=true then you will have to &amp;lt;tt&amp;gt;Weave().DitherPost(mode=6,interlaced=true)&amp;lt;/tt&amp;gt; when converting back to 8 bit.&lt;br /&gt;
&lt;br /&gt;
===High Bit Depth Processing And Dithering===&lt;br /&gt;
All High Bit Depth parameters require [[Dither]] and [[MVTools]] 2.6+. The [[AviSynth+]] doesn't need these parameters; it automatically outputs the same bitdepth as the input, but if you still need 99% alternative to lsb family there are n16 (don't has n16_in because it don't make any sense in that case).&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb_in|bool|False}}&lt;br /&gt;
:Set true if you use a 16 bits filter chain. *(EXPERIMENTAL, use under test environment)&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb_out|bool|False}}&lt;br /&gt;
:Output to 16-bit instead of 8-bit. Use the helpers at the end of the SMDegrain() script to use Ditherpost() with YUY2 formats.&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb|bool|False}}&lt;br /&gt;
:This enables 32 bit depth precision for denoising. You gain extra denoising accuracy, most noticeable in the prevention of banding in flat areas. Automatically set if either ''lsb_in'' or ''lsb_out'' are enabled.&lt;br /&gt;
&lt;br /&gt;
{{ParR|mode|int|0|-1-8}}&lt;br /&gt;
:This is the '''mode''' of [[Dither#DitherPost|DitherPost]] when ''lsb_out''=False, as a dithering method must be chosen for the 32bit-&amp;gt;8bit conversion. (Interlaced content is locked to mode=6) The default ''mode''=0 will help you optimize the dithering for optimum encodings when no further non-edge processing is done. Use ''mode''=6 (error diffusion) if further processing will be done.&lt;br /&gt;
&lt;br /&gt;
===Advanced===&lt;br /&gt;
&lt;br /&gt;
{{ParR|pel|int|2|1,2,4}}&lt;br /&gt;
:Accuracy of the motion estimation:&lt;br /&gt;
:* 1: full-pixel (Default for HD)&lt;br /&gt;
:* 2: half-pixel (Default for SD)&lt;br /&gt;
:* 4: quarter-pixel (often more accurate, but much slower and not always better)&lt;br /&gt;
&lt;br /&gt;
{{ParR|subpixel|int|2|0-3}}&lt;br /&gt;
:Subpixel interpolation method for ''pel''=2 or 4. This is the 'sharp' parameter in MSuper(), although it isn't related to output sharpness but better accuracy for the motion estimation.&lt;br /&gt;
:* 0: bilinear (softest)&lt;br /&gt;
:* 1: bicubic (4 tap Catmull-Rom)&lt;br /&gt;
:* 2: sharper Wiener (6 tap, similar to Lanczos) (Default)&lt;br /&gt;
:* 3: [[nnedi3]] (very high quality: useful for small sources but usually overkill. requires plugin)&lt;br /&gt;
&lt;br /&gt;
{{ParR|prefilter|int|-1|-1-3}}&lt;br /&gt;
{{Par|prefilter|clip|None}}&lt;br /&gt;
:* -1: off (Default)&lt;br /&gt;
:* 0: light controlled gauss blur&lt;br /&gt;
:* 1: mild median/gauss blur&lt;br /&gt;
:* 2: strong median/gauss blur&lt;br /&gt;
:* 3: [[dfttest]] (spatial)&lt;br /&gt;
:* clip: supply your own&lt;br /&gt;
:Denoises a version of the clip that will be used to obtain the motion vectors. Useful for very damaged/grainy sources, this will help to get better motion vectors.&lt;br /&gt;
:For sources with Gibbs noise, especially on anime, try ''prefilter''=1 or 2 or better yet strong median filters (through clip input) in order to soothe the high SAD of sharp edges. For blocky sources, or a general more quality/safer prefilter use option 3 (dfttest)&lt;br /&gt;
:By default dfttest outputs a sstring txt file to your script folder, you can delete it. This doesn't happen when using the modded dfttest (version 1.9.2 or higher) of the Dither tools.&lt;br /&gt;
:For HD sources ''prefilter''=2 makes more sense than 1, because it uses a wider denoising window.&lt;br /&gt;
:If instead you want to use your own prefilter denoiser, just define it in a variable and reference it here. Remember to:&lt;br /&gt;
:*Feed always 8 bit clips.&lt;br /&gt;
:*Input in fields for interlaced content *(read below)&lt;br /&gt;
:*Feed here planar ( by using Interleaved2Planar() ) YUY2 clips (not interleaved) when working with YUY2 sources.&lt;br /&gt;
:You will likely want to use spatial denoisers like median filters (removegrain=17, medianblur, etc). For very grainy or fizz grain noise you can try prefiltering in temporal or if this is not enough, try adding a new SMDegrain() line again but without globals. Use ''lsb_in'', ''lsb_out'' according so results are smooth. You can even use SMDegrain() as a prefilter for SMDegrain() in very temporal unstable sources.&lt;br /&gt;
:Another trick for fizz grain is to serve a prefiltered clip where bright values are more denoised than dark values, you can do this through luma masks with masktools2 code. Search in [https://forum.doom9.org/showthread.php?t=162813 Doom9] for reference.&lt;br /&gt;
:For interlaced sources remember:&lt;br /&gt;
::Spatial filtering: pre=separatefields().spatial_prefilters_here()&lt;br /&gt;
::Temporal filtering: pre=separatefields().interleave(selecteven().temporal_filters(),selectodd().temporal_filters())&lt;br /&gt;
:SMDegrain() (and MDegrain) is likely to produce blending artifacts or oversmooth in dark areas specially on cartoons, to tackle this see RefineMotion or expand the luma range in the darks. For this there are many options, you can use your preferred gamma enhancer and input it as the prefilter, or use the examples below for linear brightening (masktools2) and input it as a ''prefilter'' as well. Or at last and the recommended solution, to use the built-in ''Str'' (strength) and ''Amp'' (amplitude) parameters for a curve type dark enhancement, check the effects by enabling Show and changing your previewing conditions to PC levels.&lt;br /&gt;
:For brightening dark values linearly (brighter parts less brightening)&lt;br /&gt;
 str=1&lt;br /&gt;
 mt_lut(&amp;quot;x x &amp;quot;+string(str)+&amp;quot; 6 * - 255 - abs 255 / ^ x 1 - abs +&amp;quot;)&lt;br /&gt;
:Or for a more contrasty image (although not as much dark enhancing - not linear)&lt;br /&gt;
 str=40&lt;br /&gt;
 mt_lut(&amp;quot;x x &amp;quot;+string(str)+&amp;quot; 6 * - 255 - abs 255 / ^ &amp;quot;+string(str)+&amp;quot; / x 1 - abs +&amp;quot;)&lt;br /&gt;
:Good resources for custom prefilters:&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=162813&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=132310&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=133977&lt;br /&gt;
:Notes: To sum it up; generally in denoising, temporal filters are always preferred due to its natural look (versus spatial filters). But more often than not for good results prefiltering plays a key role on the output quality, and setting it up nicely can be looked as an art by itself.&lt;br /&gt;
:If there's a reached point where no prefiltering, no ''thSAD'' tweaking, etc, makes able to denoise a certain motion part/area/scene, then this is due to the motion vectors preventing them from being &amp;quot;denoised&amp;quot; (also read &amp;quot;artifacted&amp;quot;), in which case you will need to rely on alternative solutions (motion compensation, filters like MCTemporalDenoise(), TemporalDegrain(), [https://forum.doom9.org/showthread.php?p=1544619#post1544619 Multilevel MDegrain], etc) or just use plain spatial filters with motion masks. Creating these discerning masks for static and motion scenes and combining them is a research task on the end user side.&lt;br /&gt;
&lt;br /&gt;
{{Par|mfilter|clip|None}}&lt;br /&gt;
:Motion Filter, an optional user-supplied clip that will be passed through those areas where SMDegrain() couldn't find a matching block, normally high motion areas. One use for it would be to to use spatial filters, like deblockers or blurring filters that mimic motion blur.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Str|float|1.0|0.0-8.0}}&lt;br /&gt;
:Gamma correction. With this parameter you control the strength of the brightening of the ''prefilter'' clip, good for when problems with dark areas arise. Using this internally instead of externally creates less quantization artifacts, since it's done in the same stage as the TV-&amp;gt;PC range conversion.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Amp|float|0.0625|0.0-1.0}}&lt;br /&gt;
:Used when ''Str'' &amp;lt;&amp;gt; 1.0. This defines the amplitude of the brightening in the luma range, for example by using 1.0 all the luma range will be used and the brightening will find its peak at luma value 128 in the original. Default is 0.0625 (1.0/16) which just sits over luma value 16 (256/16) This and ''Str'' are extrapolated arguments from [https://forum.doom9.org/showthread.php?p=1548318#post1548318 cretindesalpes' function], you can find a graph and more insight explanations at the original post.&lt;br /&gt;
:Check these 2 parameters effects by enabling ''show''.&lt;br /&gt;
&lt;br /&gt;
{{ParR|blksize|int|8 for SD, 16 for HD|4,8,16}}&lt;br /&gt;
:Size of a block (horizontal x vertical). Larger blocks are faster and less sensitive to noise, but also less accurate.&lt;br /&gt;
&lt;br /&gt;
{{Par|overlap|int|blksize/2}}&lt;br /&gt;
:Must be *even* and *less* than block size. Common values: ''blksize''/4 or ''blksize''/2. Larger ''overlap'' looks slightly better and runs slower.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Search|int|4|0-7}}&lt;br /&gt;
:This is the '''search''' of [[MVTools/MAnalyze|MAnalyze]].&lt;br /&gt;
&lt;br /&gt;
{{Par|Truemotion|bool|True for SD, False for HD}}&lt;br /&gt;
:''Truemotion'' is a preset of some MVAnalyze parameter values. It allows easy to switch default values of all &amp;quot;true motion&amp;quot; parameters at once. Set it 'true' for true motion search (high vector coherence), set it 'false' to search motion vectors with best SAD. Truemotion is slower and may blur textures and thin details more, but will usually remove more noise.&lt;br /&gt;
:For HD sources where the main problems are just excessive grain, I have defaulted it to false, this is not only faster but honors detail accuracy (the main existing point for HD sources) and overall object shading.&lt;br /&gt;
&lt;br /&gt;
{{Par|Chroma|bool|True}}&lt;br /&gt;
:Set false to totally ignore chroma for finding motion vectors, for more speed with little cost in quality or when your chroma is too bad to find good matches. Don't process chroma planes without chroma vectors, MVTools doesn't seem to work right.&lt;br /&gt;
&lt;br /&gt;
{{Par|Hpad|int|''blksize'' for SD, 0 for HD}}&lt;br /&gt;
{{Par|Vpad|int|''blksize'' for SD, 0 for HD}}&lt;br /&gt;
:Horizontal/vertical padding added to source frame (left, right, top, and bottom) for better motion estimation near borders.&lt;br /&gt;
:Try to have clean borders in your source (no NAB/black borders) to start with before tweaking this setting. If necessary, crop beforehand ideally in multiples of 16. Turn it to 0 if you are running out of memory.&lt;br /&gt;
&lt;br /&gt;
{{Par|thSCD1|int|based on ''blksize'': 4{{=}}&amp;gt;100, 8{{=}}&amp;gt;400, 16{{=}}&amp;gt;1600}}&lt;br /&gt;
:Threshold which decides whether a block has changed between the previous frame and the current one, used to tweak the scene change detection. Raising it will lower the number of blocks detected as changed. It may be useful for noisy or flickered video. To fix blending on scene changes on dark scenes, first try ''Str'' and ''Amp''.&lt;br /&gt;
&lt;br /&gt;
{{ParR|thSCD2|int|130|0-250}}&lt;br /&gt;
:Threshold which sets how many blocks have to change for the frame to be considered as a scene change.&lt;br /&gt;
&lt;br /&gt;
{{ParR|limit|int|255|1-255}}&lt;br /&gt;
{{ParR|limitC|int|255|1-255}}&lt;br /&gt;
:Maximal change of pixel luma/chroma, to prevent some artifacts.&lt;br /&gt;
&lt;br /&gt;
{{Par|CClip|clip|None}}&lt;br /&gt;
:Optional sharp version for ''contrasharp'' to compare against; video resolution and properties must be the same (different bit depth is OK). Using this option defaults ''contrasharp'' to True.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Globals|int|0|0-3}}&lt;br /&gt;
:With this parameter you can create or load pre-processed motion vectors, to save doing the work for multiple SMDegrain calls.&lt;br /&gt;
:*0: Ignore globals, just process&lt;br /&gt;
:*1: Read globals and Process&lt;br /&gt;
:*2: Process and output globals&lt;br /&gt;
:*3: Output globals only, don't process&lt;br /&gt;
:Some parameters '''MUST MATCH''' between output and input stages: ''pel'', ''subpixel'', ''chroma'', and ''vpad''/''hpad'' cannot change. When reading (Globals=1) only some parameters work: ''tr'', ''thSAD'', ''plane'', ''limit'', ''limitc'', ''contrasharp'', ''CClip'', ''interlaced'' and the ''lsb'' parameters. Others are ignored.&lt;br /&gt;
:Global names that can be reused are: '''Super''', '''bv1''', '''fv1''', '''bv2''', '''fv2''', '''bv3''', '''fv3''', '''bv4''', '''fv4''', '''bv6''', '''fv6''', '''vmulti'''.&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=3)    # Outputs vectors&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=1)    # You can use a lower &amp;quot;tr&amp;quot; or &amp;quot;thSAD&amp;quot; if you want&lt;br /&gt;
:or&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=3)    # Outputs vectors&lt;br /&gt;
 Super = MSuper(levels=1)               # Add this line just before if you have some processing between Globals Output and Input.&lt;br /&gt;
 MDegrain3(Super, bv1, fv1, bv2, fv2, bv3, fv3, thSAD=400)&lt;br /&gt;
&lt;br /&gt;
{{Par|Show|bool|False}}&lt;br /&gt;
{{ParR|Show|str|-|&amp;quot;Speed&amp;quot;, &amp;quot;Memory&amp;quot;, &amp;quot;Quality&amp;quot;}}&lt;br /&gt;
:This will show the prefiltered clip to be used for the motion search to the left(&amp;lt;--), and the used parameters list to the right (--&amp;gt;)&lt;br /&gt;
:If the parameters panel is broken i.e. overlapping lines, hidden lines, etc, most likely your settings are wrong, (e.g. ''lsb_in''=true when input is 8bit) so it will also work well as a debug function. If you set Show to a string as indicated above, related parameters will be highlighted to guide you on correctly tweaking the function. This is loosely based, so it doesn't exclude you from reading carefully every parameter explanation.&lt;br /&gt;
:Even when you are not using any prefiltering, the clip to be used for the motion search where you obtain the motion vectors, will be converted from TV levels to PC levels, the only exception being when using ''Globals''=1 (Read) in which case the &amp;quot;prefiltered&amp;quot; clip will be exactly the same as input clip (that is no luma conversion, although constrained to 8 bit). Additionally you can tweak the dark expansion with ''Str'' and ''Amp'' parameters and check the effects in the left panel, but be aware to change your viewing conditions as it is in PC levels.&lt;br /&gt;
:The left panel preserves its properties so you can crop out the right panel and use it as a prefilter clip of any MSuper(). Therefore if you are not processing chroma (''chroma''=false) the prefiltered clip will be green, don't panic, this is correct, this happens when the U and V planes are unset. In this regard for previewing tasks with prefilterings -- or just the ''Str'' and ''Amp'' effect -- set ''chroma'' to true temporally or follow with ''GreyScale''(). For YUY2 sources set ''Planar2Interleaved''() after cropping for previewing.&lt;br /&gt;
 &lt;br /&gt;
==Final Notes==&lt;br /&gt;
If there is an important parameter not implemented, you have any issue or found a bug, please don't hesitate and ask in its [https://forum.videohelp.com/threads/369142 VideoHelp thread].&lt;br /&gt;
 &lt;br /&gt;
==Changelog==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 1px solid darkgray&amp;quot;&lt;br /&gt;
!Version&lt;br /&gt;
!Date&lt;br /&gt;
!Changes&lt;br /&gt;
|-&lt;br /&gt;
|v3.1.2.97s&lt;br /&gt;
|2018-03-26&lt;br /&gt;
|&lt;br /&gt;
Fix subpixel=3&lt;br /&gt;
Add Prefilter auto 16 (lsb) support&amp;lt;br/&amp;gt;&lt;br /&gt;
YUY2 support in avs 2.6 with masktools 2.6&amp;lt;br/&amp;gt;&lt;br /&gt;
medianblur2 now will be used in Minblur instead of Quantile RemoveGrainHD in avs 2.6&amp;lt;br/&amp;gt;&lt;br /&gt;
Add TV_range bool&amp;lt;br/&amp;gt;&lt;br /&gt;
Less lsb if not use lsb things and get ready for yv16 and yv24&amp;lt;br/&amp;gt;&lt;br /&gt;
Add dct&amp;lt;br/&amp;gt;&lt;br /&gt;
Add device_id for prefilter=4&amp;lt;br/&amp;gt;&lt;br /&gt;
No need to use Planar2Interleaved() after cropping in Show with YUY2 (this is old changed, and now with mvtools support yv16 most people will not use YUY2)&amp;lt;br/&amp;gt;&lt;br /&gt;
Add MDegrain4 and MDegrain5 and MDegrain6, this will make tr=4-6 faster&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1.2d&lt;br /&gt;
|2015-07-21&lt;br /&gt;
|&lt;br /&gt;
Fixed regression where external prefilters wouldn't be parsed for luma expansion&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1.1d&lt;br /&gt;
|2015-07-16&lt;br /&gt;
|&lt;br /&gt;
Workaround to force KNLMeansCL use discrete video card (now required)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1d&lt;br /&gt;
|2015-07-14&lt;br /&gt;
|&lt;br /&gt;
New prefilter mode 4 for grainy sources. GPU based spatio-temporal KNLmeans&amp;lt;br/&amp;gt;&lt;br /&gt;
Added dither output mode &amp;quot;Random Dither&amp;quot;.&amp;lt;br/&amp;gt;&lt;br /&gt;
Added &amp;quot;slices&amp;quot; option from Dither&amp;lt;br/&amp;gt;&lt;br /&gt;
Added soft=-2 (automatic) to internal lsfmod&amp;lt;br/&amp;gt;&lt;br /&gt;
Added assert for chroma denoise when luma only motion vectors (mvtools bug)&amp;lt;br/&amp;gt;&lt;br /&gt;
Improved lsb_in code (now using sub/add method)&amp;lt;br/&amp;gt;&lt;br /&gt;
Removed vpad/hpad=0 optimization preset for HD&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed prefilter=3 code for lsb_in YUY2&amp;lt;br/&amp;gt;&lt;br /&gt;
More fixes to Show Panel...&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated and fixed documentation (notes on YUY2 support)&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3.0d&lt;br /&gt;
|2015-03-27&lt;br /&gt;
|&lt;br /&gt;
Adjusted SD&amp;lt;&amp;gt;HD discretion&amp;lt;br/&amp;gt;&lt;br /&gt;
Added mfilter (Motion Filter) new feature&amp;lt;br/&amp;gt;&lt;br /&gt;
subpixel=3 (nnedi3); removed qual=2 due to possible blending bug (quote by cretindesalpes), this also boosts speed&amp;lt;br/&amp;gt;&lt;br /&gt;
Lowered the defaults for less aggressive denoise (still somewhat high)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed chroma not showing in debug (show) mode when lsb=true and prefilter=3 were paired&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed long lasting issues in Show Panel for certain not mod height resolutions&amp;lt;br/&amp;gt;&lt;br /&gt;
Now prefilter=0 is minblur(0), lighter denoising than prefilter=1, default is now -1 (off)&amp;lt;br/&amp;gt;&lt;br /&gt;
Documentation update (plugin updates, notes, links, examples, etc)&lt;br /&gt;
|-&lt;br /&gt;
|2.2d&lt;br /&gt;
|2013-03-05&lt;br /&gt;
|&lt;br /&gt;
Removed one residual variable in Contrasharpening function&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a regression at v2.0 for Interlaced YUY2 sources by changing wrong variable ifC to if0, and...&amp;lt;br/&amp;gt;&lt;br /&gt;
...adding a missing weave() to the last MergeChroma() call&amp;lt;br/&amp;gt;&lt;br /&gt;
Dropped Dither support. (Will still work/not work as before, but lack of official support renders it to a YMMV condition)&lt;br /&gt;
|-&lt;br /&gt;
|2.1d&lt;br /&gt;
|2012-09-09&lt;br /&gt;
|&lt;br /&gt;
Fixed Refinemotion Globals Input labels&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed ContrasharpeningHD Vectors for Interlaced HD sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Added ability to import Global Vectors even when &amp;quot;tr&amp;quot; is lower than parent instance &amp;quot;tr&amp;quot; (credit to cretindesalpes)&amp;lt;br/&amp;gt;&lt;br /&gt;
Expanded support for Interlaced Denoising &amp;quot;tr&amp;quot; up to 64 (credit to cretindesalpes)&amp;lt;br/&amp;gt;&lt;br /&gt;
Cosmetics&lt;br /&gt;
|-&lt;br /&gt;
|2.0d&lt;br /&gt;
|2012-06-07&lt;br /&gt;
|&lt;br /&gt;
Fixed and optimized chroma handling for lsb_in, contrasharpening and YUY2 content v.1.95&amp;lt;br/&amp;gt;&lt;br /&gt;
Enhanced Chroma bypass on the sharpening stage&amp;lt;br/&amp;gt;&lt;br /&gt;
Merged ContraHD() internally for Contrasharpening in HD sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Dropped QTGMC support on import/export motion vectors (small value for increased confusion)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed Median code for planar inputs in MinBlur() (needs RemoveGrainHD, dropped medianblur requirement)&amp;lt;br/&amp;gt;&lt;br /&gt;
Defaulted truemotion to false for HD inputs&amp;lt;br/&amp;gt;&lt;br /&gt;
Code Optimization and Clean up&amp;lt;br/&amp;gt;&lt;br /&gt;
Others&lt;br /&gt;
|-&lt;br /&gt;
|1.9d&lt;br /&gt;
|2012-03-23&lt;br /&gt;
|&lt;br /&gt;
Added truemotion parameter (default=true), change it to false (as in MCTemporalDenoise()), so low frequency detail won't be lost (walls...), although it could leave more noise on high frequency details&amp;lt;br/&amp;gt;&lt;br /&gt;
Added thSADC, and thSCD1/thSCD2 parameters for finer control&amp;lt;br/&amp;gt;&lt;br /&gt;
Tweaked prefilter=3 dfttest sigmas for better low frequency detail protection&amp;lt;br/&amp;gt;&lt;br /&gt;
Detached explanation and converted to html. Updated and extended the contents as well&amp;lt;br/&amp;gt;&lt;br /&gt;
Fine tuned and robustized the Show Panel&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimized and organized code, more precisely the contrasharpening part&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a few ternary checks for when Globals=3&amp;lt;br/&amp;gt;&lt;br /&gt;
Others&lt;br /&gt;
|-&lt;br /&gt;
|1.8d&lt;br /&gt;
|2012-01-18&lt;br /&gt;
|&lt;br /&gt;
Added automatic dark protection for prefilter=3 (dfttest performs badly in darks) v1.71d and extended its dark protection v1.8&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed chroma variable when chroma=false, from 2 (copy chroma) to 1 (discard chroma) v1.71d&amp;lt;br/&amp;gt;&lt;br /&gt;
Explanation and cosmetics v1.71d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added acknowledgments and updated explanation&amp;lt;br/&amp;gt;&lt;br /&gt;
Added brackets to all functions (it has been reported to cause threading problems under certain circumstances) (https://forum.doom9.org/showthread.php?p=1515886#post1515886)&amp;lt;br/&amp;gt;&lt;br /&gt;
Reworked and fixed the parameters panel. Now you have a color guide to have an idea on what to tweak depending on selected mode in Show. For strings: &amp;quot;Speed&amp;quot;, &amp;quot;Memory&amp;quot; and &amp;quot;Quality&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimized lsb_in for HD resolutions which was causing memory hogs&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed contrasharpening for YUY2 sources when lsb=true&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed some inconsistencies for YUY2 sources when prefilter=3&lt;br /&gt;
|-&lt;br /&gt;
|1.7d&lt;br /&gt;
|2012-01-11&lt;br /&gt;
|&lt;br /&gt;
Fixed and extended introduction explanation v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed some issues for Globals=1 (Read) in relation to lsb_in and luma expansion auto-prefilter v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added mild gauss blur prefilter option as prefilter=1. Consequent modes are displaced v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed prefilter 1 and 2 to Minblur (Gauss/Median combination) v.1.63d&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated MinBlur function v.1.62d and v.1.66&amp;lt;br/&amp;gt;&lt;br /&gt;
Code tidied up v.1.62d&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated luma expansion, now you can enhance darks (with 'Str' and 'Amp') in the same step as the TV-&amp;gt;PC conversion stage, thus +optimized, +quality. v.1.63d by cretindesalpes (https://forum.doom9.org/showthread.php?p=1548318#post1548318)&amp;lt;br/&amp;gt;&lt;br /&gt;
Removed pre_custom. Now use prefilter to load a prefiltered clip, as well as modes 0~3&amp;lt;br/&amp;gt;&lt;br /&gt;
Added Show parameter. Now you can see the used and default parameters along the prefilter clip as well&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed one note related to prefilter clip input for interlaced content&lt;br /&gt;
|-&lt;br /&gt;
|1.6d&lt;br /&gt;
|2011-12-24 (first open release)&lt;br /&gt;
|&lt;br /&gt;
Fixed and extended introduction explanation&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed Ditherpost for interlaced sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a broken reference for reading MRecalculate globals when tr&amp;gt;3&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a Globals=1 MSuper automatization&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a plane processing bypass when chroma=false&amp;lt;br/&amp;gt;&lt;br /&gt;
Added LSFmod as optional contrasharpening (slower, but biased contrasharpening and probably better depending on source)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added default luma expansion auto-prefilter for motion search (16% more values)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added YUY2 support&amp;lt;br/&amp;gt;&lt;br /&gt;
Added the 'mode' parameter of Ditherpost()&amp;lt;br/&amp;gt;&lt;br /&gt;
Added support for interlaced temporal radius up to 6&lt;br /&gt;
|-&lt;br /&gt;
|1.5d&lt;br /&gt;
|2011-10-14&lt;br /&gt;
|&lt;br /&gt;
Changed &amp;quot;srchSuper&amp;quot; Global variable to &amp;quot;QTGMC_srchSuper&amp;quot;, compatible with QTGMC. Anyhow you may probably want to create a new super clip. Test it out! v.1.41d&amp;lt;br/&amp;gt;&lt;br /&gt;
Introduction spelling and presentation v.1.42d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added lsb and lsb_in for prefilter=2 (dfttest) v.1.43d &amp;amp; v.1.44d&amp;lt;br/&amp;gt;&lt;br /&gt;
Some better definitions for the settings help v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
pelclip is now subpixel = 3 ('sharp' parameter before) v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
Other minor tweaks v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed an important issue when using prefilter with subpixel=3 ('pelclip' parameter before)&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimizations in Ditherpost for chroma&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed rfilter (hierarchical levels smoothing/scaling) from default 2 to 4. Better results in my judge&amp;lt;br/&amp;gt;&lt;br /&gt;
Some more little tweaks in code and introduction&lt;br /&gt;
|-&lt;br /&gt;
|1.4d&lt;br /&gt;
|2011-09-16&lt;br /&gt;
|&lt;br /&gt;
Added pelclip option for top quality subpixel interpolation when pel &amp;gt; 1&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed QTGMCV parameter to Globals, and added a bunch of new features like vectors output from SMDegrain()&amp;lt;br/&amp;gt;&lt;br /&gt;
Big introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|1.3d&lt;br /&gt;
|2011-09-14&lt;br /&gt;
|Fixed an important issue on the Interlaced parameter and improved overall handling (v.1.21d &amp;amp; v.1.3d)&lt;br /&gt;
|-&lt;br /&gt;
|1.2d&lt;br /&gt;
|2011-09-13&lt;br /&gt;
|&lt;br /&gt;
Added Interlaced parameter, for processing interlaced sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Some introduction and code optimization tweaks (v.1.12d &amp;amp; v.1.2d)&lt;br /&gt;
|-&lt;br /&gt;
|1.1d&lt;br /&gt;
|2011-09-12&lt;br /&gt;
|&lt;br /&gt;
Implemented MDegrainN for tr &amp;gt; 3, from the MVTools2 mod of Dither&amp;lt;br/&amp;gt;&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|1.0d&lt;br /&gt;
|2011-09-09&lt;br /&gt;
|&lt;br /&gt;
Added CClip parameter. Reference an earlier stage of your processing chain as your sharp version for the contrasharpening&lt;br /&gt;
|-&lt;br /&gt;
|0.9d&lt;br /&gt;
|2011-09-09&lt;br /&gt;
|&lt;br /&gt;
Added QTGMCV parameter, for reusing vectors from QTGMC bob deinterlacer&lt;br /&gt;
|-&lt;br /&gt;
|0.8d&lt;br /&gt;
|2011-09-05&lt;br /&gt;
|&lt;br /&gt;
Fixed a few things related to the lsb_in option&amp;lt;br/&amp;gt;&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|0.7d&lt;br /&gt;
|2011-09-05&lt;br /&gt;
|&lt;br /&gt;
Implemented &amp;quot;fake&amp;quot; lsb_in option. Output will have slightly more quality (if any), and will compress better. (Experimental)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a not passed argument in the hpad, vpad parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.6d&lt;br /&gt;
|2011-09-04&lt;br /&gt;
|&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|0.5d&lt;br /&gt;
|2011-07-19&lt;br /&gt;
|&lt;br /&gt;
Added dfttest option for preblur (now prefilter) option. Slower but better due to its internal deblock+denoise operation, plus sharper results&amp;lt;br/&amp;gt;&lt;br /&gt;
Added pre_custom option for the prefilter process, define here a denoised clip as your prefiltered version&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated the introduction help&lt;br /&gt;
|-&lt;br /&gt;
|0.4d&lt;br /&gt;
|2011-06-03&lt;br /&gt;
|&lt;br /&gt;
Added preblur option for slight vector blurring where motionmatch is bad (https://forum.doom9.org/showthread.php?t=161594)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added RefineMotion parameter for better motion vectors. Based off Killer() (https://forum.doom9.org/showthread.php?p=1266572#post1266572)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added parameters &amp;quot;lsb&amp;quot; and &amp;quot;lsb_out&amp;quot;, for the MVTools2 mod version of cretindesalpes' Dither (https://forum.doom9.org/showthread.php?p=1386559#post1386559)&amp;lt;br/&amp;gt;&lt;br /&gt;
Other minor aesthetics and performance adjustments&lt;br /&gt;
|-&lt;br /&gt;
|0.3d&lt;br /&gt;
|2011-03-04&lt;br /&gt;
|&lt;br /&gt;
First Mod version&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed plane (for MDegrain) and added chroma (for MAnalyse) parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|2010-01-24&lt;br /&gt;
|&lt;br /&gt;
Added introductory section&amp;lt;br/&amp;gt;&lt;br /&gt;
Added more parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|&lt;br /&gt;
Basic working version&amp;lt;br/&amp;gt;&lt;br /&gt;
Not released&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/SMDegrain</id>
		<title>SMDegrain</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/SMDegrain"/>
				<updated>2021-04-15T04:07:06Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Dependencies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Denoisers|Spatial-Temporal Denoisers|Deep_color_tools}}&lt;br /&gt;
{{Filter&lt;br /&gt;
| Caroliano, {{Author/Dogway}}, Real.Finder&lt;br /&gt;
| v3.1.2.110s&lt;br /&gt;
|&lt;br /&gt;
* [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/SMDegrain.avsi SMDegrain]&amp;lt;br/&amp;gt;&lt;br /&gt;
| 4=Spatial-Temporal Denoisers&lt;br /&gt;
| 7=[https://forum.videohelp.com/threads/369142-Simple-MDegrain-Mod-v3-0d-A-Quality-Denoising-Solution VideoHelp], [https://forum.doom9.org/showthread.php?t=163604 Doom9], [https://forum.doom9.org/showthread.php?t=174121 Doom9 mod] }}&lt;br /&gt;
&lt;br /&gt;
'''SMDegrain''', the Simple MDegrain Mod, is mainly a convenience function for using [[MVTools]]. It is not a magic function (the magic comes from mvtools), it just takes the repetitive code blocks needed for mvtools+mdegrain denoising and wraps them into this function.&lt;br /&gt;
&lt;br /&gt;
It has internal switches for interlaced or YUY2 content '''''(but you should not use it in avs 2.6 and avs+ and use YV16 instead)''''', saving you from writing long lines of code and preventing from possible mistakes. YUY2 is even automatically detected. Apart of that it adds some small and simple enhancements listed below, like easy prefilters, slightly better motion vectors (thanks to an internal TV-&amp;gt;PC luma expansion and the possibility of dark enhancement), easy nnedi3 subpixel accuracy, globals import/export, show panel, and contra-sharpening option.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* [[Zs_RF_Shared]]&lt;br /&gt;
* [[MVTools]] (mod versions recommended) and [[MaskTools2]] (it's not needed if TV_range set to false)&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
* [[Dither]] for lsb hack 16 bit processing (v1.26.5 or higher)&lt;br /&gt;
* [[RgTools]] for contrasharp=true or prefilter=1 or 2&lt;br /&gt;
* [[LSFmod]] for contrasharp &amp;gt; 0.0&lt;br /&gt;
* [[dfttest]] for prefilter=3&lt;br /&gt;
* [[nnedi3]] for subpixel=3&lt;br /&gt;
&amp;lt;strike&amp;gt;''Beware, tp7's plugin mods have no YUY2 support, require AviSynth 2.6a5 or latest Set's MT for v2.6, and Visual C++ 2012 Redistributable.''&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Aknowledgements==&lt;br /&gt;
Original '''SMDegrain()''' by Caroliano&lt;br /&gt;
&lt;br /&gt;
This function uses code from Didée, and cretindesalpes' creations, and has parts inspired by LaTo's functions (old readme, Show panel, etc) and Jawed's Killer() function, apart of relying on third-party tools for certain features.&lt;br /&gt;
&lt;br /&gt;
Special thanks go to: cretindesalpes, Didée, Gavino, Sagekilla, and MVtools people.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The benefit of using SMDegrain over directly calling MDegrain is:&lt;br /&gt;
* '''High bitdepth with lsb denoising''': This is the first wrapper function to support 32bit (16bit pipeline) MDegrain denoising.&lt;br /&gt;
* '''Higher temporal radius''' (tr&amp;gt;3): The [[MVTools]] mod (and hence this script) also allows for hack-free higher temporal radius.&lt;br /&gt;
* '''Contrasharpening''': The pretty much standarized sharpening method created by Didée is blended into the function, so you can easily use it in 16bit pipelines. An strength biased method is also possible. A ''CClip'' parameter is also supplied so you can choose another source to sharpen from, other than the default '''SMDegrain()''' input.&lt;br /&gt;
* '''YUY2 support''': It automatically and fully supports YUY2. (but that not important now after avs 2.6 and avs+)&lt;br /&gt;
* '''Interlaced support''': It supports interlaced sources with most parameters as well.&lt;br /&gt;
* '''Extended Subpixel Accuracy''': [[nnedi3]] is allowed as a subpixel filter, not necessary in most cases, but if you are quality mad try to set it on.&lt;br /&gt;
* '''Better Motion Vectors''': An internal conversion from TV levels (reduced values range) to PC levels (extended values range) is done to the clip the motion analysis will be performed on, so you can get better motion vectors (up to 16%)&lt;br /&gt;
* '''Prefilters''': An easy parameter to load generalist prefilters that perform well in most situations. It also accepts loading your personal prefiltered clips.&lt;br /&gt;
* '''Motion Filters''': New in version 3.0d. It will allow you to filter those parts where '''SMDegrain()''' couldn't find a matching block for denoising. One use for it would be spatial denoisers or deblockers since high-motion areas are prone to heavy blocking and artifacts.&lt;br /&gt;
* '''Global Motion Vector In/Out''': Reuse motion vectors globals for faster processing, or just use '''SMDegrain()''' as a shortcut for creating nice quality motion vectors.&lt;br /&gt;
* '''RefineMotion Option''' (MRecalculate): Slower, but sometimes a big quality boost.&lt;br /&gt;
* '''Show Panel''': Everything is off by default, but some settings change in context. Check what is happening behind the scenes and have a fast look at all your settings.&lt;br /&gt;
* '''Robust''': Everything of the above works with each other no problem (interoperability), also in the process some error proof, bugfixes and bug workarounds were implemented or at least warned so you know that most of what is done is reliable, bugs free and optimized. The general idea is to serve as an user friendly front end for vanilla mvtools2+mdegrain or as the original script creator entitled &amp;quot;To make your scripts shorter and less geeky&amp;quot;. Most parameters are turned off or defaulted to mvtools2 defaults and features are based on popular general conceived procedures.&lt;br /&gt;
&lt;br /&gt;
Parameters are arranged in 3 blocks.&lt;br /&gt;
*'''Basic''': For people who just need the most basic parameters because either they don't have the time, knowledge or interest into looking for complex settings. Or they are content with defaults (pretty much mvtools defaults)&lt;br /&gt;
*'''High Bit Depth (with lsb hack) ((you should not use it in avs+))''': There's not much to think about this. This just enables (default is disabled), high bit depth denoising. That is, more quality, but also needs more processing power hence slower.&lt;br /&gt;
*'''Advanced''': If you run into some problems, are nitpicking or just want to fine tune your settings according to the source, have a look at this block, it contains the rest and bulk of the function parameters.&lt;br /&gt;
&lt;br /&gt;
Temporal denoising is a widespread procedure for noise cleaning in most type of video sources. The only limitation for '''SMDegrain()''' being when there are (very) high levels of grain, in which case you would need to rely on more &amp;quot;creative&amp;quot; and source centric solutions (see [https://forum.doom9.org/showthread.php?p=1544619#post1544619 this] and ''prefilter'' notes), but those are the rare cases.&lt;br /&gt;
&lt;br /&gt;
To picture what the function does, a simple '''SMDegrain()''' call matches the next code (for SD resolutions):&lt;br /&gt;
&lt;br /&gt;
 super_search = Dither_Luma_Rebuild(S0=1.0,c=0.0625).MSuper(rfilter=4)&lt;br /&gt;
 &lt;br /&gt;
 bv2 = super_search.MAnalyse(isb = true,  delta = 2, overlap= 4)&lt;br /&gt;
 bv1 = super_search.MAnalyse(isb = true,  delta = 1, overlap= 4)&lt;br /&gt;
 fv1 = super_search.MAnalyse(isb = false, delta = 1, overlap= 4)&lt;br /&gt;
 fv2 = super_search.MAnalyse(isb = false, delta = 2, overlap= 4)&lt;br /&gt;
 &lt;br /&gt;
 MDegrain2(MSuper(levels=1), bv1, fv1, bv2, fv2, thSAD=300, thSADC=150)&lt;br /&gt;
&lt;br /&gt;
As you see no wizardry. The only changes made are the TV-&amp;gt;PC luma expansion (''Dither_Luma_Rebuild''(S0=1.0,c=0.0625) similar to ''color_yuv''(levels=&amp;quot;TV-&amp;gt;PC&amp;quot;)) so you have more range to detect motion vectors, the ''rfilter''=4 for a bit more quality super search, the changed default of ''overlap'' from 0 to 4 and ''thSAD'' and ''thSADC'' from 400 to 300 and 150 respectively for safer results. Nothing else. The problem is that as soon you want to change a little thing like say temporal radius it requires you to edit in more than a few places, so this is very annoying and so forth the main reason for '''SMDegrain()'''.&lt;br /&gt;
 &lt;br /&gt;
==Using the filter==&lt;br /&gt;
*Input can be YV12 or YUY2, and '''must''' be TV range (which is normal). It's also recommended to be in modulus 16 size (resolution multiple of 16), although not strictly necessary.&lt;br /&gt;
*Crop first (when not interlaced).&lt;br /&gt;
*Recommended to deblock if blocking is present, before crop (when cropping) and '''SMDegrain()'''. Or you can use ''prefilter''=3 which is also a good deblocker (dfttest) and let '''SMDegrain()''' clean the blocking for you.&lt;br /&gt;
*Default output mode(dithering) for ''lsb''=true (when non interlaced) is ordered dither (optimized for encoding), so it is not recommended to keep filtering non-edge areas of your source, you can instead use ''mode''=6 (error diffusion) or ''lsb_out''=true and keep filtering in 16bit&lt;br /&gt;
*Read the ''prefilter'' setting explanation for solutions to problematic sources&lt;br /&gt;
&lt;br /&gt;
==Ready-to-run Samples==&lt;br /&gt;
&lt;br /&gt;
I consider this a good starting point where to start tweaking, whether be it for quality or speed:&lt;br /&gt;
 SMDegrain(tr=2,thSAD=250,contrasharp=true,refinemotion=true,lsb=true)&lt;br /&gt;
 &lt;br /&gt;
A basic, fast, yet very functional call for light grain (mvtools2+masktools2 only needed)&lt;br /&gt;
 SMDegrain(tr=1,thSAD=300,contrasharp=true)&lt;br /&gt;
&lt;br /&gt;
A typical more worked call compatible with official mvtools2 (mvtools2+masktools2 only needed)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,interlaced=true,prefilter=1,contrasharp=true)&lt;br /&gt;
&lt;br /&gt;
Good compromise between speed and quality (denoising with high precision)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Similar to the previous example, the next is a personal preference. Turned all chroma off for safeness (chroma is rarely temporal-reliable enough) and speed.&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true,chroma=false,plane=0)&lt;br /&gt;
&lt;br /&gt;
This is a good example to show that interlaced YUY2 sources can be processed seamlessly.&lt;br /&gt;
 # mod4 (modulus 4) interlaced YUY2 source&lt;br /&gt;
 SMDegrain(tr=1,thSAD=250,interlaced=true,contrasharp=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
HD sources are detected automatically, and as so settings are optimized for speed; ''pel''=1, ''hpad''=0, ''vpad''=0, ''blksize''=32, ''overlap''=16, ''truemotion''=false&lt;br /&gt;
 # HD source (from 1100px wide or 600px high up)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb=true,chroma=false,plane=0)&lt;br /&gt;
&lt;br /&gt;
For dealing with dark scenes (you could also add ''truemotion''=false)&lt;br /&gt;
 SMDegrain(tr=3,thSAD=300,contrasharp=true,str=2.0,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Tackling a grainy source:&lt;br /&gt;
 pre=fluxsmootht(3).removegrain(11)&lt;br /&gt;
 SMDegrain(tr=6,thSAD=500,contrasharp=30,prefilter=pre,str=1.2,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Here 2 things are shown; how to work on a 16bit pipeline, and reference a prior state of the script for ''contrasharp''.&lt;br /&gt;
 sharp=last&lt;br /&gt;
 dfttest(tbsize=1,sigma=10,lsb=true)&lt;br /&gt;
 &lt;br /&gt;
 SMDegrain(tr=3,thSAD=300,CClip=sharp,lsb_in=true,lsb_out=true)&lt;br /&gt;
 &lt;br /&gt;
 LinearResize(854,480,lsb_in=true, mode=0)&lt;br /&gt;
&lt;br /&gt;
(Re)using motion vectors globals&lt;br /&gt;
 SMDegrain(tr=1,thSAD=400,prefilter=3,str=1.4,globals=3)    # Output vectors only&lt;br /&gt;
 MFlowFps(Super, bv1, fv1, num=60,den=1)&lt;br /&gt;
 &lt;br /&gt;
==Parameters==&lt;br /&gt;
{{FuncDef|SMDegrain}} (clip input, int &amp;quot;tr&amp;quot;, int &amp;quot;thSAD&amp;quot;, int &amp;quot;thSADC&amp;quot;, bool &amp;quot;RefineMotion&amp;quot;, val &amp;quot;contrasharp&amp;quot;, clip &amp;quot;CClip&amp;quot;, bool &amp;quot;interlaced&amp;quot;, int &amp;quot;plane&amp;quot;, int &amp;quot;Globals&amp;quot;, int &amp;quot;pel&amp;quot;, int &amp;quot;subpixel&amp;quot;, val &amp;quot;prefilter&amp;quot;, clip &amp;quot;mfilter&amp;quot;, int &amp;quot;blksize&amp;quot;, int &amp;quot;overlap&amp;quot;, int &amp;quot;search&amp;quot;, bool &amp;quot;truemotion&amp;quot;, int &amp;quot;limit&amp;quot;, int &amp;quot;limitc&amp;quot;, int &amp;quot;thSCD1&amp;quot;, int &amp;quot;thSCD2&amp;quot;, bool &amp;quot;chroma&amp;quot;, int &amp;quot;hpad&amp;quot;, int &amp;quot;vpad&amp;quot;, bool &amp;quot;lsb&amp;quot;, bool &amp;quot;lsb_in&amp;quot;, bool &amp;quot;lsb_out&amp;quot;, int &amp;quot;mode&amp;quot;, val &amp;quot;Show&amp;quot;, float &amp;quot;Str&amp;quot;, float &amp;quot;Amp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Basic===&lt;br /&gt;
&lt;br /&gt;
{{ParR|tr|int|2|1-128}}&lt;br /&gt;
:Temporal radius, selects the MDegrain to use. This can be considered the strength of the denoising. Higher is generally better, but also much slower and each extra frame gives less improvement.&lt;br /&gt;
:tr 4+ requires Dither's MVTools2 mod. Max 64 for interlaced.&lt;br /&gt;
&lt;br /&gt;
{{Par|thSAD|int|300}}&lt;br /&gt;
{{Par|thSADC|int|150}}&lt;br /&gt;
:&amp;quot;Sum of Absolute Differences&amp;quot; threshold. This is the spatial difference threshold where the motion search will consider whether to denoise given the formula: &lt;br /&gt;
::Denoise_Weight = max( 0, 1 - 2*blockSAD² / (thSAD² + blockSAD²) )&lt;br /&gt;
:This spatial difference will be compared in blocks (''blksize''). If your noise is not getting into consideration for the denoising try raising this value, or reduce its SAD with previous prefiltering. You can alternatively raise ''blksize'', which will likely even blocks SAD. Low values can result in staggered/blotchy denoising, large values can result in ghosting and artifacts. Values in the range 200~600 are usual.&lt;br /&gt;
:thSADC is the same logic applied to chroma planes, since there are less differences on the chroma planes it uses by default thSAD/2 for safer chroma results.&lt;br /&gt;
:'''Recommendation''': Use slightly greater values than you are used to in other mdegrain based functions since the internal clip for the motion search in SMDegrain() has the contrast increased.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Contrasharp|bool|False|True/False}}&lt;br /&gt;
{{ParR|Contrasharp|int|-|0-100}}&lt;br /&gt;
:Contrasharpening is a technique that compares the differences between the clip before blurring (original) and after blurring (filtered), and sharpens locally with consequent strength. By default the &amp;quot;sharp&amp;quot; clip is the input, the &amp;quot;after&amp;quot; clip is the denoised clip. Alternately, a &amp;quot;before&amp;quot; clip can be specified with ''CClip'' (See Advanced).&lt;br /&gt;
:*True: use Didée's Contrasharpening() function (ContraHD() for HD) which &amp;quot;Sharpens the denoised clip, but doesn't add more to any pixel than what was removed previously.&amp;quot; In the practice you will get a slightly sharper result than the source, which is welcome.&lt;br /&gt;
:*An integer: LSFmod() will be used instead. It will be much slower, but maybe better for certain sources. Its value will serve as a contrasharpening multiplier, use one around 50 for similar strength as Contrasharpening(). LSFmod is less-suitable for HD sources.&lt;br /&gt;
&lt;br /&gt;
{{Par|RefineMotion|bool|False}}&lt;br /&gt;
:Refines and recalculates motion data of previously estimated (by MAnalyse) motion vectors. Turn it on for better motion vectors, specially when dealing with ghosting issues, small details or lineart fading and whatnot.&lt;br /&gt;
:'''Caution''': It won't help much if you use a ''prefilter'' so strong that blurs too much or kills all the details you are aiming to protect in first place.&lt;br /&gt;
&lt;br /&gt;
{{ParR|plane|int|4|0-4}}&lt;br /&gt;
:Select the planes you wish to process:&lt;br /&gt;
:*0: luma only&lt;br /&gt;
:*1: chroma U&lt;br /&gt;
:*2: chroma V&lt;br /&gt;
:*3: both chromas&lt;br /&gt;
:*4: all (Default)&lt;br /&gt;
:'''Caution''': plane=1-4 can sometimes create chroma smearing. In such case I recommend denoising chroma planes in the spatial domain.&lt;br /&gt;
&lt;br /&gt;
{{Par|Interlaced|bool|False}}&lt;br /&gt;
:If you want to denoise an interlaced source set this parameter to true. Output will also be interlaced. If you pair this with ''lsb_out''=true then you will have to &amp;lt;tt&amp;gt;Weave().DitherPost(mode=6,interlaced=true)&amp;lt;/tt&amp;gt; when converting back to 8 bit.&lt;br /&gt;
&lt;br /&gt;
===High Bit Depth Processing And Dithering===&lt;br /&gt;
All High Bit Depth parameters require [[Dither]] and [[MVTools]] 2.6+. The [[AviSynth+]] doesn't need these parameters; it automatically outputs the same bitdepth as the input, but if you still need 99% alternative to lsb family there are n16 (don't has n16_in because it don't make any sense in that case).&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb_in|bool|False}}&lt;br /&gt;
:Set true if you use a 16 bits filter chain. *(EXPERIMENTAL, use under test environment)&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb_out|bool|False}}&lt;br /&gt;
:Output to 16-bit instead of 8-bit. Use the helpers at the end of the SMDegrain() script to use Ditherpost() with YUY2 formats.&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb|bool|False}}&lt;br /&gt;
:This enables 32 bit depth precision for denoising. You gain extra denoising accuracy, most noticeable in the prevention of banding in flat areas. Automatically set if either ''lsb_in'' or ''lsb_out'' are enabled.&lt;br /&gt;
&lt;br /&gt;
{{ParR|mode|int|0|-1-8}}&lt;br /&gt;
:This is the '''mode''' of [[Dither#DitherPost|DitherPost]] when ''lsb_out''=False, as a dithering method must be chosen for the 32bit-&amp;gt;8bit conversion. (Interlaced content is locked to mode=6) The default ''mode''=0 will help you optimize the dithering for optimum encodings when no further non-edge processing is done. Use ''mode''=6 (error diffusion) if further processing will be done.&lt;br /&gt;
&lt;br /&gt;
===Advanced===&lt;br /&gt;
&lt;br /&gt;
{{ParR|pel|int|2|1,2,4}}&lt;br /&gt;
:Accuracy of the motion estimation:&lt;br /&gt;
:* 1: full-pixel (Default for HD)&lt;br /&gt;
:* 2: half-pixel (Default for SD)&lt;br /&gt;
:* 4: quarter-pixel (often more accurate, but much slower and not always better)&lt;br /&gt;
&lt;br /&gt;
{{ParR|subpixel|int|2|0-3}}&lt;br /&gt;
:Subpixel interpolation method for ''pel''=2 or 4. This is the 'sharp' parameter in MSuper(), although it isn't related to output sharpness but better accuracy for the motion estimation.&lt;br /&gt;
:* 0: bilinear (softest)&lt;br /&gt;
:* 1: bicubic (4 tap Catmull-Rom)&lt;br /&gt;
:* 2: sharper Wiener (6 tap, similar to Lanczos) (Default)&lt;br /&gt;
:* 3: [[nnedi3]] (very high quality: useful for small sources but usually overkill. requires plugin)&lt;br /&gt;
&lt;br /&gt;
{{ParR|prefilter|int|-1|-1-3}}&lt;br /&gt;
{{Par|prefilter|clip|None}}&lt;br /&gt;
:* -1: off (Default)&lt;br /&gt;
:* 0: light controlled gauss blur&lt;br /&gt;
:* 1: mild median/gauss blur&lt;br /&gt;
:* 2: strong median/gauss blur&lt;br /&gt;
:* 3: [[dfttest]] (spatial)&lt;br /&gt;
:* clip: supply your own&lt;br /&gt;
:Denoises a version of the clip that will be used to obtain the motion vectors. Useful for very damaged/grainy sources, this will help to get better motion vectors.&lt;br /&gt;
:For sources with Gibbs noise, especially on anime, try ''prefilter''=1 or 2 or better yet strong median filters (through clip input) in order to soothe the high SAD of sharp edges. For blocky sources, or a general more quality/safer prefilter use option 3 (dfttest)&lt;br /&gt;
:By default dfttest outputs a sstring txt file to your script folder, you can delete it. This doesn't happen when using the modded dfttest (version 1.9.2 or higher) of the Dither tools.&lt;br /&gt;
:For HD sources ''prefilter''=2 makes more sense than 1, because it uses a wider denoising window.&lt;br /&gt;
:If instead you want to use your own prefilter denoiser, just define it in a variable and reference it here. Remember to:&lt;br /&gt;
:*Feed always 8 bit clips.&lt;br /&gt;
:*Input in fields for interlaced content *(read below)&lt;br /&gt;
:*Feed here planar ( by using Interleaved2Planar() ) YUY2 clips (not interleaved) when working with YUY2 sources.&lt;br /&gt;
:You will likely want to use spatial denoisers like median filters (removegrain=17, medianblur, etc). For very grainy or fizz grain noise you can try prefiltering in temporal or if this is not enough, try adding a new SMDegrain() line again but without globals. Use ''lsb_in'', ''lsb_out'' according so results are smooth. You can even use SMDegrain() as a prefilter for SMDegrain() in very temporal unstable sources.&lt;br /&gt;
:Another trick for fizz grain is to serve a prefiltered clip where bright values are more denoised than dark values, you can do this through luma masks with masktools2 code. Search in [https://forum.doom9.org/showthread.php?t=162813 Doom9] for reference.&lt;br /&gt;
:For interlaced sources remember:&lt;br /&gt;
::Spatial filtering: pre=separatefields().spatial_prefilters_here()&lt;br /&gt;
::Temporal filtering: pre=separatefields().interleave(selecteven().temporal_filters(),selectodd().temporal_filters())&lt;br /&gt;
:SMDegrain() (and MDegrain) is likely to produce blending artifacts or oversmooth in dark areas specially on cartoons, to tackle this see RefineMotion or expand the luma range in the darks. For this there are many options, you can use your preferred gamma enhancer and input it as the prefilter, or use the examples below for linear brightening (masktools2) and input it as a ''prefilter'' as well. Or at last and the recommended solution, to use the built-in ''Str'' (strength) and ''Amp'' (amplitude) parameters for a curve type dark enhancement, check the effects by enabling Show and changing your previewing conditions to PC levels.&lt;br /&gt;
:For brightening dark values linearly (brighter parts less brightening)&lt;br /&gt;
 str=1&lt;br /&gt;
 mt_lut(&amp;quot;x x &amp;quot;+string(str)+&amp;quot; 6 * - 255 - abs 255 / ^ x 1 - abs +&amp;quot;)&lt;br /&gt;
:Or for a more contrasty image (although not as much dark enhancing - not linear)&lt;br /&gt;
 str=40&lt;br /&gt;
 mt_lut(&amp;quot;x x &amp;quot;+string(str)+&amp;quot; 6 * - 255 - abs 255 / ^ &amp;quot;+string(str)+&amp;quot; / x 1 - abs +&amp;quot;)&lt;br /&gt;
:Good resources for custom prefilters:&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=162813&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=132310&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=133977&lt;br /&gt;
:Notes: To sum it up; generally in denoising, temporal filters are always preferred due to its natural look (versus spatial filters). But more often than not for good results prefiltering plays a key role on the output quality, and setting it up nicely can be looked as an art by itself.&lt;br /&gt;
:If there's a reached point where no prefiltering, no ''thSAD'' tweaking, etc, makes able to denoise a certain motion part/area/scene, then this is due to the motion vectors preventing them from being &amp;quot;denoised&amp;quot; (also read &amp;quot;artifacted&amp;quot;), in which case you will need to rely on alternative solutions (motion compensation, filters like MCTemporalDenoise(), TemporalDegrain(), [https://forum.doom9.org/showthread.php?p=1544619#post1544619 Multilevel MDegrain], etc) or just use plain spatial filters with motion masks. Creating these discerning masks for static and motion scenes and combining them is a research task on the end user side.&lt;br /&gt;
&lt;br /&gt;
{{Par|mfilter|clip|None}}&lt;br /&gt;
:Motion Filter, an optional user-supplied clip that will be passed through those areas where SMDegrain() couldn't find a matching block, normally high motion areas. One use for it would be to to use spatial filters, like deblockers or blurring filters that mimic motion blur.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Str|float|1.0|0.0-8.0}}&lt;br /&gt;
:Gamma correction. With this parameter you control the strength of the brightening of the ''prefilter'' clip, good for when problems with dark areas arise. Using this internally instead of externally creates less quantization artifacts, since it's done in the same stage as the TV-&amp;gt;PC range conversion.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Amp|float|0.0625|0.0-1.0}}&lt;br /&gt;
:Used when ''Str'' &amp;lt;&amp;gt; 1.0. This defines the amplitude of the brightening in the luma range, for example by using 1.0 all the luma range will be used and the brightening will find its peak at luma value 128 in the original. Default is 0.0625 (1.0/16) which just sits over luma value 16 (256/16) This and ''Str'' are extrapolated arguments from [https://forum.doom9.org/showthread.php?p=1548318#post1548318 cretindesalpes' function], you can find a graph and more insight explanations at the original post.&lt;br /&gt;
:Check these 2 parameters effects by enabling ''show''.&lt;br /&gt;
&lt;br /&gt;
{{ParR|blksize|int|8 for SD, 16 for HD|4,8,16}}&lt;br /&gt;
:Size of a block (horizontal x vertical). Larger blocks are faster and less sensitive to noise, but also less accurate.&lt;br /&gt;
&lt;br /&gt;
{{Par|overlap|int|blksize/2}}&lt;br /&gt;
:Must be *even* and *less* than block size. Common values: ''blksize''/4 or ''blksize''/2. Larger ''overlap'' looks slightly better and runs slower.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Search|int|4|0-7}}&lt;br /&gt;
:This is the '''search''' of [[MVTools/MAnalyze|MAnalyze]].&lt;br /&gt;
&lt;br /&gt;
{{Par|Truemotion|bool|True for SD, False for HD}}&lt;br /&gt;
:''Truemotion'' is a preset of some MVAnalyze parameter values. It allows easy to switch default values of all &amp;quot;true motion&amp;quot; parameters at once. Set it 'true' for true motion search (high vector coherence), set it 'false' to search motion vectors with best SAD. Truemotion is slower and may blur textures and thin details more, but will usually remove more noise.&lt;br /&gt;
:For HD sources where the main problems are just excessive grain, I have defaulted it to false, this is not only faster but honors detail accuracy (the main existing point for HD sources) and overall object shading.&lt;br /&gt;
&lt;br /&gt;
{{Par|Chroma|bool|True}}&lt;br /&gt;
:Set false to totally ignore chroma for finding motion vectors, for more speed with little cost in quality or when your chroma is too bad to find good matches. Don't process chroma planes without chroma vectors, MVTools doesn't seem to work right.&lt;br /&gt;
&lt;br /&gt;
{{Par|Hpad|int|''blksize'' for SD, 0 for HD}}&lt;br /&gt;
{{Par|Vpad|int|''blksize'' for SD, 0 for HD}}&lt;br /&gt;
:Horizontal/vertical padding added to source frame (left, right, top, and bottom) for better motion estimation near borders.&lt;br /&gt;
:Try to have clean borders in your source (no NAB/black borders) to start with before tweaking this setting. If necessary, crop beforehand ideally in multiples of 16. Turn it to 0 if you are running out of memory.&lt;br /&gt;
&lt;br /&gt;
{{Par|thSCD1|int|based on ''blksize'': 4{{=}}&amp;gt;100, 8{{=}}&amp;gt;400, 16{{=}}&amp;gt;1600}}&lt;br /&gt;
:Threshold which decides whether a block has changed between the previous frame and the current one, used to tweak the scene change detection. Raising it will lower the number of blocks detected as changed. It may be useful for noisy or flickered video. To fix blending on scene changes on dark scenes, first try ''Str'' and ''Amp''.&lt;br /&gt;
&lt;br /&gt;
{{ParR|thSCD2|int|130|0-250}}&lt;br /&gt;
:Threshold which sets how many blocks have to change for the frame to be considered as a scene change.&lt;br /&gt;
&lt;br /&gt;
{{ParR|limit|int|255|1-255}}&lt;br /&gt;
{{ParR|limitC|int|255|1-255}}&lt;br /&gt;
:Maximal change of pixel luma/chroma, to prevent some artifacts.&lt;br /&gt;
&lt;br /&gt;
{{Par|CClip|clip|None}}&lt;br /&gt;
:Optional sharp version for ''contrasharp'' to compare against; video resolution and properties must be the same (different bit depth is OK). Using this option defaults ''contrasharp'' to True.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Globals|int|0|0-3}}&lt;br /&gt;
:With this parameter you can create or load pre-processed motion vectors, to save doing the work for multiple SMDegrain calls.&lt;br /&gt;
:*0: Ignore globals, just process&lt;br /&gt;
:*1: Read globals and Process&lt;br /&gt;
:*2: Process and output globals&lt;br /&gt;
:*3: Output globals only, don't process&lt;br /&gt;
:Some parameters '''MUST MATCH''' between output and input stages: ''pel'', ''subpixel'', ''chroma'', and ''vpad''/''hpad'' cannot change. When reading (Globals=1) only some parameters work: ''tr'', ''thSAD'', ''plane'', ''limit'', ''limitc'', ''contrasharp'', ''CClip'', ''interlaced'' and the ''lsb'' parameters. Others are ignored.&lt;br /&gt;
:Global names that can be reused are: '''Super''', '''bv1''', '''fv1''', '''bv2''', '''fv2''', '''bv3''', '''fv3''', '''bv4''', '''fv4''', '''bv6''', '''fv6''', '''vmulti'''.&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=3)    # Outputs vectors&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=1)    # You can use a lower &amp;quot;tr&amp;quot; or &amp;quot;thSAD&amp;quot; if you want&lt;br /&gt;
:or&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=3)    # Outputs vectors&lt;br /&gt;
 Super = MSuper(levels=1)               # Add this line just before if you have some processing between Globals Output and Input.&lt;br /&gt;
 MDegrain3(Super, bv1, fv1, bv2, fv2, bv3, fv3, thSAD=400)&lt;br /&gt;
&lt;br /&gt;
{{Par|Show|bool|False}}&lt;br /&gt;
{{ParR|Show|str|-|&amp;quot;Speed&amp;quot;, &amp;quot;Memory&amp;quot;, &amp;quot;Quality&amp;quot;}}&lt;br /&gt;
:This will show the prefiltered clip to be used for the motion search to the left(&amp;lt;--), and the used parameters list to the right (--&amp;gt;)&lt;br /&gt;
:If the parameters panel is broken i.e. overlapping lines, hidden lines, etc, most likely your settings are wrong, (e.g. ''lsb_in''=true when input is 8bit) so it will also work well as a debug function. If you set Show to a string as indicated above, related parameters will be highlighted to guide you on correctly tweaking the function. This is loosely based, so it doesn't exclude you from reading carefully every parameter explanation.&lt;br /&gt;
:Even when you are not using any prefiltering, the clip to be used for the motion search where you obtain the motion vectors, will be converted from TV levels to PC levels, the only exception being when using ''Globals''=1 (Read) in which case the &amp;quot;prefiltered&amp;quot; clip will be exactly the same as input clip (that is no luma conversion, although constrained to 8 bit). Additionally you can tweak the dark expansion with ''Str'' and ''Amp'' parameters and check the effects in the left panel, but be aware to change your viewing conditions as it is in PC levels.&lt;br /&gt;
:The left panel preserves its properties so you can crop out the right panel and use it as a prefilter clip of any MSuper(). Therefore if you are not processing chroma (''chroma''=false) the prefiltered clip will be green, don't panic, this is correct, this happens when the U and V planes are unset. In this regard for previewing tasks with prefilterings -- or just the ''Str'' and ''Amp'' effect -- set ''chroma'' to true temporally or follow with ''GreyScale''(). For YUY2 sources set ''Planar2Interleaved''() after cropping for previewing.&lt;br /&gt;
 &lt;br /&gt;
==Final Notes==&lt;br /&gt;
If there is an important parameter not implemented, you have any issue or found a bug, please don't hesitate and ask in its [https://forum.videohelp.com/threads/369142 VideoHelp thread].&lt;br /&gt;
 &lt;br /&gt;
==Changelog==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 1px solid darkgray&amp;quot;&lt;br /&gt;
!Version&lt;br /&gt;
!Date&lt;br /&gt;
!Changes&lt;br /&gt;
|-&lt;br /&gt;
|v3.1.2.97s&lt;br /&gt;
|2018-03-26&lt;br /&gt;
|&lt;br /&gt;
Fix subpixel=3&lt;br /&gt;
Add Prefilter auto 16 (lsb) support&amp;lt;br/&amp;gt;&lt;br /&gt;
YUY2 support in avs 2.6 with masktools 2.6&amp;lt;br/&amp;gt;&lt;br /&gt;
medianblur2 now will be used in Minblur instead of Quantile RemoveGrainHD in avs 2.6&amp;lt;br/&amp;gt;&lt;br /&gt;
Add TV_range bool&amp;lt;br/&amp;gt;&lt;br /&gt;
Less lsb if not use lsb things and get ready for yv16 and yv24&amp;lt;br/&amp;gt;&lt;br /&gt;
Add dct&amp;lt;br/&amp;gt;&lt;br /&gt;
Add device_id for prefilter=4&amp;lt;br/&amp;gt;&lt;br /&gt;
No need to use Planar2Interleaved() after cropping in Show with YUY2 (this is old changed, and now with mvtools support yv16 most people will not use YUY2)&amp;lt;br/&amp;gt;&lt;br /&gt;
Add MDegrain4 and MDegrain5 and MDegrain6, this will make tr=4-6 faster&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1.2d&lt;br /&gt;
|2015-07-21&lt;br /&gt;
|&lt;br /&gt;
Fixed regression where external prefilters wouldn't be parsed for luma expansion&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1.1d&lt;br /&gt;
|2015-07-16&lt;br /&gt;
|&lt;br /&gt;
Workaround to force KNLMeansCL use discrete video card (now required)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1d&lt;br /&gt;
|2015-07-14&lt;br /&gt;
|&lt;br /&gt;
New prefilter mode 4 for grainy sources. GPU based spatio-temporal KNLmeans&amp;lt;br/&amp;gt;&lt;br /&gt;
Added dither output mode &amp;quot;Random Dither&amp;quot;.&amp;lt;br/&amp;gt;&lt;br /&gt;
Added &amp;quot;slices&amp;quot; option from Dither&amp;lt;br/&amp;gt;&lt;br /&gt;
Added soft=-2 (automatic) to internal lsfmod&amp;lt;br/&amp;gt;&lt;br /&gt;
Added assert for chroma denoise when luma only motion vectors (mvtools bug)&amp;lt;br/&amp;gt;&lt;br /&gt;
Improved lsb_in code (now using sub/add method)&amp;lt;br/&amp;gt;&lt;br /&gt;
Removed vpad/hpad=0 optimization preset for HD&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed prefilter=3 code for lsb_in YUY2&amp;lt;br/&amp;gt;&lt;br /&gt;
More fixes to Show Panel...&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated and fixed documentation (notes on YUY2 support)&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3.0d&lt;br /&gt;
|2015-03-27&lt;br /&gt;
|&lt;br /&gt;
Adjusted SD&amp;lt;&amp;gt;HD discretion&amp;lt;br/&amp;gt;&lt;br /&gt;
Added mfilter (Motion Filter) new feature&amp;lt;br/&amp;gt;&lt;br /&gt;
subpixel=3 (nnedi3); removed qual=2 due to possible blending bug (quote by cretindesalpes), this also boosts speed&amp;lt;br/&amp;gt;&lt;br /&gt;
Lowered the defaults for less aggressive denoise (still somewhat high)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed chroma not showing in debug (show) mode when lsb=true and prefilter=3 were paired&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed long lasting issues in Show Panel for certain not mod height resolutions&amp;lt;br/&amp;gt;&lt;br /&gt;
Now prefilter=0 is minblur(0), lighter denoising than prefilter=1, default is now -1 (off)&amp;lt;br/&amp;gt;&lt;br /&gt;
Documentation update (plugin updates, notes, links, examples, etc)&lt;br /&gt;
|-&lt;br /&gt;
|2.2d&lt;br /&gt;
|2013-03-05&lt;br /&gt;
|&lt;br /&gt;
Removed one residual variable in Contrasharpening function&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a regression at v2.0 for Interlaced YUY2 sources by changing wrong variable ifC to if0, and...&amp;lt;br/&amp;gt;&lt;br /&gt;
...adding a missing weave() to the last MergeChroma() call&amp;lt;br/&amp;gt;&lt;br /&gt;
Dropped Dither support. (Will still work/not work as before, but lack of official support renders it to a YMMV condition)&lt;br /&gt;
|-&lt;br /&gt;
|2.1d&lt;br /&gt;
|2012-09-09&lt;br /&gt;
|&lt;br /&gt;
Fixed Refinemotion Globals Input labels&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed ContrasharpeningHD Vectors for Interlaced HD sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Added ability to import Global Vectors even when &amp;quot;tr&amp;quot; is lower than parent instance &amp;quot;tr&amp;quot; (credit to cretindesalpes)&amp;lt;br/&amp;gt;&lt;br /&gt;
Expanded support for Interlaced Denoising &amp;quot;tr&amp;quot; up to 64 (credit to cretindesalpes)&amp;lt;br/&amp;gt;&lt;br /&gt;
Cosmetics&lt;br /&gt;
|-&lt;br /&gt;
|2.0d&lt;br /&gt;
|2012-06-07&lt;br /&gt;
|&lt;br /&gt;
Fixed and optimized chroma handling for lsb_in, contrasharpening and YUY2 content v.1.95&amp;lt;br/&amp;gt;&lt;br /&gt;
Enhanced Chroma bypass on the sharpening stage&amp;lt;br/&amp;gt;&lt;br /&gt;
Merged ContraHD() internally for Contrasharpening in HD sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Dropped QTGMC support on import/export motion vectors (small value for increased confusion)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed Median code for planar inputs in MinBlur() (needs RemoveGrainHD, dropped medianblur requirement)&amp;lt;br/&amp;gt;&lt;br /&gt;
Defaulted truemotion to false for HD inputs&amp;lt;br/&amp;gt;&lt;br /&gt;
Code Optimization and Clean up&amp;lt;br/&amp;gt;&lt;br /&gt;
Others&lt;br /&gt;
|-&lt;br /&gt;
|1.9d&lt;br /&gt;
|2012-03-23&lt;br /&gt;
|&lt;br /&gt;
Added truemotion parameter (default=true), change it to false (as in MCTemporalDenoise()), so low frequency detail won't be lost (walls...), although it could leave more noise on high frequency details&amp;lt;br/&amp;gt;&lt;br /&gt;
Added thSADC, and thSCD1/thSCD2 parameters for finer control&amp;lt;br/&amp;gt;&lt;br /&gt;
Tweaked prefilter=3 dfttest sigmas for better low frequency detail protection&amp;lt;br/&amp;gt;&lt;br /&gt;
Detached explanation and converted to html. Updated and extended the contents as well&amp;lt;br/&amp;gt;&lt;br /&gt;
Fine tuned and robustized the Show Panel&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimized and organized code, more precisely the contrasharpening part&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a few ternary checks for when Globals=3&amp;lt;br/&amp;gt;&lt;br /&gt;
Others&lt;br /&gt;
|-&lt;br /&gt;
|1.8d&lt;br /&gt;
|2012-01-18&lt;br /&gt;
|&lt;br /&gt;
Added automatic dark protection for prefilter=3 (dfttest performs badly in darks) v1.71d and extended its dark protection v1.8&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed chroma variable when chroma=false, from 2 (copy chroma) to 1 (discard chroma) v1.71d&amp;lt;br/&amp;gt;&lt;br /&gt;
Explanation and cosmetics v1.71d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added acknowledgments and updated explanation&amp;lt;br/&amp;gt;&lt;br /&gt;
Added brackets to all functions (it has been reported to cause threading problems under certain circumstances) (https://forum.doom9.org/showthread.php?p=1515886#post1515886)&amp;lt;br/&amp;gt;&lt;br /&gt;
Reworked and fixed the parameters panel. Now you have a color guide to have an idea on what to tweak depending on selected mode in Show. For strings: &amp;quot;Speed&amp;quot;, &amp;quot;Memory&amp;quot; and &amp;quot;Quality&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimized lsb_in for HD resolutions which was causing memory hogs&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed contrasharpening for YUY2 sources when lsb=true&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed some inconsistencies for YUY2 sources when prefilter=3&lt;br /&gt;
|-&lt;br /&gt;
|1.7d&lt;br /&gt;
|2012-01-11&lt;br /&gt;
|&lt;br /&gt;
Fixed and extended introduction explanation v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed some issues for Globals=1 (Read) in relation to lsb_in and luma expansion auto-prefilter v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added mild gauss blur prefilter option as prefilter=1. Consequent modes are displaced v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed prefilter 1 and 2 to Minblur (Gauss/Median combination) v.1.63d&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated MinBlur function v.1.62d and v.1.66&amp;lt;br/&amp;gt;&lt;br /&gt;
Code tidied up v.1.62d&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated luma expansion, now you can enhance darks (with 'Str' and 'Amp') in the same step as the TV-&amp;gt;PC conversion stage, thus +optimized, +quality. v.1.63d by cretindesalpes (https://forum.doom9.org/showthread.php?p=1548318#post1548318)&amp;lt;br/&amp;gt;&lt;br /&gt;
Removed pre_custom. Now use prefilter to load a prefiltered clip, as well as modes 0~3&amp;lt;br/&amp;gt;&lt;br /&gt;
Added Show parameter. Now you can see the used and default parameters along the prefilter clip as well&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed one note related to prefilter clip input for interlaced content&lt;br /&gt;
|-&lt;br /&gt;
|1.6d&lt;br /&gt;
|2011-12-24 (first open release)&lt;br /&gt;
|&lt;br /&gt;
Fixed and extended introduction explanation&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed Ditherpost for interlaced sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a broken reference for reading MRecalculate globals when tr&amp;gt;3&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a Globals=1 MSuper automatization&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a plane processing bypass when chroma=false&amp;lt;br/&amp;gt;&lt;br /&gt;
Added LSFmod as optional contrasharpening (slower, but biased contrasharpening and probably better depending on source)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added default luma expansion auto-prefilter for motion search (16% more values)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added YUY2 support&amp;lt;br/&amp;gt;&lt;br /&gt;
Added the 'mode' parameter of Ditherpost()&amp;lt;br/&amp;gt;&lt;br /&gt;
Added support for interlaced temporal radius up to 6&lt;br /&gt;
|-&lt;br /&gt;
|1.5d&lt;br /&gt;
|2011-10-14&lt;br /&gt;
|&lt;br /&gt;
Changed &amp;quot;srchSuper&amp;quot; Global variable to &amp;quot;QTGMC_srchSuper&amp;quot;, compatible with QTGMC. Anyhow you may probably want to create a new super clip. Test it out! v.1.41d&amp;lt;br/&amp;gt;&lt;br /&gt;
Introduction spelling and presentation v.1.42d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added lsb and lsb_in for prefilter=2 (dfttest) v.1.43d &amp;amp; v.1.44d&amp;lt;br/&amp;gt;&lt;br /&gt;
Some better definitions for the settings help v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
pelclip is now subpixel = 3 ('sharp' parameter before) v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
Other minor tweaks v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed an important issue when using prefilter with subpixel=3 ('pelclip' parameter before)&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimizations in Ditherpost for chroma&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed rfilter (hierarchical levels smoothing/scaling) from default 2 to 4. Better results in my judge&amp;lt;br/&amp;gt;&lt;br /&gt;
Some more little tweaks in code and introduction&lt;br /&gt;
|-&lt;br /&gt;
|1.4d&lt;br /&gt;
|2011-09-16&lt;br /&gt;
|&lt;br /&gt;
Added pelclip option for top quality subpixel interpolation when pel &amp;gt; 1&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed QTGMCV parameter to Globals, and added a bunch of new features like vectors output from SMDegrain()&amp;lt;br/&amp;gt;&lt;br /&gt;
Big introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|1.3d&lt;br /&gt;
|2011-09-14&lt;br /&gt;
|Fixed an important issue on the Interlaced parameter and improved overall handling (v.1.21d &amp;amp; v.1.3d)&lt;br /&gt;
|-&lt;br /&gt;
|1.2d&lt;br /&gt;
|2011-09-13&lt;br /&gt;
|&lt;br /&gt;
Added Interlaced parameter, for processing interlaced sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Some introduction and code optimization tweaks (v.1.12d &amp;amp; v.1.2d)&lt;br /&gt;
|-&lt;br /&gt;
|1.1d&lt;br /&gt;
|2011-09-12&lt;br /&gt;
|&lt;br /&gt;
Implemented MDegrainN for tr &amp;gt; 3, from the MVTools2 mod of Dither&amp;lt;br/&amp;gt;&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|1.0d&lt;br /&gt;
|2011-09-09&lt;br /&gt;
|&lt;br /&gt;
Added CClip parameter. Reference an earlier stage of your processing chain as your sharp version for the contrasharpening&lt;br /&gt;
|-&lt;br /&gt;
|0.9d&lt;br /&gt;
|2011-09-09&lt;br /&gt;
|&lt;br /&gt;
Added QTGMCV parameter, for reusing vectors from QTGMC bob deinterlacer&lt;br /&gt;
|-&lt;br /&gt;
|0.8d&lt;br /&gt;
|2011-09-05&lt;br /&gt;
|&lt;br /&gt;
Fixed a few things related to the lsb_in option&amp;lt;br/&amp;gt;&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|0.7d&lt;br /&gt;
|2011-09-05&lt;br /&gt;
|&lt;br /&gt;
Implemented &amp;quot;fake&amp;quot; lsb_in option. Output will have slightly more quality (if any), and will compress better. (Experimental)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a not passed argument in the hpad, vpad parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.6d&lt;br /&gt;
|2011-09-04&lt;br /&gt;
|&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|0.5d&lt;br /&gt;
|2011-07-19&lt;br /&gt;
|&lt;br /&gt;
Added dfttest option for preblur (now prefilter) option. Slower but better due to its internal deblock+denoise operation, plus sharper results&amp;lt;br/&amp;gt;&lt;br /&gt;
Added pre_custom option for the prefilter process, define here a denoised clip as your prefiltered version&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated the introduction help&lt;br /&gt;
|-&lt;br /&gt;
|0.4d&lt;br /&gt;
|2011-06-03&lt;br /&gt;
|&lt;br /&gt;
Added preblur option for slight vector blurring where motionmatch is bad (https://forum.doom9.org/showthread.php?t=161594)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added RefineMotion parameter for better motion vectors. Based off Killer() (https://forum.doom9.org/showthread.php?p=1266572#post1266572)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added parameters &amp;quot;lsb&amp;quot; and &amp;quot;lsb_out&amp;quot;, for the MVTools2 mod version of cretindesalpes' Dither (https://forum.doom9.org/showthread.php?p=1386559#post1386559)&amp;lt;br/&amp;gt;&lt;br /&gt;
Other minor aesthetics and performance adjustments&lt;br /&gt;
|-&lt;br /&gt;
|0.3d&lt;br /&gt;
|2011-03-04&lt;br /&gt;
|&lt;br /&gt;
First Mod version&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed plane (for MDegrain) and added chroma (for MAnalyse) parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|2010-01-24&lt;br /&gt;
|&lt;br /&gt;
Added introductory section&amp;lt;br/&amp;gt;&lt;br /&gt;
Added more parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|&lt;br /&gt;
Basic working version&amp;lt;br/&amp;gt;&lt;br /&gt;
Not released&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/SMDegrain</id>
		<title>SMDegrain</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/SMDegrain"/>
				<updated>2021-03-31T05:38:59Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Denoisers|Spatial-Temporal Denoisers|Deep_color_tools}}&lt;br /&gt;
{{Filter&lt;br /&gt;
| Caroliano, {{Author/Dogway}}, Real.Finder&lt;br /&gt;
| v3.1.2.110s&lt;br /&gt;
|&lt;br /&gt;
* [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/SMDegrain.avsi SMDegrain]&amp;lt;br/&amp;gt;&lt;br /&gt;
| 4=Spatial-Temporal Denoisers&lt;br /&gt;
| 7=[https://forum.videohelp.com/threads/369142-Simple-MDegrain-Mod-v3-0d-A-Quality-Denoising-Solution VideoHelp], [https://forum.doom9.org/showthread.php?t=163604 Doom9], [https://forum.doom9.org/showthread.php?t=174121 Doom9 mod] }}&lt;br /&gt;
&lt;br /&gt;
'''SMDegrain''', the Simple MDegrain Mod, is mainly a convenience function for using [[MVTools]]. It is not a magic function (the magic comes from mvtools), it just takes the repetitive code blocks needed for mvtools+mdegrain denoising and wraps them into this function.&lt;br /&gt;
&lt;br /&gt;
It has internal switches for interlaced or YUY2 content '''''(but you should not use it in avs 2.6 and avs+ and use YV16 instead)''''', saving you from writing long lines of code and preventing from possible mistakes. YUY2 is even automatically detected. Apart of that it adds some small and simple enhancements listed below, like easy prefilters, slightly better motion vectors (thanks to an internal TV-&amp;gt;PC luma expansion and the possibility of dark enhancement), easy nnedi3 subpixel accuracy, globals import/export, show panel, and contra-sharpening option.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* [[Zs_RF_Shared]]&lt;br /&gt;
* [[MVTools]] (mod versions recommended) and [[MaskTools2]] (you will not needed if you set TV_range to false)&lt;br /&gt;
&lt;br /&gt;
===Optional===&lt;br /&gt;
* [[Dither]] for 16 bit processing (v1.26.5 or higher)&lt;br /&gt;
* [[RgTools]] for contrasharp=true or prefilter=1 or 2&lt;br /&gt;
* [[LSFmod]] for contrasharp &amp;gt; 0.0&lt;br /&gt;
* [[dfttest]] for prefilter=3&lt;br /&gt;
* [[nnedi3]] for subpixel=3&lt;br /&gt;
&amp;lt;strike&amp;gt;''Beware, tp7's plugin mods have no YUY2 support, require AviSynth 2.6a5 or latest Set's MT for v2.6, and Visual C++ 2012 Redistributable.''&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Aknowledgements==&lt;br /&gt;
Original '''SMDegrain()''' by Caroliano&lt;br /&gt;
&lt;br /&gt;
This function uses code from Didée, and cretindesalpes' creations, and has parts inspired by LaTo's functions (old readme, Show panel, etc) and Jawed's Killer() function, apart of relying on third-party tools for certain features.&lt;br /&gt;
&lt;br /&gt;
Special thanks go to: cretindesalpes, Didée, Gavino, Sagekilla, and MVtools people.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
The benefit of using SMDegrain over directly calling MDegrain is:&lt;br /&gt;
* '''High bitdepth with lsb denoising''': This is the first wrapper function to support 32bit (16bit pipeline) MDegrain denoising.&lt;br /&gt;
* '''Higher temporal radius''' (tr&amp;gt;3): The [[MVTools]] mod (and hence this script) also allows for hack-free higher temporal radius.&lt;br /&gt;
* '''Contrasharpening''': The pretty much standarized sharpening method created by Didée is blended into the function, so you can easily use it in 16bit pipelines. An strength biased method is also possible. A ''CClip'' parameter is also supplied so you can choose another source to sharpen from, other than the default '''SMDegrain()''' input.&lt;br /&gt;
* '''YUY2 support''': It automatically and fully supports YUY2. (but that not important now after avs 2.6 and avs+)&lt;br /&gt;
* '''Interlaced support''': It supports interlaced sources with most parameters as well.&lt;br /&gt;
* '''Extended Subpixel Accuracy''': [[nnedi3]] is allowed as a subpixel filter, not necessary in most cases, but if you are quality mad try to set it on.&lt;br /&gt;
* '''Better Motion Vectors''': An internal conversion from TV levels (reduced values range) to PC levels (extended values range) is done to the clip the motion analysis will be performed on, so you can get better motion vectors (up to 16%)&lt;br /&gt;
* '''Prefilters''': An easy parameter to load generalist prefilters that perform well in most situations. It also accepts loading your personal prefiltered clips.&lt;br /&gt;
* '''Motion Filters''': New in version 3.0d. It will allow you to filter those parts where '''SMDegrain()''' couldn't find a matching block for denoising. One use for it would be spatial denoisers or deblockers since high-motion areas are prone to heavy blocking and artifacts.&lt;br /&gt;
* '''Global Motion Vector In/Out''': Reuse motion vectors globals for faster processing, or just use '''SMDegrain()''' as a shortcut for creating nice quality motion vectors.&lt;br /&gt;
* '''RefineMotion Option''' (MRecalculate): Slower, but sometimes a big quality boost.&lt;br /&gt;
* '''Show Panel''': Everything is off by default, but some settings change in context. Check what is happening behind the scenes and have a fast look at all your settings.&lt;br /&gt;
* '''Robust''': Everything of the above works with each other no problem (interoperability), also in the process some error proof, bugfixes and bug workarounds were implemented or at least warned so you know that most of what is done is reliable, bugs free and optimized. The general idea is to serve as an user friendly front end for vanilla mvtools2+mdegrain or as the original script creator entitled &amp;quot;To make your scripts shorter and less geeky&amp;quot;. Most parameters are turned off or defaulted to mvtools2 defaults and features are based on popular general conceived procedures.&lt;br /&gt;
&lt;br /&gt;
Parameters are arranged in 3 blocks.&lt;br /&gt;
*'''Basic''': For people who just need the most basic parameters because either they don't have the time, knowledge or interest into looking for complex settings. Or they are content with defaults (pretty much mvtools defaults)&lt;br /&gt;
*'''High Bit Depth (with lsb hack) ((you should not use it in avs+))''': There's not much to think about this. This just enables (default is disabled), high bit depth denoising. That is, more quality, but also needs more processing power hence slower.&lt;br /&gt;
*'''Advanced''': If you run into some problems, are nitpicking or just want to fine tune your settings according to the source, have a look at this block, it contains the rest and bulk of the function parameters.&lt;br /&gt;
&lt;br /&gt;
Temporal denoising is a widespread procedure for noise cleaning in most type of video sources. The only limitation for '''SMDegrain()''' being when there are (very) high levels of grain, in which case you would need to rely on more &amp;quot;creative&amp;quot; and source centric solutions (see [https://forum.doom9.org/showthread.php?p=1544619#post1544619 this] and ''prefilter'' notes), but those are the rare cases.&lt;br /&gt;
&lt;br /&gt;
To picture what the function does, a simple '''SMDegrain()''' call matches the next code (for SD resolutions):&lt;br /&gt;
&lt;br /&gt;
 super_search = Dither_Luma_Rebuild(S0=1.0,c=0.0625).MSuper(rfilter=4)&lt;br /&gt;
 &lt;br /&gt;
 bv2 = super_search.MAnalyse(isb = true,  delta = 2, overlap= 4)&lt;br /&gt;
 bv1 = super_search.MAnalyse(isb = true,  delta = 1, overlap= 4)&lt;br /&gt;
 fv1 = super_search.MAnalyse(isb = false, delta = 1, overlap= 4)&lt;br /&gt;
 fv2 = super_search.MAnalyse(isb = false, delta = 2, overlap= 4)&lt;br /&gt;
 &lt;br /&gt;
 MDegrain2(MSuper(levels=1), bv1, fv1, bv2, fv2, thSAD=300, thSADC=150)&lt;br /&gt;
&lt;br /&gt;
As you see no wizardry. The only changes made are the TV-&amp;gt;PC luma expansion (''Dither_Luma_Rebuild''(S0=1.0,c=0.0625) similar to ''color_yuv''(levels=&amp;quot;TV-&amp;gt;PC&amp;quot;)) so you have more range to detect motion vectors, the ''rfilter''=4 for a bit more quality super search, the changed default of ''overlap'' from 0 to 4 and ''thSAD'' and ''thSADC'' from 400 to 300 and 150 respectively for safer results. Nothing else. The problem is that as soon you want to change a little thing like say temporal radius it requires you to edit in more than a few places, so this is very annoying and so forth the main reason for '''SMDegrain()'''.&lt;br /&gt;
 &lt;br /&gt;
==Using the filter==&lt;br /&gt;
*Input can be YV12 or YUY2, and '''must''' be TV range (which is normal). It's also recommended to be in modulus 16 size (resolution multiple of 16), although not strictly necessary.&lt;br /&gt;
*Crop first (when not interlaced).&lt;br /&gt;
*Recommended to deblock if blocking is present, before crop (when cropping) and '''SMDegrain()'''. Or you can use ''prefilter''=3 which is also a good deblocker (dfttest) and let '''SMDegrain()''' clean the blocking for you.&lt;br /&gt;
*Default output mode(dithering) for ''lsb''=true (when non interlaced) is ordered dither (optimized for encoding), so it is not recommended to keep filtering non-edge areas of your source, you can instead use ''mode''=6 (error diffusion) or ''lsb_out''=true and keep filtering in 16bit&lt;br /&gt;
*Read the ''prefilter'' setting explanation for solutions to problematic sources&lt;br /&gt;
&lt;br /&gt;
==Ready-to-run Samples==&lt;br /&gt;
&lt;br /&gt;
I consider this a good starting point where to start tweaking, whether be it for quality or speed:&lt;br /&gt;
 SMDegrain(tr=2,thSAD=250,contrasharp=true,refinemotion=true,lsb=true)&lt;br /&gt;
 &lt;br /&gt;
A basic, fast, yet very functional call for light grain (mvtools2+masktools2 only needed)&lt;br /&gt;
 SMDegrain(tr=1,thSAD=300,contrasharp=true)&lt;br /&gt;
&lt;br /&gt;
A typical more worked call compatible with official mvtools2 (mvtools2+masktools2 only needed)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,interlaced=true,prefilter=1,contrasharp=true)&lt;br /&gt;
&lt;br /&gt;
Good compromise between speed and quality (denoising with high precision)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Similar to the previous example, the next is a personal preference. Turned all chroma off for safeness (chroma is rarely temporal-reliable enough) and speed.&lt;br /&gt;
 SMDegrain(tr=2,thSAD=300,contrasharp=true,refinemotion=true,lsb=true,chroma=false,plane=0)&lt;br /&gt;
&lt;br /&gt;
This is a good example to show that interlaced YUY2 sources can be processed seamlessly.&lt;br /&gt;
 # mod4 (modulus 4) interlaced YUY2 source&lt;br /&gt;
 SMDegrain(tr=1,thSAD=250,interlaced=true,contrasharp=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
HD sources are detected automatically, and as so settings are optimized for speed; ''pel''=1, ''hpad''=0, ''vpad''=0, ''blksize''=32, ''overlap''=16, ''truemotion''=false&lt;br /&gt;
 # HD source (from 1100px wide or 600px high up)&lt;br /&gt;
 SMDegrain(tr=2,thSAD=180,prefilter=2,contrasharp=30,refinemotion=true,lsb=true,chroma=false,plane=0)&lt;br /&gt;
&lt;br /&gt;
For dealing with dark scenes (you could also add ''truemotion''=false)&lt;br /&gt;
 SMDegrain(tr=3,thSAD=300,contrasharp=true,str=2.0,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Tackling a grainy source:&lt;br /&gt;
 pre=fluxsmootht(3).removegrain(11)&lt;br /&gt;
 SMDegrain(tr=6,thSAD=500,contrasharp=30,prefilter=pre,str=1.2,refinemotion=true,lsb=true)&lt;br /&gt;
&lt;br /&gt;
Here 2 things are shown; how to work on a 16bit pipeline, and reference a prior state of the script for ''contrasharp''.&lt;br /&gt;
 sharp=last&lt;br /&gt;
 dfttest(tbsize=1,sigma=10,lsb=true)&lt;br /&gt;
 &lt;br /&gt;
 SMDegrain(tr=3,thSAD=300,CClip=sharp,lsb_in=true,lsb_out=true)&lt;br /&gt;
 &lt;br /&gt;
 LinearResize(854,480,lsb_in=true, mode=0)&lt;br /&gt;
&lt;br /&gt;
(Re)using motion vectors globals&lt;br /&gt;
 SMDegrain(tr=1,thSAD=400,prefilter=3,str=1.4,globals=3)    # Output vectors only&lt;br /&gt;
 MFlowFps(Super, bv1, fv1, num=60,den=1)&lt;br /&gt;
 &lt;br /&gt;
==Parameters==&lt;br /&gt;
{{FuncDef|SMDegrain}} (clip input, int &amp;quot;tr&amp;quot;, int &amp;quot;thSAD&amp;quot;, int &amp;quot;thSADC&amp;quot;, bool &amp;quot;RefineMotion&amp;quot;, val &amp;quot;contrasharp&amp;quot;, clip &amp;quot;CClip&amp;quot;, bool &amp;quot;interlaced&amp;quot;, int &amp;quot;plane&amp;quot;, int &amp;quot;Globals&amp;quot;, int &amp;quot;pel&amp;quot;, int &amp;quot;subpixel&amp;quot;, val &amp;quot;prefilter&amp;quot;, clip &amp;quot;mfilter&amp;quot;, int &amp;quot;blksize&amp;quot;, int &amp;quot;overlap&amp;quot;, int &amp;quot;search&amp;quot;, bool &amp;quot;truemotion&amp;quot;, int &amp;quot;limit&amp;quot;, int &amp;quot;limitc&amp;quot;, int &amp;quot;thSCD1&amp;quot;, int &amp;quot;thSCD2&amp;quot;, bool &amp;quot;chroma&amp;quot;, int &amp;quot;hpad&amp;quot;, int &amp;quot;vpad&amp;quot;, bool &amp;quot;lsb&amp;quot;, bool &amp;quot;lsb_in&amp;quot;, bool &amp;quot;lsb_out&amp;quot;, int &amp;quot;mode&amp;quot;, val &amp;quot;Show&amp;quot;, float &amp;quot;Str&amp;quot;, float &amp;quot;Amp&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Basic===&lt;br /&gt;
&lt;br /&gt;
{{ParR|tr|int|2|1-128}}&lt;br /&gt;
:Temporal radius, selects the MDegrain to use. This can be considered the strength of the denoising. Higher is generally better, but also much slower and each extra frame gives less improvement.&lt;br /&gt;
:tr 4+ requires Dither's MVTools2 mod. Max 64 for interlaced.&lt;br /&gt;
&lt;br /&gt;
{{Par|thSAD|int|300}}&lt;br /&gt;
{{Par|thSADC|int|150}}&lt;br /&gt;
:&amp;quot;Sum of Absolute Differences&amp;quot; threshold. This is the spatial difference threshold where the motion search will consider whether to denoise given the formula: &lt;br /&gt;
::Denoise_Weight = max( 0, 1 - 2*blockSAD² / (thSAD² + blockSAD²) )&lt;br /&gt;
:This spatial difference will be compared in blocks (''blksize''). If your noise is not getting into consideration for the denoising try raising this value, or reduce its SAD with previous prefiltering. You can alternatively raise ''blksize'', which will likely even blocks SAD. Low values can result in staggered/blotchy denoising, large values can result in ghosting and artifacts. Values in the range 200~600 are usual.&lt;br /&gt;
:thSADC is the same logic applied to chroma planes, since there are less differences on the chroma planes it uses by default thSAD/2 for safer chroma results.&lt;br /&gt;
:'''Recommendation''': Use slightly greater values than you are used to in other mdegrain based functions since the internal clip for the motion search in SMDegrain() has the contrast increased.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Contrasharp|bool|False|True/False}}&lt;br /&gt;
{{ParR|Contrasharp|int|-|0-100}}&lt;br /&gt;
:Contrasharpening is a technique that compares the differences between the clip before blurring (original) and after blurring (filtered), and sharpens locally with consequent strength. By default the &amp;quot;sharp&amp;quot; clip is the input, the &amp;quot;after&amp;quot; clip is the denoised clip. Alternately, a &amp;quot;before&amp;quot; clip can be specified with ''CClip'' (See Advanced).&lt;br /&gt;
:*True: use Didée's Contrasharpening() function (ContraHD() for HD) which &amp;quot;Sharpens the denoised clip, but doesn't add more to any pixel than what was removed previously.&amp;quot; In the practice you will get a slightly sharper result than the source, which is welcome.&lt;br /&gt;
:*An integer: LSFmod() will be used instead. It will be much slower, but maybe better for certain sources. Its value will serve as a contrasharpening multiplier, use one around 50 for similar strength as Contrasharpening(). LSFmod is less-suitable for HD sources.&lt;br /&gt;
&lt;br /&gt;
{{Par|RefineMotion|bool|False}}&lt;br /&gt;
:Refines and recalculates motion data of previously estimated (by MAnalyse) motion vectors. Turn it on for better motion vectors, specially when dealing with ghosting issues, small details or lineart fading and whatnot.&lt;br /&gt;
:'''Caution''': It won't help much if you use a ''prefilter'' so strong that blurs too much or kills all the details you are aiming to protect in first place.&lt;br /&gt;
&lt;br /&gt;
{{ParR|plane|int|4|0-4}}&lt;br /&gt;
:Select the planes you wish to process:&lt;br /&gt;
:*0: luma only&lt;br /&gt;
:*1: chroma U&lt;br /&gt;
:*2: chroma V&lt;br /&gt;
:*3: both chromas&lt;br /&gt;
:*4: all (Default)&lt;br /&gt;
:'''Caution''': plane=1-4 can sometimes create chroma smearing. In such case I recommend denoising chroma planes in the spatial domain.&lt;br /&gt;
&lt;br /&gt;
{{Par|Interlaced|bool|False}}&lt;br /&gt;
:If you want to denoise an interlaced source set this parameter to true. Output will also be interlaced. If you pair this with ''lsb_out''=true then you will have to &amp;lt;tt&amp;gt;Weave().DitherPost(mode=6,interlaced=true)&amp;lt;/tt&amp;gt; when converting back to 8 bit.&lt;br /&gt;
&lt;br /&gt;
===High Bit Depth Processing And Dithering===&lt;br /&gt;
All High Bit Depth parameters require [[Dither]] and [[MVTools]] 2.6+. The [[AviSynth+]] doesn't need these parameters; it automatically outputs the same bitdepth as the input, but if you still need 99% alternative to lsb family there are n16 (don't has n16_in because it don't make any sense in that case).&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb_in|bool|False}}&lt;br /&gt;
:Set true if you use a 16 bits filter chain. *(EXPERIMENTAL, use under test environment)&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb_out|bool|False}}&lt;br /&gt;
:Output to 16-bit instead of 8-bit. Use the helpers at the end of the SMDegrain() script to use Ditherpost() with YUY2 formats.&lt;br /&gt;
&lt;br /&gt;
{{Par|lsb|bool|False}}&lt;br /&gt;
:This enables 32 bit depth precision for denoising. You gain extra denoising accuracy, most noticeable in the prevention of banding in flat areas. Automatically set if either ''lsb_in'' or ''lsb_out'' are enabled.&lt;br /&gt;
&lt;br /&gt;
{{ParR|mode|int|0|-1-8}}&lt;br /&gt;
:This is the '''mode''' of [[Dither#DitherPost|DitherPost]] when ''lsb_out''=False, as a dithering method must be chosen for the 32bit-&amp;gt;8bit conversion. (Interlaced content is locked to mode=6) The default ''mode''=0 will help you optimize the dithering for optimum encodings when no further non-edge processing is done. Use ''mode''=6 (error diffusion) if further processing will be done.&lt;br /&gt;
&lt;br /&gt;
===Advanced===&lt;br /&gt;
&lt;br /&gt;
{{ParR|pel|int|2|1,2,4}}&lt;br /&gt;
:Accuracy of the motion estimation:&lt;br /&gt;
:* 1: full-pixel (Default for HD)&lt;br /&gt;
:* 2: half-pixel (Default for SD)&lt;br /&gt;
:* 4: quarter-pixel (often more accurate, but much slower and not always better)&lt;br /&gt;
&lt;br /&gt;
{{ParR|subpixel|int|2|0-3}}&lt;br /&gt;
:Subpixel interpolation method for ''pel''=2 or 4. This is the 'sharp' parameter in MSuper(), although it isn't related to output sharpness but better accuracy for the motion estimation.&lt;br /&gt;
:* 0: bilinear (softest)&lt;br /&gt;
:* 1: bicubic (4 tap Catmull-Rom)&lt;br /&gt;
:* 2: sharper Wiener (6 tap, similar to Lanczos) (Default)&lt;br /&gt;
:* 3: [[nnedi3]] (very high quality: useful for small sources but usually overkill. requires plugin)&lt;br /&gt;
&lt;br /&gt;
{{ParR|prefilter|int|-1|-1-3}}&lt;br /&gt;
{{Par|prefilter|clip|None}}&lt;br /&gt;
:* -1: off (Default)&lt;br /&gt;
:* 0: light controlled gauss blur&lt;br /&gt;
:* 1: mild median/gauss blur&lt;br /&gt;
:* 2: strong median/gauss blur&lt;br /&gt;
:* 3: [[dfttest]] (spatial)&lt;br /&gt;
:* clip: supply your own&lt;br /&gt;
:Denoises a version of the clip that will be used to obtain the motion vectors. Useful for very damaged/grainy sources, this will help to get better motion vectors.&lt;br /&gt;
:For sources with Gibbs noise, especially on anime, try ''prefilter''=1 or 2 or better yet strong median filters (through clip input) in order to soothe the high SAD of sharp edges. For blocky sources, or a general more quality/safer prefilter use option 3 (dfttest)&lt;br /&gt;
:By default dfttest outputs a sstring txt file to your script folder, you can delete it. This doesn't happen when using the modded dfttest (version 1.9.2 or higher) of the Dither tools.&lt;br /&gt;
:For HD sources ''prefilter''=2 makes more sense than 1, because it uses a wider denoising window.&lt;br /&gt;
:If instead you want to use your own prefilter denoiser, just define it in a variable and reference it here. Remember to:&lt;br /&gt;
:*Feed always 8 bit clips.&lt;br /&gt;
:*Input in fields for interlaced content *(read below)&lt;br /&gt;
:*Feed here planar ( by using Interleaved2Planar() ) YUY2 clips (not interleaved) when working with YUY2 sources.&lt;br /&gt;
:You will likely want to use spatial denoisers like median filters (removegrain=17, medianblur, etc). For very grainy or fizz grain noise you can try prefiltering in temporal or if this is not enough, try adding a new SMDegrain() line again but without globals. Use ''lsb_in'', ''lsb_out'' according so results are smooth. You can even use SMDegrain() as a prefilter for SMDegrain() in very temporal unstable sources.&lt;br /&gt;
:Another trick for fizz grain is to serve a prefiltered clip where bright values are more denoised than dark values, you can do this through luma masks with masktools2 code. Search in [https://forum.doom9.org/showthread.php?t=162813 Doom9] for reference.&lt;br /&gt;
:For interlaced sources remember:&lt;br /&gt;
::Spatial filtering: pre=separatefields().spatial_prefilters_here()&lt;br /&gt;
::Temporal filtering: pre=separatefields().interleave(selecteven().temporal_filters(),selectodd().temporal_filters())&lt;br /&gt;
:SMDegrain() (and MDegrain) is likely to produce blending artifacts or oversmooth in dark areas specially on cartoons, to tackle this see RefineMotion or expand the luma range in the darks. For this there are many options, you can use your preferred gamma enhancer and input it as the prefilter, or use the examples below for linear brightening (masktools2) and input it as a ''prefilter'' as well. Or at last and the recommended solution, to use the built-in ''Str'' (strength) and ''Amp'' (amplitude) parameters for a curve type dark enhancement, check the effects by enabling Show and changing your previewing conditions to PC levels.&lt;br /&gt;
:For brightening dark values linearly (brighter parts less brightening)&lt;br /&gt;
 str=1&lt;br /&gt;
 mt_lut(&amp;quot;x x &amp;quot;+string(str)+&amp;quot; 6 * - 255 - abs 255 / ^ x 1 - abs +&amp;quot;)&lt;br /&gt;
:Or for a more contrasty image (although not as much dark enhancing - not linear)&lt;br /&gt;
 str=40&lt;br /&gt;
 mt_lut(&amp;quot;x x &amp;quot;+string(str)+&amp;quot; 6 * - 255 - abs 255 / ^ &amp;quot;+string(str)+&amp;quot; / x 1 - abs +&amp;quot;)&lt;br /&gt;
:Good resources for custom prefilters:&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=162813&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=132310&lt;br /&gt;
:*https://forum.doom9.org/showthread.php?t=133977&lt;br /&gt;
:Notes: To sum it up; generally in denoising, temporal filters are always preferred due to its natural look (versus spatial filters). But more often than not for good results prefiltering plays a key role on the output quality, and setting it up nicely can be looked as an art by itself.&lt;br /&gt;
:If there's a reached point where no prefiltering, no ''thSAD'' tweaking, etc, makes able to denoise a certain motion part/area/scene, then this is due to the motion vectors preventing them from being &amp;quot;denoised&amp;quot; (also read &amp;quot;artifacted&amp;quot;), in which case you will need to rely on alternative solutions (motion compensation, filters like MCTemporalDenoise(), TemporalDegrain(), [https://forum.doom9.org/showthread.php?p=1544619#post1544619 Multilevel MDegrain], etc) or just use plain spatial filters with motion masks. Creating these discerning masks for static and motion scenes and combining them is a research task on the end user side.&lt;br /&gt;
&lt;br /&gt;
{{Par|mfilter|clip|None}}&lt;br /&gt;
:Motion Filter, an optional user-supplied clip that will be passed through those areas where SMDegrain() couldn't find a matching block, normally high motion areas. One use for it would be to to use spatial filters, like deblockers or blurring filters that mimic motion blur.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Str|float|1.0|0.0-8.0}}&lt;br /&gt;
:Gamma correction. With this parameter you control the strength of the brightening of the ''prefilter'' clip, good for when problems with dark areas arise. Using this internally instead of externally creates less quantization artifacts, since it's done in the same stage as the TV-&amp;gt;PC range conversion.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Amp|float|0.0625|0.0-1.0}}&lt;br /&gt;
:Used when ''Str'' &amp;lt;&amp;gt; 1.0. This defines the amplitude of the brightening in the luma range, for example by using 1.0 all the luma range will be used and the brightening will find its peak at luma value 128 in the original. Default is 0.0625 (1.0/16) which just sits over luma value 16 (256/16) This and ''Str'' are extrapolated arguments from [https://forum.doom9.org/showthread.php?p=1548318#post1548318 cretindesalpes' function], you can find a graph and more insight explanations at the original post.&lt;br /&gt;
:Check these 2 parameters effects by enabling ''show''.&lt;br /&gt;
&lt;br /&gt;
{{ParR|blksize|int|8 for SD, 16 for HD|4,8,16}}&lt;br /&gt;
:Size of a block (horizontal x vertical). Larger blocks are faster and less sensitive to noise, but also less accurate.&lt;br /&gt;
&lt;br /&gt;
{{Par|overlap|int|blksize/2}}&lt;br /&gt;
:Must be *even* and *less* than block size. Common values: ''blksize''/4 or ''blksize''/2. Larger ''overlap'' looks slightly better and runs slower.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Search|int|4|0-7}}&lt;br /&gt;
:This is the '''search''' of [[MVTools/MAnalyze|MAnalyze]].&lt;br /&gt;
&lt;br /&gt;
{{Par|Truemotion|bool|True for SD, False for HD}}&lt;br /&gt;
:''Truemotion'' is a preset of some MVAnalyze parameter values. It allows easy to switch default values of all &amp;quot;true motion&amp;quot; parameters at once. Set it 'true' for true motion search (high vector coherence), set it 'false' to search motion vectors with best SAD. Truemotion is slower and may blur textures and thin details more, but will usually remove more noise.&lt;br /&gt;
:For HD sources where the main problems are just excessive grain, I have defaulted it to false, this is not only faster but honors detail accuracy (the main existing point for HD sources) and overall object shading.&lt;br /&gt;
&lt;br /&gt;
{{Par|Chroma|bool|True}}&lt;br /&gt;
:Set false to totally ignore chroma for finding motion vectors, for more speed with little cost in quality or when your chroma is too bad to find good matches. Don't process chroma planes without chroma vectors, MVTools doesn't seem to work right.&lt;br /&gt;
&lt;br /&gt;
{{Par|Hpad|int|''blksize'' for SD, 0 for HD}}&lt;br /&gt;
{{Par|Vpad|int|''blksize'' for SD, 0 for HD}}&lt;br /&gt;
:Horizontal/vertical padding added to source frame (left, right, top, and bottom) for better motion estimation near borders.&lt;br /&gt;
:Try to have clean borders in your source (no NAB/black borders) to start with before tweaking this setting. If necessary, crop beforehand ideally in multiples of 16. Turn it to 0 if you are running out of memory.&lt;br /&gt;
&lt;br /&gt;
{{Par|thSCD1|int|based on ''blksize'': 4{{=}}&amp;gt;100, 8{{=}}&amp;gt;400, 16{{=}}&amp;gt;1600}}&lt;br /&gt;
:Threshold which decides whether a block has changed between the previous frame and the current one, used to tweak the scene change detection. Raising it will lower the number of blocks detected as changed. It may be useful for noisy or flickered video. To fix blending on scene changes on dark scenes, first try ''Str'' and ''Amp''.&lt;br /&gt;
&lt;br /&gt;
{{ParR|thSCD2|int|130|0-250}}&lt;br /&gt;
:Threshold which sets how many blocks have to change for the frame to be considered as a scene change.&lt;br /&gt;
&lt;br /&gt;
{{ParR|limit|int|255|1-255}}&lt;br /&gt;
{{ParR|limitC|int|255|1-255}}&lt;br /&gt;
:Maximal change of pixel luma/chroma, to prevent some artifacts.&lt;br /&gt;
&lt;br /&gt;
{{Par|CClip|clip|None}}&lt;br /&gt;
:Optional sharp version for ''contrasharp'' to compare against; video resolution and properties must be the same (different bit depth is OK). Using this option defaults ''contrasharp'' to True.&lt;br /&gt;
&lt;br /&gt;
{{ParR|Globals|int|0|0-3}}&lt;br /&gt;
:With this parameter you can create or load pre-processed motion vectors, to save doing the work for multiple SMDegrain calls.&lt;br /&gt;
:*0: Ignore globals, just process&lt;br /&gt;
:*1: Read globals and Process&lt;br /&gt;
:*2: Process and output globals&lt;br /&gt;
:*3: Output globals only, don't process&lt;br /&gt;
:Some parameters '''MUST MATCH''' between output and input stages: ''pel'', ''subpixel'', ''chroma'', and ''vpad''/''hpad'' cannot change. When reading (Globals=1) only some parameters work: ''tr'', ''thSAD'', ''plane'', ''limit'', ''limitc'', ''contrasharp'', ''CClip'', ''interlaced'' and the ''lsb'' parameters. Others are ignored.&lt;br /&gt;
:Global names that can be reused are: '''Super''', '''bv1''', '''fv1''', '''bv2''', '''fv2''', '''bv3''', '''fv3''', '''bv4''', '''fv4''', '''bv6''', '''fv6''', '''vmulti'''.&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=3)    # Outputs vectors&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=1)    # You can use a lower &amp;quot;tr&amp;quot; or &amp;quot;thSAD&amp;quot; if you want&lt;br /&gt;
:or&lt;br /&gt;
 SMDegrain(tr=3,thSAD=400,globals=3)    # Outputs vectors&lt;br /&gt;
 Super = MSuper(levels=1)               # Add this line just before if you have some processing between Globals Output and Input.&lt;br /&gt;
 MDegrain3(Super, bv1, fv1, bv2, fv2, bv3, fv3, thSAD=400)&lt;br /&gt;
&lt;br /&gt;
{{Par|Show|bool|False}}&lt;br /&gt;
{{ParR|Show|str|-|&amp;quot;Speed&amp;quot;, &amp;quot;Memory&amp;quot;, &amp;quot;Quality&amp;quot;}}&lt;br /&gt;
:This will show the prefiltered clip to be used for the motion search to the left(&amp;lt;--), and the used parameters list to the right (--&amp;gt;)&lt;br /&gt;
:If the parameters panel is broken i.e. overlapping lines, hidden lines, etc, most likely your settings are wrong, (e.g. ''lsb_in''=true when input is 8bit) so it will also work well as a debug function. If you set Show to a string as indicated above, related parameters will be highlighted to guide you on correctly tweaking the function. This is loosely based, so it doesn't exclude you from reading carefully every parameter explanation.&lt;br /&gt;
:Even when you are not using any prefiltering, the clip to be used for the motion search where you obtain the motion vectors, will be converted from TV levels to PC levels, the only exception being when using ''Globals''=1 (Read) in which case the &amp;quot;prefiltered&amp;quot; clip will be exactly the same as input clip (that is no luma conversion, although constrained to 8 bit). Additionally you can tweak the dark expansion with ''Str'' and ''Amp'' parameters and check the effects in the left panel, but be aware to change your viewing conditions as it is in PC levels.&lt;br /&gt;
:The left panel preserves its properties so you can crop out the right panel and use it as a prefilter clip of any MSuper(). Therefore if you are not processing chroma (''chroma''=false) the prefiltered clip will be green, don't panic, this is correct, this happens when the U and V planes are unset. In this regard for previewing tasks with prefilterings -- or just the ''Str'' and ''Amp'' effect -- set ''chroma'' to true temporally or follow with ''GreyScale''(). For YUY2 sources set ''Planar2Interleaved''() after cropping for previewing.&lt;br /&gt;
 &lt;br /&gt;
==Final Notes==&lt;br /&gt;
If there is an important parameter not implemented, you have any issue or found a bug, please don't hesitate and ask in its [https://forum.videohelp.com/threads/369142 VideoHelp thread].&lt;br /&gt;
 &lt;br /&gt;
==Changelog==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 1px solid darkgray&amp;quot;&lt;br /&gt;
!Version&lt;br /&gt;
!Date&lt;br /&gt;
!Changes&lt;br /&gt;
|-&lt;br /&gt;
|v3.1.2.97s&lt;br /&gt;
|2018-03-26&lt;br /&gt;
|&lt;br /&gt;
Fix subpixel=3&lt;br /&gt;
Add Prefilter auto 16 (lsb) support&amp;lt;br/&amp;gt;&lt;br /&gt;
YUY2 support in avs 2.6 with masktools 2.6&amp;lt;br/&amp;gt;&lt;br /&gt;
medianblur2 now will be used in Minblur instead of Quantile RemoveGrainHD in avs 2.6&amp;lt;br/&amp;gt;&lt;br /&gt;
Add TV_range bool&amp;lt;br/&amp;gt;&lt;br /&gt;
Less lsb if not use lsb things and get ready for yv16 and yv24&amp;lt;br/&amp;gt;&lt;br /&gt;
Add dct&amp;lt;br/&amp;gt;&lt;br /&gt;
Add device_id for prefilter=4&amp;lt;br/&amp;gt;&lt;br /&gt;
No need to use Planar2Interleaved() after cropping in Show with YUY2 (this is old changed, and now with mvtools support yv16 most people will not use YUY2)&amp;lt;br/&amp;gt;&lt;br /&gt;
Add MDegrain4 and MDegrain5 and MDegrain6, this will make tr=4-6 faster&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1.2d&lt;br /&gt;
|2015-07-21&lt;br /&gt;
|&lt;br /&gt;
Fixed regression where external prefilters wouldn't be parsed for luma expansion&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1.1d&lt;br /&gt;
|2015-07-16&lt;br /&gt;
|&lt;br /&gt;
Workaround to force KNLMeansCL use discrete video card (now required)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|3.1d&lt;br /&gt;
|2015-07-14&lt;br /&gt;
|&lt;br /&gt;
New prefilter mode 4 for grainy sources. GPU based spatio-temporal KNLmeans&amp;lt;br/&amp;gt;&lt;br /&gt;
Added dither output mode &amp;quot;Random Dither&amp;quot;.&amp;lt;br/&amp;gt;&lt;br /&gt;
Added &amp;quot;slices&amp;quot; option from Dither&amp;lt;br/&amp;gt;&lt;br /&gt;
Added soft=-2 (automatic) to internal lsfmod&amp;lt;br/&amp;gt;&lt;br /&gt;
Added assert for chroma denoise when luma only motion vectors (mvtools bug)&amp;lt;br/&amp;gt;&lt;br /&gt;
Improved lsb_in code (now using sub/add method)&amp;lt;br/&amp;gt;&lt;br /&gt;
Removed vpad/hpad=0 optimization preset for HD&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed prefilter=3 code for lsb_in YUY2&amp;lt;br/&amp;gt;&lt;br /&gt;
More fixes to Show Panel...&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated and fixed documentation (notes on YUY2 support)&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3.0d&lt;br /&gt;
|2015-03-27&lt;br /&gt;
|&lt;br /&gt;
Adjusted SD&amp;lt;&amp;gt;HD discretion&amp;lt;br/&amp;gt;&lt;br /&gt;
Added mfilter (Motion Filter) new feature&amp;lt;br/&amp;gt;&lt;br /&gt;
subpixel=3 (nnedi3); removed qual=2 due to possible blending bug (quote by cretindesalpes), this also boosts speed&amp;lt;br/&amp;gt;&lt;br /&gt;
Lowered the defaults for less aggressive denoise (still somewhat high)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed chroma not showing in debug (show) mode when lsb=true and prefilter=3 were paired&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed long lasting issues in Show Panel for certain not mod height resolutions&amp;lt;br/&amp;gt;&lt;br /&gt;
Now prefilter=0 is minblur(0), lighter denoising than prefilter=1, default is now -1 (off)&amp;lt;br/&amp;gt;&lt;br /&gt;
Documentation update (plugin updates, notes, links, examples, etc)&lt;br /&gt;
|-&lt;br /&gt;
|2.2d&lt;br /&gt;
|2013-03-05&lt;br /&gt;
|&lt;br /&gt;
Removed one residual variable in Contrasharpening function&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a regression at v2.0 for Interlaced YUY2 sources by changing wrong variable ifC to if0, and...&amp;lt;br/&amp;gt;&lt;br /&gt;
...adding a missing weave() to the last MergeChroma() call&amp;lt;br/&amp;gt;&lt;br /&gt;
Dropped Dither support. (Will still work/not work as before, but lack of official support renders it to a YMMV condition)&lt;br /&gt;
|-&lt;br /&gt;
|2.1d&lt;br /&gt;
|2012-09-09&lt;br /&gt;
|&lt;br /&gt;
Fixed Refinemotion Globals Input labels&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed ContrasharpeningHD Vectors for Interlaced HD sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Added ability to import Global Vectors even when &amp;quot;tr&amp;quot; is lower than parent instance &amp;quot;tr&amp;quot; (credit to cretindesalpes)&amp;lt;br/&amp;gt;&lt;br /&gt;
Expanded support for Interlaced Denoising &amp;quot;tr&amp;quot; up to 64 (credit to cretindesalpes)&amp;lt;br/&amp;gt;&lt;br /&gt;
Cosmetics&lt;br /&gt;
|-&lt;br /&gt;
|2.0d&lt;br /&gt;
|2012-06-07&lt;br /&gt;
|&lt;br /&gt;
Fixed and optimized chroma handling for lsb_in, contrasharpening and YUY2 content v.1.95&amp;lt;br/&amp;gt;&lt;br /&gt;
Enhanced Chroma bypass on the sharpening stage&amp;lt;br/&amp;gt;&lt;br /&gt;
Merged ContraHD() internally for Contrasharpening in HD sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Dropped QTGMC support on import/export motion vectors (small value for increased confusion)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed Median code for planar inputs in MinBlur() (needs RemoveGrainHD, dropped medianblur requirement)&amp;lt;br/&amp;gt;&lt;br /&gt;
Defaulted truemotion to false for HD inputs&amp;lt;br/&amp;gt;&lt;br /&gt;
Code Optimization and Clean up&amp;lt;br/&amp;gt;&lt;br /&gt;
Others&lt;br /&gt;
|-&lt;br /&gt;
|1.9d&lt;br /&gt;
|2012-03-23&lt;br /&gt;
|&lt;br /&gt;
Added truemotion parameter (default=true), change it to false (as in MCTemporalDenoise()), so low frequency detail won't be lost (walls...), although it could leave more noise on high frequency details&amp;lt;br/&amp;gt;&lt;br /&gt;
Added thSADC, and thSCD1/thSCD2 parameters for finer control&amp;lt;br/&amp;gt;&lt;br /&gt;
Tweaked prefilter=3 dfttest sigmas for better low frequency detail protection&amp;lt;br/&amp;gt;&lt;br /&gt;
Detached explanation and converted to html. Updated and extended the contents as well&amp;lt;br/&amp;gt;&lt;br /&gt;
Fine tuned and robustized the Show Panel&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimized and organized code, more precisely the contrasharpening part&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a few ternary checks for when Globals=3&amp;lt;br/&amp;gt;&lt;br /&gt;
Others&lt;br /&gt;
|-&lt;br /&gt;
|1.8d&lt;br /&gt;
|2012-01-18&lt;br /&gt;
|&lt;br /&gt;
Added automatic dark protection for prefilter=3 (dfttest performs badly in darks) v1.71d and extended its dark protection v1.8&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed chroma variable when chroma=false, from 2 (copy chroma) to 1 (discard chroma) v1.71d&amp;lt;br/&amp;gt;&lt;br /&gt;
Explanation and cosmetics v1.71d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added acknowledgments and updated explanation&amp;lt;br/&amp;gt;&lt;br /&gt;
Added brackets to all functions (it has been reported to cause threading problems under certain circumstances) (https://forum.doom9.org/showthread.php?p=1515886#post1515886)&amp;lt;br/&amp;gt;&lt;br /&gt;
Reworked and fixed the parameters panel. Now you have a color guide to have an idea on what to tweak depending on selected mode in Show. For strings: &amp;quot;Speed&amp;quot;, &amp;quot;Memory&amp;quot; and &amp;quot;Quality&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimized lsb_in for HD resolutions which was causing memory hogs&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed contrasharpening for YUY2 sources when lsb=true&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed some inconsistencies for YUY2 sources when prefilter=3&lt;br /&gt;
|-&lt;br /&gt;
|1.7d&lt;br /&gt;
|2012-01-11&lt;br /&gt;
|&lt;br /&gt;
Fixed and extended introduction explanation v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed some issues for Globals=1 (Read) in relation to lsb_in and luma expansion auto-prefilter v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added mild gauss blur prefilter option as prefilter=1. Consequent modes are displaced v.1.61d&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed prefilter 1 and 2 to Minblur (Gauss/Median combination) v.1.63d&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated MinBlur function v.1.62d and v.1.66&amp;lt;br/&amp;gt;&lt;br /&gt;
Code tidied up v.1.62d&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated luma expansion, now you can enhance darks (with 'Str' and 'Amp') in the same step as the TV-&amp;gt;PC conversion stage, thus +optimized, +quality. v.1.63d by cretindesalpes (https://forum.doom9.org/showthread.php?p=1548318#post1548318)&amp;lt;br/&amp;gt;&lt;br /&gt;
Removed pre_custom. Now use prefilter to load a prefiltered clip, as well as modes 0~3&amp;lt;br/&amp;gt;&lt;br /&gt;
Added Show parameter. Now you can see the used and default parameters along the prefilter clip as well&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed one note related to prefilter clip input for interlaced content&lt;br /&gt;
|-&lt;br /&gt;
|1.6d&lt;br /&gt;
|2011-12-24 (first open release)&lt;br /&gt;
|&lt;br /&gt;
Fixed and extended introduction explanation&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed Ditherpost for interlaced sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a broken reference for reading MRecalculate globals when tr&amp;gt;3&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a Globals=1 MSuper automatization&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a plane processing bypass when chroma=false&amp;lt;br/&amp;gt;&lt;br /&gt;
Added LSFmod as optional contrasharpening (slower, but biased contrasharpening and probably better depending on source)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added default luma expansion auto-prefilter for motion search (16% more values)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added YUY2 support&amp;lt;br/&amp;gt;&lt;br /&gt;
Added the 'mode' parameter of Ditherpost()&amp;lt;br/&amp;gt;&lt;br /&gt;
Added support for interlaced temporal radius up to 6&lt;br /&gt;
|-&lt;br /&gt;
|1.5d&lt;br /&gt;
|2011-10-14&lt;br /&gt;
|&lt;br /&gt;
Changed &amp;quot;srchSuper&amp;quot; Global variable to &amp;quot;QTGMC_srchSuper&amp;quot;, compatible with QTGMC. Anyhow you may probably want to create a new super clip. Test it out! v.1.41d&amp;lt;br/&amp;gt;&lt;br /&gt;
Introduction spelling and presentation v.1.42d&amp;lt;br/&amp;gt;&lt;br /&gt;
Added lsb and lsb_in for prefilter=2 (dfttest) v.1.43d &amp;amp; v.1.44d&amp;lt;br/&amp;gt;&lt;br /&gt;
Some better definitions for the settings help v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
pelclip is now subpixel = 3 ('sharp' parameter before) v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
Other minor tweaks v.1.45d&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed an important issue when using prefilter with subpixel=3 ('pelclip' parameter before)&amp;lt;br/&amp;gt;&lt;br /&gt;
Optimizations in Ditherpost for chroma&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed rfilter (hierarchical levels smoothing/scaling) from default 2 to 4. Better results in my judge&amp;lt;br/&amp;gt;&lt;br /&gt;
Some more little tweaks in code and introduction&lt;br /&gt;
|-&lt;br /&gt;
|1.4d&lt;br /&gt;
|2011-09-16&lt;br /&gt;
|&lt;br /&gt;
Added pelclip option for top quality subpixel interpolation when pel &amp;gt; 1&amp;lt;br/&amp;gt;&lt;br /&gt;
Changed QTGMCV parameter to Globals, and added a bunch of new features like vectors output from SMDegrain()&amp;lt;br/&amp;gt;&lt;br /&gt;
Big introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|1.3d&lt;br /&gt;
|2011-09-14&lt;br /&gt;
|Fixed an important issue on the Interlaced parameter and improved overall handling (v.1.21d &amp;amp; v.1.3d)&lt;br /&gt;
|-&lt;br /&gt;
|1.2d&lt;br /&gt;
|2011-09-13&lt;br /&gt;
|&lt;br /&gt;
Added Interlaced parameter, for processing interlaced sources&amp;lt;br/&amp;gt;&lt;br /&gt;
Some introduction and code optimization tweaks (v.1.12d &amp;amp; v.1.2d)&lt;br /&gt;
|-&lt;br /&gt;
|1.1d&lt;br /&gt;
|2011-09-12&lt;br /&gt;
|&lt;br /&gt;
Implemented MDegrainN for tr &amp;gt; 3, from the MVTools2 mod of Dither&amp;lt;br/&amp;gt;&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|1.0d&lt;br /&gt;
|2011-09-09&lt;br /&gt;
|&lt;br /&gt;
Added CClip parameter. Reference an earlier stage of your processing chain as your sharp version for the contrasharpening&lt;br /&gt;
|-&lt;br /&gt;
|0.9d&lt;br /&gt;
|2011-09-09&lt;br /&gt;
|&lt;br /&gt;
Added QTGMCV parameter, for reusing vectors from QTGMC bob deinterlacer&lt;br /&gt;
|-&lt;br /&gt;
|0.8d&lt;br /&gt;
|2011-09-05&lt;br /&gt;
|&lt;br /&gt;
Fixed a few things related to the lsb_in option&amp;lt;br/&amp;gt;&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|0.7d&lt;br /&gt;
|2011-09-05&lt;br /&gt;
|&lt;br /&gt;
Implemented &amp;quot;fake&amp;quot; lsb_in option. Output will have slightly more quality (if any), and will compress better. (Experimental)&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed a not passed argument in the hpad, vpad parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.6d&lt;br /&gt;
|2011-09-04&lt;br /&gt;
|&lt;br /&gt;
Minor introduction and code optimization tweaks&lt;br /&gt;
|-&lt;br /&gt;
|0.5d&lt;br /&gt;
|2011-07-19&lt;br /&gt;
|&lt;br /&gt;
Added dfttest option for preblur (now prefilter) option. Slower but better due to its internal deblock+denoise operation, plus sharper results&amp;lt;br/&amp;gt;&lt;br /&gt;
Added pre_custom option for the prefilter process, define here a denoised clip as your prefiltered version&amp;lt;br/&amp;gt;&lt;br /&gt;
Updated the introduction help&lt;br /&gt;
|-&lt;br /&gt;
|0.4d&lt;br /&gt;
|2011-06-03&lt;br /&gt;
|&lt;br /&gt;
Added preblur option for slight vector blurring where motionmatch is bad (https://forum.doom9.org/showthread.php?t=161594)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added RefineMotion parameter for better motion vectors. Based off Killer() (https://forum.doom9.org/showthread.php?p=1266572#post1266572)&amp;lt;br/&amp;gt;&lt;br /&gt;
Added parameters &amp;quot;lsb&amp;quot; and &amp;quot;lsb_out&amp;quot;, for the MVTools2 mod version of cretindesalpes' Dither (https://forum.doom9.org/showthread.php?p=1386559#post1386559)&amp;lt;br/&amp;gt;&lt;br /&gt;
Other minor aesthetics and performance adjustments&lt;br /&gt;
|-&lt;br /&gt;
|0.3d&lt;br /&gt;
|2011-03-04&lt;br /&gt;
|&lt;br /&gt;
First Mod version&amp;lt;br/&amp;gt;&lt;br /&gt;
Fixed plane (for MDegrain) and added chroma (for MAnalyse) parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|2010-01-24&lt;br /&gt;
|&lt;br /&gt;
Added introductory section&amp;lt;br/&amp;gt;&lt;br /&gt;
Added more parameters&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|&lt;br /&gt;
Basic working version&amp;lt;br/&amp;gt;&lt;br /&gt;
Not released&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/EdgeFixer</id>
		<title>EdgeFixer</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/EdgeFixer"/>
				<updated>2021-03-28T05:38:55Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat6|External_filters|Plugins|Plugins_x64|Adjustment_filters|Borders and Cropping|Deep_color_tools}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|[https://github.com/sekrit-twc sekrit-twc]&lt;br /&gt;
|25 Mar 2019 &lt;br /&gt;
|3=[http://s000.tinyupload.com/index.php?file_id=15734691908025476289 EdgeFixer.7z]&lt;br /&gt;
|4=Borders and Cropping&lt;br /&gt;
|5=&lt;br /&gt;
|6=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
EdgeFixer repairs bright and dark line artifacts near the border of an image. When an image is resampled with a negative-lobe kernel, such as Bicubic or Lanczos, a series of bright and dark lines may appear around the image borders. These lines need not be cropped, as they contain spatial information that can be recovered. EdgeFixer uses least squares regression to correct the offending lines based on a reference line. ContinuityFixer uses the adjacent line as the reference, whereas ReferenceFixer uses an external reference image.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/sekrit-twc/EdgeFixer#edgefixer Github homepage for examples].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* [[AviSynth+]] (x86 / x64)&lt;br /&gt;
* Supported color formats: 8...16-bit, [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|ContinuityFixer (clip clip, int &amp;quot;left&amp;quot;, int &amp;quot;top&amp;quot;, int &amp;quot;right&amp;quot;, int &amp;quot;bottom&amp;quot;, int &amp;quot;radius&amp;quot;)}}&lt;br /&gt;
:{{Template:FuncDef|ReferenceFixerFixer (clip clip, clip ref, int &amp;quot;left&amp;quot;, int &amp;quot;top&amp;quot;, int &amp;quot;right&amp;quot;, int &amp;quot;bottom&amp;quot;, int &amp;quot;radius&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Reference clip, only applicable to ReferenceFixer.&lt;br /&gt;
&lt;br /&gt;
::{{Par2|left|int|0}}&lt;br /&gt;
::{{Par2|top|int|0}}&lt;br /&gt;
::{{Par2|right|int|0}}&lt;br /&gt;
::{{Par2|bottom|int|0}}&lt;br /&gt;
:::The number of lines to filter along each edge.&lt;br /&gt;
&lt;br /&gt;
::{{Par2|radius|int|0}}&lt;br /&gt;
:::Limit the window used for the least squares regression, useful in the presence of overlaid content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 ContinuityFixer (left=2, top=4, right=0, bottom=2, radius=0)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 ReferenceFixer ([[FastBlur]](0.8125, 0, iterations = 1, gamma = false), left=10)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version       Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 25 Mar 2019   2019/03/25      - Compiled with Microsoft Visual Studio C++ 2017.&lt;br /&gt;
 r1            2018/01/13      - first release&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!r1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== External Links ==&lt;br /&gt;
*[https://github.com/sekrit-twc/EdgeFixer GitHub] - Source code&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Borders_and_Cropping| External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Zs_RF_Shared</id>
		<title>Zs RF Shared</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Zs_RF_Shared"/>
				<updated>2021-03-27T09:45:21Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Other_filters|Multipurpose Filters}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| real.finder, Multi Peoples&lt;br /&gt;
| v1.143&lt;br /&gt;
| [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi Zs_RF_Shared.avsi]&lt;br /&gt;
| Multipurpose Filters&lt;br /&gt;
|&lt;br /&gt;
|6=[http://forum.doom9.org/showpost.php?p=1665492&amp;amp;postcount=27 Doom9 Thread]}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;[[Zs_RF_Shared]]&amp;lt;/tt&amp;gt; - Shared Functions and utility.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.7 or [http://sourceforge.net/projects/avisynth2/ greater]or [[AviSynth+]]&lt;br /&gt;
**It will work better and with more things (features and advantages) in AviSynth 2.6 and even better in AviSynth+.&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version         Date(D/M/Y)      Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v1.143          11/12/2020       -&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
*[https://forum.doom9.org/showthread.php?t=174121 Doom9 Forum] - See this thread for support.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Multipurpose_Filters|External Filters]] &amp;amp;larr;'''&lt;br /&gt;
-----------------------------------------------&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/FixChromaBleedingMod</id>
		<title>FixChromaBleedingMod</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/FixChromaBleedingMod"/>
				<updated>2021-03-27T09:27:49Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Chroma correction}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|AmjadSONY&lt;br /&gt;
|1.35&lt;br /&gt;
|3=[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/FixChromaBleedingMod.avsi FixChromaBleedingMod.avsi]&lt;br /&gt;
|4=Chroma Correction&lt;br /&gt;
|5=&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=77074#post1673932 Doom9 thread]}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
A script to reduce color bleeding, over-saturation, and color shifting mainly in red and blue areas. This script is based on [[FixChromaBleeding]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/ greater]&lt;br /&gt;
* [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|Progressive]] input only or Fields&lt;br /&gt;
* Supported color formats: [[YUY2]], [[YV12]], [[YV411]]&lt;br /&gt;
=== Required Plugins and Scripts ===&lt;br /&gt;
Latest versions of the following filters are recommended unless stated otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
*[[Zs_RF_Shared]]&lt;br /&gt;
*[[ChromaShift]]&lt;br /&gt;
*[[ChromaShiftSP]]&lt;br /&gt;
*[[MaskTools2]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|FixChromaBleedingMod (clip input, int &amp;quot;cxShift&amp;quot;, int &amp;quot;cyShift&amp;quot;, float &amp;quot;thr&amp;quot;, float &amp;quot;strength&amp;quot;, bool &amp;quot;f&amp;quot;, float &amp;quot;opacity&amp;quot;, bool &amp;quot;n&amp;quot;, bool &amp;quot;xysh&amp;quot;, bool &amp;quot;Bic&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|cxShift|int|-4}}&lt;br /&gt;
::{{Par2|cyShift|int|-4}}&lt;br /&gt;
:::Horizontal and vertical chroma shift; vertical shift is ignored when &amp;lt;code&amp;gt;{{Template:FuncDef|xysh}}=false&amp;lt;/code&amp;gt; (default). &lt;br /&gt;
:::*When &amp;lt;code&amp;gt;{{Template:FuncDef|xysh}}=false&amp;lt;/code&amp;gt;, positive values shift chroma to the right, negative values shift to left. &lt;br /&gt;
:::*When &amp;lt;code&amp;gt;{{Template:FuncDef|xysh}}=true&amp;lt;/code&amp;gt;, positive values shift chroma to the left/up, negative values shift right/down. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|thr|float|4.0}}&lt;br /&gt;
:::Masking threshold, higher values treat more areas as color bleed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|strength|float|0.8}}&lt;br /&gt;
:::[[Tweak|Saturation]] strength in clip to be merged with the original chroma. Values below 1.0 reduce the saturation, a value of 1.0 leaves the saturation intact.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|f|bool|true}}&lt;br /&gt;
:::Set to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; to enable fast processing on the mask clip (default). &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|opacity|float|1.0}}&lt;br /&gt;
:::[[Overlay|Opacity]] strength when blending the original chroma with the corrected one. Range is from 0.0 to 1.0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|n|bool|false}}&lt;br /&gt;
:::Set to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; to blur the mask clip. This parameter is ignored when &amp;lt;code&amp;gt;{{Template:FuncDef|f}}=true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|xysh|bool|false}}&lt;br /&gt;
:::Set to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; to shift chroma with &amp;lt;tt&amp;gt;[[ChromaShiftSP]]&amp;lt;/tt&amp;gt; which also allows vertical shifting.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|Bic|bool|false}}&lt;br /&gt;
:::Set to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; to scale the mask with [[BicubicResize]] instead of [[BilinearResize]]. This parameter is ignored when &amp;lt;code&amp;gt;{{Template:FuncDef|f}}=false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
FixChromaBleedingMod with default settings:&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 FixChromaBleedingMod(cxShift=-4, cyShift=-4, thr=4.0, strength=0.8, f=true, opacity=1.0, n=false, xysh=flase, Bic=false)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date(D/M/Y)      Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 1.35         30/04/2015       - [http://pastebin.com/gbmD61RF]&lt;br /&gt;
 1.34         29/04/2015       - [http://pastebin.com/XmVym47E]&lt;br /&gt;
 1.32         09/04/2015       - [http://pastebin.com/puA4NrTj]&lt;br /&gt;
 1.3          22/03/2015       - [http://pastebin.com/y3JfEFdf]&lt;br /&gt;
 1.2          06/02/2014       - [http://pastebin.com/Y0RQYJNr]&lt;br /&gt;
 1.1          06/02/2014       - [http://pastebin.com/1GL9pfZ7]&lt;br /&gt;
 1.0          31/01/2014       - [http://pastebin.com/5PLa9RwJ] (initial release)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Chroma_correction|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/DeHaloHmod</id>
		<title>DeHaloHmod</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/DeHaloHmod"/>
				<updated>2021-03-27T09:26:43Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Dehalo}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|AmjadSONY&lt;br /&gt;
|11/11/2016&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/DeHaloH.avsi DeHaloHmod.avsi]&lt;br /&gt;
|Dehalo&lt;br /&gt;
|&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=145898#post1675762 Doom9 Thread]}}&lt;br /&gt;
== Description ==&lt;br /&gt;
[[DeHaloHmod]] - a modfificaition of &amp;lt;tt&amp;gt;DeHaloH&amp;lt;/tt&amp;gt; by Vitaliy Gorbatenko.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
*AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/ greater]&lt;br /&gt;
*[[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|Progressive]] input only &lt;br /&gt;
*Supported color formats: [[YV12]]&lt;br /&gt;
&lt;br /&gt;
=== Required Plugins ===&lt;br /&gt;
Latest versions of the following filters are recommended unless stated otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
*[[Zs_RF_Shared]]&lt;br /&gt;
*[[MaskTools2]]&lt;br /&gt;
*[[SmoothUV]] &amp;lt;!--(only required when mode=0 / 3)--&amp;gt;&lt;br /&gt;
*[[TBilateral]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|DeHaloHmod (clip input, int &amp;quot;Radius&amp;quot;, int &amp;quot;Str&amp;quot;, bool &amp;quot;Maska&amp;quot;, bool &amp;quot;strong&amp;quot;, int &amp;quot;mode&amp;quot;, int &amp;quot;thr&amp;quot;, string &amp;quot;exdehalo&amp;quot;, bool &amp;quot;analog&amp;quot;, bool &amp;quot;dirty&amp;quot;, bool &amp;quot;smooth&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|clp|clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|Radius|int|2}}&lt;br /&gt;
:::Radius, the default value is 2 but it's set to 6 when &amp;lt;code&amp;gt;dirty=true&amp;lt;/code&amp;gt;, and 4 when &amp;lt;code&amp;gt;smooth=true&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dirty=false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|Str|int|3}}&lt;br /&gt;
:::Strength, the default value is 3 but it's set to 5 when &amp;lt;code&amp;gt;smooth=true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|Maska|bool|false|}}&lt;br /&gt;
:::Set to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; to show mask.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|strong|bool|true}}&lt;br /&gt;
:::Only has an effect when mode is set to 0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|mode|int|3}}&lt;br /&gt;
:::Masking mode.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|thr|int|140}}&lt;br /&gt;
:::Threshold, Only has an effect when mode is not set to 0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|exdehalo|string| }}&lt;br /&gt;
:::You can use it with an external dehalo filter like this: &amp;lt;code&amp;gt;DeHaloHmod(exdehalo=&amp;quot;[[BlindDeHalo3]](4,4)&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|analog|bool|false}}&lt;br /&gt;
:::When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the edge mask is processed with &amp;lt;code&amp;gt;[[ColorYUV|ColorYUV(autogain=true)]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|dirty|bool|false}}&lt;br /&gt;
:::When set to true, a smoothed clip will be use to create the edge mask.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|smooth|bool|false}}&lt;br /&gt;
:::When set to true, it wiil make the Invert mask smoothed by mt_inflate(155,155) and if exdehalo is not used DeHalo_alpha, YAHR2, and TBilateral will be use to create the smoothed and DeHalo clip. When set to false, only TBilateral is used.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
DeHaloHmod with default values.&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 DeHaloHmod(Radius=2, Str=3, Maska=false, strong=true, mode=3, thr=140, analog=false, dirty=false, smooth=false)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date(D/M/Y)      Changes&amp;lt;br&amp;gt;&lt;br /&gt;
              11/11/2016       - [http://pastebin.com/tA7aHtYP]&lt;br /&gt;
              09/05/2016       - [http://pastebin.com/KkuiDtiK]&lt;br /&gt;
              09/05/2016       - [http://pastebin.com/jRFB4NDp]&lt;br /&gt;
              22/10/2015       - [http://pastebin.com/D6M00iYG]&lt;br /&gt;
              30/10/2014       - [http://pastebin.com/GhVpsids]&lt;br /&gt;
              27/08/2014       - Initial release[http://pastebin.com/LtaC7ECe]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== External Links ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Dehaloing|External Filters]] &amp;amp;larr;'''&lt;br /&gt;
-----------------------------------------------&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/YAHRmod_source</id>
		<title>YAHRmod source</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/YAHRmod_source"/>
				<updated>2021-03-27T09:24:15Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Scripts]]&lt;br /&gt;
source: https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/YAHR.avsi&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Y'et A'nother H'alo R'educing script&lt;br /&gt;
# YAHR A.SONY mod 1.38, original YAHR was by Didée&lt;br /&gt;
# good deHalo for modern DVD and other cases&lt;br /&gt;
&lt;br /&gt;
function YAHR2(clip clp, int &amp;quot;depth&amp;quot;, int &amp;quot;blur&amp;quot;, bool &amp;quot;useawarp4&amp;quot;, int &amp;quot;depthV&amp;quot;, int &amp;quot;blurV&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
depth         = Default(depth, 8)&lt;br /&gt;
useawarp4     = Default(useawarp4, false)&lt;br /&gt;
&lt;br /&gt;
blur = defined(blurV) &amp;amp;&amp;amp; !defined(blur) ? depth==0 ? 0 : blur : blur&lt;br /&gt;
&lt;br /&gt;
defined(depthV) ? depthV != 0 &amp;amp;&amp;amp; depth==0 ? eval(&amp;quot;blurV=defined(blurV) ? blurV : blur Chr(3) blur=defined(blur) ? blur : 0&amp;quot;) : depthV==0 &amp;amp;&amp;amp; depth != 0 ? eval(&amp;quot;blurV=defined(blurV) ? blurV : 0&amp;quot;) : nop() : nop()&lt;br /&gt;
&lt;br /&gt;
awarp_params = defined(depthV) ? &amp;quot;,depthV=&amp;quot; + string(depthV) : &amp;quot;&amp;quot;&lt;br /&gt;
awarp_params = defined(blurV) ? awarp_params + &amp;quot;,blurV=&amp;quot; + string(blurV) : defined(depthV) ? depthV==0 ? &amp;quot;,blurV=0&amp;quot; : awarp_params : awarp_params&lt;br /&gt;
&lt;br /&gt;
b1    = clp.minblur(2).removegrain(11,-1)&lt;br /&gt;
b1D   = mt_makediff(clp,b1)&lt;br /&gt;
w1    = useawarp4 ? clp.aWarpSharp4xx(depth=depth,blur=blur,chroma=1,useawarp4=true,depthV=depthV,blurV=blurV) : eval(&amp;quot;clp.aWarpSharp2(depth=depth,blur=blur,chroma=1&amp;quot; + awarp_params + &amp;quot;)&amp;quot;)&lt;br /&gt;
w1b1  = w1.minblur(2,1).removegrain(11,-1)&lt;br /&gt;
w1b1D = mt_makediff(w1,w1b1)&lt;br /&gt;
DD    = b1D.repair(w1b1D,13) &lt;br /&gt;
DD2   = mt_makediff(b1D,DD)&lt;br /&gt;
clp.mt_makediff(DD2,U=2,V=2)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/External_filters</id>
		<title>External filters</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/External_filters"/>
				<updated>2021-03-27T09:23:00Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Spatio-Temporal Denoisers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Rough classification of third-party filters for AviSynth - a perpetual work in progress.&lt;br /&gt;
&lt;br /&gt;
This page lists both scripts (see [[Import]]) and plugins (see [[Plugins]]).&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
==== Download sites ====&lt;br /&gt;
A large list of filters can be downloaded from the following sites but be aware that some plugins listed '''may be outdated''', only recommended as a backup.&lt;br /&gt;
&lt;br /&gt;
*[https://web.archive.org/web/20130803185015/http://www.64k.it:80/andres/dettaglio.php?sez=avisynth Andres' Filter Collection] &lt;br /&gt;
*[https://chaosking.de/repo/avsfilters/ AviSynth Filter DB by ChaosKing] | [https://web.archive.org/web/20140412062911/http://chaosking.de/avisynth-filter-db mirror]&lt;br /&gt;
*[http://www.avisynth.info/?plugin=attach&amp;amp;pcmd=list&amp;amp;refer=%E3%82%A2%E3%83%BC%E3%82%AB%E3%82%A4%E3%83%96 AviSynth.info Filter Archive]&lt;br /&gt;
*[http://xhmikosr.1f0.de/_old/avisynth/plugins/ XhmikosR's Builds] &lt;br /&gt;
*[http://www.avisynth.nl/users/warpenterprises/ Warp Enterprises' AviSynth Filter Collection]&lt;br /&gt;
&lt;br /&gt;
====64-bit filters====&lt;br /&gt;
'''[[AviSynth%2B_x64_plugins|Comprehensive list of AviSynth+ 64-bit filters]] &amp;amp;rarr;'''&lt;br /&gt;
&lt;br /&gt;
====Outdated AviSynth plugins====&lt;br /&gt;
[[External plugins old|External plugins (old)]] - these older plugins are not recommended, page is there mainly for historical purposes.&lt;br /&gt;
&lt;br /&gt;
==== Using filters ====&lt;br /&gt;
Most scripts will apply filters in the following order:&lt;br /&gt;
&lt;br /&gt;
# Create an AviSynth clip from a video file using a source filter.&lt;br /&gt;
# Correct or remove any unwanted features in the video (e.g. dot crawl, field blending or telecine).&lt;br /&gt;
# Denoise the video (optional).&lt;br /&gt;
# Manipulate the video into the desired format (by e.g. changing the size and frame rate).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--AviSynth filters have been classified under these four basic tasks, with a fifth category for filters that fall outside this scheme, and a sixth category for filters that process audio only.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Source Filters ==&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [https://forum.doom9.org/showthread.php?t=135855 BassAudio]&lt;br /&gt;
| [https://www.un4seen.com/ Bass Audio] decoder. Supports wav, aiff, mp3, mp2, mp1, ogg. Support for aac, ac3, alac, ape, cd, flac, midi, mpc, ofr, spx, tta, wma, wv with additional included dll's. The filter is included in the Behappy package.&lt;br /&gt;
| N/A&lt;br /&gt;
| [https://forum.doom9.org/showthread.php?t=135855 Plugin]&lt;br /&gt;
| dimzon&lt;br /&gt;
|-&lt;br /&gt;
|[[BestAudioSource]]&lt;br /&gt;
|A new sample accurate but somewhat slow FFmpeg based audio source filter for AviSynth+. No indexing required and only available in 64-bit. &lt;br /&gt;
|N/A&lt;br /&gt;
|[[BestAudioSource|Plugin]]&lt;br /&gt;
|{{Author/Myrsloik}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.gyroshot.com/cmvsource.htm CMVSource]&lt;br /&gt;
| Load [http://www.bay12games.com/dwarves/ Dwarf Fortress] CMV and CCMV movies.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=162850 Plugin]&lt;br /&gt;
| {{Author/Robert Martens}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=122598 DGAVCDecode] &lt;br /&gt;
| AVC/H.264 decoder plug-in. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.videohelp.com/tools/DGAVCDec Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DGDecode]] &lt;br /&gt;
| Decode MPEG1/MPEG2 streams from: DVD VOBs, captured transport streams, *.mpg/*.m2v/*.pva files, etc. Use this instead of MPEGDecoder/MPEG2Dec3.&lt;br /&gt;
| [[RGB24]], [[YUY2]], [[YV12]], [[I420]] &lt;br /&gt;
| [{{N2Moved}}/dgmpgdec/dgmpgdec.html Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=170107 DGMVCSource]&lt;br /&gt;
|MVC source filter for AviSynth.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|[http://rationalqm.us/dgmvcsource/dgmvcsource100b26.zip Plugin]&lt;br /&gt;
|{{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| DVInfo&lt;br /&gt;
| Grabs the timestamp and recording date info from a DV-AVI. See [http://forum.doom9.org/showthread.php?t=61688 discussion].&lt;br /&gt;
| N/A&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/dvinfo_20100602.zip Plugin] [http://forum.doom9.org/showthread.php?p=1740824#post1740824 Update]&lt;br /&gt;
| {{Author/WarpEnterprises}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20071025023927/http://mvideo.ddpp.net/eng/dvtimestampex.htm DVTimeStampEx]&lt;br /&gt;
| Shows DV timestamp information over a DV clip.&lt;br /&gt;
| N/A&lt;br /&gt;
| [http://web.archive.org/web/20071024123608/http://mvideo.ddpp.net/downld/dvtimestampex_0_5_5.zip Plugin] - [http://web.archive.org/web/20071024123608/http://mvideo.ddpp.net/downld/dvtimestampex_0_5_5_src.zip source code]&lt;br /&gt;
| [http://web.archive.org/web/20071025023932/http://mvideo.ddpp.net/eng/index.htm basilik]&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=134275 DSS2]&lt;br /&gt;
| DirectShowSource2 that uses the installed Haali Media Splitter along with its ''avss.dll'' AviSynth plugin. It can convert VFR files to CFR in order to support frame-accurate seeking. Not recommended due to the fact that Haali Media Splitter is considered outdated, '''use DDS2mod'''.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20130923230211/http://haali.su/mkv/ Plugin]&lt;br /&gt;
| Haali&lt;br /&gt;
|-&lt;br /&gt;
| [[DSS2mod]]&lt;br /&gt;
| DirectShowSource2 mod, this version does not require Haali Media Splitter. &lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[DSS2mod|Plugin]]&lt;br /&gt;
| forclip&lt;br /&gt;
|-&lt;br /&gt;
| [[FFmpegSource]]&lt;br /&gt;
| Decodes all ffmpeg ([http://en.wikipedia.org/wiki/Libavcodec libavcodec]) supported A/V formats with frame accurate seeking in AVI, MKV and MP4. See [http://forum.doom9.org/showthread.php?t=127037 discussion].&lt;br /&gt;
| [[RGB]], [[YUY2]], [[YV12]], [[I420]]&lt;br /&gt;
| [http://github.com/FFMS/ffms2/releases Plugin]&lt;br /&gt;
| {{Author/Myrsloik}}, TheFluff, Plorkyeran, others&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=169651 FRIMSource]&lt;br /&gt;
|FRIMSource is an AviSynth plugin for sequential reading of elementary or transport streams (MPEG2, H.264 AVC/MVC-3D, VC1).&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=169651 Plugin]&lt;br /&gt;
|videofan3d&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=110021 HDVInfo] &lt;br /&gt;
| Grabs the timestamp and recording date info out of a M2T-D2V file&lt;br /&gt;
| N/A&lt;br /&gt;
| [http://web.archive.org/web/20120419204535/http://strony.aster.pl/paviko/hdvinfo0.93.zip Plugin]&lt;br /&gt;
| {{Author/paviko}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ImageSequence]]&lt;br /&gt;
| Load png, jpg, bmp, pcx, tga and gif image sequences using the [http://corona.sourceforge.net/ Corona Image I/O Library]. CoronaSequence/RawSequence.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/imagesequence_20101115.zip Plugin]&lt;br /&gt;
| {{Author/WarpEnterprises}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=135928 Immaavs]&lt;br /&gt;
| ImmaRead uses the ImageMagick libraries to read images. Many formats are supported including animations, multipage files, image sequences and images with different sizes.&lt;br /&gt;
|&lt;br /&gt;
| [http://www.wilbertdijkhof.com/ Plugin]&lt;br /&gt;
| {{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
| IUF&lt;br /&gt;
| Import Uncompressed File. Must be uncompressed! Supported uncompressed Formats: avi, omf(avid), pxr(pixar), mov(24/32bit quicktime), cineon. Can export as well. See [http://forum.doom9.org/showthread.php?t=51227 discussion].&lt;br /&gt;
| [[RGB]]&lt;br /&gt;
| [http://web.archive.org/web/20091016215740/http://geocities.com/hanfrunz/iuf_v1.5.zip Plugin] &lt;br /&gt;
| hanfrunz&lt;br /&gt;
|-&lt;br /&gt;
| [[JpegSource]]&lt;br /&gt;
| An advanced JPEG decoder for Avisynth 2.6. See [http://forum.doom9.org/showthread.php?t=170028 discussion].&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://dl.dropboxusercontent.com/s/rjnt0y3ead2c6ef/JpegSource_20140419.7z Plugin] &lt;br /&gt;
| SEt&lt;br /&gt;
|-&lt;br /&gt;
| [[LSMASHSource]]&lt;br /&gt;
| A source plugin for audio and video, it uses Libav ([http://en.wikipedia.org/wiki/Libav#Contained_codecs libavcodec]) to decode all supported A/V formats. See [http://forum.doom9.org/showthread.php?t=167435 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[LSMASHSource|Plugin]]&lt;br /&gt;
| {{Author/VFR-maniac}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MPEG2DecPlus]]&lt;br /&gt;
|MPEG2DecPlus is a MPEG-1/2 decoder plug-in. MPEG2DecPlus is a project to modernize &amp;quot;[[DGDecode]].dll&amp;quot; for AviSynth+.&lt;br /&gt;
|[[YV12]], [[YV16]]&lt;br /&gt;
|[[MPEG2DecPlus|Plugin]]&lt;br /&gt;
|{{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [[NicAudio]]&lt;br /&gt;
| Audio Plugins for Audio: MPEGAudio/AC3/DTS/LPCM and other uncompressed formats. Formerly known As EvilMPASource. See [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=89629 discussion], [http://forum.doom9.org/showthread.php?t=135876 continued discussion].&lt;br /&gt;
| N/A&lt;br /&gt;
| [[NicAudio|Plugin]]&lt;br /&gt;
| {{Author/Nic}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=103931 OmfSource] &lt;br /&gt;
| Opens the AVID OMF file format (video only, and only works with captured files). See [http://forum.doom9.org/showthread.php?t=103931 discussion].&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.tateu.net/software/ Plugin]&lt;br /&gt;
| {{Author/tateu}}&lt;br /&gt;
|-&lt;br /&gt;
| [[QTSource]]&lt;br /&gt;
| Quicktime Import/Export Filter using an existing installation of Quicktime 6/7. See [http://forum.doom9.org/showthread.php?t=104293 discussion].&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]]&lt;br /&gt;
| [http://www.tateu.net/software/ Plugin]&lt;br /&gt;
| {{Author/tateu}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20120124010957/http://arenafilm.hu/alsog/avisynthr3d/ R3DSource]&lt;br /&gt;
| Redcode RAW source plugin to load R3D clips. See [http://reduser.net/forum/showthread.php?25398 discussion].&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://web.archive.org/web/20120124010957/http://arenafilm.hu/alsog/avisynthr3d/ Plugin]&lt;br /&gt;
| {{Author/Kertai Gábor}}&lt;br /&gt;
|-&lt;br /&gt;
| [[RawSource26]]&lt;br /&gt;
| Loads raw video data directly from files. Further modifications (most raw formats, YUV4MPEG2 compatible with latest spec).&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[RawSource26|Plugin]]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1403600 Sashimi]&lt;br /&gt;
(function &amp;quot;RawReader&amp;quot;)&lt;br /&gt;
| Loads raw video data directly from files, similarly to RawSource, but also allows for skipping headers, and extra formats (long list to help anyone doing a search):  GREY, Y8, interleaved RGB, BGR (which is RGB24), BGRA (which is RGB32), ARBG, ABGR, RGBA, interleaved YUV (which is YCbCr), YUY2, UYVY, AYUV, planar YUV formats YUV444, YUV422, YUV420 (as YV12), YUV420 (as IMC2), and some raw ImageMagick formats.  Some supports for different bit-depths.  Includes YUVInterleaved.avsi, InterleavedConversions.avsi, and PlanarConversions.avsi.  [http://forum.doom9.org/showthread.php?p=1403600 Discussion].&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://sites.google.com/site/ourenthusiasmsasham/soft Plugin with scripts]&lt;br /&gt;
| [http://sites.google.com/site/ourenthusiasmsasham/ PitifulInsect]&lt;br /&gt;
|-&lt;br /&gt;
| [[VapourSource]]&lt;br /&gt;
| VapourSynth script reader for AviSynth+ and AviSynth2.6x.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[VapourSource|Plugin]]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=170311 VideoInputSource]&lt;br /&gt;
| Capture video frames from video capture card or webcam in real-time.&lt;br /&gt;
|[[RGB24]]&lt;br /&gt;
|[http://github.com/fieliapm/himawari_avs_plugin/raw/master/VideoInputSource/VideoInputSource.dll Plugin]&lt;br /&gt;
|[http://github.com/fieliapm fieliapm]&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/slavanap/ssifSource ssifSource]&lt;br /&gt;
| Open m2ts, ssif and mpls files located in decrypted Blu-ray and Blu-ray 3D discs. Supports horizontal of vertical stack of views as output, views selection and swap autodetection.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[https://github.com/slavanap/ssifSource/releases plugin]&lt;br /&gt;
|[http://github.com/slavanap slavanap]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Restoration Filters ==&lt;br /&gt;
&lt;br /&gt;
These remove effects or artifacts introduced (deliberately or accidentally) into the source video. Denoisers are classified separately.&lt;br /&gt;
&lt;br /&gt;
=== Anti-[[aliasing]] ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[DAA]]&lt;br /&gt;
| Anti-aliasing with contra-sharpening.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| mcDAA3&lt;br /&gt;
| Motion-Compensated Anti-aliasing with contra-sharpening, can deal with ifade too, created because when applied daa3 to fixed scenes, it could damage some details and other issues. See [http://forum.doom9.org/showthread.php?p=1639679#post1639679 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.mediafire.com/?wqkob7zx1p119e0 Script]&lt;br /&gt;
| AmjadSONY&lt;br /&gt;
|-&lt;br /&gt;
| [[MAA2]]&lt;br /&gt;
| Updated version of the MAA antialising script.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV24]]&lt;br /&gt;
| [http://web.archive.org/web/20140624125132/https://raw.githubusercontent.com/AviSynth/avs-scripts/master/maa2.avsi Script]&lt;br /&gt;
| line0&lt;br /&gt;
|-&lt;br /&gt;
| [[santiag]]&lt;br /&gt;
| Simple anti-aliasing with independent horizontal and vertical anti-aliasing strength.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1393006 Script]&lt;br /&gt;
| {{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
| SharpAAMCmod&lt;br /&gt;
| High quality MoComped AntiAliasing script, also a line darkener since it uses edge masking to apply tweakable warp-sharpening, &amp;quot;normal&amp;quot; sharpening and line darkening with optional temporal stabilization of these edges. Part of [[AnimeIVTC]]. See [http://forum.doom9.org/showthread.php?t=138305] and [http://forum.doom9.org/showthread.php?t=140031]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| thetoof&lt;br /&gt;
|-&lt;br /&gt;
| [[TIsophote]]&lt;br /&gt;
| A level-set (isophote) smoothing filter.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20070222162751/http://bengal.missouri.edu/~kes25c/TIsophotev091.zip Plugin]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
|[[xaa]]&lt;br /&gt;
|Versatile anti-aliasing script.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV24]]&lt;br /&gt;
|[http://www.mediafire.com/download/sygi04y47eknvc2/xaa_v1.1.1.avsi Script]&lt;br /&gt;
|Desbreko&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Chroma correction ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [{{N2Archived}}/trbarry/Readme_BT709ToBT601.txt BT709ToBT601]&lt;br /&gt;
| Convert from BT.709 (HDTV) to BT.601 (SDTV) colorimetry.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [{{N2Archived}}/trbarry/BT709ToBT601.zip Plugin]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
|[[caf]]&lt;br /&gt;
|Chromatic Aberration Fixer.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/ChromaShiftSP.avsi Script]&lt;br /&gt;
| Torchlight&lt;br /&gt;
|-&lt;br /&gt;
| [[ChromaShift]]&lt;br /&gt;
| This filter will shift the chrominance information by an even number of pixels, in either horizontal direction. It can also apply an overall vertical shift of the total chrominance information, up or down. It is primarily intended to correct improper colour registration. See [http://forum.doom9.org/showthread.php?t=33302 discussion.]&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB32]]&lt;br /&gt;
| [http://web.archive.org/web/20091026153334/http://www.geocities.com/siwalters_uk/chromashift27.zip Plugin]&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ChromaShiftSP]]&lt;br /&gt;
| This script can shift chroma in all directions with subpixel accuracy.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://avisynth.nl/images/ChromaShiftSP.avsi Script]&lt;br /&gt;
| IanB, McCauley &lt;br /&gt;
|-&lt;br /&gt;
| [[ColorMatrix]]&lt;br /&gt;
| ColorMatrix corrects the colors of MPEG-2 streams. More correctly, many MPEG-2 streams use slightly different coefficients (called Rec.709) for storing the color information than AviSynth's color conversion routines or the XviD/DivX decoders (called Rec.601) do, with the result that DivX/XviD clips or MPEG-2 clips encoded by TMPGEnc/QuEnc are displayed with slighty off colors. This can be checked by opening the MPEG-2 stream directly in VDubMod.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[ColorMatrix|Plugin]]&lt;br /&gt;
| {{Author/Wilbert Dijkhof}}, {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FixChromaBleeding]]&lt;br /&gt;
| Fixes area of chroma bleeding by shifting the chroma and lowering the saturation in the affected areas. See [http://forum.doom9.org/showthread.php?t=77074 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20091026141730/http://www.geocities.com/alex_j_jordan/chroma.txt Script]&lt;br /&gt;
| {{Author/Alex Jordan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FixChromaBleedingMod]]&lt;br /&gt;
| Fixes area of chroma bleeding by shifting the chroma and lowering the saturation in the affected areas. See [http://forum.doom9.org/showthread.php?t=77074#post1673932 discussion]&lt;br /&gt;
| [[YV12]], [[YUY2]], [[YV411]]&lt;br /&gt;
| [[FixChromaBleedingMod_source|Script]]&lt;br /&gt;
| AmjadSONY&lt;br /&gt;
|-&lt;br /&gt;
| [[FixChromaticAberration]]&lt;br /&gt;
| FixChromaticAberration resizes (and crops) the red/green/blue channels of the image separately. This helps to minimize the colored edges next to the image corners that result from lenses with chromatic aberration. See [http://forum.doom9.org/showthread.php?p=1520786#post1520786 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://avisynth.nl/index.php/FixChromaticAberration Script]&lt;br /&gt;
| Martin Wagener&lt;br /&gt;
|-&lt;br /&gt;
| [[MoveChroma]]&lt;br /&gt;
| Chroma shifting filter; can be used to independently shift the U/V channels left or right.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[MoveChroma|Plugin]]&lt;br /&gt;
| [http://noraneco.ddo.jp/apechironnup]&lt;br /&gt;
|-&lt;br /&gt;
| [[ReInterpolate411]]&lt;br /&gt;
| This is a fast and simple filter to correct the improper 4:1:1 =&amp;gt; 4:2:2 conversion that seems to occur with some DV/4:1:1 codecs.&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [{{N2Archived}}/trbarry/ReInterpolate411.zip Plugin]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.avisynth.nl/users/fizick/reinterpolate420/reinterpolate420.html ReInterpolate420]&lt;br /&gt;
| Usually, DV decoders upsample [[PAL]] DV (which is YV12) to YUY2 using point sampling. This plugin re-interpolates the original chroma samples.&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://www.avisynth.nl/users/fizick/reinterpolate420/reinterpolate420_v3.zip Plugin]&lt;br /&gt;
|  {{Author/Wilbert Dijkhof}}&lt;br /&gt;
{{Author/Fizick}} (v3)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Debanding ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| AdaptDBMC&lt;br /&gt;
| Luma / Fade / Blue adaptive debanding script. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&amp;amp;t=512 Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GradFun2db]]&lt;br /&gt;
| A simple and fast debanding filter.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[GradFun2db|Plugin]]&lt;br /&gt;
| Prunedtree&lt;br /&gt;
|-&lt;br /&gt;
| [[GradFun2DBmod]]&lt;br /&gt;
| An advanced debanding script based on GradFun2DB.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=144537 Script]&lt;br /&gt;
| {{Author/LaTo}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Dither_tools#GradFun3|GradFun3]]&lt;br /&gt;
| This debanding script, part of the [[Dither_tools|Dither]] package, has several gradient smoothing algorithms, including a bilateral filter. It uses an ordered dithering, which has a good resilience to lossy compression.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]], [[Y8]], [[YV411]]&lt;br /&gt;
| [[Dither_tools|Script]]&lt;br /&gt;
| {{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
| [[f3kdb|flash3kyuu_deband]]&lt;br /&gt;
| Fast debanding plugin ported from AviUtl.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[YV16]], [[YV24]], [[Y8]], [[YV411]]&lt;br /&gt;
| [[f3kdb|Plugin]]&lt;br /&gt;
| [http://github.com/SAPikachu/ SAPikachu]&lt;br /&gt;
|-&lt;br /&gt;
| LumaDB&lt;br /&gt;
| Fast 8-bit debanding filter with luma-adaptive grain and mask. Used to process luma only. See [http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&amp;amp;t=668 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20131111114932/http://www.nmm-hd.org/upload/get~3YK_B5TfcyI/LumaDB-0.7.rar Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
| LumaDBL&lt;br /&gt;
| Fast 16-bit debanding filter with luma-adaptive grain and mask. Used to process luma only. Works in 16-bit internally and can also input/output 16-bit. See [http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&amp;amp;t=668 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20131111114947/http://www.nmm-hd.org/upload/get~mQYIS9H6Qas/LumaDBL-0.7.rar Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Deblocking ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| BlockKiller&lt;br /&gt;
| Deblocking filter, see [http://forum.doom9.org/showthread.php?p=1410479#post1410479 discussion].&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1410479&amp;amp;postcount=19 Script]&lt;br /&gt;
| Jawed&lt;br /&gt;
|-&lt;br /&gt;
| BlockTerminator&lt;br /&gt;
| Deblocking filter, see [http://forum.doom9.org/showthread.php?p=831936#post831936 discussion.]&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=831936&amp;amp;postcount=24 Script]&lt;br /&gt;
| foxyshadis&lt;br /&gt;
|-&lt;br /&gt;
| [[DeBlock]]&lt;br /&gt;
| Deblocking filter. DGDecode also uses DeBlock.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], &amp;lt;br&amp;gt;all 8-32bit Y/YUV [[planar]] colorspaces &lt;br /&gt;
| [[DeBlock|Plugin]]&lt;br /&gt;
| {{Author/Fizick}} / {{Author/Manao}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Deblock_QED]]&lt;br /&gt;
| &amp;quot;A postprocessed Deblock(): Uses full frequencies of Deblock's changes on block borders, but DCT-lowpassed changes on block interiours.&amp;quot; [http://forum.doom9.org/showpost.php?p=913365&amp;amp;postcount=4 Didée]. See [http://forum.doom9.org/showthread.php?p=944459 discussion.] For updated Deblock QED see this [http://forum.doom9.org/showthread.php?t=154777 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/Deblock_QED_MT2Mod.avsi Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
|[[DeblockPP7]]&lt;br /&gt;
| A port of the MPlayer PP7 deblocking filter.&lt;br /&gt;
|[[YUY2]], [[YV12]]&lt;br /&gt;
|[[DeblockPP7|Plugin]]&lt;br /&gt;
|John Doe&lt;br /&gt;
|-&lt;br /&gt;
| [[FunkyDeBlock]]&lt;br /&gt;
| Deblocking script based on BlindPP and high/low pass separation. See [http://forum.doom9.org/showthread.php?t=72431 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| Mug Funky&lt;br /&gt;
|-&lt;br /&gt;
| [[MDeblock]]&lt;br /&gt;
| Plugin for removing block artifacts.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[MDeblock|Plugin]]&lt;br /&gt;
| {{Author/kassandro}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SmoothD]]&lt;br /&gt;
| Filter to deblock frames while keeping high frequency detail.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[SmoothD|Plugin]]&lt;br /&gt;
| Tobias Bergmann&lt;br /&gt;
|-&lt;br /&gt;
| [[SmoothD2]]&lt;br /&gt;
| Deblocking filter.  Rewrite of SmoothD. Faster, better detail preservation, optional chroma deblocking.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[SmoothD2|Plugin]]&lt;br /&gt;
| Jim Conklin&lt;br /&gt;
|-&lt;br /&gt;
| SmoothDeblock&lt;br /&gt;
| Slow and complex, but produces very good results - especially on severely blocky sources - in a similar manner to TempGaussMC and QTGMC. See [http://forum.doom9.org/showthread.php?t=111526 discussion] and an [http://forum.doom9.org/showthread.php?p=945261#post945261 overall comment].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1553458#post1553458 Script]&amp;lt;br&amp;gt;[[SmoothDeblock_source|(alt source)]]&lt;br /&gt;
| redfordxx&lt;br /&gt;
|-&lt;br /&gt;
|[http://avisynth.org.ru/unblock/unblock.html Unblock]&lt;br /&gt;
|UnBlock is a filter that removes the &amp;quot;blockiness&amp;quot; of heavily or moderately compressed images with statistical approach. See [http://forum.doom9.org/showthread.php?t=133059 discussion].&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://avisynth.org.ru/unblock/unblock11.zip Plugin]&lt;br /&gt;
|{{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
|[[vsDeblockPP7]]&lt;br /&gt;
|A port of the MPlayer PP7 deblocking filter. Includes high bit-depth support.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], &amp;lt;br&amp;gt;all 8-32bit [[planar]] colorspaces &lt;br /&gt;
|[[vsDeblockPP7|Plugin]]&lt;br /&gt;
|Asd-d&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dehaloing ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[abcxyz]]&lt;br /&gt;
| Filter to remove halos. See [http://forum.doom9.org/showthread.php?t=144982 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Media:abcxyz_MT2.avsi|Script]]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[BlindDeHalo3]]&lt;br /&gt;
| Filter to remove edge enhancement artifacts. See [http://forum.doom9.org/showthread.php?p=622289#post622289 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/attachment.php?attachmentid=5599&amp;amp;d=1143030001 Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeHalo_alpha]]&lt;br /&gt;
| Very powerful filter to remove edge enhancement artifacts. See [http://forum.doom9.org/showthread.php?p=777956#post777956 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/Dehalo_alpha_mt.avsi Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
|[[DeHaloHmod]]&lt;br /&gt;
| Another halo reducer, it includes lots of options to tweak for best performance. See [http://forum.doom9.org/showthread.php?p=1675762#post1675762 discussion]&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
| [[DeHaloHmod|Script]]&lt;br /&gt;
|AmjadSONY&lt;br /&gt;
|-&lt;br /&gt;
|[[FineDehalo]]&lt;br /&gt;
|Halo removal script that uses DeHalo_alpha with a few masks and optional contra-sharpening to try remove halos without removing important details (like line edges).&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[http://avisynth.nl/images/FineDehalo.avsi Script]&lt;br /&gt;
|{{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=172599 HaloBuster]&lt;br /&gt;
|Really slow high quality halo remover.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=172599 Script]&lt;br /&gt;
|feisty2&lt;br /&gt;
|-&lt;br /&gt;
| Mask_DHA&lt;br /&gt;
| A combination of the best of DeHalo_alpha and BlindDeHalo3, plus a few minor tweaks to the masking. See [http://forum.doom9.org/showthread.php?t=148498 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| 'Orum&lt;br /&gt;
|-&lt;br /&gt;
| [[VHSHaloremover]]&lt;br /&gt;
| Quick &amp;amp; dirty halo removal. Will introduce some blurriness, but the halos are so huge you can’t avoid it. See [http://forum.doom9.org/showthread.php?p=1758184#post1758184]&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [http://pastebin.com/s24mSgJ5 Script]&lt;br /&gt;
| {{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
| [[YAHR]]&lt;br /&gt;
| Basic filter with no variables to remove edge enhancement artifacts. See [http://forum.doom9.org/showthread.php?p=1205653#post1205653]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/YAHR.avsi Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| YAHRmod&lt;br /&gt;
| Basic filter used to reduce halos in modern DVD and other cases.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[YAHRmod_source|Script]]&lt;br /&gt;
| AmjadSONY&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Deringing &amp;amp; Mosquito Noise ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[aWarpSharpDering]]&lt;br /&gt;
| Tries to clean up slight ringing around edges by heavily aWarpSharp-ing the image and then applying it only to the areas where the difference is small enough so detail isn't destroyed.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/AWarpSharpDering.avsi Script]&lt;br /&gt;
| [http://leak.no-ip.org/AviSynth/ Leak]&lt;br /&gt;
|-&lt;br /&gt;
| [http://rationalqm.us/dgmpgdec/DGDecodeManual.html#BlindPP BlindPP]&lt;br /&gt;
| Deblocking &amp;amp; deringing filter; part of [[DGDecode]]. &amp;lt;br&amp;gt;Mosquito noise removal: &amp;lt;code&amp;gt;BlindPP(quant=16, cpu2=&amp;quot;ooooxx&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [{{N2Moved}}/dgmpgdec/dgmpgdec.html Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=636297#post636297 BlindDeRing]&lt;br /&gt;
| Deringing filter.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://chaosking.de/wp-content/uploads/avsfilters/Restoration_Filters/Deringing/BlindDeRing___(2005).7z Plugin]&lt;br /&gt;
| krieger2005&lt;br /&gt;
|-&lt;br /&gt;
|[https://gist.github.com/acuozzo/940869257cc79016215600a2392b33eb Deemphasize]&lt;br /&gt;
|This AviSynth function deemphasizes ringing common to SD video signals resulting from a playback device in the transfer chain poorly compensating for pre-emphasis baked into the source signal.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[https://gist.github.com/acuozzo/940869257cc79016215600a2392b33eb Script]&lt;br /&gt;
|[https://github.com/acuozzo acuozzo]&lt;br /&gt;
|-&lt;br /&gt;
|[https://sourceforge.net/projects/avisynth-dering/ Dering]&lt;br /&gt;
|Deringing filter intended for deringing VHS captured video.&lt;br /&gt;
|[[YUY2]], [[YV12]]&lt;br /&gt;
|[https://sourceforge.net/projects/avisynth-dering/files/release4/ C-Plugin]&lt;br /&gt;
|[https://sourceforge.net/u/alexrayne/profile/ alexrayne]&lt;br /&gt;
|-&lt;br /&gt;
| [[EdgeCleaner]]&lt;br /&gt;
| A simple edge cleaning and weak dehaloing function. See [http://forum.doom9.org/showthread.php?t=164592 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1568521&amp;amp;postcount=13 Script]&lt;br /&gt;
| [http://forum.doom9.org/member.php?u=80518 canuckerfan]&lt;br /&gt;
|-&lt;br /&gt;
| [[HQDering]]&lt;br /&gt;
| Applies deringing by using a smart smoother near edges (where ringing occurs) only. See [http://forum.doom9.org/showthread.php?p=1043583#post1043583 here] and [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=67532 here] for details.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=793930#post793930 Script]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[HQDering mod]]&lt;br /&gt;
| Applies deringing by using a smart smoother near edges (where ringing occurs) only.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140711173345/http://www.nmm-hd.org/upload/get~08CusazVphU/HQDeringmod_v1.8.avsi Script]&lt;br /&gt;
| [http://www.nmm-hd.org/newbbs/memberlist.php?mode=viewprofile&amp;amp;u=479&amp;amp;sid=ff62d0f6c22fcfdbe97b53c8351429bc mawen1250]&lt;br /&gt;
|-&lt;br /&gt;
| [[LazyDering]]&lt;br /&gt;
| Tries to clean up slight ringing around edges by applying [[aWarpSharp2]] only to areas where the difference is small enough so detail isn't destroyed.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20131103155455/http://anime-addict.ani-x.com/files/avisynth/scripts/LazyDering_v0.1.avsi Script]&lt;br /&gt;
| [http://leak.no-ip.org/AviSynth/ Leak], RazorbladeByte&lt;br /&gt;
|-&lt;br /&gt;
| [[MosquitoNR]]&lt;br /&gt;
| A noise reduction filter designed for mosquito noise, which is often caused by lossy compression.&lt;br /&gt;
| [[Y8]], [[YV411]], [[YV12]], [[YV16]], [[YV24]], [[YUY2]]&lt;br /&gt;
| [[MosquitoNR|Plugin]]&lt;br /&gt;
| {{Author/b_inary}}&lt;br /&gt;
|-&lt;br /&gt;
|ungibbs&lt;br /&gt;
|ungibbs, a gibbs artifact remover.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=134502 Script]&lt;br /&gt;
|*.mp4 guy&lt;br /&gt;
|-&lt;br /&gt;
|WarpDeRing&lt;br /&gt;
|Uses aWarpSharp2's flattening to clean out ringing/smaller halos, then runs some masks to preserve the edges and avoid the thinning.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[WarpDeRing_source|Script]]&lt;br /&gt;
|mirkosp&lt;br /&gt;
|-&lt;br /&gt;
|WarpDeRing_faster&lt;br /&gt;
|Same as WarpDeRing but may be a bit faster.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[WarpDeRing_faster_source|Script]]&lt;br /&gt;
|mirkosp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Deinterlacing ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| Area&lt;br /&gt;
| A port of Gunnar Thalin's VirtualDub filter &amp;quot;Deinterlace - area based&amp;quot; to AviSynth.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/area_5F25_dll_20030217.zip Plugin]&lt;br /&gt;
| {{Author/Donald Graft}} // {{Author/Gunnar Thalin}}&lt;br /&gt;
|-&lt;br /&gt;
| BlendBob&lt;br /&gt;
| Filter designed for use after a smart bob; blends every other frame with the closest matching neighbouring frame. See [http://forum.doom9.org/showthread.php?threadid=80289 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://leak.no-ip.org/AviSynth/BlendBob/ Plugin]&lt;br /&gt;
| {{Author/Leak}}&lt;br /&gt;
|-&lt;br /&gt;
|[[BWDIF]]&lt;br /&gt;
|Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic interpolation algorithms.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], all 8-32bit [[planar]] colorspaces &lt;br /&gt;
|[[BWDIF|Plugin]]&lt;br /&gt;
|Asd-g&lt;br /&gt;
|-&lt;br /&gt;
| DGBob&lt;br /&gt;
| This filter splits each field of the source into its own frame and then adaptively creates the missing lines either by interpolating the current field or by using the previous field's data. See [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=55598 discussion].&lt;br /&gt;
| [[RGB]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [{{N2Moved}}/dgbob/dgbob.html Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Decomb]]&lt;br /&gt;
| The FieldDeinterlace filter provides functionality similar to the postprocessing function of Telecide. You can use it for pure interlaced streams (that is, those not containing telecined progressive frames). The name refers to the fact that field mode differencing is used.&lt;br /&gt;
| [[YUY2]], [[YUY2]]&lt;br /&gt;
| [[Decomb|Plugin]]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[EEDI2]]&lt;br /&gt;
| EEDI2 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).&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[EEDI2|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[eedi3|EEDI3]]&lt;br /&gt;
| Another edge directed interpolation filter. Works by minimizing a cost functional involving every pixel in a scan line. eedi3 is good for deinterlacing and enlarging images by the powers of 2.&lt;br /&gt;
| [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[eedi3|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
|[[FieldHint]]&lt;br /&gt;
|FieldHint combines arbitrary fields from the input clip, and optionally adds Telecide-compatible postprocessing hints.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20120223025813/http://ivtc.org/yatta%20support/fieldhint-0.12.rar Plugin]&lt;br /&gt;
|{{Author/akupenguin}}&lt;br /&gt;
|-&lt;br /&gt;
| IBob&lt;br /&gt;
| Interpolating Bob works identically to the Avisynth built-in [[Bob]] filter except that it uses linear interpolation instead of bicubic resizing. See [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=62142 discussion]. &lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://kevin.atkinson.dhs.org/ibob/ Plugin]&lt;br /&gt;
| {{Author/Kevin Atkinson}}&lt;br /&gt;
|-&lt;br /&gt;
| KernelDeint&lt;br /&gt;
| This filter deinterlaces using a kernel approach. It gives greatly improved vertical resolution in deinterlaced areas compared to simple field discarding. Superceded by [[LeakKernelDeint]], see the description below in this table. &lt;br /&gt;
| [[RGB]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [{{N2Moved}}/kerneldeint/kerneldeint.html Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LeakKernelDeint]]&lt;br /&gt;
| This filter deinterlaces using a kernel approach. It gives greatly improved vertical resolution in deinterlaced areas compared to simple field discarding. Compared to KernelDeint, it is low-level optimized (for speed) and provides some useful new functionality. As the original author of KernelDeint() states, LeakKernelDeint() is the preferred version to use.&lt;br /&gt;
| [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://leak.no-ip.org/AviSynth/LeakKernelDeint/LeakKernelDeint_1.5.4.zip Plugin]&lt;br /&gt;
| {{Author/Leak}}&lt;br /&gt;
|-&lt;br /&gt;
| [[nnedi3]]&lt;br /&gt;
| nnedi3 is an intra-field only deinterlacer. It takes in a frame, throws away one field, and then interpolates the missing pixels using only information from the kept field. It also has same rate and double rate modes.&lt;br /&gt;
| [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[nnedi3|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[nnedi3ocl]]&lt;br /&gt;
| OpenCL rewrite of [[nnedi3]]. See [http://forum.doom9.org/showthread.php?t=169766 discussion].&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://dl.dropboxusercontent.com/s/bmemjsu7jqnlk65/nnedi3ocl_20131208.7z Plugin]&lt;br /&gt;
| SEt&lt;br /&gt;
|-&lt;br /&gt;
| [[QTGMC]]&lt;br /&gt;
| by -Vit- [http://forum.doom9.org/showthread.php?t=156028] A new deinterlacer based on TempGaussMC_beta2. It's faster and has a presets system for speed/quality selection. There are also several new features including progressive support and noise/grain processing. The script also contains extensive comments to better describe the settings and the workings of the TGMC algorithm.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[QTGMC|Script]]&lt;br /&gt;
| -Vit-&lt;br /&gt;
|-&lt;br /&gt;
| [[SangNom2]]&lt;br /&gt;
| Reimplementation of the old [[SangNom]] plugin.&lt;br /&gt;
| [[Y8]],[[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[SangNom2|Plugin]]&lt;br /&gt;
| {{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.guthspot.se/video/AVSPorts/SmoothDeinterlacer/ SmoothDeinterlace]&lt;br /&gt;
| This contains an adaptive deinterlacer plugin for (AVISynth). It is based on Gunnar Thalin's [http://www.guthspot.se/video/index.htm#deinterlacesmooth Smooth Deinterlace plugin] for VirtualDub.&amp;lt;br&amp;gt;&lt;br /&gt;
See also [[SmoothDeinterlaceFunctions]]&lt;br /&gt;
| [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.guthspot.se/video/AVSPorts/SmoothDeinterlacer/AVSSmoothDeinterlacer.zip Plugin]&lt;br /&gt;
| {{Author/Gunnar Thalin}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TDeint]]&lt;br /&gt;
| TDeint is a bi-directionally, motion adaptive (sharp) deinterlacer. It can also adaptively choose between using per-field and per-pixel motion adaptivity. It can use cubic interpolation, kernel interpolation (with temporal direction switching), or one of two forms of modified ELA interpolation which help to reduce &amp;quot;jaggy&amp;quot; edges in moving areas where interpolation must be used. TDeint also supports user overrides through an input file, and can act as a smart bobber or same frame rate deinterlacer, as well as an IVTC post-processor. See [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=82264 discussion].&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[TDeint|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TelecideHints]]&lt;br /&gt;
| The filter process the stats file to get the usual progressive matches and identify VFR sections.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://mod16.org/fansub/Telecidehints11.rar Plugin]&lt;br /&gt;
| {{Author/Myrsloik}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TempGaussMC]]&lt;br /&gt;
| Motion-compensated bob deinterlacer, based on temporal gaussian blurring. reduces noise/grain of the source and does NOT leave the original fields unchanged. Output is rich with details and very stable. Is SLOW&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[TempGaussMC|Script]]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?p=1734089#post1734089 w3fdif]&lt;br /&gt;
|Weston 3 Field Deinterlacing Filter (very beta).&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://horman.net/avisynth/download/w3fdif.zip Plugin]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Yadif]]&lt;br /&gt;
| 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.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[Yadif|C-Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [[yadifmod]]&lt;br /&gt;
| Modified version of Fizick's avisynth filter port of yadif from mplayer. This version doesn't internally generate spatial predictions, but takes them from an external clip. It also is not an Avisynth_C plugin (just a normal one).&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[yadifmod|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[yadifmod2]]&lt;br /&gt;
| Yadif + yadifmod for avisynth2.6/avisynth+. &lt;br /&gt;
| [[YV24]], [[YV16]], [[YV12]], [[YV411]], [[Y8]]&lt;br /&gt;
| [[yadifmod2|Plugin]]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Duplicate Frame Detectors ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[ApparentFPS]]&lt;br /&gt;
| Shows underlying framerate where a clip has had many duplicates inserted, easier than counting unique frames.&lt;br /&gt;
| (see [[ApparentFPS|docs]])&lt;br /&gt;
| [[ApparentFPS|Plugin]]&lt;br /&gt;
| StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| [[DeDup]]&lt;br /&gt;
| Remove (drop) duplicate frames in the interest of compression quality and speed. Resulting clip will have a variable frame rate.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[DeDup]]&lt;br /&gt;
| {{Author/akupenguin}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Dup]]&lt;br /&gt;
| A robust duplicate frame detector; a frame that is determined to be close enough to its predecessor to be considered a duplicate will be replaced by a copy of the predecessor. This can significantly reduce the size of encoded clips with virtually no visual effect. Provides the capability to replace frames with a blend of all the duplicates, providing a valuable noise reduction. &lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[Dup|Plugin]]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=175357 Duplicity2/DropDeadGorgeous]&lt;br /&gt;
|A two faced scheming and double dealing [on your behalf] dupe tool.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=175357 Script]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=134930 Dupped]&lt;br /&gt;
| Another frame duplication function, similar to Dup, but hopefully more accurate.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140420181919/http://www.randomdestination.com/members/corran/misc/dupped/dupped.avsi Script]&lt;br /&gt;
| [https://github.com/eparsons Corran]&lt;br /&gt;
|-&lt;br /&gt;
| [[DupStep]]&lt;br /&gt;
| Duplicate frame detector/decimator filter for [[AviSynth+]], 64-bit version only.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]], [[YV411]], [[Avisynthplus_color_formats|8-16 bits]]&lt;br /&gt;
| [[DupStep|Plugin]]&lt;br /&gt;
| [http://github.com/Orum Orum]&lt;br /&gt;
|-&lt;br /&gt;
|[[ExactDedup]]&lt;br /&gt;
| ExactDedup is a filter intended to remove frames that are exact duplicates of each other, leaving only the first and (optionally) last frames of a run intact, and generates a Matroska v2 timecodes file with timing information for the ensuing stream.&lt;br /&gt;
| [[RGB24]] [[RGB32]], [[Y8]], [[YV12]] [[YV16]], [[YV24]]&lt;br /&gt;
| [[ExactDedup|Plugin]]&lt;br /&gt;
|Steve Melenchuk, Arick Chan, StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/getdups/getdups.html GetDups] &lt;br /&gt;
| Selecting unique duplicate frames from clip, it return frames which have copies only, by one from the series (group). Made for 8mm films.&lt;br /&gt;
| [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://avisynth.nl/users/fizick/getdups/getdups096.zip Plugin]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=164372 MorphDups]&lt;br /&gt;
| Replace duplicate frames by interpolations.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=164372 Script]&lt;br /&gt;
| sven_x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Fieldblending and Frameblending removal ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[c_deblend]] &lt;br /&gt;
| c_deblend is a simple blend replacing function like unblend or removeblend. Superseded by [[srestore]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| [[Cdeint]]&lt;br /&gt;
| Restores 24fps FILM out of a fieldblended FILM -&amp;gt; Telecine -&amp;gt; [[NTSC]] -&amp;gt; Blendconversion -&amp;gt; [[PAL]] - Video (alternative for Restore24).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| [[Deblend]]&lt;br /&gt;
| See [http://forum.doom9.org/showthread.php?p=760375#post760375 discussion].&lt;br /&gt;
|&lt;br /&gt;
| Script&lt;br /&gt;
| actionman133&lt;br /&gt;
|-&lt;br /&gt;
| [[ExBlend]]&lt;br /&gt;
| ExBlend is a plugin to repair damage caused by blend deinterlacing of telecined clips, which results in a double blend, every five frames, GGGBBGGGBBGGGBB etc where 'G' is good and 'B' is blend.&lt;br /&gt;
| [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[ExBlend|Plugin]]&lt;br /&gt;
| StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| [[FixBlendIVTC]]&lt;br /&gt;
| A blend replacing/frame restoring function for doubleblends caused by blend-deinterlacing of telecined sources. Superseded by [[srestore]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| [[mrestore]]&lt;br /&gt;
| Uses conditional frame evaluation to undo standard conversions with blends. Superseded by [[srestore]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| [[RemoveBlend]]&lt;br /&gt;
| This filter is used to remove blended fields/frames. See [http://forum.doom9.org/showthread.php?t=75772 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [//web.archive.org/web/20061113201230/http://bossanovaguitar.com/video/removeblend-0.3.zip Plugin]&lt;br /&gt;
| {{Author/violao}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Restore24]]&lt;br /&gt;
| Restore24 is an AviSynth filter that is able to do the nearly impossible: Restore 24fps FILM out of a fieldblended FILM -&amp;gt; Telecine -&amp;gt; [[NTSC]] -&amp;gt; Blendconversion -&amp;gt; [[PAL]] - Video. See [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=75432 discussion].&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| scharfis_brain&lt;br /&gt;
|-&lt;br /&gt;
| [[RestoreFPS]]&lt;br /&gt;
| RestoreFPS reverses the kind of blending generated by [[ConvertFPS]], restoring original framerate. It will work perfectly well on any regular blend pattern.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://wilbertdijkhof.com/mg262/Restorefps_v10.zip Plugin]&lt;br /&gt;
| {{Author/mg262}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Srestore]]&lt;br /&gt;
| Replacement function for mrestore, c_deblend, FixBlendIVTC and DupHq.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Srestore|script]]&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| Specials&lt;br /&gt;
| Helps restore video with blended fields/frames using a reference source. See [http://forum.doom9.org/showthread.php?t=165030 discussion] and much more information [http://horman.net/doctorwho/specials.php here] and [http://forum.doom9.org/showthread.php?t=168832 here].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://horman.net/specials.zip Plugin]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| Unblend&lt;br /&gt;
| Unblend is based on warpenterprise's deblend algorithm and neuron2's decimate code, with YV12 support only. The aim is the same of deblend. See [http://forum.doom9.org/showthread.php?t=55019 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/unblend_5F25_dll_2003.zip Plugin]&lt;br /&gt;
| Bach&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Film Damage correction ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[[DePulse]]&lt;br /&gt;
|DePulse is dropout remover, removes white/black noise horizontal streaking in analogue captures.&lt;br /&gt;
|[[YUY2]]&lt;br /&gt;
|[[DePulse|Plugin]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[DeScratch]]&lt;br /&gt;
| DeScratch removes vertical scratches from films. Also it can be used for removing of horizontal noise lines such as drop-outs from analog VHS captures (after image rotation). &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[DeScratch|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeSpot]]&lt;br /&gt;
| This filter is designed to remove temporal noise in the form of dots (spots) and streaks found in some videos. The filter is also useful for restoration (cleaning) of old telecined 8mm (and other) films from spots (from dust) and some stripes (scratches).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[DeSpot|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [[deVCR]]&lt;br /&gt;
| deVCR eliminates (to a certain degree) the annoying horizontal lines that keep crawling around your VHS or Beta recorded video.&lt;br /&gt;
| 8-bit RGB/YUV&lt;br /&gt;
| [[DeVCR#Script|Script]]&lt;br /&gt;
| Ricardo Garcia&lt;br /&gt;
|-&lt;br /&gt;
|[[KillPulse]]&lt;br /&gt;
|KillPulse is dropout remover, removes white/black noise horizontal streaking in analogue captures.&lt;br /&gt;
|[[YUY2]]&lt;br /&gt;
|[[KillPulse|Plugin]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[RemoveDirt]]&lt;br /&gt;
| RemoveDirt is a temporal cleaner for AviSynth 2.6 and AviSynth+.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[RemoveDirt|Plugin]]&lt;br /&gt;
| {{Author/kassandro}}, {{Author/pinterf}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=121197 RemoveLine]&lt;br /&gt;
|Script for removal of horizontal stripes.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|Script&lt;br /&gt;
|Yup&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=181777 SpotLess]&lt;br /&gt;
|Script filter to remove spots and noise using mvTools2 and Medianblur2. Copes with spots on multiple consecutive frames, setting RadT accordingly.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[HBD]] &lt;br /&gt;
|Script&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=144271 VideoFred's Film Restoring]&lt;br /&gt;
| A suite of scripts for film restoring.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=144271 Script]&lt;br /&gt;
| videoFred&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Frequency Interference removal ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [http://avisynth.org.ru/defreq/defreq.html DeFreq]&lt;br /&gt;
| Defreq uses Fast Fourier Transform method for frequency selecting an removing. See [http://forum.doom9.org/showthread.php?t=82978 discussion].&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://avisynth.org.ru/defreq/defreq07.zip Plugin]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.nl/users/vcmohan/FanFilter/FanFilter.html FanFilter] &lt;br /&gt;
| Regular vertical frequency interference is filtered in spatial domain.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB32]], [[RGB24]]&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/FanFilter/FanFilter.zip Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IVTC &amp;amp; Decimation ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AnimeIVTC]]&lt;br /&gt;
| What it does:&lt;br /&gt;
* High quality adaptative field matching for hard telecine&lt;br /&gt;
* Bob, remove the blends and decimate back to the desired framerate for DHT/field-blended&lt;br /&gt;
* Creating a VFR clip for hybrid sources&lt;br /&gt;
* Bob the interlaced credits, blend-deinterlacing the background while doing minimal damage on the progressive credits, convert their framerate to match the episode's and splice them with it OR leave them @ 30p to create a VFR clip&lt;br /&gt;
* Very good combing removal and anti-aliasing functions&lt;br /&gt;
See [http://forum.doom9.org/showthread.php?t=138305] and See [http://forum.doom9.org/showthread.php?p=1673928] for mod version.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| thetoof&lt;br /&gt;
|-&lt;br /&gt;
|[[DecombUCF]]&lt;br /&gt;
|Decomb Using Clean Field. This function removes noise generated in one field, such as BS/terrestrial digital video scene changes and moving scenes. (Used after reverse telecine)&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[DecombUCF|Script]]&lt;br /&gt;
|tyottoenc&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=158230 DOCI]&lt;br /&gt;
| Destruction of Chroma Interlacing fixes a problem where you captured pulleddown video in YV12.  In the combed frames, the chroma from two frames has been blended, leading to a ghosting effect when IVTC'd.  This filter reconstructs the chroma exactly and fixes the problem.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=158230 Script]&lt;br /&gt;
| jmac698&lt;br /&gt;
|-&lt;br /&gt;
| [[FDecimate]]&lt;br /&gt;
| The FDecimate() filter provides extended decimation capabilities not available from Decimate(). It can remove frames from a clip to achieve the desired frame rate, while retaining audio/video synchronization. It preferentially removes duplicate frames where possible. (&amp;quot;FDecimate&amp;quot; stands for &amp;quot;Free Decimate&amp;quot;, which implies that the output frame rate may be freely chosen, and is not limited to 1-in-N decimation).&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[FDecimate|Plugin]]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FDecimate2]]&lt;br /&gt;
| FDecimate2 is based on FDecimate v1.0.2. FDecimate2, fixes some problems with bugged metrics in FDecimate v1.0.2.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[FDecimate2|Plugin]]&lt;br /&gt;
| {{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[IT]]&lt;br /&gt;
| Inverse Telecine plugin.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[IT|Plugin]]&lt;br /&gt;
| {{Author/thejam79}} / {{Author/minamina}}&lt;br /&gt;
|-&lt;br /&gt;
| [[IVTC_txt60mc|ivtc_txt60mc]]&lt;br /&gt;
| Deinterlaces telecined footage with that has been overlayed scrolling text at 60i.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[IVTC_txt60mc|Script]]&lt;br /&gt;
| {{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
|JIVTC&lt;br /&gt;
|JIVTC applies inverse telecine in a way to minimize artifacts often seen on Japanese TV broadcasts followed by recalculating the fields that might still contain some.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://raw.githubusercontent.com/lovesyk/avisynth-scripts/master/JIVTC.avsi Script]&lt;br /&gt;
|[http://github.com/lovesyk lovesyk]&lt;br /&gt;
|-&lt;br /&gt;
|[[MDec2]]&lt;br /&gt;
|MDec2 is a 2 pass decimating filter, acting much like the MultiDecimate filter.&lt;br /&gt;
|[[RGB32]], [[RGB24]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[MDec2|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| MultiDecimate&lt;br /&gt;
| Removes N out of every M frames, taking the frames most similar to their predecessors. See [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=51901&amp;amp;perpage=20&amp;amp;pagenumber=2 discussion].&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [{{N2Moved}}/multidecimate/multidecimate.html Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| RePal&lt;br /&gt;
|  [http://forum.doom9.org/showthread.php?t=48401 Discussion] / [http://forum.doom9.org/showthread.php?p=1092552#post1092552 repal_29.97Hz_mod]&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/repal_5F25_dll_20030523.zip Plugin] - [http://forum.doom9.org/attachment.php?attachmentid=8028&amp;amp;d=1201414683 Mod]&lt;br /&gt;
| Bach&lt;br /&gt;
|-&lt;br /&gt;
| [[Decomb]]&lt;br /&gt;
| The Telecide and Decimate filters can be combined to implement IVTC.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[Decomb|Plugin]]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=182369 TelecineBob]&lt;br /&gt;
|If your source soffers from field blending, as long as no deinterlacing is made you will find out that conveniently the blended fields are often paired with a clean one. FieldDeBlend takes advantage of that and checks for frames whose fields don't match to replace the frame with a clean one as long there is one.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[https://www.mediafire.com/file/sa1oae96m63mkje/TelecineBob.zip/file Plugin]&lt;br /&gt;
|Ceppo&lt;br /&gt;
|-&lt;br /&gt;
| [[TIVTC]]&lt;br /&gt;
| A package containing these 7 filters: TFM, TDecimate, MergeHints, FrameDiff, FieldDiff, ShowCombedTIVTC, and RequestLinear. Also contains these 3 conditional functions: IsCombedTIVTC, CFieldDiff, and CFrameDiff. Designed primarily for IVTC operations.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[TIVTC|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| TPRIVTC&lt;br /&gt;
| TPRIVTC stands for TMPEG InVerse Telecine, i.e. the process where an 29.97fps interlaced NTSC clip is converted to 23.976fps while removing interlaced frames. [http://web.archive.org/web/20030808191810/http://kurosu.inforezo.org/avs/TPRIVTC/index.html Readme]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/tprivtc_5F25_dll_20040930.zip Plugin]&lt;br /&gt;
| daxab, {{Author/Kurosu}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=167875 WeaveMan]&lt;br /&gt;
| Remove arbitrary pulldown patterns manually; meant for perfectionists to undo non-standard 24-&amp;gt;25 fps, 25-&amp;gt;29.97 fps, etc. telecine conversions, along with other weird telecine anomalies created by broadcasters speeding up film-sourced content. See sample case [http://forum.doom9.org/showthread.php?p=1630931&amp;amp;highlight=weaveman#post1630931 here].&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20131208232913/http://chidragon.thedessie.com/Doom9/WeaveMan-v0.2.zip Plugin]&lt;br /&gt;
| ChiDragon&lt;br /&gt;
|-&lt;br /&gt;
| [[IvtcBlend]]&lt;br /&gt;
| Waka demonstrated an IvtcBlend function that uses the information in the &amp;quot;extra&amp;quot; fields of a telecined source to help combat temporal noise.&lt;br /&gt;
|&lt;br /&gt;
| Script&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ghost Removal ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| FixVHSOversharp&lt;br /&gt;
| FixVHSOversharp attempts to repair the light and dark halos that follow high contrast edges found in VHS sources. See [http://web.archive.org/web/20131014010552/http://www.videohelp.eu/forum/avisynth/2851-avisynth-fixvhsoversharp-beta.html discussion.] &lt;br /&gt;
| | [[YUY2]]&lt;br /&gt;
| [http://web.archive.org/web/20091026142456/http://www.geocities.com/mrtibsvideo/fixvhsoversharp.html Plugin]&lt;br /&gt;
| [http://web.archive.org/web/20091027001215/http://geocities.com/mrtibsvideo/ MrTibs]&lt;br /&gt;
|-&lt;br /&gt;
| [[GhostBuster|Ghostbuster]]&lt;br /&gt;
| A filter for the removal of ghosting.&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [[GhostBuster|Plugin]]&lt;br /&gt;
| {{Author/SansGrip}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LGhost]]&lt;br /&gt;
| Plugin intended for ghost removal but can also reduce edge (ringing) artifacts.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[LGhost|Plugin]]&lt;br /&gt;
| {{Author/minamina}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logo Removal ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AvsInpaint]]&lt;br /&gt;
| This plugin comes with the intention to provide a suit for the removal of logos, whether opaque or transparent. It provides algorithms for these tasks: logo detection, deblending, and logo inpainting.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[AvsInpaint|C-Plugin]]&lt;br /&gt;
| AMSS0815, {{Author/pinterf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeKafka]]&lt;br /&gt;
| This fairly simple filter washes away those annoying bugs from broadcast clips.&lt;br /&gt;
| Any&lt;br /&gt;
| Script&lt;br /&gt;
| poptone&lt;br /&gt;
|-&lt;br /&gt;
| DeLogo&lt;br /&gt;
| DeLogo Filter for VirtualDub. Removes static elements, e.g. logos or watermarks, from the video stream. It can remove either opaque elements or alpha blended, the latter even without destroying the picture beneath. &lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [{{N2Moved}}/delogo132/delogo.html Plugin] &amp;amp; [http://forum.doom9.org/showthread.php?t=119447 Script]&lt;br /&gt;
| Karel Suhajda&lt;br /&gt;
|-&lt;br /&gt;
|[[DelogoHD]]&lt;br /&gt;
|DelogoHD is an overhaul of the original delogo filter, which was originally written by MakKi many years ago. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], &amp;lt;br&amp;gt; 8-16bit planar YUV&lt;br /&gt;
|[[DelogoHD|Plugin]]&lt;br /&gt;
|MeteorRain&lt;br /&gt;
|-&lt;br /&gt;
| [[ExInpaint]]&lt;br /&gt;
| Exemplar-Based Image Inpainting. See [http://forum.doom9.org/showthread.php?t=133773 discussion] &lt;br /&gt;
| [[RGB24]] [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[ExInpaint|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=176860 InpaintDelogo]&lt;br /&gt;
|InpaintDelogo is an advanced logo and watermark removal function using inpainting and deblending with an adjustable fine process to hide artifacts and get best delogo results.&lt;br /&gt;
Can remove opaque, transparent, semi-transparent and some dynamic logos from video.&lt;br /&gt;
|Any&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=176860 Script]&lt;br /&gt;
|VoodooFX&lt;br /&gt;
|-&lt;br /&gt;
| [[InpaintFunc]]&lt;br /&gt;
| Script for logo removal using inpainting. Can remove alpha blended or opaque logos with a basic postprocessing to hide artifacts.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[InpaintFunc|Script]]&lt;br /&gt;
| Reuf Toc&lt;br /&gt;
|-&lt;br /&gt;
| [[rm_logo]]&lt;br /&gt;
| Combination of deblending and inpainting to remove logos with adjustable postprocessing to further hide artifacts. See [http://forum.doom9.org/showthread.php?t=134919]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/Rm_logo.avs Script]&lt;br /&gt;
| Spuds &lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=154559 s_ExLogo]&lt;br /&gt;
|De-logo function with clipping (Dekafka mod).&lt;br /&gt;
|[[YUY2]]&lt;br /&gt;
|[http://www.mediafire.com/download/40cpnnctd0uutpv/s_ExLogo_1.1.zip Script]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Uglarm]]&lt;br /&gt;
| Filter for blurring a logo, using LogoAway style Uglarm Interpolation method.&lt;br /&gt;
| [[RGB24]] [[RGB32]],[[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[Uglarm|Plugin]]&lt;br /&gt;
| {{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[X-Logo]]&lt;br /&gt;
| X-Logo AviSynth plugin and VirtualDub filter. Removes opaque logos.&lt;br /&gt;
| [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[X-Logo|Plugin]]&lt;br /&gt;
| [http://web.archive.org/web/20041204210505/http://members.verizon.net/~vze3kkvm/filters.html Leuf]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Luma Equalization ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[Antiflicker]]&lt;br /&gt;
| &amp;quot;A quick-and-dirty port of my VirtualDub filter (which sucks, by the way; it was one of my first filters).&amp;quot; &lt;br /&gt;
See [http://forum.doom9.org/showthread.php?p=224573#post224573 discussion.]&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/antiflicker_5F25_dll_20030304.zip Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeFlicker]]&lt;br /&gt;
| Can remove old film intensity flicker by temporal mean luma smoothing. Can also correct blinding of automatic gain control after flashes.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], [[YUY2]]&lt;br /&gt;
| [[DeFlicker|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}, {{Author/pinterf}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1326599#post1326599 Dumb Deflicker]&lt;br /&gt;
| Gathers average luma of frames, smoothens that with TemporalSoften, and applies the obtained difference to the original input.  It is pretty simple, read &amp;quot;dumb&amp;quot;. See [http://forum.doom9.org/showthread.php?p=1326599#post1326599 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1326599#post1326599 Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[EquLines]]&lt;br /&gt;
| Equalizes total luminosity in pairs of even and odd lines. Useful for removing inter-line differences from telecined films.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[EquLines|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LMFlicker]]&lt;br /&gt;
| LMFlicker is intended to reduce flickering in some film/VHS transfers. FieldFade is a similar concept, but applied on a per-field basis, to reduce combing in a video where fades were applied after telecine.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[LMFlicker|Plugin]]&lt;br /&gt;
| {{Author/akupenguin}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=159493 Local Deflicker]&lt;br /&gt;
| Deflickers only part of a frame. See [http://forum.doom9.org/showthread.php?t=159493 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=159493 Script]&lt;br /&gt;
| prokhozhijj&lt;br /&gt;
|-&lt;br /&gt;
| [[ReduceFlicker]]&lt;br /&gt;
| Plugin to reduce temporal oscillations.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[ReduceFlicker|Plugin]]&lt;br /&gt;
| {{Author/kassandro}}, {{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TimeLapseDF]]&lt;br /&gt;
| Designed to remove luminosity flicker in time lapse photography. Unlike most other flicker removal filters, utilizes cumulative distribution function in addition to average frame luminosity.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[TimeLapseDF|Plugin]]&lt;br /&gt;
| {{Author/Denis Zhitenev}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Vinverse]]&lt;br /&gt;
| A simple but effective plugin to remove residual combing.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[Vinverse|Plugin]]&lt;br /&gt;
| {{Author/Didée}}, {{Author/tritical}}, {{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=106898 wdeflicker]&lt;br /&gt;
| Modifies luma of a source clip by refering to a temporally super-smoothed clip. Heights of source and reference clips must match. &lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://forum.doom9.org/attachment.php?attachmentid=5417&amp;amp;d=1139174468 Plugin]&lt;br /&gt;
| Osmiridium&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== [[:Category:Rainbow &amp;amp; Dot Crawl Removal|Rainbow &amp;amp; Dot Crawl Removal]] ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[Bifrost]]&lt;br /&gt;
| Bifrost uses temporal blending to remove or at least reduce the effect of rainbows.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Bifrost|Plugin]]&lt;br /&gt;
| {{Author/Myrsloik}}, dubhater&lt;br /&gt;
|-&lt;br /&gt;
| [[CC]]&lt;br /&gt;
| Dot crawl and rainbow removal.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://www.chiyoclone.net/dl/cc_20040522.lzh Plugin]&lt;br /&gt;
| {{Author/chiyo-clone}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Checkmate]]&lt;br /&gt;
| Spatial-temporal dot crawl removal.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Checkmate|Plugin]]&lt;br /&gt;
| {{Author/mf}} / prunedtree&lt;br /&gt;
|-&lt;br /&gt;
| [[ChubbyRain]]&lt;br /&gt;
| Spatial-temporal rainbow reducing script.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/ChubbyRain.avsi Script]&lt;br /&gt;
| Mug Funky&lt;br /&gt;
|-&lt;br /&gt;
| [[ChubbyRain2]]&lt;br /&gt;
| Spatial-temporal rainbow reducing script based on [[ChubbyRain]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/ChubbyRain2.avsi Script]&lt;br /&gt;
| Lothar&lt;br /&gt;
|-&lt;br /&gt;
| [[DeCrawl]]&lt;br /&gt;
| Spatial and temporal dot crawl removal, particularly for animated material.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/decrawl_20060924.zip Plugin]&lt;br /&gt;
| Dan Donovan&lt;br /&gt;
|-&lt;br /&gt;
| [[DeCross]]&lt;br /&gt;
| Cross Color Reduction. Also known as rainbows.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[DeCross|Plugin]]&lt;br /&gt;
| {{Author/minamina}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeDot]]&lt;br /&gt;
| Removes dot crawl and may also be useful for rainbows.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[DeDot|Plugin]]&lt;br /&gt;
| {{Author/thejam79}} / {{Author/minamina}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeRainbow]]&lt;br /&gt;
| A simple script to reduce rainbows. See [http://forum.doom9.org/showthread.php?p=398106#post398106 discussion.]&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://avisynth.nl/images/DeRainbow.avsi Script]&lt;br /&gt;
| sh0dan&lt;br /&gt;
|-&lt;br /&gt;
| [[DFMDeRainbow]]&lt;br /&gt;
| Creates mask to process only edges; rainbows are removed by hitting chroma planes with two passes of FluxSmooth (hence &amp;quot;Double-Flux-Mask&amp;quot;).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/DFMDeRainbow-20140223.avsi Script]&lt;br /&gt;
| {{Author/Scintilla}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=170328 FadeDeRainbow]&lt;br /&gt;
|Another de-rainbowing script.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=170328 Script]&lt;br /&gt;
|bxyhxyh&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/guavacomb.htm GuavaComb]&lt;br /&gt;
| Removes dot crawl, rainbows, and some kinds of shimmering. See [http://forum.doom9.org/showthread.php?t=37456 discussion]&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/guavacomb_5F25_dll_20030801.zip Plugin]&lt;br /&gt;
| {{Author/Lindsey Dubb}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LUTDeCrawl]]&lt;br /&gt;
| Purely spatial; only targets pixels for dot crawl removal if luma is fluctuating and (optionally) chroma is not.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140421001939/http://www.aquilinestudios.org/scripts/LUTDeCrawl-20081003.avsi Script]&lt;br /&gt;
| {{Author/Scintilla}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LUTDeRainbow]]&lt;br /&gt;
| Purely spatial; only targets pixels for derainbowing if chroma is fluctuating and (optionally) luma is not.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140421001939/http://www.aquilinestudios.org/scripts/LUTDeRainbow-20081003.avsi Script]&lt;br /&gt;
| {{Author/Scintilla}}&lt;br /&gt;
|-&lt;br /&gt;
| [[mfRainbow]]&lt;br /&gt;
| Derainbows in areas of high Y, U and V frequencies, which fluctuate heavily.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/MfRainbow-v0.32.avsi Script]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Rainbow_Smooth]]&lt;br /&gt;
| A small spatial derainbow function. It uses [[SmoothUV]] to smooth out chroma and edge masking to prevent color bleeding.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/Rainbow_smooth.avsi Script]&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| [[SmartSSIQ]]&lt;br /&gt;
| SSIQ can alter the color on the entire picture. So this script first applies SSIQ to the entire picture. Then it locates the edges. Finally, it layers ONLY the de-rainbowed edges onto the original video.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/SmartSSIQ.avsi Script]&lt;br /&gt;
| LB&lt;br /&gt;
|-&lt;br /&gt;
| [[SSIQ]]&lt;br /&gt;
| Rainbow remover. A port of the VirtualDub plugin [http://www.doki.ca/filters/ Smart Smoother IQ.]&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB32]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/ssiq_20070304.zip Plugin]&lt;br /&gt;
| {{Author/Myrsloik}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TComb]]&lt;br /&gt;
| A temporal comb filter (it reduces cross-luminance (rainbowing) and cross-chrominance (dot crawl) artifacts in static areas of the picture).&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[TComb|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[YARK]]&lt;br /&gt;
| Yet Another Rainbow Killer. Based on mfRainbow v0.31, chubbyrain2, and various other scripts shown [http://forum.doom9.org/showthread.php?t=141165 here].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[YARK|Script]]&lt;br /&gt;
| jase99&lt;br /&gt;
|-&lt;br /&gt;
| [[ASTDR]]&lt;br /&gt;
| ASTDR uses mt_motion for motion and edge to deal with moving Rainbow and apply mask once more in the opposite way to keep around the lines as they are. It uses DeCross and other filters to remove Rainbow. ASTDRmc avoids chroma bleeding in moving scenes. See [http://forum.doom9.org/showpost.php?p=1665492&amp;amp;postcount=27 post on doom9.org].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[ASTDR|Script]]&lt;br /&gt;
| AmjadSONY&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stabilization ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[CelStabilize]]&lt;br /&gt;
| Script which holds a fixed background steady.  Doesn't work well with pans or fades.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/index.php/CelStabilize Script]&lt;br /&gt;
| mg262&lt;br /&gt;
|-&lt;br /&gt;
| [[DePan]]&lt;br /&gt;
| Tools for estimation and compensation of global motion (pan).&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[DePan|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Depansafe]]&lt;br /&gt;
|Another DePan stabilization script. &lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[DepanSafe|Script]]&lt;br /&gt;
|[http://pastebin.com/u/tophf tophf]&lt;br /&gt;
|-&lt;br /&gt;
| [[Deshaker3D]]&lt;br /&gt;
| Experimental 3D image stabilizer (VDub [http://www.guthspot.se/video/deshaker.htm Deshaker] required).&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [[Deshaker3D|Plugin]]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=172136 SpatialAlign]&lt;br /&gt;
|Fix spatial alignment between two clips containing similar scenes.&lt;br /&gt;
|Any?&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=172136 Script]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
| [[Stab]]&lt;br /&gt;
| Simple but powerful script to remove small high frequency jitter that appears often on old/bad transfers.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Stab|Script]]&lt;br /&gt;
| g-force&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.videohelp.com/threads/371336-Stabilization-Tools-Pack-v1-8 Stabilization Tools Pack]&lt;br /&gt;
| A set of tools to work with common stabilization issues, mainly from telecine process.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.videohelp.com/threads/371336-Stabilization-Tools-Pack-v1-8 Script]&lt;br /&gt;
|{{Author/Dogway}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20151223052321/http://code.google.com/p/avisynthrestoration/wiki/TBC TBC]&lt;br /&gt;
| Stabilizes horizontal jitter in video from analog VCRs, similar to the function of a Time Base Corrector.(note: will cause SEt's Avisynth 2.6 MT to stop working)&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20151223052318/https://code.google.com/p/avisynthrestoration/downloads/list Script]&lt;br /&gt;
| halifaxgeorge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Denoisers ==&lt;br /&gt;
Strength/Quality of Denoisers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(need subclassification)&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AdaptiveMedian]]&lt;br /&gt;
| This is an adaptive Median Filter for eliminating certain types of noise. It uses local statistics (minimum, maximum and median values) of a moving local grid, and changes grid size depending on local statistics.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[AdaptiveMedian|Plugin]]&lt;br /&gt;
|{{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| Atc&lt;br /&gt;
| Alternate Temporal Cleaner; a fast temporal cleaner with some cool stuff.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://ziquash.chez-alice.fr/atc%20beta%201.zip Plugin]&lt;br /&gt;
| {{Author/Marc FD}}&lt;br /&gt;
|-&lt;br /&gt;
| ColourizeSmooth&lt;br /&gt;
| ColourizeSmooth uses a general colourizing algorithm to smooth a given clip. ColourizeSmooth is based on this [http://www.cs.huji.ac.il/~yweiss/Colorization algorithm.] See [http://forum.doom9.org/showthread.php?t=91344 discussion]&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/colourizesmooth_5F25_dll_20050429.zip Plugin]&lt;br /&gt;
| insanedesio&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.kevina.org/temporal_median/ ConditionalTemporalMedian]&lt;br /&gt;
|This filter is designed to remove temporal noise in the form of small dots and streaks found in some videos. A common cause of this is dirty VHS heads but I have also seen small black or white streaks in broadcast material. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.kevina.org/temporal_median/CondTemporalMedian-0.93.zip Plugin]&lt;br /&gt;
| {{Author/Kevin Atkinson}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Deathray]]&lt;br /&gt;
|OpenCL GPU accelerated spatial/temporal non-local means de-noising.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[Deathray|Plugin]]&lt;br /&gt;
|[http://github.com/JawedAshraf Jawed]&lt;br /&gt;
|-&lt;br /&gt;
| [[DeNoise]]&lt;br /&gt;
| This is an adaptive local noise reduction filter. It uses global variance of the noise, local mean and local variance in a moving grid of specified size. It tries to preserve edges as closely as possible. The global variance value can be specified or it can be computed from a window. The global variance can have one value for the entire clip or can vary frame to frame linearly or computed from a window with its coordinates linearly moving with frame numbers.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[DeNoise|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20071105084352/http://www.geocities.com/fredthompson6/Kiraru2002/Kiraru2002sROOM.htm#dnr2 DNR2]&lt;br /&gt;
| Dynamic Noise Reduction 2 is based on the VirtualDub [http://www.shdon.com/vid/dnr DNR] filter by Steve Don and Avery Lee. &lt;br /&gt;
| [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/dnr2_5F25_dll_20021225.zip Plugin]&lt;br /&gt;
| {{Author/kiraru2002}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DeSaltPepper]]&lt;br /&gt;
| Remove white and black noise.&lt;br /&gt;
| Any&lt;br /&gt;
| [[DeSaltPepper|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ExtendedBilateral]]&lt;br /&gt;
| ExtendedBilateral extends the regular bilateral filtering process by adding an &amp;quot;initial estimation preprocess.&amp;quot; It is similar in operation to [[TBilateral]] and offers many of the same options (though not all) while adding the preprocess.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[ExtendedBilateral|Plugin]]&lt;br /&gt;
|insanedesio&lt;br /&gt;
|-&lt;br /&gt;
| [[FFTQuiver]]&lt;br /&gt;
| Remove periodic noise. Useful for analog interference.&lt;br /&gt;
| [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[FFTQuiver|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| SmootherHiQ&lt;br /&gt;
| VirtualDub's ''Smart Smoother High Quality'' for AviSynth, see archived [http://web.archive.org/web/20040611013235/http://cultact-server.novi.dk/kpo/avisynth/smooth_hiq_as.html documentation].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/smoothhiq_5F25_dll_20030208.zip Plugin]&lt;br /&gt;
| {{Author/Sh0dan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TNLMeans]]&lt;br /&gt;
| TNLMeans is an implementation of the NL-means denoising algorithm.&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=171817 TfNLMeans] - an AviSynth 2.6 fork of TNLMeans 1.0.3&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[TNLMeans|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[KNLMeansCL]]&lt;br /&gt;
| KNLMeans is an optimized OpenCL implementation of the Non-local means denoising algorithm.&lt;br /&gt;
| [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[KNLMeansCL|Plugin]]&lt;br /&gt;
| [http://github.com/Khanattila Khanattila]&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=172966 xNLMeans]&lt;br /&gt;
|xNLMeans is an AviSynth plugin implementation of the Non Local Means denoising proposition. This implementation provides several optimizations and extensions over the original proposition and other implementations.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[http://www.mediafire.com/download/4stpv24pvpfclzm/xNLMeans_0.03_20160324.zip Plugin] &amp;lt;!--[http://www.mediafire.com/download/bmldoqgmmboij8n/xNLMeans_0.01_151212.zip older version]--&amp;gt;&lt;br /&gt;
|martin53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Spatial Denoisers ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[_2DCleanYUY2]]&lt;br /&gt;
| Averages pixels in a configurable radius around a source pixel that are within a configurable threshold of the central pixel. A port of the VirtualDub plugin [{{N2Moved}}/2dcleaner.html 2D Cleaner.]&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://dl.dropboxusercontent.com/s/vh7a5xmdpyj3d8u/_2DCleanYUY2_v0_10_mod_for_smp_YV12.zip Plugin]&lt;br /&gt;
| {{Author/kiraru2002}}, {{Author/xeon533}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DctFilter]]&lt;br /&gt;
| An experimental filter that operates on DCT coefficients. &lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[DctFilter|Plugin]]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| [[DCTFun]]&lt;br /&gt;
| A fast spatial denoiser that does a hard thresholding of a complete 4x4 ICT transform.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/index.php/DCTFun Plugin]&lt;br /&gt;
| Prunedtree &lt;br /&gt;
|-&lt;br /&gt;
| eDeen&lt;br /&gt;
| eDeen is a ultra powerfull spatial denoiser for very experienced encoders only.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://ziquash.chez-alice.fr/eDeen%20beta%201.zip Plugin]&lt;br /&gt;
| {{Author/Marc FD}}&lt;br /&gt;
|-&lt;br /&gt;
| [[frfun3b]]&lt;br /&gt;
| Fractal denoising. See [http://forum.doom9.org/showthread.php?t=110200 discussion] &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20080905123941/http://soulhunter.chronocrossdev.com/data/frfun3b_rev3.zip Plugin]&lt;br /&gt;
| prunedtree&lt;br /&gt;
|-&lt;br /&gt;
| [[frfun3d]]&lt;br /&gt;
| Fractal denoising; frfun3d is a quality optimized frfun3b. See [http://forum.doom9.org/showthread.php?t=110200 discussion] &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://dl.dropboxusercontent.com/s/xqxfy59pcv3ea1q/frfun3d_r1.zip Plugin]&lt;br /&gt;
| prunedtree&lt;br /&gt;
|-&lt;br /&gt;
| [[frfun7]]&lt;br /&gt;
| Fractal denoising. See [http://forum.doom9.org/showthread.php?t=110200 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Frfun7|Plugin]]&lt;br /&gt;
| prunedtree&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20101201051903/http://gpubilateral.sourceforge.net/ GPUBilateral]&lt;br /&gt;
| In short, bilateral filter is a edge-preserving smooth filter. See [http://forum.doom9.org/showthread.php?t=136370 discussion.]&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://sourceforge.net/projects/gpubilateral/files/ Plugin]&lt;br /&gt;
| Sompon Virojanadara    &lt;br /&gt;
|-&lt;br /&gt;
|Kuwahara&lt;br /&gt;
|This filter is an edge preserving spatial noise reduction filter. It applies spatial smoothing while preserving the edges. See [http://forum.doom9.org/showthread.php?p=1689773 discussion]&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[http://www.wilbertdijkhof.com/Kuwahara_v11.zip Plugin]&lt;br /&gt;
|{{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MiniDeen]]&lt;br /&gt;
|MiniDeen is a spatial denoising filter. It replaces every pixel with the average of its neighbourhood. This is a port of the &amp;quot;a2d&amp;quot; method from the AviSynth plugin [[Deen]], version beta 2.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], 8-16bit planar YUV in AviSynth+&lt;br /&gt;
|[[MiniDeen|Plugin]]&lt;br /&gt;
|dubhater / MeteorRain&lt;br /&gt;
|-&lt;br /&gt;
| [{{N2Moved}}/msmooth/msmooth.html Msmooth]&lt;br /&gt;
| Masked smoother, designed specifically for anime.&lt;br /&gt;
| [[YV12]], [[RGB32]]&lt;br /&gt;
| [{{N2Moved}}/msmooth/msmooth202.zip Plugin]&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Neo_VagueDenoiser]]&lt;br /&gt;
|Wavelet based Denoiser. Refactored version of the original VagueDenoiser; includes optimizations, additional colorspaces, and high bit depth support.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], 8-16bit planar YUV in AviSynth+&lt;br /&gt;
|[[Neo_VagueDenoiser|Plugin]]&lt;br /&gt;
| HolyWu, [https://github.com/msg7086 MeteorRain]&lt;br /&gt;
|-&lt;br /&gt;
| [[SmoothUV]]&lt;br /&gt;
| A spatial denoising plugin based on [{{N2Moved}}/smooth.html Smart Smoother] and [{{N2Moved}}/hiq/smoothhiq.html Smart Smooth HiQ].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[SmoothUV|Plugin]]&lt;br /&gt;
| {{Author/Kurosu}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SmoothUV2]]&lt;br /&gt;
| SmoothUV2 is a spatial derainbow filter. This filter performs structure-preserving smoothing (blurring) on the U/V (chrominance or colour) information of the image, leaving Y (luminance) intact.  &lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[SmoothUV2|Plugin]]&lt;br /&gt;
| [https://github.com/dubhater dubhater], [https://github.com/Asd-g asd-g]&lt;br /&gt;
|-&lt;br /&gt;
|[[SPresso]]&lt;br /&gt;
|A fast script to make SD content compress better while keeping the &amp;quot;original look&amp;quot;.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showpost.php?p=867316&amp;amp;postcount=23 Script]&lt;br /&gt;
|{{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TBilateral]] &lt;br /&gt;
| TBilateral is a spatial smoothing filter that uses the bilateral filtering algorithm.  It does a nice job of smoothing while retaining picture structure.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[TBilateral|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[UnDot]]&lt;br /&gt;
| UnDot is a simple median filter for removing dots, that is stray orphan pixels and mosquito noise. It clips each pixel value to stay within min and max of its eight surrounding neighbors. See [http://forum.doom9.org/showthread.php?s=&amp;amp;postid=205442#post205442 discussion].&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20130207143129/http://neuron2.net/trbarry/UnDot.zip Plugin]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| [[VagueDenoiser]]&lt;br /&gt;
| This is a Wavelet based Denoiser. Basically, it transforms each frame from the video input into the wavelet domain, using various wavelet filters. Then it applies some filtering to the obtained coefficients.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[VagueDenoiser|Plugin]]&lt;br /&gt;
| {{Author/Lefungus}}, {{Author/Kurosu}}, {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [[VerticalCleaner]]&lt;br /&gt;
| Fast vertical cleaner.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[VerticalCleaner|Plugin]]&lt;br /&gt;
| {{Author/kassandro}}&lt;br /&gt;
|-&lt;br /&gt;
|[[vsMSmooth]]&lt;br /&gt;
|vsMSmooth is a spatial smoother that doesn't touch edges. &lt;br /&gt;
||[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], all planar Y, YUV, and RGB formats,  8 to 16 bit&lt;br /&gt;
|[[vsMSmooth|Plugin]]&lt;br /&gt;
|Dubhater, Asd-g&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Temporal Denoisers ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[Cnr2]]&lt;br /&gt;
| A fast chroma denoiser. Very effective against stationary rainbows and huge analogic chroma activity. Useful to filter VHS/TV caps.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[Cnr2|Plugin]]&lt;br /&gt;
| {{Author/Marc FD}}, {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FluxSmooth]]&lt;br /&gt;
| Examines each pixel and compares it to the corresponding pixel in the previous and last frame.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[FluxSmooth|Plugin]]&lt;br /&gt;
| {{Author/SansGrip}}, {{Author/Sh0dan}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/grapesmoother.htm GrapeSmoother]&lt;br /&gt;
| This filter averages out visual noise between frames.&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/grapesmoother_5F25_dll_20030801.zip Plugin]&lt;br /&gt;
| {{Author/Lindsey Dubb}}&lt;br /&gt;
|-&lt;br /&gt;
| MVDegrain&lt;br /&gt;
| Strong and effective temporal denoiser. Part of the [[MVTools]] package.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[MVTools|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.nl/users/fizick/docs/english/externalfilters/temporalcleaner.htm TemporalCleaner]&lt;br /&gt;
| TemporalCleaner is an AviSynth port of the original port of the VirtualDub filter TemporalCleaner made by [http://home.earthlink.net/~casaburi/download/#temporalcleaner Jim Casaburi.]&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/temporalcleaner_5F25_dll.zip Plugin]&lt;br /&gt;
| vlad59&lt;br /&gt;
|-&lt;br /&gt;
| [[TTempSmooth]] &lt;br /&gt;
| TTempSmooth is a motion adaptive (it only works on stationary parts of the picture), temporal smoothing filter.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://web.archive.org/web/20151125175557/http://bengal.missouri.edu/~kes25c/TTempSmoothv094.zip Plugin]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Temporal Degrain]]&lt;br /&gt;
| SLOW but very effective at removing most grain from video sources.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/TemporalDegrain.avs Script]&lt;br /&gt;
| Didée, Sagekilla &lt;br /&gt;
|-&lt;br /&gt;
| [[TemporalDegrain2]]&lt;br /&gt;
| Temporal Degrain enhanced with parts of QTGMC, potentially slower but more effective at removing grain from video sources while retaining more details.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/TemporalDegrain-v2.avsi Script]&lt;br /&gt;
| Didée, Sagekilla, Vit, real.finder, ErazorTT&lt;br /&gt;
|-&lt;br /&gt;
|[[vsTTempSmooth]]&lt;br /&gt;
|vsTTempSmooth is a motion adaptive (it only works on stationary parts of the picture), temporal smoothing filter. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], all planar Y, YUV, and YUVA (8-32 bit) &lt;br /&gt;
|[[vsTTempSmooth|Plugin]]&lt;br /&gt;
|HolyWu, Asd-g&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Spatio-Temporal Denoisers ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[Convolution3D]]&lt;br /&gt;
| Convolution3D is a spatio-temporal smoother, it applies a 3D convolution filter to all pixels of consecutive frames.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Convolution3D|Plugin]]&lt;br /&gt;
| {{Author/Vlad59}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Deen]]&lt;br /&gt;
| Deen is a set of assembly-optimised denoisers, like various 3d and 2d convolutions.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[Deen|Plugin]]&lt;br /&gt;
| {{Author/Marc FD}}&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMF&lt;br /&gt;
| A fast and accurate denoiser for a Full HD video from a H.264 camera. See [http://forum.doom9.org/showthread.php?t=162603 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web-beta.archive.org/web/20160315085026/http://forum.doom9.org/showthread.php?t=162603 Script]&lt;br /&gt;
| rean&lt;br /&gt;
|-&lt;br /&gt;
| [[dfttest]]&lt;br /&gt;
| A 2D/3D frequency domain denoiser.&lt;br /&gt;
| [[YUY2]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[dfttest|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| dfttestMC&lt;br /&gt;
| A script that motion compensates dfttest. See [http://forum.doom9.org/showthread.php?t=147676 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=147676 Script]&lt;br /&gt;
| thewebchat&lt;br /&gt;
|-&lt;br /&gt;
| [[DeGrainMedian]]&lt;br /&gt;
| Two stage Spatio-Temporal Limited Median filter for grain removal.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[DeGrainMedian|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FFT3DFilter]]&lt;br /&gt;
| A 3D Frequency Domain filter - gives strong denoising and moderate sharpening.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], [[YUY2]], any Y, YUV and Planar RGB 8-32 bit&lt;br /&gt;
| [[FFT3DFilter|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}, martin53, {{Author/pinterf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FFT3DGPU]]&lt;br /&gt;
| Similar algorithm to FFT3DFilter, but uses graphics hardware for increased speed.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], [[YUY2]], Planar RGB 8 bit&lt;br /&gt;
| [[FFT3DGPU|Plugin]]&lt;br /&gt;
| {{Author/tsp}}, {{Author/pinterf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[hqdn3d]] &lt;br /&gt;
| High Quality DeNoise 3D is an Avisynth 2.5 port of the MPlayer filter of the same name. It performs a 3-way low-pass filter, which can completely remove high-frequency noise while minimizing blending artifacts. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[hqdn3d|Plugin]]&lt;br /&gt;
| {{Author/akupenguin}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=174804 mclean]&lt;br /&gt;
|Typical spatial filters work by removing large variations in the image on a small scale, reducing noise but also making the image less sharp or temporally stable. mClean removes noise whilst retaining as much detail as possible, as well as provide optional image enhancement.&lt;br /&gt;
|[[YV12]], [[HBD]]&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=174804 Script]&lt;br /&gt;
|burfadel&lt;br /&gt;
|-&lt;br /&gt;
| [[MC_Spuds]]&lt;br /&gt;
| Motion compensated noise removal with sharpening. Extremely slow, but extremely effective.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[MC_Spuds|Script]]&lt;br /&gt;
| Spuds, {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[MCTemporalDenoise]]&lt;br /&gt;
| Another high quality motion compensated noise removal script with an accompanying post-processing component (with loads of excess feature such as MC-Post-sharpening, MC-antialiasing, deblock, edgeclean and much more)&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[MCTemporalDenoise|Script]]&lt;br /&gt;
| {{Author/LaTo}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/mipsmooth.htm MipSmooth]&lt;br /&gt;
| MipSmooth is a reinvention of [[SmoothHiQ]] and [[Convolution3D]]. MipSmooth was made to enable smoothing of larger pixel areas than 3x3(x3), to remove blocks and smoothing out low-frequency noise. See [http://forum.doom9.org/showthread.php?t=64940 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/mipsmooth_5F25_dll_20051223.zip Plugin]&lt;br /&gt;
| {{author/Sh0dan}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/nomosmooth.htm NoMoSmooth]&lt;br /&gt;
| NoMoSmooth temporally denoises relatively static areas and a spatially denoises moving parts. In addition to this motion-based approach, NoMoSmooth employs another technique to try to retain as much existing detail as possible: only pixels that are &amp;quot;fluctuating&amp;quot; are smoothed. See [http://forum.doom9.org/showthread.php?t=37471 discussion.]&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/nomosmooth_5F25_dll_200309015.zip Plugin]&lt;br /&gt;
| SansGrip&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/peachsmoother.htm PeachSmoother]&lt;br /&gt;
| PeachSmoother was designed to cope with the oddities of analog broadcast TV.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/peachsmoother_5F25_dll_20030801.zip Plugin]&lt;br /&gt;
| {{Author/Lindsey Dubb}}&lt;br /&gt;
|-&lt;br /&gt;
| RemoveDirtMC&lt;br /&gt;
| See [http://forum.doom9.org/showthread.php?p=1485300#post1485300 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/RemoveDirtMC_SE.avsi Script]&lt;br /&gt;
| Nephilis/A.SONY&lt;br /&gt;
|-&lt;br /&gt;
| [[RemoveGrain]]&lt;br /&gt;
| RemoveGrain is a plugin package containing various plugins for spatial and temporal denoising, repairing, sharpening, deinterlacing, and other utility functions.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[RemoveGrain|Plugin]]&lt;br /&gt;
| {{Author/kassandro}}&lt;br /&gt;
|-&lt;br /&gt;
| [[RemoveGrainHD]]&lt;br /&gt;
| RemoveGrainHD is like RemoveGrain but intended for high definition content. It includes various spatial and temporal functions. See [http://web.archive.org/web/20130412014246/http://www.removegrainhd.de.tf/ documentation.]&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[RemoveGrainHD|Plugin]]&lt;br /&gt;
| {{Author/kassandro}}&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| RemoveNoiseMC&lt;br /&gt;
| Motion compensated filter for removing noise, larger spots and other dirt. Written as an alternative to the old Dust. Last update Nov 2006. It uses mvtools v1. Jenyok collected together all RemoveNoise and various filters functions and adapted to MVTools v2.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=110078 Script]&lt;br /&gt;
| Heini011&lt;br /&gt;
|-&lt;br /&gt;
| [[RgTools]]&lt;br /&gt;
| Modern rewrite of &amp;lt;tt&amp;gt;[[RgTools/RemoveGrain|RemoveGrain]]&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;[[RgTools/Repair|Repair]]&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;[[RgTools/BackwardClense|BackwardClense]]&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;[[RgTools/Clense|Clense]]&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;[[RgTools/ForwardClense|ForwardClense]]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;[[RgTools/VerticalCleaner| VerticalCleaner]]&amp;lt;/tt&amp;gt; all in a single plugin. &lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[RgTools|Plugin]]&lt;br /&gt;
| {{Author/tp7}}, {{Author/pinterf}}&lt;br /&gt;
|-&lt;br /&gt;
|[[SMDegrain]]&lt;br /&gt;
|SMDegrain is a convenience function for using MDegrain, including 16bit and interlaced support, with extra capabilities for light sharpening and spatial filtering.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
|[[SMDegrain|Script]]&lt;br /&gt;
|{{Author/Dogway}}&lt;br /&gt;
|-&lt;br /&gt;
|[[STMedianFilter]]&lt;br /&gt;
|STMedianFilter is a (slightly motion compensated) spatial/temporal median filter. It fairly very fine grained, using only adjacent pixels in space and time, so it looks at the adjacent 26 locations to filter each location. &lt;br /&gt;
|[[YUY2]], [[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20130207143129/http://neuron2.net/trbarry/STMedianFilter.zip Plugin]&lt;br /&gt;
|{{Author/Tom Barry}}, {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
|[[STPresso]]&lt;br /&gt;
|A fast script to make SD/720p content compress better without losing detail and original grain structure.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[STPresso|Script]]&lt;br /&gt;
|{{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| zzz_denoise&lt;br /&gt;
| Simple wrapper around a combination of dfttest and MDegrain3. Requires the [[External_filters#Deepcolor_Filters|Dither]] package.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1390594#post1390594 Script]&lt;br /&gt;
| {{Author/cretindesalpes}} &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adjustment Filters ==&lt;br /&gt;
&lt;br /&gt;
=== Averaging/Layering/Masking ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[Average]]&lt;br /&gt;
| A simple plugin that calculates weighted frame-by-frame average from multiple clips. &lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[Average|Plugin]]&lt;br /&gt;
| {{Author/tp7}}, {{Author/mg262}}&lt;br /&gt;
|-&lt;br /&gt;
|[[AviSynthGimpLayer]]&lt;br /&gt;
|AviSynth Gimp-style Layer merge plugin.&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[[AviSynthGimpLayer|Plugin]]&lt;br /&gt;
| [http://sourceforge.net/u/panzerboy66/profile/ panzerboy66]&lt;br /&gt;
|-&lt;br /&gt;
|[[AVS_SoftLight]]&lt;br /&gt;
|AviSynth+ plugin. It makes a softlight blend with a negative of average. Only x64 version available and with CUDA support. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[AVS_SoftLight|Plugin]]&lt;br /&gt;
|Argaricolm&lt;br /&gt;
|-&lt;br /&gt;
| BlockAverage&lt;br /&gt;
| A simple filter that just averages the Y values of each 2x2 pixel block in a YV12 image – U and V values are left alone as they already common to each 2x2 block in a progressive YV12 image. Just made to see if it satisfies the requirements in [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=91580&amp;amp;perpage=10&amp;amp;pagenumber=1 this thread].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20091028073306/http://geocities.com/siwalters_uk/blockaverage01.zip Plugin]&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|-&lt;br /&gt;
|CheckMask&lt;br /&gt;
|A YV12 spatial dot finding filter for AviSynth.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://www.avisynth.nl/users/warpenterprises/files/checkmask_5F25_dll_20050310.zip Plugin]&lt;br /&gt;
|[http://web.archive.org/web/20090618112048/http://kawaii-shoujo.net/AntiAliased/index.html Dan Donovan]&lt;br /&gt;
|-&lt;br /&gt;
|[[ClipBlend]]&lt;br /&gt;
|Filter to blend consecutive frames in a clip. &lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[[ClipBlend|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[ColorScreenMask]]&lt;br /&gt;
|ColorScreenMask is a special effects plugin for processing chroma key (i.e., a green screen or blue screen) backgrounds. It uses color thresholds rather than absolute values as the criteria for setting the alpha channel transparency. &lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[ColorScreenMask|Plugin]]&lt;br /&gt;
|Grandpa Oddball&lt;br /&gt;
|-&lt;br /&gt;
|[[ColourMask]]&lt;br /&gt;
|Creates colour masks.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[ColourMask|Plugin]]&lt;br /&gt;
|{{Author/mg262}}&lt;br /&gt;
|-&lt;br /&gt;
|[[CombMask]]&lt;br /&gt;
|A filter to create and process comb masks. These filters were written from scratch, but most of logic comes from tritical's [[TIVTC]] plugin.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[CombMask|Plugin]]&lt;br /&gt;
|{{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Fusion]]&lt;br /&gt;
|Pyramidal image processing for video, it uses image pyramids to blend clips together (more commonly used in the creation of HDR images and image stitching).&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[Fusion|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GraMaMa]]&lt;br /&gt;
| Gradient Mask Maker: Creates a mask (either a gradient or black/white) given a prescribed shape (such as circle, ellipse, line, square or rectangle).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[GraMaMa|Plugin]]&lt;br /&gt;
| {{author/E-Male}}, &lt;br /&gt;
{{author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://umezawa.dyndns.info/archive/imck/imck-2.3.0-readme.html ImasMultiColorKeying]&lt;br /&gt;
|Chroma keying filter (Japanese)&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[http://umezawa.dyndns.info/archive/imck/ Plugin]&lt;br /&gt;
|Umezawa Takeshi&lt;br /&gt;
|-&lt;br /&gt;
|MaskCrop&lt;br /&gt;
|Non-clip plugin and function to speed up filtering with a mask.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://www.dropbox.com/s/8c4rxlwbs020ib1/MaskCrop0.1.2.7z?dl=1 Plugin] &amp;lt;!--[http://www.dropbox.com/s/98bcjuiy2ojkz75/MaskCrop0.1.1.7z?dl=1 Old v0.1.1 plugin] [http://www.dropbox.com/s/xcrlno31jqavqob/MaskCrop.7z?dl=1 Old v0.1.0 plugin]--&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.videohelp.com/threads/369143-ResizersPack-MasksPack-PlaygroundPack-SmoothContrast-Logo-mod-functions?s=7811fcf9c429ffb99f2e0a4b8043832d&amp;amp;p=2364052&amp;amp;viewfull=1#post2364052 MasksPack]&lt;br /&gt;
|This is a set of functions related to masks, so localized filtering will be able, giving you finer control on how and where to filter or protect certain zones.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://www.mediafire.com/download/mch99c0z5957u9z/MasksPack2.3.zip Script]&lt;br /&gt;
|{{Author/Dogway}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Median]]&lt;br /&gt;
|A filter plugin for AviSynth which generates a pixel-by-pixel median of several clips. This is particularly useful for filtering out noise and glitches from multiple VHS/SVHS/8mm/Hi8 tape captures, but can be used for other purposes also.&lt;br /&gt;
|[[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
|[[Median|Plugin]]&lt;br /&gt;
|{{Author/ajk}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MTCombMask]]&lt;br /&gt;
|This filter produces a mask showing areas that are combed, it uses 3-point sampling to determine combing in a pixel. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], 8-16bit planar Y/YUV/YUVA&lt;br /&gt;
|[[MTCombMask|Plugin]]&lt;br /&gt;
|{{Author/Manao}}, [https://github.com/Asd-g Asd-g]&lt;br /&gt;
|-&lt;br /&gt;
| ParameterisedBlend&lt;br /&gt;
| ParameterisedBlend allows you to blend any number of frames within a clip, or blend any number of different clips together.  You can use it as an extended, gamma-aware replacement for Merge().&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://sites.google.com/site/ourenthusiasmsasham/soft#TOC-ParameterisedBlend Plugin]&lt;br /&gt;
| [http://sites.google.com/site/ourenthusiasmsasham/ PitifulInsect]&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=172388 Polygon]&lt;br /&gt;
|The very raw beginning of a plugin for drawing high quality polygons (mainly to be used as masks) in AviSynth.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=172388 Plugin]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[[RedAverage]]&lt;br /&gt;
|Frame-by-frame averaging/merging of multiple clips. Includes a masked average, weighted average, and a merge filter. &lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[RedAverage|Plugin]]&lt;br /&gt;
|redfordxx&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/jojje/shapemask ShapeMask]&lt;br /&gt;
|A filter plugin for AviSynth that identifies bright areas such as projector screens at conferences and creates a mask out of them. The use case for which it was created is to deal with overly bright lectures, such as screen casts or talks where the speaker or producer hasn't followed presentation 101; Use light text on a dark background! See [http://forum.doom9.org/showthread.php?t=172308 discussion.]&lt;br /&gt;
|[[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20150702103042/http://snarl.zapto.org/files/ShapeMask-1.0.zip Plugin]&lt;br /&gt;
|[http://github.com/jojje jojje]&lt;br /&gt;
|-&lt;br /&gt;
|[[TColorMask]]&lt;br /&gt;
|A simple color masking plugin for AviSynth.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[TColorMask|Plugin]]&lt;br /&gt;
|{{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
|[[TCombMask]]&lt;br /&gt;
|TCombMask is a simple filter that creates a comb map that can (could) be used by other filters.  It currently supports optional motion adaption, optional spatial adaption, optional luma &amp;lt;-&amp;gt; chroma linking, different thresholds for chroma and luma, and much more.&lt;br /&gt;
|[[YUY2]], [[YV12]]&lt;br /&gt;
|[[TCombMask|Plugin]]&lt;br /&gt;
|{{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
|[[TempLinearApproximate]]&lt;br /&gt;
|TempLinearApproximate takes several frames and for each pixel calculates linear approximation of its values through time, then returns its value in the middle (unless close to beginning or end of clip) of that line.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[[TempLinearApproximate|Plugin]]&lt;br /&gt;
|Mystery Keeper&lt;br /&gt;
|-&lt;br /&gt;
|[[TMaskCleaner]]&lt;br /&gt;
|A really simple mask cleaning plugin for AviSynth based on mt_hysteresis.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[TMaskCleaner|Plugin]]&lt;br /&gt;
|{{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TMM]]&lt;br /&gt;
| TMM builds a motion-mask for TDeint, which TDeint uses via its 'emask' parameter.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[TMM|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TMM2]]&lt;br /&gt;
| A rewrite of TMM&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[TMM2|Plugin]]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Unpremultiply]] &lt;br /&gt;
| This plugin convert the input RGBA clip from premultiplied alpha to straight matted alpha.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [[Unpremultiply|Plugin]]&lt;br /&gt;
| [http://web.archive.org/web/20160610124858/http://code.google.com/p/avisynth-unpremultiply/ Josh Sutinen]&lt;br /&gt;
|-&lt;br /&gt;
| [[uu_mt_blend]]&lt;br /&gt;
| ''Blend'' (''[[Overlay]], [[Layer]]'') two clips using [[MaskTools2|MaskTools]]. Wide selection of blend modes.&lt;br /&gt;
| [[YV12]],[[RGB24]],[[RGB32]]&lt;br /&gt;
| [[Media:UU_mt_blend.avs|Script]]&lt;br /&gt;
| rafriff42&lt;br /&gt;
|-&lt;br /&gt;
|[[Watermark2]]&lt;br /&gt;
|Creates a transparent deformation in the video akin to a watermark. The watermark is defined by a black and white image which may be a dynamic image. The intensity of the effect is controlled by several parameters.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[Watermark2|Plugin]]&lt;br /&gt;
|[http://sourceforge.net/u/phillvanleersum/profile/ DrPhill], {{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[YRangeMask]]&lt;br /&gt;
| AviSynth script to create a mask by specifying the range of the brightness. &lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[YRangeMask|Script]]&lt;br /&gt;
| Chikuzen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Blurring ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[https://www.animemusicvideos.org/forum/viewtopic.php?t=101724 BlurMod/ApplyOnAngle]&lt;br /&gt;
|BlurMod() shrinks, blurs, then resizes; resulting in a very strong blur. ApplyonAngle() rotates, filters, then rotates back; making any filter appear as if applied on an angle.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|Script&lt;br /&gt;
|Phantasmagoriat&lt;br /&gt;
|-&lt;br /&gt;
| [[BucketMedian]]&lt;br /&gt;
| BucketMedian is an implementation of spatial median filter adapting bucket (counting) sort algorithm.&lt;br /&gt;
| [[Y8]], [[YV411]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[BucketMedian|Plugin]]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FastBlur]]&lt;br /&gt;
| Fast approximate Gaussian blurs.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[FastBlur|Plugin]]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GBlur]]&lt;br /&gt;
| Gaussian blur.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[GBlur|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MedianBlur]]&lt;br /&gt;
| A plugin with 5 different types of median blur filters.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[MedianBlur|Plugin]]&lt;br /&gt;
| {{Author/tsp}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MedianBlur2]]&lt;br /&gt;
| Implementation of [http://nomis80.org/ctmf.html constant time median filter] for AviSynth 2.6, similar to MedianBlur.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[MedianBlur2|Plugin]]&lt;br /&gt;
| {{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [[VariableBlur]]&lt;br /&gt;
| VariableBlur is a Gaussian, binomial or average blur filter with a variable radius (variance).&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]],&lt;br /&gt;
| [[VariableBlur|Plugin]]&lt;br /&gt;
| {{Author/tsp}}, {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[VariableMedian]]&lt;br /&gt;
| A simple median filter. See [http://forum.doom9.org/showthread.php?t=83985 discussion]&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://web.archive.org/web/20091027134543if_/http://www.geocities.com/siwalters_uk/variablemedian.zip Plugin]&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Borders and Cropping ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[[BorderControl]]&lt;br /&gt;
| It's designed to allow you to manipulate the regions at the top, bottom and sides of a frame. Set a black border, set a border region to be faded out and you can &amp;quot;smear&amp;quot; the border to save having to crop and resize the whole frame for the sake of a few pixels. Each border (top,bottom.left and right) can be manipulated independently. See [http://forum.doom9.org/showthread.php?t=33479 discussion] and [http://avisynth.org.ru/docs/english/externalfilters/bordercontrol.htm documentation].&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20140709005736/http://www.geocities.com/siwalters_uk/bordercontrol14.zip Plugin]&lt;br /&gt;
|{{Author/Simon Walters}}&lt;br /&gt;
|-&lt;br /&gt;
|[[EdgeFixer]]&lt;br /&gt;
|EdgeFixer repairs bright and dark line artifacts near the border of an image. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[[EdgeFixer]]&lt;br /&gt;
|[https://github.com/sekrit-twc sekrit-twc]&lt;br /&gt;
|-&lt;br /&gt;
|[[FillBorders]]&lt;br /&gt;
|This is a simple filter that fills the borders of a clip, without changing the clip's dimensions.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[[FillBorders]]&lt;br /&gt;
|[http://github.com/dubhater dubhater] / Asd&lt;br /&gt;
|-&lt;br /&gt;
|[[FillMargins]]&lt;br /&gt;
|FillMargins is a simple AviSynth filter that fills the four margins of a video clip with the outer pixels of the unfilled portion. It takes integer 4 parameters specifying the size of the left, top, right, and bottom margins. These may be any value and do not have to be any particular multiple. See discussion [http://forum.doom9.org/showthread.php?t=50132 here] and [http://forum.doom9.org/showthread.php?t=55881 here], additional [http://avisynth.org.ru/docs/english/externalfilters/fillmargins.htm documentation]&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20130207143129/http://neuron2.net/trbarry/FillMargins.zip Plugin]&lt;br /&gt;
|{{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| Padding&lt;br /&gt;
| Duplicate edge pixels to the outside with [[PointResize]]. See [http://forum.doom9.org/showthread.php?t=165946 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1596804&amp;amp;postcount=5 Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
|[[AutoCrop]]&lt;br /&gt;
|Automatically crops black borders ([http://en.wikipedia.org/wiki/Letterbox wikipedia:Letterbox], [http://en.wikipedia.org/wiki/Pillar_box_%28film%29 wikipedia:Pillar box], [http://en.wikipedia.org/wiki/Windowbox_%28film%29 wikipedia:Windowbox]) from a clip. Operates in preview mode (overlays the recommended cropping information) or cropping mode. Can also ensure width and height are multiples of specified numbers. See original [http://forum.doom9.org/showthread.php?t=37204 discussion] and updated AutoCrop [http://forum.doom9.org/showthread.php?t=87602 discussion]&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://len0x.leffe.dnsalias.com/autocrop12.zip Plugin]&lt;br /&gt;
| [http://web.archive.org/web/20050404182221/http://www.videofringe.com/autocrop/ Glenn Bussell], len0x&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/slavanap/ssifSource CropDetect]&lt;br /&gt;
| Plugin to detect black bounding box in video and crop it easily. See [http://forum.doom9.org/showthread.php?p=1761842#post1761842 discussion]. Note, CropDetect small plugin merged within ssifSource project. Look for &amp;quot;CropDetect&amp;quot; function in Sub3D.dll&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[https://github.com/slavanap/ssifSource/releases plugin]&lt;br /&gt;
|[http://github.com/slavanap slavanap]&lt;br /&gt;
|-&lt;br /&gt;
|[[RoboCrop]]&lt;br /&gt;
| RoboCrop is an automatic cropping solution to crop black borders from video clips, loosely based on (but using no code from) AutoCrop by Glenn Bussell. See [http://forum.doom9.org/showthread.php?t=168053 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://www.mediafire.com/file/krdo0aye4dlvpit/RoboCrop_25%2626_dll_v1-10_20160825.zip Plugin]&lt;br /&gt;
| StainlessS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Colourspace Conversion ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [{{N2Moved}}/autoyuy2/autoyuy2.html AutoYUY2]&lt;br /&gt;
| This filter is correctly converts YV12 to YUY2 without color bias.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Plugin&lt;br /&gt;
| {{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=171786 Cnv2]&lt;br /&gt;
| Universal [[Convert|ConvertTo...()]] wrapper with some additional features. Requires [http://forum.doom9.org/showthread.php?t=147846 GScript]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=171786 Script]&lt;br /&gt;
| martin53&lt;br /&gt;
|-&lt;br /&gt;
| ConvertToYCgCo&lt;br /&gt;
| Converts to the YCgCo colorspace. See [http://forum.doom9.org/showthread.php?t=161736 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://forum.doom9.org/attachment.php?attachmentid=12748&amp;amp;d=1331769022 Plugin]&lt;br /&gt;
| xv&lt;br /&gt;
|-&lt;br /&gt;
| InterleavedConversions&lt;br /&gt;
| Tools for interleaving and de-interleaving 2, 3, and 4-channel data.&lt;br /&gt;
| &lt;br /&gt;
| Script&lt;br /&gt;
| PitifulInsect&lt;br /&gt;
|-&lt;br /&gt;
| ManualColorMatrix&lt;br /&gt;
| Can perform any matrix-based color conversion. See [http://forum.doom9.org/showthread.php?t=161777 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YV24]]&lt;br /&gt;
| [http://forum.doom9.org/attachment.php?attachmentid=12346&amp;amp;d=1309522614 Plugin]&lt;br /&gt;
| xv&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3_resize16]]&lt;br /&gt;
|An advanced script for high quality 16-bit image resizing and colorspace conversion. &lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[http://avisynth.nl/index.php/Nnedi3_resize16 Script]&lt;br /&gt;
|mawen1250&lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|This plugin is a set of filters that offers converting packed(interleaved) formats to planar formats and vice versa.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YUY2]], [[YV16]]&lt;br /&gt;
|[[PlanarTools|Plugin]]&lt;br /&gt;
|{{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| YUY2inRGB&lt;br /&gt;
| A quick filter that stuffs YUY2 into RGB24. See [http://forum.doom9.org/showthread.php?p=639948#post639948 discussion.]&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://trevlac.us/YUY2inRGB.zip Plugin]&lt;br /&gt;
| {{Author/Trevlac}}&lt;br /&gt;
|-&lt;br /&gt;
| YUY2toRGB219&lt;br /&gt;
| Converts YUY2 to studioRGB. With this kind of conversion, luma will not change, meaning no quantization error on luma. See [http://forum.doom9.org/showthread.php?p=639432#post639432 discussion.]&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://trevlac.us/colorCorrection/YUY2toRGB219.zip Plugin] &lt;br /&gt;
| {{Author/Trevlac}}&lt;br /&gt;
|-&lt;br /&gt;
|[[YV12To422]]&lt;br /&gt;
|YV12 to YV16/YUY2 converter for AviSynth 2.6.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[YV12To422|Plugin]]&lt;br /&gt;
|{{Author/Chikuzen}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Effects ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AddGrainC]]&lt;br /&gt;
| Generates film like grain or other effects (like rain) by adding random noise to clip. Noise can be horizontally or vertically correlated causing streaking. Contains AddGrain &amp;amp; AddGrainC &lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]],&lt;br /&gt;
[[Y8]], [[YV411]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[AddGrainC|Plugin]]&lt;br /&gt;
|{{Author/Tom Barry}}, {{Author/Foxyshadis}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{Author/LaTo}}, {{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
| AddStaticGrainM&lt;br /&gt;
| This function adds static grain in dark areas based on a mask.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[AddStaticGrainM_source|Script]]&lt;br /&gt;
| [http://canihaziframe.wordpress.com/2011/02/23/addstaticgrainm/ Daiz]&lt;br /&gt;
|-&lt;br /&gt;
| [http://kvcd.net/sansgrip/avisynth/Blockbuster-readme.html AddNoise/Blockbuster]&lt;br /&gt;
| Makes encoder allocate more bits to darker areas, thus eliminating DCT blocks by decreasing the clips compressibility.&lt;br /&gt;
| &lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/blockbuster_5F25_src_20021229.zip Plugin]&lt;br /&gt;
| Ross Thomas&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=87295 AviShader]&lt;br /&gt;
| generic plugin that uses your 3D card's hardware to assist with rendering&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/avishader_5F25_dll_20041228.zip Plugin]&lt;br /&gt;
| Antitorgo&lt;br /&gt;
|-&lt;br /&gt;
| [[ColorLooks]]&lt;br /&gt;
| This plugin is based on Trev's VDub filter Colorlooks and Donald Graft's Colorize (well it works a bit similar). I also added some new stuff. The plugin contains the following filters: Technicolor, Colorize, Sepia and Posterize.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[ColorLooks|Plugin]]&lt;br /&gt;
| {{author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=170732 crt_display]&lt;br /&gt;
| CRT emulation with scanline and phosphor effects. crt_display emulates a CRT display using aperture grille (Trinitron) or Cromaclear technologies. See [http://forum.doom9.org/showthread.php?t=170732 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=170732 Script]&lt;br /&gt;
|{{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
| [[EffectsMany]]&lt;br /&gt;
| Creates 34 types of special &amp;quot;animated&amp;quot; effects. Effects act on the input clip in the range of the frame numbers specified. The Audio is not affected.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[EffectsMany|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[EffectsPlus]]&lt;br /&gt;
| '''AviSynth+ only'''. Creates 26 types of special &amp;quot;animated&amp;quot; effects. Effects act on the input clip in the range of the frame numbers specified. The Audio is not affected.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[HBD]] colorspaces&lt;br /&gt;
| [[EffectsPlus|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[f3kgrain]]&lt;br /&gt;
| Another 8/16-bit luma adaptive grain generator.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [http://web.archive.org/web/20131111114900/http://www.nmm-hd.org/upload/get~ElhZlazJbsQ/f3kgrain_v0.4.avsi Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Fingerprint]]&lt;br /&gt;
|Video fingerprint filter. &lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[Fingerprint|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GNoise]]&lt;br /&gt;
| Adds random noise to a clip. See [http://forum.doom9.org/showthread.php?p=841700#post841700 duscussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20080905123941/http://soulhunter.chronocrossdev.com/data/gnoise_r5.zip Plugin]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GrainFactory3]]&lt;br /&gt;
| Noise generator that tries to simulate the behavior of silver grain on film. See [http://forum.doom9.org/showthread.php?t=141303 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[GrainFactory3|Script]]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GrainFactory3mod]]&lt;br /&gt;
| Luma adaptive grain generating filter in 8-bit precision. Based on Didée's [[GrainFactory3]] script.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140722190952/http://www.nmm-hd.org/upload/get~kvNvGpuyxfc/GrainFactory3mod_v1.2.avsi Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GrainFactoryLite]]&lt;br /&gt;
| Luma adaptive grain generating filter with stacked 16-bit input/output support. Based on Didée's [[GrainFactory3]] script, processing in 16-bit precision, and some commonly unused parameters removed.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140722185917/http://www.nmm-hd.org/upload/get~FaqsQaMom9s/GrainFactoryLite_v1.2.avsi Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/HollywoodSq/HollywoodSq.html HollywoodSQ]&lt;br /&gt;
| Creates popup album, akin to Hollywood squares TV show&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://avisynth.nl/users/vcmohan/HollywoodSq/HollywoodSq.html Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| KenBurnsEffect&lt;br /&gt;
| Given clip, zooms, pans &amp;amp; rotates clip. See [http://en.wikipedia.org/wiki/Ken_Burns_Effect wikipedia:Ken Burns Effect]&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=135776 Script]&lt;br /&gt;
| mikeytown2&lt;br /&gt;
|-&lt;br /&gt;
| [[MPlayerNoise]]&lt;br /&gt;
| Noise Generator ported from MPlayer. See [http://forum.doom9.org/showthread.php?t=84181 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/bergfiltercollection_5F25_dll_20041019.zip Plugin]&lt;br /&gt;
| {{Author/bergi}}&lt;br /&gt;
|-&lt;br /&gt;
| [[NoiseGenerator]]&lt;br /&gt;
| Newer function based off of Blockbuster. Adds random noise to clip.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/noisegenerator_5F25_dll_20050616.zip Plugin]&lt;br /&gt;
| Shubin&lt;br /&gt;
|-&lt;br /&gt;
| [[Scanlines]]&lt;br /&gt;
| Add Scanlines (black horizontal bars) to a video. see [http://en.wikipedia.org/wiki/Scan_line wikipedia:Scan Line]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/scanlines_5F25_dll_20031103.zip Plugin]&lt;br /&gt;
| turulo&lt;br /&gt;
|-&lt;br /&gt;
|[[ShufflessS]]&lt;br /&gt;
|Shuffle spacial columns or rows (1D), or blocks(2D) of frames, or temporal shuffle (frame order), all shuffles Inversable, ie undoable.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], [[HBD]] formats in AviSynth+&lt;br /&gt;
|[[ShufflessS|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[StaticNoiseC]]&lt;br /&gt;
| Generates static grain using the Mersenne Twister random number generator. See [http://www.nmm-hd.org/newbbs/viewtopic.php?f=8&amp;amp;t=118&amp;amp;start=20#p772 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20131228160225/http://www.nmm-hd.org/upload/get~YnWFecZw0Uo/StaticNoiseC20110108b.zip Plugin]&lt;br /&gt;
| histamine&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/sorayuki/TawawaFilter TawawaFilter]&lt;br /&gt;
|An AviSynth plugin to make video in blue color.&lt;br /&gt;
|[[RGB24]]&lt;br /&gt;
|[https://github.com/sorayuki/TawawaFilter/releases/ Plugin]&lt;br /&gt;
|[https://github.com/sorayuki sorayuki]&lt;br /&gt;
|-&lt;br /&gt;
| [[TurnsTile]]&lt;br /&gt;
| Applies mosaic and/or palette effects to a clip.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[TurnsTile|Plugin]]&lt;br /&gt;
| {{Author/Robert Martens}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Field Order ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| PFR&lt;br /&gt;
| Tries to restore the original progressive field order of a movie (or any predominantly filmed material transferred to video) where the field order changes at scene changes in a seemingly random fashion! See [http://forum.doom9.org/showthread.php?t=49815 discussion.]&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [http://web.archive.org/web/20091028073306/http://geocities.com/siwalters_uk/pfravs.html Plugin]&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|-&lt;br /&gt;
| ReverseFieldDominance&lt;br /&gt;
| This filter is intended to reverse the field dominance of [[PAL]] DV video. See [http://forum.doom9.org/showthread.php?t=46765 discussion.]&lt;br /&gt;
| [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://web.archive.org/web/20091028073306/http://geocities.com/siwalters_uk/reversefielddominance.html Plugin]&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Frame Rate Conversion ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AlterFPS]]&lt;br /&gt;
| AlterFPS can be used to speed up or slow down a video by adding or removing fields. It works like the 3:2 pulldown of NTSC film material, except you can choose your new speed. It can also blend frames for progressive frame results, and blend fields like ConvertFPS.&lt;br /&gt;
| Any&lt;br /&gt;
| Script&lt;br /&gt;
| actionman133&lt;br /&gt;
|-&lt;br /&gt;
| [[convert60ito24p]]&lt;br /&gt;
| convert60ito24p converts a 60fps interlaced NTSC Video into a 24fps progressive Video using different blending techniques.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]]&lt;br /&gt;
| Script&lt;br /&gt;
| scharfis_brain&lt;br /&gt;
|-&lt;br /&gt;
|[[FixFPS]]&lt;br /&gt;
|Fix the frames to a more consistent pattern with the help of Matroska Version 2 Timecodes.  Mostly useful for fixing weird framerate from using a third party program to capture (ex. .kkapture with Mupen).  Generally used with the plugin ExactDedup.  It should be noted that FixFPS would try it's best not to lose any frames from the source.  It does this by pushing frames to the next available spot, if possible, but it can cause side effects. See [http://tasvideos.org/forum/viewtopic.php?t=18914 discussion].&lt;br /&gt;
|Any&lt;br /&gt;
|[https://www.mediafire.com/?7bip52hu7v1pps2 Plugin]&lt;br /&gt;
|Aktan&lt;br /&gt;
|-&lt;br /&gt;
| [http://github.com/arkeet/fpsdown/blob/master/README.md FPSDown]&lt;br /&gt;
| This filter reduces the framerate of a video by 1/2, by blending odd and even frames together. However, it does this in a smart way such that in case of duplicate frames, it will do the smart thing to remove unnecessary blurring in the output video.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://github.com/arkeet/fpsdown/blob/master/README.md Plugin]&lt;br /&gt;
| [http://github.com/arkeet/ arkeet]&lt;br /&gt;
|-&lt;br /&gt;
| [[FrameDbl]]&lt;br /&gt;
| FrameDbl will generate extra frames to double the frame rate. It does this using a motion compensated approach to interpolating between frames. See [http://forum.doom9.org/showthread.php?t=56036 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [{{N2Archived}}/trbarry/FrameDbl.zip Plugin]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FrameRateConverter]]&lt;br /&gt;
| FrameRateConverter uses motion interpolation with fine artifact removal.&lt;br /&gt;
| [[YV24]], [[YV16]], [[YV12]], [[Y8]]&lt;br /&gt;
| [[FrameRateConverter|Plugin]]&lt;br /&gt;
| [https://github.com/mysteryx93 MysteryX]&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.spirton.com/uploads/InterFrame/InterFrame2.html InterFrame]&lt;br /&gt;
| Frame rate conversion script. Interframe works very well at converting 24FPS to 60FPS; converts videos to higher frame rates like newer TVs do. Common names are frame doubling, smooth motion, among others. See [http://forum.doom9.org/showthread.php?t=160226 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1486831&amp;amp;postcount=1 Script]&lt;br /&gt;
|{{Author/SubJunk}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.compression.ru/video/frame_rate_conversion/index_en_msu.html MSU_FRC]&lt;br /&gt;
|The filter is intended for video frame rate up-conversion. It increases the frame rate integer times. It allows, for example, to convert a video with 15 fps into a video with 30 fps.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://www.compression.ru/video/frame_rate_conversion/src/msu_frc.zip Plugin]&lt;br /&gt;
|Dmitriy Vatolin, et al.&lt;br /&gt;
|-&lt;br /&gt;
| Motion&lt;br /&gt;
| Fast true-motion motion-compensation functions for AviSynth. [http://forum.doom9.org/showthread.php?t=101859 Discussion], [http://web.archive.org/web/20060103143553/http://people.pwf.cam.ac.uk/mg262/posts/Motion/motion.html Documentation]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://wilbertdijkhof.com/mg262/Motion_v10.zip plugin]&lt;br /&gt;
| mg262&lt;br /&gt;
|-&lt;br /&gt;
| NTSC tools&lt;br /&gt;
| Automatic [[NTSC]] to [[PAL]] conversion with 24p, 30p, 60i detection. See [http://forum.doom9.org/showthread.php?t=114054 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/NTSC_tools.avsi Script]&lt;br /&gt;
| Mug Funky&lt;br /&gt;
|-&lt;br /&gt;
| [[SalFPS3]]&lt;br /&gt;
| A modded version of MotionProtectedFPS for extra protection.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/SalFPS3.avs Script]&lt;br /&gt;
| Mug Funky, {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SickJumps]]&lt;br /&gt;
| Speed ramping, aka time-remapping (smooth speed changes). Processes both video and audio.&lt;br /&gt;
| [[RGB]], [[YUV]]&lt;br /&gt;
| [[SickJumps|Plugin]]&lt;br /&gt;
| {{Author/Robert Martens}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SVPflow]]&lt;br /&gt;
| SVPflow provides fast and high quality GPU accelerated frame rate interpolation.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[SVPflow|Plugin]]&lt;br /&gt;
| [http://www.svp-team.com/wiki/Credits SVP Team]&lt;br /&gt;
|-&lt;br /&gt;
| [http://github.com/gnaggnoyil/tc2cfr tc2cfr]&lt;br /&gt;
| This plugin that can read a timecode file and convert a given video clip in to one with a constant framerate by adding duplicate frames. Note: only supports Matroska V1 timecodes.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://github.com/gnaggnoyil/tc2cfr/releases Plugin]&lt;br /&gt;
| [http://github.com/gnaggnoyil gnaggnoyil]&lt;br /&gt;
|-&lt;br /&gt;
| [[TimecodeFPS]]&lt;br /&gt;
| Converts clip from VFR to CFR.  Timing information from clip is discarded, and matroska v2 timecodes from the timecodes file are used instead.&lt;br /&gt;
| Any&lt;br /&gt;
| [[TimecodeFPS|C-Plugin]]&lt;br /&gt;
| natt&lt;br /&gt;
|-&lt;br /&gt;
| [[VFRtoCFR]]&lt;br /&gt;
| Converts a variable frame rate (VFR) video to a constant frame rate (CFR) video with the help of Matroska Version 2 Timecodes.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[VFRtoCFR|Plugin]]&lt;br /&gt;
| Aktan&lt;br /&gt;
|-&lt;br /&gt;
| [[VfrToCfr]]&lt;br /&gt;
| This plugin converts variable frame rate clips to constant frame rate by introducing null frames.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[VfrToCfr|Plugin]]&lt;br /&gt;
| joyje&lt;br /&gt;
|-&lt;br /&gt;
|[[YFRC]]&lt;br /&gt;
| Yushko Frame Rate Converter - doubles the frame rate with strong artifact detection and scene change detection.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://avisynth.nl/images/YFRC-01dd-10mm-2015yyyy.avsi Script]&lt;br /&gt;
| Oleg Yushko&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Frame Replacement/Range Processing ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[[ApplyEvery]]&lt;br /&gt;
|A collection of AviSynth functions that operate at regular intervals in a clip. &lt;br /&gt;
|&lt;br /&gt;
|[[ApplyEvery|Plugin]]&lt;br /&gt;
|{{Author/stickboy}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://www.avisynth.nl/users/fizick/badframes/badframes.html BadFrames]&lt;br /&gt;
|Replaces given bad frames by neighbors or blend (interpolation). Useful for frames with very large defects. &lt;br /&gt;
|&lt;br /&gt;
|[http://www.avisynth.nl/users/fizick/badframes/badframes20.zip Plugin]&lt;br /&gt;
|{{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
|[[ClipClop]]&lt;br /&gt;
|Clipclop is a simple plugin to replace ranges in a source clip with the same range, from a replacement clip. Supports up to 255 replacement clips, with unlimited number of replacements into output clip.&lt;br /&gt;
|&lt;br /&gt;
|[[ClipClop|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[FrameRepeat]]&lt;br /&gt;
|FrameRepeat() is a simple plugin to select frames to repeat. Requires AviSynth 2.6.&lt;br /&gt;
|&lt;br /&gt;
|[[FrameRepeat|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[FrameSel|FrameSel/FrameRep]]&lt;br /&gt;
|FrameSel() is a simple plugin to select individual frames from a clip. Can select frames numbers by direct arguments to filter, or in a string, or in a command file.&lt;br /&gt;
|&lt;br /&gt;
|[[FrameSel|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=164766 MatchFrames/LocateFrames]&lt;br /&gt;
|MatchFrames, intended for matched frames extraction,LocateFrames, intended to be usable by other scripts to identify matches.&lt;br /&gt;
|&lt;br /&gt;
|[http://www.mediafire.com/folder/hb26mthbjz7z6/StainlessS Script]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[RemapFrames]]&lt;br /&gt;
|A collection of functions to rearrange frames between clips. Remaps the frame indices in a clip or from a second clip as specified by an input text file or by an input string. Efficient alternatives to long chains of &amp;lt;tt&amp;gt;FreezeFrame, DeleteFrame, or ApplyRange&amp;lt;/tt&amp;gt;. &lt;br /&gt;
|&lt;br /&gt;
|[[RemapFrames|Plugin]]&lt;br /&gt;
|{{Author/stickboy}}, {{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Prune]]&lt;br /&gt;
|Prune is a simple plugin to trim() multiple source clips and splice the results into a new clip. Supports up to 256 source clips, with unlimited number of trims/splices into output clip. Prune can fade Audio (to reduce clicks between splices) for supported audio formats. The plugin will do [[AlignedSplice]] only.&lt;br /&gt;
|&lt;br /&gt;
|[[Prune|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Levels and Chroma ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AutoAdjust]]&lt;br /&gt;
| A high quality automatic adjustement filter. It calculates statistics of clip, averages them temporally to stabilize data and uses them to adjust luminance gain &amp;amp; color balance.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[AutoAdjust|Plugin]]&lt;br /&gt;
| {{Author/LaTo}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=173208#post1757661 AutoContrast]&lt;br /&gt;
|Auto contrast adjustment.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=173208#post1757661 Script]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Autolevels]]&lt;br /&gt;
| Improvement of the [[ColorYUV]] filter's autogain feature. It stretches the luma histogram to use the entire specified range, averaging the amount of &amp;quot;gain&amp;quot; over consecutive frames to better handle flashes and to avoid flickering.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[Autolevels|Plugin]]&lt;br /&gt;
| {{Author/frustum}} &amp;amp; Theodor Anschütz &amp;amp; StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[AVSCube]]&lt;br /&gt;
|[[AviSynth+]] plugin to load and apply .cube [http://en.wikipedia.org/wiki/3D_lookup_table 3D LUTs].&lt;br /&gt;
|[[Avisynthplus_color_formats|RGBP16]]&lt;br /&gt;
|[[AVSCube|Plugin]]&lt;br /&gt;
|{{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=16806 AWB]&lt;br /&gt;
| Automatic white balance for real world footage, similar to the known function in digital cameras.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=168062 Script]&lt;br /&gt;
| martin53&lt;br /&gt;
|-&lt;br /&gt;
| [[ChanMix]]&lt;br /&gt;
| Creates a grayscale image from an RGB24 source, it has 3 parameters to specify how much of each color-channel is used.&lt;br /&gt;
| [[RGB24]]&lt;br /&gt;
| [[ChanMix|Plugin]]&lt;br /&gt;
| E-Male&lt;br /&gt;
|-&lt;br /&gt;
| [[ChannelMixer]]&lt;br /&gt;
| Very similar to the ChannelMixer function found in Photoshop. 9 Adjustments are possible, 3 for each color channel.&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[ChannelMixer|Plugin]]&lt;br /&gt;
| Gustaf Ullberg&lt;br /&gt;
|-&lt;br /&gt;
| [https://forum.doom9.org/showthread.php?t=173364 ChromaJig]&lt;br /&gt;
| Automatic Colorization.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1775733#post1775733 Script]&lt;br /&gt;
| MWilson&lt;br /&gt;
|-&lt;br /&gt;
| [[ColorBalance]]&lt;br /&gt;
| Same tool that is found in Gimp &amp;amp; Cinepaint.&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[ColorBalance|Plugin]]&lt;br /&gt;
| Gavino &amp;amp; mikeytown2&lt;br /&gt;
|-&lt;br /&gt;
|[[ColorLooks]]&lt;br /&gt;
| The plugin contains the following filters: Technicolor, Colorize, Sepia and Posterize.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
|[[ColorLooks|Plugin]]&lt;br /&gt;
|{{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[[ColorYUV2]]&lt;br /&gt;
|YUV color adjustment plugin with a graffer. &lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[ColorYUV2|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ColourLike]]&lt;br /&gt;
| Makes a clip look like a 'reference' clip by adjusting each colour mask.&lt;br /&gt;
| [[RGB32]], [[YV12]]&lt;br /&gt;
| [[ColourLike|Plugin]]&lt;br /&gt;
| {{Author/mg262}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ColourWarp]]&lt;br /&gt;
| Smooth remapping of UV colour values using control points for colour correction.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[ColourWarp|Plugin]]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[[DGHDRtoSDR]]&lt;br /&gt;
|[[AviSynth+]] plugin to convert UHD BluRay HDR10 to SDR. (GPU accelerated - CUDA)&lt;br /&gt;
|[[Avisynthplus_color_formats|YUV420P16]]&lt;br /&gt;
|[[DGHDRtoSDR|Plugin]]&lt;br /&gt;
|{{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[[DGPQtoHLG]]&lt;br /&gt;
|[[AviSynth+]] plugin to convert UHD BluRay HDR10 PQ to HDR10 HLG. GPU accelerated - CUDA) &lt;br /&gt;
|[[Avisynthplus_color_formats|YUV420P16]]&lt;br /&gt;
|[[DGPQtoHLG|Plugin]]&lt;br /&gt;
|{{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
|[[DGTonemap]]&lt;br /&gt;
|[[AviSynth+]] plugin for basic Reinhard tonemapping for HDR-&amp;gt;SDR.&lt;br /&gt;
|[[Avisynthplus_color_formats|RGBPS]]&lt;br /&gt;
|[[DGTonemap|Plugin]]&lt;br /&gt;
|{{Author/Donald Graft}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ExpLabo]]&lt;br /&gt;
| ExpLabo is a multi-filters plugin, focused on the non-linear transformation of image color space.&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[ExpLabo|Plugin]]&lt;br /&gt;
| brabbudu&lt;br /&gt;
|-&lt;br /&gt;
|[https://web.archive.org/web/20180916224719/http://mpierce.pie2k.com/pages/211.php Exposure]&lt;br /&gt;
|Exposure function for AviSynth.&lt;br /&gt;
|[[RGB24]]&lt;br /&gt;
|[https://web.archive.org/web/20171023011558if_/http://mpierce.pie2k.com/downloads/exposure.zip Plugin]&lt;br /&gt;
|Matt Pierce&lt;br /&gt;
|-&lt;br /&gt;
| [[FlimsYlevels]]&lt;br /&gt;
| Luma adjustment function to give a more &amp;quot;film-ish&amp;quot; look. (Based on {{Author/Didée}}'s [[Ylevels]]).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| FlimsyFeet &lt;br /&gt;
|-&lt;br /&gt;
|[[GamMac]]&lt;br /&gt;
|Useful to correct color cast on old 8mm films.&lt;br /&gt;
|[[RGB32]], [[RGB24]]&lt;br /&gt;
|[[GamMac|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
|[[GamMatch]]&lt;br /&gt;
|Gamma Matcher; useful to correct bad color clip where there is a better color source of perhaps lower rez available.&lt;br /&gt;
|[[RGB32]], [[RGB24]]&lt;br /&gt;
|[[GamMatch|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GiCocu]]&lt;br /&gt;
| Use GIMP/Photoshop curve files.&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[GiCocu|Plugin]]&lt;br /&gt;
| E-Male&lt;br /&gt;
|-&lt;br /&gt;
|[[GradationCurve]]&lt;br /&gt;
|[[AviSynth+]] plugin that loads Photoshop ACV and GIMP crv curve files. Also can compute the gradation curve through given anchor points. Like what Photoshop and Gimp do in the Curves setting.&lt;br /&gt;
|[[Avisynthplus_color_formats|PlanarRGB, PlanarYUV]]&lt;br /&gt;
|[[GradationCurve|Plugin+Script]]&lt;br /&gt;
|ErazorTT&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=167027#post1629321 Gray_Balance]&lt;br /&gt;
|A gray balance script, which is based on Black/White/Gray balance picker.&lt;br /&gt;
|[[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=167027#post1629321 Script]&lt;br /&gt;
|Kisa_AG&lt;br /&gt;
|-&lt;br /&gt;
| [[HDRAGC]]&lt;br /&gt;
| High Dynamic Range Automatic Gain Control - Increase dynamic range of video clips (enhance shadows). It's &amp;quot;simply&amp;quot; gaining (brightening) dark areas of image without causing blow of highlights. Amount of gain is calculated automatically, but can be influenced by parameters.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[HDRAGC|Plugin]]&lt;br /&gt;
| {{Author/paviko}}&lt;br /&gt;
|-&lt;br /&gt;
|[[HDRTools]]&lt;br /&gt;
|HDR color conversion plugin for AviSynth+.&lt;br /&gt;
|[[RGB32]], [[RGB64]], Planar YUV/RGB (8-16 and 32bit)&lt;br /&gt;
|[[HDRTools|Plugin]]&lt;br /&gt;
|[https://github.com/jpsdr jpsdr]&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=161986 HighlightLimiter]&lt;br /&gt;
| &amp;quot;Darkening highlight&amp;quot;. Works well on over exposed clips. It can also be combined with ContrastMask to create HDR effect&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1522100#post1522100 Script]&lt;br /&gt;
| javlak&lt;br /&gt;
|-&lt;br /&gt;
| [[HistogramAdjust]]&lt;br /&gt;
| Adjusts the histogram of a frame by either equalizing it or by matching with histogram of another image, or with given histogram table of values.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[HistogramAdjust|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Histograms in RGB &amp;amp; CMY]]&lt;br /&gt;
| Similar to Histogram(&amp;quot;levels&amp;quot;) but for RGB and CMY instead of YUV. It also includes a RGB parade color scope.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[Histograms in RGB &amp;amp; CMY|Script]]&lt;br /&gt;
| -Vit-&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/magiblot/HSLTint HSLTint]&lt;br /&gt;
|An [[AviSynth+]] filter for creating monochromatic tints with user-defined hue and saturation.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]] - all bit-depths&lt;br /&gt;
|[https://github.com/magiblot/HSLTint/blob/master/HSLTint.avsi Script]&lt;br /&gt;
|magiblot&lt;br /&gt;
|-&lt;br /&gt;
|[[HSVAdjust]]&lt;br /&gt;
|HSVAdjust/HSLAdjust/HSIAdjust let's you rotate hues, control the strength of color (saturation), or modify the brightness of a clip. The type of brightness depends on the filter. It's value for HSVAdjust, lightness for HSLAdjust or intensity for HSIAdjust.&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[[HSVAdjust|Plugin]]&lt;br /&gt;
|{{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Hue]]&lt;br /&gt;
|This plugin is a port of Donald Graft's VirtualDub [http://rationalqm.us/hue.html Hue] filter.&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[[Hue|Plugin]]&lt;br /&gt;
|{{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=176091 LinearTransformation]&lt;br /&gt;
|This script performs Linear Transformations based on a matrix conversion. Matrices are made by Francesco Bucciantini (FranceBB).&lt;br /&gt;
|[[YV12]], [[YV16]], [[YV24]], [[RGB24]], [[RGB32]], [[RGB32]], [[RGB48]],[[RGBPS]]&lt;br /&gt;
|[https://github.com/FranceBB/LinearTransformation Linear Transformation]&lt;br /&gt;
|[https://forum.doom9.org/member.php?u=219051 FranceBB]&lt;br /&gt;
|-&lt;br /&gt;
|[[MatchHistogram]]&lt;br /&gt;
| Tries to modify the histogram of the input clip to match that of a reference clip. Should be used for analysis only, not for production.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[MatchHistogram|Plugin]]&lt;br /&gt;
| {{Author/LaTo}}&lt;br /&gt;
|-&lt;br /&gt;
| [[OutRange]]&lt;br /&gt;
| A simple function to scan the whole video and output a log file, in which out-of-tv-range frames are logged.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[OutRange|Script]]&lt;br /&gt;
| 06_taro&lt;br /&gt;
|-&lt;br /&gt;
|[[RGBAdapt]]&lt;br /&gt;
|Another RGB color correction plugin, it also also includes a graffer.&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[[RGBAdapt|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
|[[RgbAmplifier]]&lt;br /&gt;
|An AviSynth forensic plugin to amplify color shifts.&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[[RgbAmplifier|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [https://forum.doom9.org/showthread.php?t=181857 SafeColorLimiter]&lt;br /&gt;
| Automatic Clipping to get a broadcast safe output in Limited TV Range.&lt;br /&gt;
| [[Y8]], [[Y10]], [[Y12]], [[Y14]], [[Y16]], [[Y32]], [[YV12]], [[YV411]], [[YUY2]], [[YV16]], [[YV24]]&lt;br /&gt;
| [https://github.com/FranceBB/SafeColorLimiter Script]&lt;br /&gt;
| [http://forum.doom9.org/member.php?u=219051 FranceBB]&lt;br /&gt;
|-&lt;br /&gt;
|[[SelectiveColour]]&lt;br /&gt;
|AviSynth implementation of Photoshop's selective colour adjustment. &lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[SelectiveColour|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SGradation]]&lt;br /&gt;
| SGradation is much like a gamma function, but '2nd order'.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| Script&lt;br /&gt;
| martin53&lt;br /&gt;
|-&lt;br /&gt;
|[[ShowChannels]]&lt;br /&gt;
|Simple plugin whose only function is to display the average Y,U and V values for a YUV frame or R,G, and B for an RGB frame. Also shows accumulated average for all frames visited so far.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[ShowChannels|Plugin]]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ShowOverRange]]&lt;br /&gt;
| Shows illegal &amp;quot;TV range&amp;quot; by painting pixels blue for anything less than 16 and red for anything greater than 235.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[ShowOverRange|Plugin]]&lt;br /&gt;
| {{Author/SAPikachu}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SmoothAdjust]]&lt;br /&gt;
| SmoothAdjust is a set of 5 plugins to make YUV adjustments. These 5 plugins have a smoothing &amp;amp; dithering algorithm to avoid banding issue. SmoothAdjust is [[SmoothLevels|SmoothLevels']] successor. &lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[SmoothAdjust|Plugin]]&lt;br /&gt;
| {{Author/LaTo}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Tint]]&lt;br /&gt;
| Tints the image toward a specified colour.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| actionman133 &lt;br /&gt;
|-&lt;br /&gt;
| [[TweakColor]]&lt;br /&gt;
| Target specific hue and saturation ranges for hue and saturation adjustments.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[TweakColor|Plugin]]&lt;br /&gt;
| {{Author/Trevlac}}&lt;br /&gt;
|-&lt;br /&gt;
| [[VideoScope]]&lt;br /&gt;
| Similar to Histogram(&amp;quot;classic&amp;quot;) but with additional features, it shows waveform monitors and a vectorscope. &lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [[VideoScope|Plugin]]&lt;br /&gt;
| {{Author/Randy French}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1832763#post1832763 VideoTek]&lt;br /&gt;
| VideoTek is a Tektronix-like waveform monitor for AviSynth.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [https://github.com/FranceBB/VideoTek/blob/master/VideoTek.avsi Script]&lt;br /&gt;
| [http://forum.doom9.org/member.php?u=219051 FranceBB]&lt;br /&gt;
|-&lt;br /&gt;
| [[WhiteBalance]]&lt;br /&gt;
| Correct the white balance of a clip with a large degree of control and accuracy over other methods of correcting white balance.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[WhiteBalance|Plugin]]&lt;br /&gt;
| SomeJoe&lt;br /&gt;
|-&lt;br /&gt;
| [[Ylevels]]&lt;br /&gt;
| A simple replacement for Avisynth's internal [[Levels]] command, with a few neat differences.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| Script&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Line Darkening ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| FastLineDarkenMOD&lt;br /&gt;
| Line darkening script. See original [http://forum.doom9.org/showthread.php?t=82125 discussion.] Updated [http://forum.doom9.org/showthread.php?p=1060081#post1060081 script.] Additional [http://forum.doom9.org/showthread.php?p=1023638#post1023638 information.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1060081#post1060081 Script]&lt;br /&gt;
| Vectrangle / {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Hysteria]]&lt;br /&gt;
|Hysteria, a line darkening script by Scintilla.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://pastebin.com/raw/fvDdiV6m Script]&lt;br /&gt;
|Scintilla&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showpost.php?p=993939&amp;amp;postcount=2 LineDarkenToon]&lt;br /&gt;
| LineDarkenToon use the idea of mf_toon (0.5) for linedarken. I wanted a really small fast code like FastLineDarken but with similar output like mf_toon and this is the result.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=993939&amp;amp;postcount=2 Script]&lt;br /&gt;
| MOmonster&lt;br /&gt;
|-&lt;br /&gt;
| [[mfToon]]&lt;br /&gt;
| mfToon darkens cartoon edges. In default operation, it performs line darkening, Xsharpening, and warp sharpening. &lt;br /&gt;
See [http://forum.doom9.org/showthread.php?t=53364 discussion.] Additional information [http://forum.doom9.org/showthread.php?t=125128 here] and [http://forum.doom9.org/showthread.php?t=52066 here]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20090212071718/http://mf.creations.nl/avs/functions/mfToon-v0.52.avs Script]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
|[[proToon]]&lt;br /&gt;
|Line darkening script, used to be known as vmToon and before that mfToon.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://pastebin.com/raw/Aw9En26L Script]&lt;br /&gt;
|TheProfileth&lt;br /&gt;
|-&lt;br /&gt;
| [[SuperToon]]&lt;br /&gt;
| An attempt to optimize/speed up the previous versions of mfToon, vmToon, etc. See [http://forum.doom9.org/showthread.php?t=163987 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=163987 Script]&lt;br /&gt;
| Hadien&lt;br /&gt;
|-&lt;br /&gt;
| [[Toon]]&lt;br /&gt;
| Simple and fast line darkener. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://dl.dropbox.com/s/guk5plphkthdy2f/Toon-v1.1.7z Plugin]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ToonLite]]&lt;br /&gt;
| It's the same as [[Toon]], just without the warpsharp processing..&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20090218093135/http://mf.creations.nl/avs/filters/Toon-v1.0-lite.dll Plugin]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
| [[vmToon]]&lt;br /&gt;
| The successor to mfToon. Darkens lines, thins lines, and does supersampled sharpening all in one, but slow. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/Vmtoon-v0.74.avsi Script]&lt;br /&gt;
| Vectrangle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Resizers ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=181665 AiUpscale]&lt;br /&gt;
|An AviSynth+ implementation of some Super-Resolution Convolutional Neural Networks.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[Avisynthplus_color_formats|plus HBD formats in AVS+]]&lt;br /&gt;
|[https://github.com/Alexkral/AviSynthAiUpscale Script]&lt;br /&gt;
|[https://github.com/Alexkral Alexkral]&lt;br /&gt;
|-&lt;br /&gt;
|[[Anime4KCPP]]&lt;br /&gt;
|Anime4K is a simple high-quality anime upscale algorithm with GPU acceleration support. [[AviSynth+]] x64 only.&lt;br /&gt;
|[[RGB24]], [[YV24]], [[YV16]], [[YV12]]&lt;br /&gt;
|[[Anime4KCPP|Plugin]]&lt;br /&gt;
|TianZerL&lt;br /&gt;
|-&lt;br /&gt;
| [[avsresize]]&lt;br /&gt;
| [http://github.com/sekrit-twc/zimg z.lib] resizers for [[AviSynth+]]. avsresize provides resizing, colorspace and bit depth conversation. &lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], [[Avisynthplus_color_formats|plus HBD formats in AVS+]]&lt;br /&gt;
| [[avsresize|Plugin]]&lt;br /&gt;
| [http://github.com/sekrit-twc sekrit-twc]&lt;br /&gt;
|-&lt;br /&gt;
| [[AreaResize]]&lt;br /&gt;
| An area-average resizer plugin; only use to downscale.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[AreaResize|Plugin]]&lt;br /&gt;
| {{Author/Chikuzen}}, Aktanusa&lt;br /&gt;
|-&lt;br /&gt;
| [[Debicubic]]&lt;br /&gt;
| This filter is designed to reverse the effects of bicubic upsampling.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140622040033/http://rgb.chromashift.org/debicubic%20r2.zip Plugin]&lt;br /&gt;
| Prunedtree&lt;br /&gt;
|-&lt;br /&gt;
| [[Debilinear]]&lt;br /&gt;
| This filter is designed to reverse the effects of bilinear upsampling.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140214021604/http://rgb.chromashift.org/debilinear%20r6.zip Plugin]&lt;br /&gt;
| Prunedtree&lt;br /&gt;
|-&lt;br /&gt;
|[https://gist.github.com/kgrabs/b042214d715176ac9ab563c188995457 Desample]&lt;br /&gt;
|Desampling functions for AviSynth+, replaces DebilinearM and lineart_rpow2. Also includes DeCrossConversionMT which is a replacement for ccc, ccc_720.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[Avisynthplus_color_formats|plus HBD formats in AVS+]]&lt;br /&gt;
|[https://gist.github.com/kgrabs/b042214d715176ac9ab563c188995457 Script]&lt;br /&gt;
|[https://github.com/kgrabs kgrabs]&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?p=1738351#post1738351 edi_rpow2]&lt;br /&gt;
|An improved rpow2 function for nnedi3, nnedi3ocl, eedi3, and eedi2. Requires [http://www.mediafire.com/download/lcbtb7uta4ta5pc/ResizeX_v1.0.avsi ResizeX]&lt;br /&gt;
|[[RGB24]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[http://www.mediafire.com/view/pcmkxaauku375xd/edi_rpow2_v1.0.avsi Script]&lt;br /&gt;
|Desbreko&lt;br /&gt;
|-&lt;br /&gt;
|[[FCBI]]&lt;br /&gt;
|Fast Curvature Based Interpolation.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[[FCBI|Plugin]]&lt;br /&gt;
|{{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [[JincResize]]&lt;br /&gt;
| Jinc (EWA Lanczos) Resampler Plugin for AviSynth/AviSynth+.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[JincResize|Plugin]]&lt;br /&gt;
| innocenat&lt;br /&gt;
|-&lt;br /&gt;
| Lanczosplusv3&lt;br /&gt;
| Very slow, but high quality resizer. See [http://forum.doom9.org/showthread.php?t=136690]&lt;br /&gt;
| &lt;br /&gt;
| Script&lt;br /&gt;
| *.mp4 guy&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3/nnedi3_rpow2|nnedi3_rpow2]]&lt;br /&gt;
| Enlarge images by the powers of 2 using Neural Network New-Edge Directed Interpolation ; nnedi3_rpow2 is a function included in [[nnedi3]].&lt;br /&gt;
|[[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
|[[nnedi3|Plugin]]&lt;br /&gt;
|{{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3ocl/nnedi3x_rpow2|nnedi3x_rpow2]]&lt;br /&gt;
| Enlarge images by the powers of 2 using Neural Network New-Edge Directed Interpolation ; nnedi3x_rpow2 is a script function included in [[nnedi3ocl]].&lt;br /&gt;
|[[RGB24]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[nnedi3ocl|Script and Plugin]]&lt;br /&gt;
|SeT&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3_resize16]]&lt;br /&gt;
|An advanced script for high quality image resizing and colorspace conversion. &lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[http://avisynth.nl/index.php/Nnedi3_resize16 Script]&lt;br /&gt;
|mawen1250 &lt;br /&gt;
|-&lt;br /&gt;
| [[PointSize]]&lt;br /&gt;
| A set of [http://en.wikipedia.org/wiki/Image_scaling pixel art resizers]; Includes Scale2x/3x, LQ2x/3x/4x, HQ2x/3x/4x, xBRZ (2x to 6x).&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [[PointSize|Plugin]]&lt;br /&gt;
| `Orum&lt;br /&gt;
|-&lt;br /&gt;
| [[ResampleHQ]]&lt;br /&gt;
| ResampleHQ provides gamma-aware resizing and colorspace conversion.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [[ResampleHQ|Plugin]]&lt;br /&gt;
| Cory Nelson&lt;br /&gt;
|-&lt;br /&gt;
|[[ResampleMT]]&lt;br /&gt;
|Internaly multi-threaded resampling functions, also includes desampling functions (DeBilinear, DeBicubic,...).&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[Avisynthplus_color_formats|plus HBD formats in AVS+]]&lt;br /&gt;
|[[ResampleMT|Plugin]]&lt;br /&gt;
|[http://github.com/jpsdr jpsdr]&lt;br /&gt;
|-&lt;br /&gt;
|[[Resize8]]&lt;br /&gt;
|&amp;lt;tt&amp;gt;Resize8()&amp;lt;/tt&amp;gt; works just like AviSynth's internal resizers but with some extra features. It had correct chroma placement, optional adaptive anti-ringing algorithm and few other features.  &lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[http://web.archive.org/web/20150911013350/http://www.nmm-hd.org/upload/get~8y1IjaaqvoI/Resize8_v1.2.avsi Script]&lt;br /&gt;
|mawen1250 &lt;br /&gt;
|-&lt;br /&gt;
|ResizeX&lt;br /&gt;
|ResizeX is a wrapper function for AviSynth's internal resizers and Dither_resize16 that corrects for the chroma shift caused by the internal resizers when they're used on horizontally subsampled chroma with MPEG2 placement.&lt;br /&gt;
|[[RGB24]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[http://www.mediafire.com/download/lcbtb7uta4ta5pc/ResizeX_v1.0.avsi Script]&lt;br /&gt;
|Desbreko&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=135735 Seamer]&lt;br /&gt;
| Seam Carving/Liquid Rescale for Content-Aware Image Resizing. See [http://en.wikipedia.org/wiki/Seam_carving wikipedia:Seam Carving]&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://avisynth.nl/users/vcmohan/Seamer/Seamer.html Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|SincResize&lt;br /&gt;
|SincResize is an experimental plugin that uses DCT to perform resizing. See [http://forum.doom9.org/showthread.php?p=953002#post953002 discussion], read on for more information.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://cafxx.strayorange.com/files/SincResize4.7z Plugin]&lt;br /&gt;
|[http://cafxx.strayorange.com/ CAFxX]&lt;br /&gt;
|-&lt;br /&gt;
| [[SimpleResize]]&lt;br /&gt;
| Resizing plugin with 4 filters: SimpleResize, WarpResize, InterlacedResize and InterlacedWarpedResize.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[SimpleResize|Plugin]]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=147117 SplineResize]&lt;br /&gt;
| SplineResize contains two kinds of spline based resizers: The first ones are the (cubic) spline based resizers from Panorama tools: Spline100Resize (using 10 sample points) and Spline144Resize (using 12 sample points) are examples. Other ones are available in AviSynth itself. The second ones are natural cubic splines that use the kernel itself as a spline.&lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://www.wilbertdijkhof.com/SplineResize_v02.zip Plugin]&lt;br /&gt;
| {{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=175945 Unwiden/Widen]&lt;br /&gt;
|Resize filters to unwiden/widen, see discussion. &lt;br /&gt;
|[[RGB32]], [[YV24]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=175945 Plugin]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/sunnyone/Waifu2xAvisynth waifu2x]&lt;br /&gt;
|Single-Image Super-Resolution for anime/fan-art using Deep Convolutional Neural Networks.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[http://github.com/sunnyone/Waifu2xAvisynth/releases Plugin]&lt;br /&gt;
|[http://github.com/sunnyone sunnyone]&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1111789#post1111789 ZoomBox]&lt;br /&gt;
| Replacement for ResizeKAR. Resizes clip Keeping the Aspect Ratio. Can set Source/Target PAR/DAR, option to zoom in/out in order to hide/show black borders.&lt;br /&gt;
| &lt;br /&gt;
| Script&lt;br /&gt;
| mikeytown2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sharpeners ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[aSharp]] &lt;br /&gt;
| Simple unsharp mask filter with optional adaptive sharpening.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[aSharp|Plugin]]&lt;br /&gt;
| {{Author/Marc FD}}&lt;br /&gt;
|-&lt;br /&gt;
|[[AVSShock]]&lt;br /&gt;
|This Shock Filter sharpens edges of images by applying erosions or dilations depending on the sign of the Laplacian (or the so called Haralick-Canny edge detector). &lt;br /&gt;
|[[YUY2]], [[YV12]]&lt;br /&gt;
|[[AVSShock|C-Plugin]]&lt;br /&gt;
|AMSS0815&lt;br /&gt;
|-&lt;br /&gt;
| [[aWarpSharp2]]&lt;br /&gt;
| A modern rewrite of aWarpSharp with several bugfixes and optimizations.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], all planar Y, YUV formats,  8 to 16-bit&lt;br /&gt;
| [[aWarpSharp2|Plugin]]&lt;br /&gt;
| {{Author/SEt}}&lt;br /&gt;
|-&lt;br /&gt;
| [[blah]]&lt;br /&gt;
| Sharpening. See [http://forum.doom9.org/showthread.php?t=155030 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1406843 Script]&lt;br /&gt;
| *.mp4 guy&lt;br /&gt;
|-&lt;br /&gt;
|[[CAS]]&lt;br /&gt;
|Contrast Adaptive Sharpening.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], all planar Y, YUV(A), RGB(A) formats,  8 to 32-bit&lt;br /&gt;
|[[CAS|Plugin]]&lt;br /&gt;
|Asd-g&lt;br /&gt;
|-&lt;br /&gt;
| [[FineSharp]]&lt;br /&gt;
| Small and relatively fast realtime-sharpening function, designed for 1080p, or after scaling 720p -&amp;gt; 1080p during playback (to make 720p look more being like 1080p). See [http://forum.doom9.org/showthread.php?p=1569035#post1569035 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1569035#post1569035 Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LimitedSharpen]]&lt;br /&gt;
| LimitedSharpen can be used like a traditional sharpener, but producing much less artifacts. It can be used as a replacement for the common &amp;quot;resize(x4)-XSharpen-resize(x1)&amp;quot; combo, with very similar results (perhaps even better) - but at least 2 times faster, since it requires much less oversampling.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/LimitedSharpenFaster.avsi Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[LSFmod]]&lt;br /&gt;
| A LimitedSharpenFaster mod with a lot of new features and optimizations. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=142706 Script]&lt;br /&gt;
| {{Author/LaTo}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=173515 MCLS_16]&lt;br /&gt;
|Motion Compensate Limited Sharpen 16bit&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=173515 Script]&lt;br /&gt;
|Motenai Yoda&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=153201 MedSharp]&lt;br /&gt;
|Soft thresholded median sharpening function. See [http://forum.doom9.org/showthread.php?t=153201 discussion].&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=153201 Script]&lt;br /&gt;
|*.mp4 guy &lt;br /&gt;
|-&lt;br /&gt;
| [[MSharpen]]&lt;br /&gt;
| &amp;lt;tt&amp;gt;MSharpen&amp;lt;/tt&amp;gt; is a very simple masked sharpening plugin for AviSynth. This version is a reimplementation of neuron2's old &amp;lt;tt&amp;gt;MSharpen&amp;lt;/tt&amp;gt; plugin.&lt;br /&gt;
| [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[MSharpen|Plugin]]&lt;br /&gt;
| {{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [[NonlinUSM]]&lt;br /&gt;
| Non-linear Unsharp Masking.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1555234&amp;amp;postcount=46 Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[pSharpen]]&lt;br /&gt;
| Performs two-point sharpening to avoid overshoot. See [http://forum.doom9.org/showthread.php?t=172422 discussion].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=172422#post1732663 Script]&lt;br /&gt;
| ilpippo80, colours&lt;br /&gt;
|-&lt;br /&gt;
|[[ReCon]]&lt;br /&gt;
|'''ReCon'''volution - makes things sharp by mixing pixels together. See [http://forum.doom9.org/showthread.php?t=153201 discussion].&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?p=1409582#post1409582 Script]&lt;br /&gt;
|*.mp4 guy &lt;br /&gt;
|-&lt;br /&gt;
| [[SeeSaw]]&lt;br /&gt;
| SeeSaw uses a balance of denoising and sharpening to enhance a clip. The aim is to enhance weak detail without over-sharpening or creating jaggies on strong detail, and produce a result that is temporally stable without detail shimmering.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://avisynth.nl/images/SeeSaw.avs Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| SharpenComplex2&lt;br /&gt;
| Port of MPC-HC's Sharpen Complex 2 to AviSynth. Despite the name, this script is very simple, see [http://forum.doom9.org/showthread.php?t=158385 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[SharpenComplex2_source|Script]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| SSXSharpen&lt;br /&gt;
| Included in SharpTools. Sharpens the picture using [[supersampling]] techniques.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20100120201434/http://mf.creations.nl/avs/functions/SharpTools-v0.3.avs Script]&lt;br /&gt;
| {{Author/mf}}, {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SSSharp]]&lt;br /&gt;
| Also known as Super Slow Sharpen - a very slow, but high quality sharpener. See [http://forum.doom9.org/showthread.php?t=132330 discussion]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1071731 Script]&lt;br /&gt;
| *.mp4 guy&lt;br /&gt;
|-&lt;br /&gt;
| [[TUnsharp]]&lt;br /&gt;
| TUnsharp is a basic sharpening filter that uses a couple different variations of unsharp masking and allows for controlled sharpening based on edge magnitude and min/max neighborhood value clipping.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[TUnsharp|Plugin]]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[UnFilter]]&lt;br /&gt;
| This filter softens/sharpens a clip. It implements horizontal and vertical filters designed to (slightly) reverse previous efforts at softening or edge enhancement that are common (but ugly) in DVD mastering.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[UnFilter|Plugin]]&lt;br /&gt;
| {{Author/Tom Barry}}&lt;br /&gt;
|-&lt;br /&gt;
| [[UnsharpHQ]]&lt;br /&gt;
| A strong and fast unsharp mask with some new features. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[UnsharpHQ|Plugin]]&lt;br /&gt;
| list&lt;br /&gt;
|-&lt;br /&gt;
|[[vsMSharpen]]&lt;br /&gt;
|vsMSharpen is a sharpener that tries to sharpen only edges. This plugin is a port of the VapourSynth plugin MSharpen. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]], all planar Y, YUV, and RGB formats,  8 to 16 bit&lt;br /&gt;
|[[vsMSharpen|Plugin]]&lt;br /&gt;
|Dubhater, Asd-g&lt;br /&gt;
|-&lt;br /&gt;
| [[WarpSharp]]&lt;br /&gt;
| WarpSharp contains these sharpeners: &amp;lt;tt&amp;gt;UnsharpMask, WarpSharp, Xsharpen&amp;lt;/tt&amp;gt;.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[WarpSharp|Plugin]]&lt;br /&gt;
|???, {{Author/seraphy}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Rotation/Shear/Skew/Perspective ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[DeBarrel]]&lt;br /&gt;
| Remove barrel and pincushion distortion, where straight lines appear curved.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]]&lt;br /&gt;
| [[DeBarrel|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Defish]]&lt;br /&gt;
|Barrel and pincushion distortion correction filter.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[Defish|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=171922 Defish Different Projections]&lt;br /&gt;
|Defish with different map projections, like Lambert Cylindrical Equal Area, Mercator and Miller projections.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=171922 Script]&lt;br /&gt;
|Kisa_AG&lt;br /&gt;
|-&lt;br /&gt;
| [[FTurn]]&lt;br /&gt;
| Fast implementation of [[TurnLeft]](), [[TurnRight]]() and [[Turn180]]() AviSynth functions.&lt;br /&gt;
| [[Y8]], [[YV12]],[[YV24]]&lt;br /&gt;
| [[FTurn|Plugin]]&lt;br /&gt;
| {{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=165978 Quad]&lt;br /&gt;
|An Avisynth plugin to perform quadrilateral transformations. Quad is now superseded by [[warp]].&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[http://horman.net/quad.zip Plugin] -- [http://forum.doom9.org/showpost.php?p=1602709&amp;amp;postcount=22 no SSE]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Reform]]&lt;br /&gt;
| Skewed images are corrected or vice versa, useful if video is recorded with slightly incorrectly located camera. Sometimes referred to as perspective correction.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[Reform|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Reformer]]&lt;br /&gt;
| Perspective correction and warping.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[Reformer|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Rotate]]&lt;br /&gt;
| Rotate or shear on any given angle.&lt;br /&gt;
| [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[Rotate|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/Spinner/Spinner.html Spinner]&lt;br /&gt;
| Spinner plugin rotates a frame or selected part of it about the given axis coordinates in floating point precision.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/Spinner/Spinner_2_6.zip Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[[warp]]&lt;br /&gt;
|A collection of geometry correction filters (also includes new version of Quad).&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
|[[warp|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[[xyremap]]&lt;br /&gt;
|xyremap is a filter for remapping pixels using formulae written in [http://en.wikipedia.org/wiki/Reverse_Polish_notation reverse Polish notation].&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[[xyremap|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Zoom]]&lt;br /&gt;
| Zoom, Pan &amp;amp; Rotate Clip. Adds alpha layer to clip.&lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [[Zoom|Plugin]]&lt;br /&gt;
| {{Author/WarpEnterprises}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Subtitling ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AssRender]]&lt;br /&gt;
| Libass-based subtitle renderer. &lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YV24]], [[YV12]], [[Y8]]&lt;br /&gt;
| [[AssRender|C-Plugin]]&lt;br /&gt;
| lachs0r, TheFluff&lt;br /&gt;
|-&lt;br /&gt;
|[[FreeSub]]&lt;br /&gt;
|Subtitle with bdf fonts.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YV24]]&lt;br /&gt;
|[[FreeSub|C-Plugin]]&lt;br /&gt;
|Natt&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/slavanap/ssifSource sub3d]&lt;br /&gt;
|Plugin for rendering subtitles on 3D video with correct depth.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[https://github.com/slavanap/ssifSource/tree/master/Sub3D Sources] [https://github.com/slavanap/ssifSource/releases Binaries][http://forum.doom9.org/showthread.php?t=173143 Discussion] &lt;br /&gt;
|slavanap&lt;br /&gt;
|-&lt;br /&gt;
| [[SubtitleEx]]&lt;br /&gt;
| Similar to the original [[Subtitle]] function but can do more: apply text to range; effects - bold, underline, italic, center, fading, motion, blur, emboss, etc...; alpha channel.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[SubtitleEx|Plugin]]&lt;br /&gt;
|[http://web.archive.org/web/20070821222318/http://mvideo.ddpp.net/eng/index.htm basilik]&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=119390 SUPtext]&lt;br /&gt;
|Overlays SUP-subtitles on a video clip.&lt;br /&gt;
|[[RGB32]], [[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/attachment.php?attachmentid=7846&amp;amp;d=1196858433 Plugin]&lt;br /&gt;
|emmel&lt;br /&gt;
|-&lt;br /&gt;
| [[SupTitle]]&lt;br /&gt;
| Blu-ray PGS .SUP Subtitle Renderer Plugin for AviSynth. See [http://forum.doom9.org/showthread.php?t=148167 discussion] &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [[SupTitle|Plugin]]&lt;br /&gt;
| {{Author/ZachSaw}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/vsfilter.htm VSFilter]&lt;br /&gt;
| Supported Subtitle Formats: VOBsub (.sub/.idx), SubStation Alpha/Advanced SubStation Alpha (.ssa/.ass), SubRip (.srt), MicroDVD (.sub), SAMI (.smi), PowerDivX (.psb), Universal Subtitle Format (.usf), Structured Subtitle Format (.ssf). See [http://en.wikipedia.org/wiki/VSFilter]&lt;br /&gt;
| &lt;br /&gt;
| [http://sourceforge.net/project/showfiles.php?group_id=205650&amp;amp;package_id=246121&amp;amp;release_id=541232 Plugin]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[VSFilterMod]]&lt;br /&gt;
| VSFilterMod is modification of original VSFilter subtitle renderer by Gabest. This mod brings up new features and some minor bugfixes. &lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YV12]]&lt;br /&gt;
| [[VSFilterMod|Plugin]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|[[xy-VSFilter]]&lt;br /&gt;
|High performance VSFilter compatible subtitle filters.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[YV12]]&lt;br /&gt;
|[[xy-VSFilter|Plugin]]&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Transitions ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| DissolveAGG&lt;br /&gt;
| Wipe Transition with a soft edge. See [http://forum.doom9.org/showthread.php?t=118016 discussion]. &lt;br /&gt;
'''Note:''' There exist multiple variants of the script as the result of the interaction between authors in that discussion.&lt;br /&gt;
| &lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=900674#post900674 Script (v1)], [http://forum.doom9.org/showthread.php?p=1152440#post1152440 Script (v2)], [http://forum.doom9.org/showthread.php?p=1152632#post1152632 Script (v3)] &lt;br /&gt;
| {{Author/zemog}}, {{Author/mikeytown2}}, {{Author/Gavino}} and others&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=62277 JDL_MaskTransition]&lt;br /&gt;
| Combines two clips using the specified mask clip.  The audio tracks are blended during the transition. About any transition can be made with this function.&lt;br /&gt;
| &lt;br /&gt;
| [http://avisynth.nl/users/stickboy/jdl-effects.avsi Script]&lt;br /&gt;
| {{Author/stickboy}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TransAll]]&lt;br /&gt;
| Around 150 distinct transitions can be created with this plugin. &lt;br /&gt;
| [[RGB]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[TransAll|Plugin]]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Transition_AlbertGasset|Transition (Albert Gasset)]]&lt;br /&gt;
| Various wipe and random block modes. Has 19 built in patterns or it can use an external file.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[Transition_AlbertGasset|C-Plugin]]&lt;br /&gt;
| {{Author/Albert Gasset}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Transition_Shubin|Transition (Shubin)]]&lt;br /&gt;
| Contains 2 transition modes: circle and line.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[Transition_Shubin|Plugin]]&lt;br /&gt;
| {{Author/shubin}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other Filters ==&lt;br /&gt;
&lt;br /&gt;
=== Debugging/Diagnostic Filters ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| AVInfo&lt;br /&gt;
| AVIInfo gives information about the streams in the clip without loading any frames. filename can be a WAV file or an AVI file with several audio streams (it won't open AVI files with embedded subtitles though). It will return the info as a string. &lt;br /&gt;
| &lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/avinfo_5F25_dll_20050417.zip Plugin]&lt;br /&gt;
| trevlac, wilbert &lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=174797 AVSMeter]&lt;br /&gt;
| AVSMeter is a CLI (command line interface) tool which measures the speed/efficiency of Avisynth scripts and checks if Avisynth and its plugin sub-system are set up and working correctly. Documentation for usage and features is included in the distribution package.&lt;br /&gt;
|&lt;br /&gt;
| Command line executable&lt;br /&gt;
| Groucho2004&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=176079 Avisynth Info Tool]&lt;br /&gt;
| This program performs a thorough test of your Avisynth installation and associated plugins, checking if external dependencies are installed, etc.&lt;br /&gt;
|&lt;br /&gt;
| Windows application with graphical user interface&lt;br /&gt;
| Groucho2004&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=173259 avsr]&lt;br /&gt;
|CLI (command line interface) tool which simply executes an Avisynth script. This is useful when, for example, you want to write an image sequence to the disk by using &amp;quot;ImageWriter&amp;quot;.&lt;br /&gt;
|&lt;br /&gt;
| Command line executable&lt;br /&gt;
| Groucho2004&lt;br /&gt;
|-&lt;br /&gt;
|[[Butteraugli]]&lt;br /&gt;
|Butteraugli is an estimating filter for the psychovisual similarity of two images.&lt;br /&gt;
|[[RGBP8]]&lt;br /&gt;
|[[Butteraugli|Plugin]]&lt;br /&gt;
|{{Author/Asd-g}}&lt;br /&gt;
|-&lt;br /&gt;
|[[ColorDiff]]&lt;br /&gt;
|ColorDiff makes a greyscale (Y8) frame according to the input frame's pixels' &amp;quot;distance&amp;quot; from a specified color. The diff is calculated by simply getting the diff of the individual color components from the desired color's components and summing them up. Also, weights can be set for the individual diffs.&lt;br /&gt;
|[[RGB32]], [[RGB24]], [[YUY2]], [[YV12]] &lt;br /&gt;
|[[ColorDiff|C-Plugin]]&lt;br /&gt;
|Ignus2&lt;br /&gt;
|-&lt;br /&gt;
| [[DumpPixelValues]]&lt;br /&gt;
| Samples the colors from selected pixels for every frame in a video source and outputs the data to a text or binary file. See [http://www.theneitherworld.com/mcpoodle/Tools/DumpPixelValues.html homepage.]&lt;br /&gt;
| [[RGB32]], [[YUY2]]&lt;br /&gt;
| [http://www.theneitherworld.com/mcpoodle/Tools/DumpPixelValues.zip Plugin]&lt;br /&gt;
| [http://www.theneitherworld.com/mcpoodle/Tools/index.html McPoodle]&lt;br /&gt;
|-&lt;br /&gt;
|[[FFTSpectrum]]&lt;br /&gt;
|FFTSpectrum is a filter that displays the FFT frequency spectrum of a given clip.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[FFTSpectrum|Plugin]]&lt;br /&gt;
|{{Author/Asd-g}}&lt;br /&gt;
|-&lt;br /&gt;
|[[GrainEvaluate]]&lt;br /&gt;
| A script to analyze and log the strength of grain for each frame. See [http://forum.doom9.org/showthread.php?t=167455 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|[http://www.nmm-hd.org/upload/get~-eJfUjEXJY4/GrainEvaluate.avsi Script]&lt;br /&gt;
|{{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showpost.php?p=1462931&amp;amp;postcount=81 Glitch Analyzer]&lt;br /&gt;
| Glitch Analyzer generates a diagnostic video, then analyzes the recorded version of it, to detect swapped, dropped, or repeated fields.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1467907#post1467907 Script]&lt;br /&gt;
| jmac698&lt;br /&gt;
|-&lt;br /&gt;
| [[Grid]]&lt;br /&gt;
| Overlays a grid, useful for pixel counting.&lt;br /&gt;
| Any&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/Grid/Grid.zip Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Info2]]&lt;br /&gt;
| A faster, prettier alternative to info().&lt;br /&gt;
|Any&lt;br /&gt;
|[[Info2|Plugin]]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[[KPassFilterCL]]&lt;br /&gt;
|KPassFilterCL is a set of tools in the frequency domain.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[KPassFilterCL|Plugin]]&lt;br /&gt;
|[http://github.com/Khanattila Khanattila ]&lt;br /&gt;
|-&lt;br /&gt;
|[[MaxCLLFind]]&lt;br /&gt;
| PQ HDR Analyzer plugin for [[AviSynth+]], analyzes MaxCLL and MaxFALL and writes it to a text file.&lt;br /&gt;
|[[RGB64]]&lt;br /&gt;
|[[MaxCLLFind|Plugin]]&lt;br /&gt;
|Tom Arrow&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20160610124531/http://code.google.com/p/avisynthrestoration/wiki/Measure Measure]&lt;br /&gt;
| Measures luminence of greyscale bars and prints results on-screen.  Can be used to set brightness/contrast in capture settings accurately.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20151223052318/https://code.google.com/p/avisynthrestoration/downloads/list Script]&lt;br /&gt;
| halifaxgeorge&lt;br /&gt;
|-&lt;br /&gt;
|[[Pixelscope]]&lt;br /&gt;
|This debugging filter displays individual pixel values.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YUY2]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=175688 Plugin]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/lcferrum/segment-display-ocr SegmentDisplayOCR]&lt;br /&gt;
|SegmentDisplayOCR is a seven-segment display recognition filter for AviSynth. It has built in logging functionality (it will log frame recognition results) and also can be used in AviSynth conditional filters. The main purpose of this filter is to process readings of various digital instruments (e.g. digital multimeters) captured on video. So if your favourite instrument lacks interface for connecting it to PC you can capture it's readings on cam and convert them to computer readable format with SegmentDisplayOCR filter.&lt;br /&gt;
| [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[http://sourceforge.net/projects/segmentdisplayocr/files/SegmentDisplayOCR/ Plugin]&lt;br /&gt;
|[http://github.com/lcferrum lcferrum]&lt;br /&gt;
|-&lt;br /&gt;
|[[SSIM]]&lt;br /&gt;
|A filter that compute an objective video quality metric between two videos. Based on SSIM work from [http://web.archive.org/web/20060515090025/http://www.cns.nyu.edu/~zwang/files/research/ssim/index.html Zhou Wang]. It has been created with the help of Mfa.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[[SSIM|Plugin]]&lt;br /&gt;
|[http://web.archive.org/web/20060507012947/http://perso.wanadoo.fr/reservoir/ Lefungus]&lt;br /&gt;
|-&lt;br /&gt;
| [[ShowPixelValues]]&lt;br /&gt;
| This filter displays the actual Y U and V (or R G and B) values from pixels within a frame. See [http://forum.doom9.org/showthread.php?t=64192 discussion] and [http://web.archive.org/web/20091028073306/http://geocities.com/siwalters_uk/showpixelvalues.html homepage.]&lt;br /&gt;
| [[RGB32]], [[YUY2]]&lt;br /&gt;
| [http://web.archive.org/web/20091028122947/http://geocities.com/siwalters_uk/showpixelvalues1.4c.zip Plugin]&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=176131 SysInfo]&lt;br /&gt;
|This plugin returns info about OS/CPU*/Memory/Screen/AviSynth.&lt;br /&gt;
|Any&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=176131 Plugin]&lt;br /&gt;
|Groucho2004&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=168241 Timer]&lt;br /&gt;
|AviSynth script to add a highly customizable timer to your video.&lt;br /&gt;
|Any&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=168241 Script]&amp;lt;!-- https://gist.github.com/darealshinji/9770276 --&amp;gt;&lt;br /&gt;
|djcj&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20151223052321/http://code.google.com/p/avisynthrestoration/wiki/Testpatterns Testpatterns]&lt;br /&gt;
| This filter creates a sinewave frequency sweep directly in YV12, useful to measuring video response.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20151223052318/https://code.google.com/p/avisynthrestoration/downloads/list Script]&lt;br /&gt;
| halifaxgeorge&lt;br /&gt;
|-&lt;br /&gt;
| [http://avisynth.org.ru/docs/english/externalfilters/tmonitor.htm TMonitor]&lt;br /&gt;
| TMonitor is a filter very similar to AVSMon. It enables monitoring of an Avisynth clip via previewing the video, viewing clip information (such as video width, height, colorspace, number of frames, audio samples, sample rate, number of audio channels, and more), and adjusting the audio delay. It also supports multiple instances per script, allowing viewing of differences between different parts of a processing chain.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20151125175557/http://bengal.missouri.edu/~kes25c/TMonitorv094.zip Plugin]&lt;br /&gt;
|{{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=53238 ViewFields/UnViewFields]&lt;br /&gt;
| [http://web.archive.org/web/20140709004333/http://www.geocities.com/siwalters_uk/unviewfields.html UnViewFields], [http://web.archive.org/web/20140708181324/http://www.geocities.com/siwalters_uk/viewfields.html ViewFields]&lt;br /&gt;
| &lt;br /&gt;
| Plugin&lt;br /&gt;
| {{Author/Simon Walters}}&lt;br /&gt;
|-&lt;br /&gt;
|[[VMAF]]&lt;br /&gt;
|VMAF is a perceptual video quality assessment algorithm developed by Netflix. &lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]],&amp;lt;br&amp;gt; 8-16bit planar YUV&lt;br /&gt;
|[[VMAF|Plugin]]&lt;br /&gt;
|{{Author/Asd-g}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Comptest]]&lt;br /&gt;
| The script Compressibility test can be used for a compressibility test on a clip.&lt;br /&gt;
|&lt;br /&gt;
| Script&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[SeeTheDifference]]&lt;br /&gt;
| SeeTheDifference just makes the difference visible between an encoded and an original videoclip. So you can see what you really &amp;quot;lose&amp;quot; when encoding a video.&lt;br /&gt;
|&lt;br /&gt;
| Script&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Edge Detection ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[aWarpsharp2/aSobel|aSobel]]&lt;br /&gt;
| Sobel edge dectecion filter included in [[aWarpSharp2]]. &lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[aWarpSharp2| Plugin]]&lt;br /&gt;
| {{Author/SEt}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2/Mt edge| mt_edge]]&lt;br /&gt;
| Edge detection filter included in [[MaskTools2]].&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [[MaskTools2|Plugin]]&lt;br /&gt;
| {{Author/Manao}}&lt;br /&gt;
|-&lt;br /&gt;
|[[scharr]]&lt;br /&gt;
|Edge detection using the [https://en.wikipedia.org/wiki/Sobel_operator#Alternative_operators Scharr operator].&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[scharr|Script]]&lt;br /&gt;
|zorr &lt;br /&gt;
|-&lt;br /&gt;
| [[tcanny]]&lt;br /&gt;
| Contains a canny edge detection filter and distance transform filter.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140804144614/http://bengal.missouri.edu/~kes25c/tcanny.zip Plugin]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TCannyMod]]&lt;br /&gt;
| Canny edge detection filter for Avisynth 2.6. Reimplementation of tcanny. See [http://forum.doom9.org/showthread.php?t=168449  discussion]&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://github.com/chikuzen/TCannyMod/releases/ Plugin]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TEdgeMask]]&lt;br /&gt;
| TEdgeMask creates an edge mask based off gradient vector magnitude.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20151125175557/http://bengal.missouri.edu/~kes25c/TEdgeMaskv09.zip Plugin]&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [[TEMmod]]&lt;br /&gt;
| TEdgeMask modified for Avisynth 2.6. It creates an edge mask using gradient vector magnitude. See [http://forum.doom9.org/showthread.php?t=168390  discussion]&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://github.com/chikuzen/TEMmod/releases Plugin]&lt;br /&gt;
| {{Author/Chikuzen}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Export Filters ===&lt;br /&gt;
&lt;br /&gt;
These filters can write directly to media files. &lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=135928 Immaavs]&lt;br /&gt;
| ImmaWrite uses the ImageMagick libraries to write images. Many formats are supported including animations and multipage files.&lt;br /&gt;
| &lt;br /&gt;
| [http://www.geocities.com/wilbertdijkhof/ Plugin]&lt;br /&gt;
| {{author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=172837 TWriteAVI]&lt;br /&gt;
| Serve AVI file to program requesting it as well as write an avi file. Useful for speeding up 2 pass encodes at the cost of hard drive space. [http://forum.doom9.org/showthread.php?t=172761 Update for AviSynth 2.6]. [http://forum.doom9.org/showthread.php?p=1750415#post1750415 Usage]. [http://forum.doom9.org/showthread.php?p=1073371#post1073371 Old mod by squid_80].&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.mediafire.com/download/84csi0174ettu5l/TWriteAVI_dll_v2.03-20160603.zip Plugin]&amp;lt;!--[http://www.mediafire.com/download/c5iboqi43ijprap/TWriteAVI_dll_v2.02-20160106.zip older version]--&amp;gt;&lt;br /&gt;
| {{Author/tritical}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1403600 Sashimi]&lt;br /&gt;
(function &amp;quot;RawWriter&amp;quot;)&lt;br /&gt;
| Sashimi writes (and reads) almost any regular raw uncompressed data format you can define.  You'll find a fuller description under [[#Source_Filters|Source Filters]].&lt;br /&gt;
| [[RGB]], [[YUY2]],[[YV12]]&lt;br /&gt;
| [http://sites.google.com/site/ourenthusiasmsasham/soft Plugin with scripts]&lt;br /&gt;
| [http://sites.google.com/site/ourenthusiasmsasham/ PitifulInsect]&lt;br /&gt;
|-&lt;br /&gt;
| [[SoundOut]]&lt;br /&gt;
| SoundOut is a GUI driven sound file output module for AviSynth (it exports audio to several compressors).&lt;br /&gt;
| All audio.&lt;br /&gt;
| [[SoundOut|Plugin]]&lt;br /&gt;
| {{Author/Sh0dan}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Import Filters ===&lt;br /&gt;
&lt;br /&gt;
These filters are used to import filters written for other audio and video packages.&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?threadid=92174 FreeFrame]&lt;br /&gt;
| Allows [http://freeframe.sourceforge.net/ freeframe] filters (mostly effects) to be used directly in AviSynth.&lt;br /&gt;
| [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/freeframe_5F25_dll_20050426.zip Plugin]&lt;br /&gt;
| {{Author/Myrsloik}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Meta-Filters ===&lt;br /&gt;
&lt;br /&gt;
These filters are primarily designed to be used with other filters, to restrict or augment their effect.&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[[AVSTP]]&lt;br /&gt;
|A library for multithreaded plug-in development&lt;br /&gt;
|Any&lt;br /&gt;
|[[AVSTP|Plugin]]&lt;br /&gt;
|{{Author/cretindesalpes}}&lt;br /&gt;
|-&lt;br /&gt;
|[[MP_Pipeline]]&lt;br /&gt;
|Run parts of an AviSynth script in external processes.&lt;br /&gt;
|Any&lt;br /&gt;
|[[MP_Pipeline|Plugin]]&lt;br /&gt;
|[http://github.com/SAPikachu/ SAPikachu]&lt;br /&gt;
|-&lt;br /&gt;
| [[MT]]&lt;br /&gt;
| MT is a filter that enables other filters to run multithreaded. This should hopefully speed up processing on hyperthreaded/multicore processors or multiprocessor systems. See [http://forum.doom9.org/showthread.php?t=94996]&lt;br /&gt;
| Any&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/mt_20070301.zip Plugin]&lt;br /&gt;
| tsp&lt;br /&gt;
|-&lt;br /&gt;
| [[MVTools]] &lt;br /&gt;
| MVTools provides filters for estimation and compensation of objects' motion in video clips. Motion compensation may be used for strong temporal denoising, advanced framerate conversions, image restoration and other tasks. See [http://forum.doom9.org/showthread.php?t=131033]&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[MVTools|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=164073 SoraThread]&lt;br /&gt;
|Sora's avs multi-process/multi-thread plugin package&lt;br /&gt;
|Any&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=164073 Plugin]&lt;br /&gt;
|leiming2006&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=154886 ThreadRequest]&lt;br /&gt;
|Yet another plugin for multithread processing. [http://web.archive.org/web/20130124045626/http://lantis.homeunix.org/avisynth.shtml Archive homepage (Japanese)]&lt;br /&gt;
|Any&lt;br /&gt;
|[http://www.mediafire.com/download/4xux7d7l1u3toy8/ThreadRequest+102a.rar Plugin]&lt;br /&gt;
|lantis&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Multipurpose Filters ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=174433 amDCT]&lt;br /&gt;
|amDCT() is an adaptive video filter providing deblocking, sharpening, local range expansion, smoothing, and bright noise removal in a single filter that can be used on video of any level of quality. These four operations work synergistically to drastically reduce block artifacts while maintaining detail and increasing local contrast.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://sites.google.com/site/amdctfilter/ Plugin]&lt;br /&gt;
|jconklin&lt;br /&gt;
|-&lt;br /&gt;
|[[AVExtensions]]&lt;br /&gt;
|Audio-video extensions is a collection of various AviSynth filters used to modify audio or video. &lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[[AVExtensions|Plugin]]&lt;br /&gt;
|nutbread&lt;br /&gt;
|-&lt;br /&gt;
|[[AviSynthShader]]&lt;br /&gt;
|This plugin allows running HLSL pixel shaders within AviSynth. This gives access to various HLSL filters that haven't been programmed in AviSynth.&lt;br /&gt;
|[[RGB32]], [[YV24]], [[YV12]]&lt;br /&gt;
|[[AviSynthShader|Plugin]]&lt;br /&gt;
|[http://github.com/mysteryx93 MysteryX]&lt;br /&gt;
|-&lt;br /&gt;
|[[CLExpr]]&lt;br /&gt;
|AviSynth Expr filter implemented in OpenCL for runtime calculation of expressions on 8 and 16-bit depths clips. Makes mt_lutxy and mt_lutxyz possible on 16-bit.&lt;br /&gt;
|[[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[CLExpr|Plugin]]&lt;br /&gt;
|{{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=166061 HybridFuPP]&lt;br /&gt;
| An adaptive processor, allowing picture cleaning and compressibility gain. Original [http://forum.doom9.org/showthread.php?t=146632 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.mediafire.com/download/6g09aazs4z7m11a/HybridFuPP_0.992b.zip Script]&lt;br /&gt;
| Fupp&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools2]]&lt;br /&gt;
| This plugin provides tools for the creation, enhancement and manipulation of masks for each [[YUV]] component.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]]&lt;br /&gt;
| [[MaskTools2|Plugin]]&lt;br /&gt;
| {{Author/Manao}}, {{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [[MVTools]]&lt;br /&gt;
| This plugin provides a collection of functions for motion estimation and compensation.&lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[MVTools|Plugin]]&lt;br /&gt;
| Various&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Scene Change Detection ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=171624 DBSC]&lt;br /&gt;
|A scene change detection tool set/kit/box (work-in-progress).&lt;br /&gt;
|All&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=171624 Script]&lt;br /&gt;
|{{Author/StainlessS}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=145143 EDLmaker]&lt;br /&gt;
| Simple scenechange detector that writes to EDL file.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=145143 Script]&lt;br /&gt;
| Mug Funky&lt;br /&gt;
|-&lt;br /&gt;
| [[MVTools2/MSCDetection|MSCDetection]]&lt;br /&gt;
| Part of MVTools2; MSCDetection creates a scene detection mask clip from motion vectors data. &lt;br /&gt;
| [[YV12]], [[YUY2]]&lt;br /&gt;
| [[MVTools|Plugin]]&lt;br /&gt;
| {{Author/Fizick}}&lt;br /&gt;
|-&lt;br /&gt;
| SCDetect&lt;br /&gt;
| Detect scene change and output scene change frames to a file.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20140614152525/http://www.nmm-hd.org/upload/get~TfPm2QO4jbk/SCDetect_v0.3.rar Script]&lt;br /&gt;
| {{Author/06_taro}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://akuvian.org/src/avisynth/sclavc/readme.txt SceneChangeLavc]&lt;br /&gt;
| SClavc is an AviSynth plugin intended to allow access to libavcodec's scene-change metrics. See [http://akuvian.org/src/avisynth/sclavc/ homepage.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/scenechangelavc_5F25_dll_20041201.zip Plugin]&lt;br /&gt;
| {{Author/akupenguin}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SCXvid]]&lt;br /&gt;
| SCXvid produces first pass Xvid logs from AviSynth at the equivalent of the default VFW preset. These logs are primarily intended to get scene change information from but may have other uses.&lt;br /&gt;
|  [[YV12]]&lt;br /&gt;
| [http://dl.dropbox.com/s/402hlckyn669p9n/SCXvid-1.1.rar Plugin]&lt;br /&gt;
| {{Author/Myrsloik}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SCXvidMask]]&lt;br /&gt;
| A tiny AviSynth plugin that reads an SCXvid log and creates a binary mask based on it.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://github.com/tp7/SCXvidMask/releases Plugin]&lt;br /&gt;
| {{Author/tp7}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Support filters ===&lt;br /&gt;
&lt;br /&gt;
These filters are primarily designed to augment the creation of custom script-based filters.&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[ApplyInterlacedFilter]]&lt;br /&gt;
| ApplyInterlacedFilter safely processes interlaced video with spatial and temporal filters.&lt;br /&gt;
|&lt;br /&gt;
| Script&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=162874 ArcFuns]&lt;br /&gt;
|This plugin expands the available numerical functions with missing inverse trig functions.&lt;br /&gt;
|N/A&lt;br /&gt;
|[http://forum.doom9.org/attachment.php?attachmentid=12494&amp;amp;d=1319627190 Plugin]&lt;br /&gt;
|{{Author/Gavino}}&lt;br /&gt;
|-&lt;br /&gt;
|[[AvsFilterNet]]&lt;br /&gt;
|The main objective of AvsFilterNet is to provide a wrapper for AviSynth, making it possible to write simple filter in any .Net languages. &lt;br /&gt;
|N/A&lt;br /&gt;
|[[AvsFilterNet|Plugin]]&lt;br /&gt;
|SAPikachu&lt;br /&gt;
|-&lt;br /&gt;
|[[AvsMotion]]&lt;br /&gt;
|AviSynth plugin for animating clips with AAE motion tracking data.&lt;br /&gt;
| [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[AvsMotion|Plugin]]&lt;br /&gt;
|{{Author/tp7}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=46506 Call]&lt;br /&gt;
| Call an external program from the script.&lt;br /&gt;
| N/A&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/call_5F25_dll_20030310.zip Plugin]&lt;br /&gt;
| Nic, DDogg&lt;br /&gt;
|-&lt;br /&gt;
|[[CallCmd]]&lt;br /&gt;
|Plugin to execute command on selectable frames or at startup or closedown. Based on [http://forum.doom9.org/showthread.php?t=46506 Call by Nic].&lt;br /&gt;
|N/A&lt;br /&gt;
|[[CallCmd|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[ClipBoard]]&lt;br /&gt;
|Get text from Clipboard.&lt;br /&gt;
|N/A&lt;br /&gt;
|[[ClipBoard|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[FileSize]]&lt;br /&gt;
|Plugin to get filesize.&lt;br /&gt;
|N/A&lt;br /&gt;
|[[FileSize|Plugin]]&lt;br /&gt;
|pureexe&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.roelofs-coaching.nl/blobs/downloads/ProgramName.html GetProgramName]&lt;br /&gt;
|An AviSynth plug-in to retrieve the name of the calling application.&lt;br /&gt;
|N/A&lt;br /&gt;
|[https://www.roelofs-coaching.nl/blobs/downloads/ProgramName.zip Plugin]&lt;br /&gt;
|[http://www.roelofs-coaching.nl/J.M. Roelofs]&lt;br /&gt;
|-&lt;br /&gt;
|[[GetProgramName2]]&lt;br /&gt;
|GetProgramName2 is similar to GetProgramName by JM Roelofs, but this plugin is a newly written.  &lt;br /&gt;
|N/A&lt;br /&gt;
|[[GetProgramName2|Plugin]]&lt;br /&gt;
|[https://github.com/enccc enccc]&lt;br /&gt;
|-&lt;br /&gt;
| GetSystemEnv&lt;br /&gt;
| An AviSynth plug-in to retrieve information from the system. &lt;br /&gt;
| N/A&lt;br /&gt;
| [http://www.avisynth.nl/users/stickboy/GetSystemEnv.zip Plugin]&lt;br /&gt;
| {{Author/stickboy}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GRunT]]&lt;br /&gt;
| Extends AviSynth's [[Runtime_environment|Runtime Environment]], making it easier to use, especially inside script functions.&lt;br /&gt;
| Any&lt;br /&gt;
| [[GRunT|Plugin]]&lt;br /&gt;
| {{Author/Gavino}}&lt;br /&gt;
|-&lt;br /&gt;
| [[GScript]]&lt;br /&gt;
| Extends the Avisynth scripting language to provide additional control-flow constructs: multi-line conditionals (if-then-else blocks), 'while' loops and 'for' loops.&lt;br /&gt;
| Any&lt;br /&gt;
| [[GScript|Plugin]]&lt;br /&gt;
| {{Author/Gavino}}&lt;br /&gt;
|-&lt;br /&gt;
|[[LoadDLL]]&lt;br /&gt;
| Used to manually load dll files in AviSynth. Useful if a filter relies on an external dll that is not in the system PATH.&lt;br /&gt;
| N/A&lt;br /&gt;
| [[LoadDLL|Plugin]]&lt;br /&gt;
|{{Author/tsp}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=97748 PlaneMinMax]&lt;br /&gt;
| Frame-based YV12 plane Min/Max/Avg functions without [[ConditionalFilter]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/planeminmax_5F25_dll_20050727.zip Plugin]&lt;br /&gt;
| Bart Silverstein&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=83451 pop]&lt;br /&gt;
|A filter to get values from variables that may not yet be initialized.&lt;br /&gt;
|Any&lt;br /&gt;
|[http://www.tsp.person.dk/pop.zip Plugin] &amp;lt;!--[http://web.archive.org/web/20160224093903/http://www.tsp.person.dk/pop.zip archived]--&amp;gt;&lt;br /&gt;
|{{Author/tsp}}&lt;br /&gt;
|-&lt;br /&gt;
| [[RT_Stats]]&lt;br /&gt;
| Compile-time/Runtime Functions.&lt;br /&gt;
| N/A&lt;br /&gt;
| [[RT_Stats|Plugin]]&lt;br /&gt;
| StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[[StrFmt]]&lt;br /&gt;
|Simple plugin to produce formatted string, and additional function to string replace with another string.&lt;br /&gt;
|Any&lt;br /&gt;
|[[StrFmt|Plugin]]&lt;br /&gt;
|StainlessS&lt;br /&gt;
|-&lt;br /&gt;
|[https://forum.doom9.org/showthread.php?t=174387 StrResolve]&lt;br /&gt;
|String Variables Resolving Plugin (for masktools expressions)&lt;br /&gt;
|Any&lt;br /&gt;
|[http://www.mediafire.com/file/wu6zexhssd0y77i/170310_StrResolve_v050.zip Plugin]&lt;br /&gt;
|martin53&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Deepcolor Filters ===&lt;br /&gt;
(also check the [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|High Bit-Depth]] page and the [[:Category:Deep_color_tools|Deep Color Tools]] category)&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[Dither_tools|Dither]]&lt;br /&gt;
| Generates video with up to 16 bits per component after denoising and dithers back to 8 bits for storage. Primarily written to smooth fine gradients to remove color banding during/after denoising. Can also recover high bitdepth data potentially contained in a noisy clip; dither a high bitdepth picture into a standard YV12; and perform basic operations (masking, curves...) on high bitdepth pictures, as they cannot be manipulated safely with conventional AviSynth filters.&lt;br /&gt;
| [[Planar]] colorspaces&lt;br /&gt;
| [[Dither_tools|Plugin + scripts]]&lt;br /&gt;
| {{Author/cretindesalpes}} &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 3D Filters ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[https://sourceforge.net/projects/voix/files/2d3/ 2Dto3D]&lt;br /&gt;
|2Dto3D is a collection of scripts for 2D to 3D conversion. Conversion is good but not perfect.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[https://sourceforge.net/projects/voix/files/2d3/ Script]&lt;br /&gt;
|[https://sourceforge.net/u/brankoj/profile/ brankoj]&lt;br /&gt;
|-&lt;br /&gt;
| [http://web.archive.org/web/20110809073332/http://arenafilm.hu/alsog/anaglyph/ Analglyph]&lt;br /&gt;
| This filter produces analglyph video from a stereo pair.  Analglyph is a 3d viewing method which uses colored glasses.  The plugin supports the advanced [http://web.archive.org/web/20130706165544/www.site.uottawa.ca/~edubois/anaglyph/ Dubois] algorithm, which is able to reduce the ghosting effect that is possible in the conversion.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://chaosking.de/wp-content/uploads/avsfilters/Unclassified/Anaglyph___(0.85_-_2010-08-29).7z Plugin] / [http://web.archive.org/web/20140412062911/http://chaosking.de/wp-content/uploads/avsfilters/Unclassified/Anaglyph___(0.85_-_2010-08-29).7z mirror]&lt;br /&gt;
| {{Author/Kertai Gábor}}&lt;br /&gt;
|-&lt;br /&gt;
| Anaglypher &lt;br /&gt;
| A plugin for combining stereopairs into single anaglyph image.&lt;br /&gt;
| [[RGB32]], [[RGB24]]&lt;br /&gt;
| [http://shura.luberetsky.ru/anaglypher/Anaglypher.zip Plugin]&lt;br /&gt;
| [http://shura.luberetsky.ru/ Shura Luberetsky]&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=162616 Displace / McM_2D_to_3D]&lt;br /&gt;
|Plugin and script that enables you to convert 2d to 3d stereo with bidirectional pulfrich effect + add depth to stationary objects.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=162616#post1539121 Plugin/Script]&lt;br /&gt;
|Mcmount&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=143855 fauxD]&lt;br /&gt;
|2D to stereo-3D conversion in real-time.&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[http://forum.doom9.org/attachment.php?attachmentid=9278&amp;amp;d=1232092731 Plugin]&lt;br /&gt;
|eslave&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.pantarheon.org/AviSynth3DToolbox/ Pantarheon 3D AviSynth Toolbox]&lt;br /&gt;
| The Toolbox contains a number of basic functions which allow you to multiplex the left and right views found in two separate videos into one video, using several of the common methods currently in use.&lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.pantarheon.org/AviSynth3DToolbox/zip/ Script]&lt;br /&gt;
| [http://www.pantarheon.org/ G. Adam Stanislav]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Libraries ===&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
|[http://avslib.sourceforge.net/ AVSLib]&lt;br /&gt;
|General purpose toolkit/extension library enhancing AviSynths ability to perform complex linear and non-linear video editing tasks. Includes support for Array containers &amp;amp; operators, debugging tools, math &amp;amp; string functions, filters and many more.&lt;br /&gt;
|&lt;br /&gt;
|[http://sourceforge.net/projects/avslib/ AVSLib]&lt;br /&gt;
|[http://gzarkadas.users.sourceforge.net/ gzarkadas]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Audio Filters ==&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [[AddAudio]]&lt;br /&gt;
| A function that adds silent audio to a clip. Needed for CCE 2.50 users.&lt;br /&gt;
| N/A&lt;br /&gt;
| Script&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?p=1861891#post1861891 Audiofix]&lt;br /&gt;
|Plugin to fix a specific audio problem, see [http://forum.doom9.org/showthread.php?t=175991 discussion].&lt;br /&gt;
|&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?p=1861891#post1861891 Plugin]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[AudioGraph]]&lt;br /&gt;
| Displays the audio waveform superimposed on the video. Intended to help with editing rather than for final output. Useful for finding specific dialog or sound, and for checking A/V sync.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]]&lt;br /&gt;
| [[AudioGraph|Plugin]]&lt;br /&gt;
| Richard Ling, {{author/Sh0dan}}&lt;br /&gt;
|-&lt;br /&gt;
|[[AudioLimiter]]&lt;br /&gt;
| To increase volume for silent sounds a lot, to increase volume for middle-volume sounds a little and to keep hi-volume sounds untoched.&lt;br /&gt;
| N/A&lt;br /&gt;
|[[AudioLimiter|Plugin]]&lt;br /&gt;
|dimzon&lt;br /&gt;
|-&lt;br /&gt;
|[[AudioTimeline]]&lt;br /&gt;
|Displays a audio timeline track under the frame. It is especially suited for thumbsheets, where it allows to estimate the audio track of the thumbnailed clip.&lt;br /&gt;
|[[RGB24]], [[RGB32]], [[Y8]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
|[[AudioTimeline|Plugin]]&lt;br /&gt;
|martin53&lt;br /&gt;
|-&lt;br /&gt;
| [[BeFa]]&lt;br /&gt;
| Band Eliminate Filter for Audio.&lt;br /&gt;
| N/A&lt;br /&gt;
| [[BeFa|Plugin]]&lt;br /&gt;
| {{Author/kiraru2002}}&lt;br /&gt;
|-&lt;br /&gt;
| [[FindAudioSyncScript]]&lt;br /&gt;
| FindAudioSyncScript helps you to find the appropriate audio delays, if you have desync'ed audio.&lt;br /&gt;
| N/A&lt;br /&gt;
| Script&lt;br /&gt;
| IanB&lt;br /&gt;
|-&lt;br /&gt;
| [[MinMaxAudio]]&lt;br /&gt;
| Computes the root mean square, maximal or minimal value over all samples in all channels,or just over all samples in channel, and outputs the value (in decibels) as a float. It's a conditional audio filter, so the computation is done framewise.&lt;br /&gt;
| N/A&lt;br /&gt;
| [[MinMaxAudio|Plugin]]&lt;br /&gt;
| {{author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Normalize2]]&lt;br /&gt;
|Audio normalizing plugin. The main difference between this plugin and the built-in normalizing plugin [[Normalize]]() is that this plugin can store the peak level value in an external file and uses a lookup table to do the actual normalizing (for speed).&lt;br /&gt;
|N/A&lt;br /&gt;
|[[Normalize2|Plugin]]&lt;br /&gt;
|[http://sourceforge.net/u/jcsston/profile/ jcsston]&lt;br /&gt;
|-&lt;br /&gt;
| [[SoxFilter]]&lt;br /&gt;
| Use [http://sox.sourceforge.net/ SOX] audio effects within AviSynth. Most effects are supported, and multiple effects can be stacked after each other.&lt;br /&gt;
| N/A&lt;br /&gt;
| [[SoxFilter|Plugin]]&lt;br /&gt;
| {{author/Sh0dan}}&lt;br /&gt;
|-&lt;br /&gt;
|[[Spectrogram]]&lt;br /&gt;
|Linear [http://en.wikipedia.org/wiki/Spectrogram spectrogram] for AviSynth 2.6.&lt;br /&gt;
|Any&lt;br /&gt;
|[[Spectrogram|Plugin]]&lt;br /&gt;
|[http://github.com/innocenat innocenat]&lt;br /&gt;
|-&lt;br /&gt;
|SwitchByAudio&lt;br /&gt;
|Plugin to switch video source based on audio. See [http://forum.doom9.org/showthread.php?t=167011 discussion]&lt;br /&gt;
|[[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]  &lt;br /&gt;
|[http://www.avisynth.nl/users/vcmohan/SwitchByAudio/SwitchByAudio.zip Plugin]&lt;br /&gt;
|{{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showpost.php?p=1722472&amp;amp;postcount=20 TimeStretchPlugin]&lt;br /&gt;
|[[TimeStretch]] with multichannel support and updated SoundTouch library. &lt;br /&gt;
|N/A&lt;br /&gt;
|[http://www.wilbertdijkhof.com/TimeStretch_v258.zip Plugin]&lt;br /&gt;
|{{Author/Wilbert Dijkhof}}&lt;br /&gt;
|-&lt;br /&gt;
| [[ViewAudio]]&lt;br /&gt;
| Includes two filters: ViewAudio and CacheAudio. &lt;br /&gt;
| [[YUY2]], [[YV12]]&lt;br /&gt;
| [[ViewAudio|Plugin]]&lt;br /&gt;
| {{Author/minamina}}&lt;br /&gt;
|-&lt;br /&gt;
| VUmeter&lt;br /&gt;
| Classic analog-style VU meter; see [https://forum.doom9.org/showthread.php?t=175370 discussion]. Uses MinMaxAudio.&lt;br /&gt;
| Any&lt;br /&gt;
| [https://github.com/raffriff42/AvisynthPlusUtilities script]&lt;br /&gt;
| raffriff42&lt;br /&gt;
|-&lt;br /&gt;
| [[Waveform]]&lt;br /&gt;
| Displays audio waveforms superimposed on the video, similar to AudioGraph below but with multi-channel support and consistent support for all colourspaces.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]  &lt;br /&gt;
| [http://horman.net/avisynth/download/waveform0.3.zip Plugin]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== As Yet Unclassified ==&lt;br /&gt;
&lt;br /&gt;
{{FilterTable}}&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=397426#post397426 Adjust]&lt;br /&gt;
| Generic Y-Channel mapping. Can define a function for the Y Channel. See [http://forum.doom9.org/showthread.php?p=397426 discussion.]&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/files/adjust_5F25_dll_20031110.zip Plugin]&lt;br /&gt;
| [http://avisynth.nl/users/warpenterprises/ WarpEnterprises]&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=166588 Adaptive Lens Blur Repair]&lt;br /&gt;
|This function adaptively repairs video damaged by lens blur, using a frame-adaptive repair mask, a selection of sharpeners and multi-stage motion-compensated artifact removal.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/attachment.php?attachmentid=13154&amp;amp;stc=1&amp;amp;d=1354907363 Script]&lt;br /&gt;
| fvisagie&lt;br /&gt;
|-&lt;br /&gt;
|[[amp]]&lt;br /&gt;
|Inspired by [http://forum.doom9.org/showthread.php?t=168293 RgbAmplifier], it performs temporal smoothing, then (optionally) enhances the difference between the windowed average and the current frame.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [[amp|Plugin]]&lt;br /&gt;
| {{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
|[[AutoOverlay]]&lt;br /&gt;
|Auto-aligned optimal overlay of one video clip onto another with color adjustment.&lt;br /&gt;
| [[RGB32]], [[YV24]], [[YV12]]&lt;br /&gt;
| [https://github.com/introspected/AutoOverlay/releases Plugin]&lt;br /&gt;
| [https://github.com/introspected introspected]&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/Xenoveritas/AviSynth-Stuff/tree/master/AutoTrace AutoTraceFilter]&lt;br /&gt;
|An intentionally useless plugin that uses [http://autotrace.sourceforge.net/ AutoTrace] to trace and then resize a source video, rendering the result using GDI+.&lt;br /&gt;
|[[RGB24]]&lt;br /&gt;
| [http://github.com/Xenoveritas/AviSynth-Stuff/tree/master/AutoTrace Plugin]&lt;br /&gt;
| [http://github.com/Xenoveritas Xenoveritas]&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=675275#post675275 BeforeAfter]&lt;br /&gt;
| See the difference before and after; similar discussion [http://forum.doom9.org/showthread.php?t=98876 here]. (missing [http://www.animemusicvideos.org/forum/viewtopic.php?f=11&amp;amp;t=45223 BeforeAfterDiff] and BeforeAfterLine scripts.)&lt;br /&gt;
| any&lt;br /&gt;
| Script&lt;br /&gt;
| Corran&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=158696 ccc]&lt;br /&gt;
|A plugin specifically designed for Cross-Conversion Correction.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20150403181720/http://japland.org/ccc/ccc_v0.4a_avs.zip Plugin]&lt;br /&gt;
|Daemon404&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/ColorIt/ColorIt.html Colorit]&lt;br /&gt;
| Color a black and white image or recolor a color image. See [http://forum.doom9.org/showthread.php?t=93990 discussion.]&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/ColorIt/Colorit.zip Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| CutFrames&lt;br /&gt;
| Cut a range of frames from a single a/v clip. Opposite of Trim with extras.&lt;br /&gt;
| &lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=135423 Script]&lt;br /&gt;
| mikeytown2&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| Plugin with the following functions: IDCT, IDCT2, FDCT, FDCT2. See [http://forum.doom9.org/showthread.php?p=667382#post667382 discussion]&lt;br /&gt;
| [[YUY2]]&lt;br /&gt;
| [http://alainmuchembled.free.fr/DCT.zip Plugin]&lt;br /&gt;
| lcld&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?p=1444027#post1444027 DDigit]&lt;br /&gt;
| DDigit Plugin Text Rendering Pack for Plugin writers. See [http://forum.doom9.org/showthread.php?t=156888 discussion.]&lt;br /&gt;
|&lt;br /&gt;
| [http://www.mediafire.com/download/bfhj5crwaxbupeh/DDigitTest_25%2626_v1-06_dll_20150330-RECOMPILE.zip Plugin]&lt;br /&gt;
| {{Author/StainlessS}}&lt;br /&gt;
|- &lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=80419 DeBlot]&lt;br /&gt;
| Color Blot Reduction. &lt;br /&gt;
| [[YUY2]],[[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/deblot_5F25_dll_20030628.zip Plugin]&lt;br /&gt;
| {{Author/minamina}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=95193 DeJump]&lt;br /&gt;
| This is a specific filter which might be used to stabilize some &amp;quot;jumpy&amp;quot; video sources captured from VHS. &lt;br /&gt;
|[[YUY2]]&lt;br /&gt;
| [http://forum.doom9.org/attachment.php?attachmentid=3988&amp;amp;d=1117479069 Plugin]&lt;br /&gt;
| dinstun&lt;br /&gt;
|-&lt;br /&gt;
|[[FFAvisynth]]&lt;br /&gt;
| A plugin which lets you directly use [http://en.wikipedia.org/wiki/Ffdshow ffdshow] video and audio filters from AviSynth scripts.  &lt;br /&gt;
| [[YV12]], [[YUY2]], [[RGB24]], [[RGB32]]&lt;br /&gt;
| [http://sourceforge.net/projects/ffdshow-tryout/ Plugin]&lt;br /&gt;
| Milan Cutka &lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/Youka/FLuaG FLuaG]&lt;br /&gt;
| FLuaG (Floating Lua Graphics) is an AviSynth plugin for video/audio data editing via Lua scripting. See [http://forum.doom9.org/showthread.php?t=161852 discussion] &lt;br /&gt;
| [[RGB32]]&lt;br /&gt;
| [http://github.com/Youka/FLuaG/archive/master.zip Plugin]&lt;br /&gt;
| [http://github.com/Youka Youka]&lt;br /&gt;
|-&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=150291 FritzPhoto]&lt;br /&gt;
| Use Avisynth to process still images.&lt;br /&gt;
| &lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=150291 FritzPhoto]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?p=1600151#post1600151 FSubstitute]&lt;br /&gt;
|Tries to automate the task of replacing bad frames using adjacent or close-by frames.&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?p=1600151#post1600151 Script]&lt;br /&gt;
|martin53&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=130611 GrainOptimizer]&lt;br /&gt;
|The only temporal-only grain reducer! See discussion for more information. Related topics: [http://forum.doom9.org/showthread.php?t=137117 x264: Film Grain Optimization], [http://web.archive.org/web/20090916181521/http://x264dev.blogspot.com/2008/05/film-grain-optimization.html]&lt;br /&gt;
|[[YV12]]&lt;br /&gt;
|[http://web.archive.org/web/20081228144846/http://mirror05.x264.nl/Dark/force.php?file=./GrainOptimizer_2.02.zip Plugin]&lt;br /&gt;
|Dark Shikari&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/Youka/LVS LVS]&lt;br /&gt;
| LVS (Lua Video Sync) is a video frameserver plugin to edit video frames with the capability of scripting language Lua + 2D image processing functionality. See [http://forum.doom9.org/showthread.php?t=167716 discussion]. [https://github.com/Youka/LVS GitHub]&lt;br /&gt;
| [[RGB32]], [[RGB24]]&lt;br /&gt;
| [http://sourceforge.net/projects/lua-video-sync/files/ Plugin]&lt;br /&gt;
| [http://github.com/Youka Youka]&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/NeuralNet/NeuralNet.html NeuralNet]&lt;br /&gt;
| Neural networks through back propagation learn and filter some types of noise. Classification and linear type networks are included.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/NeuralNet/NeuralNet.zip Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
| PseudoColor &lt;br /&gt;
| This filter first converts clip to b/w, then colors it to pseudorandom colors according to brightness. See [http://forum.doom9.org/showthread.php?t=61570 discussion.]&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YV12]]&lt;br /&gt;
| [http://www.avisynth.nl/users/warpenterprises/files/pseudocolor_5F25_dll_20030919.zip Plugin]&lt;br /&gt;
| Shubin&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/jeremypoulter/QRCodeSource QRCodeSource]&lt;br /&gt;
|AviSynth plugin to provide a means to embed QR codes in video.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
|[http://github.com/jeremypoulter/QRCodeSource/releases Plugin]&lt;br /&gt;
|[http://github.com/jeremypoulter jeremypoulter]&lt;br /&gt;
|-&lt;br /&gt;
|RemoveDeadPixels&lt;br /&gt;
|See [http://forum.doom9.org/showthread.php?p=699915#post699915 here] and [http://videoprocessing.fr.yuku.com/topic/27/Removedeadpixels here].&lt;br /&gt;
|[[YUY2]]&lt;br /&gt;
|[http://web.archive.org/web/20160610103945/http://home.arcor.de/kassandro/RemoveDeadPixels.rar Plugin]&lt;br /&gt;
|{{Author/kassandro}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=172601 rgba_rpn]&lt;br /&gt;
|A filter for manipulating the pixels of [[RGB]] (and also [[YUV]]) clips using [http://en.wikipedia.org/wiki/Reverse_Polish_notation reverse Polish notation.] &lt;br /&gt;
|[[RGB32]], [[RGB24]], [[YUY2]], [[YV12]]&lt;br /&gt;
|[http://horman.net/avisynth/downloads/rgba_rpn0.1.zip Plugin]&lt;br /&gt;
|{{Author/David Horman}}&lt;br /&gt;
|-&lt;br /&gt;
| [[SegmentedAmp]] &lt;br /&gt;
| Image is segmented with watershed algorithm for smoothing and/or sharpening.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| [http://avisynth.nl/index.php/SegmentedAmp Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://forum.doom9.org/showthread.php?t=172377 SmoothSkip]&lt;br /&gt;
|In tribute to tritical's awesome filter, this one tackles the inverse problem of [[TIVTC/TDecimate|TDecimate]]; allowing for addressing frames that have non-smooth, skippy motion. For source code see [http://github.com/jojje/SmoothSkip GitHub repository]. &lt;br /&gt;
|[[YUY2]], [[YV12]]&lt;br /&gt;
|[http://github.com/jojje/SmoothSkip/releases/download/v1.0.2/SmoothSkip-1.0.2.zip Plugin]&lt;br /&gt;
|[http://github.com/jojje jojje]&lt;br /&gt;
|-&lt;br /&gt;
| [[Soothe]]&lt;br /&gt;
| Lessens the temporal instability and aliasing caused by sharpening, by comparing the original and sharpened clip, leaving a smoother and slightly softer output. See [http://forum.doom9.org/showthread.php?t=99679 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://forum.doom9.org/showthread.php?t=99679 Script]&lt;br /&gt;
| {{Author/Didée}}&lt;br /&gt;
|-&lt;br /&gt;
|[https://sourceforge.net/projects/ssbrenderer/ SSBRenderer]&lt;br /&gt;
|SSBRenderer is a plugin for AviSynth to render 2D graphics and subtitles by SSB (Substation Beta) data on frames of video streams. [https://forum.doom9.org/showthread.php?t=169951 Doom9 Forum discussion], [https://github.com/Youka/SSBRenderer GitHub]&lt;br /&gt;
|[[RGB24]], [[RGB32]]&lt;br /&gt;
|[https://sourceforge.net/projects/ssbrenderer/files/ C-Plugin]&lt;br /&gt;
|[https://github.com/Youka Youka ]&lt;br /&gt;
|-&lt;br /&gt;
| [http://sourceforge.net/projects/avisynthtrackin/ Tracking]&lt;br /&gt;
| Use computer vision to track objects in the video, and produce ConditionalReader input. Demo at [http://www.youtube.com/watch?v=SQ-JtJs7US0 Youtube]. &lt;br /&gt;
| [[RGB24]]&lt;br /&gt;
| [http://sourceforge.net/projects/avisynthtrackin/files/1.1/AvisynthTrackin.1.1.binary.zip/download Plugin]&lt;br /&gt;
| [http://avisynthtrackin.sourceforge.net/ Shlomo Matichin]&lt;br /&gt;
|-&lt;br /&gt;
| UnSmooth&lt;br /&gt;
| What does it do. It amplifies noise, small detail, and artifacts. Doesn't sound very attractive, but there can still be some detail left in over smoothed encodes. See [http://forum.doom9.org/showthread.php?t=63361 discussion.]&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
| [http://web.archive.org/web/20090821183550/http://mf.creations.nl/avs/functions/UnSmooth-v0.1.avs Script]&lt;br /&gt;
| {{Author/mf}}&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.avisynth.nl/users/vcmohan/WaterShed/Watershed.html WaterShed] &lt;br /&gt;
| Assuming image grey values to be elevations, it is segmented into basins and watershed lines. Useful in certain medical image analysis and recoloring work.&lt;br /&gt;
| [[RGB32]], [[RGB24]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
| AviSynth 2.5.8: [http://www.avisynth.nl/users/vcmohan/WaterShed/Watershed.zip Plugin]&lt;br /&gt;
AviSynth 2.6.0: [http://www.avisynth.nl/users/vcmohan/WaterShed/Watershed_2_6.zip Plugin]&lt;br /&gt;
| {{Author/vcmohan}}&lt;br /&gt;
|-&lt;br /&gt;
|[http://github.com/Xenoveritas/AviSynth-Stuff/tree/master/xvplugins xvplugins]&lt;br /&gt;
|This is simply a bunch of AviSynth stuff that isn't (really) possible using plain AviSynth and instead required a plugin.&lt;br /&gt;
|[[RGB32]]&lt;br /&gt;
| [http://github.com/Xenoveritas/AviSynth-Stuff/tree/master/xvplugins Plugin]&lt;br /&gt;
| [http://github.com/Xenoveritas Xenoveritas]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:AviSynth_Usage]]&lt;br /&gt;
[[Category:External_filters]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2021-03-27T09:20:28Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Core Plugins and Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, real.finder&lt;br /&gt;
| v3.364s&lt;br /&gt;
| 3=[https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Zs_RF_Shared</id>
		<title>Zs RF Shared</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Zs_RF_Shared"/>
				<updated>2021-03-27T09:20:05Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: Created page with &amp;quot;{{FilterCat4|External_filters|Scripts|Other_filters|Multipurpose Filters}} {{Filter3 | real.finder, Multi Peoples | v1.143 | [https://github.com/realfinder/AVS-Stuff/raw/maste...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Other_filters|Multipurpose Filters}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| real.finder, Multi Peoples&lt;br /&gt;
| v1.143&lt;br /&gt;
| [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi Zs_RF_Shared.avsi]&lt;br /&gt;
| Multipurpose Filters&lt;br /&gt;
|&lt;br /&gt;
|6=[http://forum.doom9.org/showpost.php?p=1665492&amp;amp;postcount=27 Doom9 Thread]}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;[[Zs_RF_Shared]]&amp;lt;/tt&amp;gt; - Shared Functions and utility.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.7 or [http://sourceforge.net/projects/avisynth2/ greater]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version         Date(D/M/Y)      Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v1.143          11/12/2020       -&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
*[https://forum.doom9.org/showthread.php?t=174121 Doom9 Forum] - See this thread for support.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Multipurpose_Filters|External Filters]] &amp;amp;larr;'''&lt;br /&gt;
-----------------------------------------------&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ASTDR</id>
		<title>ASTDR</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ASTDR"/>
				<updated>2021-03-27T09:09:50Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Rainbow &amp;amp; Dot Crawl Removal}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| AmjadSONY&lt;br /&gt;
| v1.78&lt;br /&gt;
| [https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/ASTDR.avsi ASTDR.avsi]&lt;br /&gt;
| Rainbow &amp;amp; Dot Crawl Removal&lt;br /&gt;
|&lt;br /&gt;
|6=[http://forum.doom9.org/showpost.php?p=1665492&amp;amp;postcount=27 Doom9 Thread]}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;[[ASTDR]]&amp;lt;/tt&amp;gt; - A Spatio-Temporal DeRainbowing function. &amp;lt;tt&amp;gt;{{Template:FuncDef|ASTDRmc}}&amp;lt;/tt&amp;gt; is a motion-compensated variant that helps avoid chroma bleeding in moving scenes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/ greater]&lt;br /&gt;
* [[FAQ_different_types_content#How_do_I_recognize_progressive.2C_interlaced.2C_telecined.2C_hybrid_and_blended_content.3F|Progressive]] or Field Based input&lt;br /&gt;
* Supported color formats: [[YV12]]&lt;br /&gt;
&lt;br /&gt;
=== Required Plugins ===&lt;br /&gt;
Latest versions of the following filters are recommended unless stated otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
*[[Zs_RF_Shared]]&lt;br /&gt;
*[[aWarpSharp2]]&lt;br /&gt;
*[[DeCross]]&lt;br /&gt;
*[[FluxSmooth]]&lt;br /&gt;
*[[hqdn3d]]&lt;br /&gt;
*[[MaskTools2]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;{{Template:FuncDef|ASTDRmc}}&amp;lt;/tt&amp;gt; requires a few more plugins: [[MVTools]] and [[TEMmod]] if you're using AviSynth 2.6 or [[TEdgeMask]] for 2.5.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|ASTDR (clip input, int &amp;quot;strength&amp;quot;, int &amp;quot;tempsoftth&amp;quot;, int &amp;quot;tempsoftrad&amp;quot;, int &amp;quot;tempsoftsc&amp;quot;, float &amp;quot;blstr&amp;quot;, int &amp;quot;tht&amp;quot;, int &amp;quot;FluxStv&amp;quot;, int &amp;quot;dcn&amp;quot;, bool &amp;quot;edgem&amp;quot;, bool &amp;quot;exmc&amp;quot;, clip &amp;quot;edgemprefil&amp;quot;, bool &amp;quot;nomask&amp;quot;)}}&lt;br /&gt;
:{{Template:FuncDef|ASTDRmc (clip input, int &amp;quot;strength&amp;quot;, int &amp;quot;tempsoftth&amp;quot;, int &amp;quot;tempsoftrad&amp;quot;, int &amp;quot;tempsoftsc&amp;quot;, float &amp;quot;blstr&amp;quot;, int &amp;quot;tht&amp;quot;, int &amp;quot;FluxStv&amp;quot;, int &amp;quot;dcn&amp;quot;, bool &amp;quot;edgem&amp;quot;, int &amp;quot;thSAD&amp;quot;, clip &amp;quot;prefil&amp;quot;, bool &amp;quot;chroma&amp;quot;, clip &amp;quot;edgemprefil&amp;quot;, bool &amp;quot;nomask&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|strength|int|5}}&lt;br /&gt;
:::[[hqdn3d|hqdn3d's]] &amp;lt;tt&amp;gt;cs&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ct&amp;lt;/tt&amp;gt; parameters.&amp;lt;!--that control the strengths of the spatial and temporal filtering on the chroma channels. &amp;lt;tt&amp;gt;cs&amp;lt;/tt&amp;gt; defaults to &amp;lt;code&amp;gt;strength*3/5&amp;lt;/code&amp;gt;.--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|tempsoftth|int|30}}&lt;br /&gt;
::{{Par2|tempsoftrad|int|3}}&lt;br /&gt;
::{{Par2|tempsoftsc|int|3}}&lt;br /&gt;
:::[[TemporalSoften|TemporalSoften's]] &amp;lt;tt&amp;gt;chroma_threshold&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;radius&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;scenechange&amp;lt;/tt&amp;gt; parameters.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|blstr|float|0.5}}&lt;br /&gt;
:::[[Blur]] strength.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|tht|int|255}}&lt;br /&gt;
:::[[MaskTools2/Mt_motion|mt_motion's]] &amp;lt;tt&amp;gt;thT&amp;lt;/tt&amp;gt; parameter.&amp;lt;!--; scene change detection threshold?--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|FluxStv|int|75}}&lt;br /&gt;
:::[[FluxSmooth|FluxSmoothST's]] &amp;lt;tt&amp;gt;temporal_threshold&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;spatial_threshold&amp;lt;/tt&amp;gt; parameters.&amp;lt;!--Spatial and temporal neighbour pixels within this threshold from the current pixel are included in the average.--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|dcn|int|15}}&lt;br /&gt;
:::[[DeCross|DeCross']] &amp;lt;tt&amp;gt;Noise&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|edgem|bool|false}}&lt;br /&gt;
:::Set to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; to use an edge mask.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
ASTDR with default settings:&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 ASTDR(strength=5, tempsoftth=30, tempsoftrad=3, tempsoftsc=3, blstr=0.5, tht=255, FluxStv=75, dcn=15, edgem=false)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version         Date(D/M/Y)      Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v1.76           11/07/2019       - [http://pastebin.com/j5JVNwSP]&lt;br /&gt;
 v1.75           15/08/2018       - [http://pastebin.com/LiVG4NFh]&lt;br /&gt;
 v1.74           11/11/2017       - [http://pastebin.com/xyVhfQFe]&lt;br /&gt;
 v1.72           07/11/2017       - [http://pastebin.com/b03M4Xav]&lt;br /&gt;
 v1.61           02/01/2017       - [http://pastebin.com/vnQs8Dxi]&lt;br /&gt;
 v1.59           01/01/2017       - [http://pastebin.com/sVEPMJ8N]&lt;br /&gt;
 v1.53           06/10/2016       - [http://pastebin.com/QQ5ycB6f]&lt;br /&gt;
 v1.52           25/01/2016       - [http://pastebin.com/A6F1TLL4]&lt;br /&gt;
 v1.51           07/06/2015       - [http://pastebin.com/P3uun3x4]&lt;br /&gt;
 v1.50           10/05/2015       - [http://pastebin.com/UfKWfb8Z]&lt;br /&gt;
 v1.49           27/04/2015       - [http://pastebin.com/HqPCrDF6] [http://pastebin.com/GyzH6gfZ]&lt;br /&gt;
 v1.47           22/12/2014       - [http://pastebin.com/dzszpfLk]&lt;br /&gt;
 v1.45           21/12/2014       - [http://pastebin.com/jLQ4qrFi]&lt;br /&gt;
 v1.4            21/12/2014       - [http://pastebin.com/jcfDpcdz]&lt;br /&gt;
 v1.2            04/02/2014       - [http://pastebin.com/0D16eaHv]&lt;br /&gt;
 v1.0            04/02/2014       - [http://pastebin.com/06EfSweJ] Initial release&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
*[https://forum.doom9.org/showthread.php?t=174121 Doom9 Forum] - See this thread for support.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Rainbow_.26_Dot_Crawl_Removal|External Filters]] &amp;amp;larr;'''&lt;br /&gt;
-----------------------------------------------&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/AssRender</id>
		<title>AssRender</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/AssRender"/>
				<updated>2021-03-04T14:21:02Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat6|External_filters|Plugins|Plugins_x64|Adjustment_filters|Subtitling|Deep_color_tools}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|1=pinterf, vadosnaprimer, Blitzker, pingplug, lachs0r, TheFluff&lt;br /&gt;
|2=v0.35&lt;br /&gt;
|3=[https://github.com/pinterf/assrender/releases/ assrender-0.35.7z]&lt;br /&gt;
|4=Subtitling&lt;br /&gt;
|5=Source code is MIT license, binaries are GPL&lt;br /&gt;
|6=[https://forum.doom9.org/showthread.php?t=148926 Doom9 Thread]}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
AssRender is an AviSynth plugin that renders ASS/SSA and SRT (without the HTML-like markup) subtitles. It uses libass to render the subtitles.&lt;br /&gt;
&lt;br /&gt;
This also means that it is much more picky about script syntax than VSFilter and friends, so keep that in mind before blaming the filter. Yes, people have reported a lot of errors that were actually the script author’s fault and libass vs VSFilter compatibility.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;'''Note:'''&amp;lt;/span&amp;gt; AssRender is a C-plugin so it must be loaded using [[Plugins#LoadCPlugin|LoadCPlugin]], except if you're using AviSynth+, it allows autoloading of C-plugins.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]&lt;br /&gt;
* [x64]: [[AviSynth+]] &lt;br /&gt;
* Supported color formats: [[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
** AviSynth+: all [[planar]] formats (8/10/12/14/16bit, Y/YUV/RGB with or without alpha) are supported. [[RGB48]] and [[RGB64]] are also supported.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|assrender (clip, string file, string &amp;quot;vfr&amp;quot;, int &amp;quot;hinting&amp;quot;, float &amp;quot;scale&amp;quot;, float &amp;quot;line_spacing&amp;quot;, float &amp;quot;dar&amp;quot;, float &amp;quot;sar&amp;quot;, int &amp;quot;top&amp;quot;, int &amp;quot;bottom&amp;quot;, int &amp;quot;left&amp;quot;, int &amp;quot;right&amp;quot;, string &amp;quot;charset&amp;quot;, int &amp;quot;debuglevel&amp;quot;, string &amp;quot;fontdir&amp;quot;, string &amp;quot;srt_font&amp;quot;, string &amp;quot;colorspace&amp;quot;) }}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2||clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2||string|}}&lt;br /&gt;
:::Your subtitle file. May be ASS, SSA or SRT.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|vfr|string| }}&lt;br /&gt;
:::Specify timecodes v1 or v2 file when working with VFRaC.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|hinting|int|0}}&lt;br /&gt;
:::Font hinting mode. Choose between: &lt;br /&gt;
:::*none (0, default), light (1), normal (2) and Freetype native (3) autohinting.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|scale|float|1.0}}&lt;br /&gt;
:::Font scale. Defaults to 1.0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|line_spacing|float|1.0}}&lt;br /&gt;
:::Line spacing in pixels. Defaults to 1.0 and won’t be scaled with frame size. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|dar|float| }}&lt;br /&gt;
::{{Par2|sar|float| }}&lt;br /&gt;
:::Aspect ratio. Of course you need to set both parameters.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|top|int|0}}&lt;br /&gt;
::{{Par2|bottom|int|0}}&lt;br /&gt;
::{{Par2|left|int|0}}&lt;br /&gt;
::{{Par2|right|int|0}}&lt;br /&gt;
:::Margins. They will be added to the frame size and may be negative.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|charset|string|&amp;quot;UTF-8&amp;quot;}}&lt;br /&gt;
:::Character set to use, in GNU iconv or enca format. Defaults to UTF-8.&lt;br /&gt;
:::Example enca format: enca:pl:cp1250 (guess the encoding for Polish, fall back on cp1250)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debuglevel|int|0}}&lt;br /&gt;
:::How much crap assrender is supposed to spam to stderr.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|fontdir|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
:::Additional font directory.&lt;br /&gt;
:::Useful if you are lazy but want to keep your system fonts clean.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|srt_font|string|&amp;quot;Sans&amp;quot;}}&lt;br /&gt;
:::Font to use for SRT subtitles. Defaults to whatever Fontconfig chooses for “Sans”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|colorspace|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
:::The color space of your (YUV) video. Possible values:&lt;br /&gt;
:::* &amp;quot;Rec2020&amp;quot;, &amp;quot;BT.2020&amp;quot;&lt;br /&gt;
:::* &amp;quot;Rec709&amp;quot;, &amp;quot;BT.709&amp;quot;&lt;br /&gt;
:::* &amp;quot;Rec601&amp;quot;, &amp;quot;BT.601&amp;quot;&lt;br /&gt;
:::* &amp;quot;PC.709&amp;quot;&lt;br /&gt;
:::* &amp;quot;PC.601&amp;quot;&lt;br /&gt;
:::* &amp;quot;TV.fcc&amp;quot;, &amp;quot;PC.fcc&amp;quot;&lt;br /&gt;
:::* &amp;quot;TV.240m&amp;quot;, &amp;quot;PC.240m&amp;quot;&lt;br /&gt;
:::* &amp;quot;none&amp;quot;, &amp;quot;guess&amp;quot;&lt;br /&gt;
:::Default is to use the ASS script's &amp;quot;YCbCr Matrix&amp;quot; or &amp;quot;Video Colorspace&amp;quot; property.&lt;br /&gt;
:::Recognized .ASS properties: &amp;quot;TV.601&amp;quot; &amp;quot;TV.709&amp;quot;, &amp;quot;PC.601&amp;quot; &amp;quot;PC.709&amp;quot; &amp;quot;TV.240m&amp;quot; &amp;quot;PC.240m&amp;quot; &amp;quot;TV.fcc&amp;quot; &amp;quot;PC.fcc&amp;quot; and &amp;quot;none&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:::&amp;quot;none&amp;quot; and &amp;quot;guess&amp;quot; decides upon on video resolution: width &amp;gt; 1280 or height &amp;gt; 576 → BT.709, else → BT.601. When no hint found in ASS script and 'colorspace' parameter is empty then the default is BT.601.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 AssRender(&amp;quot;subtitles.ass&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
2021-03-04 - pinterf&lt;br /&gt;
     * Version 0.35:&lt;br /&gt;
        - Windows MSVC: Update to libass v0.15 (git submodule update --init --recursive --remote)&lt;br /&gt;
          For changes since v0.14 see https://github.com/libass/libass/blob/master/Changelog&lt;br /&gt;
        - don't guess base on video resolution (realfinder)&lt;br /&gt;
          if .ass file has no Matrix info then it should be treated as it &amp;quot;Rec601&amp;quot; to maintain compatibility&lt;br /&gt;
        - Parameter 'colorspace' default value is no longer &amp;quot;guess&amp;quot;&lt;br /&gt;
        - Add more color options: PC.709, PC.601, TV.fcc, PC.fcc, TV.240m, PC.240m, none.&lt;br /&gt;
          &amp;quot;none&amp;quot; and &amp;quot;guess&amp;quot; implies &amp;quot;guess-by-resolution&amp;quot;.&lt;br /&gt;
        - Fix: possible crash on initializing phase (buffer overread, linux crashed, Windows was just lucky)&lt;br /&gt;
&lt;br /&gt;
2021-03-01 - pinterf&lt;br /&gt;
     * Version 0.34:&lt;br /&gt;
        - Fix the fix: revert matrix change made in 0.33&lt;br /&gt;
        - Fix: Check matrix from .ASS file &amp;quot;YCbCr Matrix:&amp;quot; section besides &amp;quot;Video Colorspace:&amp;quot;&lt;br /&gt;
          Recognized values are &amp;quot;tv.601&amp;quot; and &amp;quot;tv.709&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2021-02-28 - pinterf&lt;br /&gt;
     * Version 0.33:&lt;br /&gt;
        - Fix: wrong Bt.709 matrix (it wasn't :) )&lt;br /&gt;
&lt;br /&gt;
2021-02-27 - pinterf&lt;br /&gt;
     * Version 0.32:&lt;br /&gt;
        - Fix: treat I420 variant as YV12 instead of unsupported color space&lt;br /&gt;
&lt;br /&gt;
2021-02-18 - pinterf&lt;br /&gt;
     * Version 0.31:&lt;br /&gt;
        - Fix colors for planar RGB&lt;br /&gt;
        - code: hidden ifdef FOR_AVISYNTH_26_ONLY for Avisynth 2.6-only build&lt;br /&gt;
&lt;br /&gt;
2021-02-17 - pinterf&lt;br /&gt;
     * Version 0.30:&lt;br /&gt;
        - 10-16 bit support (including RGB48 and RGB64)&lt;br /&gt;
        - YV411, Planar RGB support&lt;br /&gt;
&lt;br /&gt;
2021-02-16 - pinterf&lt;br /&gt;
     * Version 0.29:&lt;br /&gt;
        - project moved to https://github.com/pinterf/assrender from https://github.com/vadosnaprimer/assrender&lt;br /&gt;
        - Move to Visual Studio 2019 - v142 platform toolset&lt;br /&gt;
        - Add .def module definition file for Avisynth 2.6 std compatibility (function name mangling)&lt;br /&gt;
        - Update Avisynth C headers&lt;br /&gt;
        - Check Linux and gcc-MinGW CMake build&lt;br /&gt;
        - Add build instructions and change log to README&lt;br /&gt;
&lt;br /&gt;
2019-01-14 - vadosnaprimer&lt;br /&gt;
        - https://github.com/vadosnaprimer/assrender/&lt;br /&gt;
        - add batch that lets not to change deps sdk and vs version copied from SMP libass&lt;br /&gt;
        - update SMP submodules&lt;br /&gt;
&lt;br /&gt;
2016-10-18 - Blitzker&lt;br /&gt;
        - https://github.com/Blitzker/assrender&lt;br /&gt;
        - Visual Studio 2015 support&lt;br /&gt;
&lt;br /&gt;
2012-04-20 - lachs0r &lt;br /&gt;
    * Version 0.25:&lt;br /&gt;
        - code restructured&lt;br /&gt;
        - added support for the BT.709 color space and the “Video Colorspace”&lt;br /&gt;
          property that has been introduced with recent versions of Aegisub.&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated everything, switched to MinGW-w64&lt;br /&gt;
              (same toolchain as mplayer2 now)&lt;br /&gt;
&lt;br /&gt;
2011-09-22 - lachs0r &lt;br /&gt;
    * Version 0.24.1:&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated libass to current git HEAD&lt;br /&gt;
            - switched Harfbuzz to libass’ compatibility branch&lt;br /&gt;
            - compiled Harfbuzz without Uniscribe backend&lt;br /&gt;
              fixes lots of crashes and misbehavior&lt;br /&gt;
&lt;br /&gt;
2011-07-29 - lachs0r&lt;br /&gt;
    * Version 0.24:&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated libass to current git HEAD:&lt;br /&gt;
                - fixed performance regression&lt;br /&gt;
&lt;br /&gt;
2011-07-29 - lachs0r&lt;br /&gt;
    * Version 0.23:&lt;br /&gt;
        - disabled font hinting by default&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated libass to current git HEAD and included Harfbuzz:&lt;br /&gt;
                - added support for bidirectional text, Arabic shaping etc.&lt;br /&gt;
                - added proper support for @fonts (vertical writing)&lt;br /&gt;
                - slight performance regression&lt;br /&gt;
                  (glyph cache not hooked up with Harfbuzz yet)&lt;br /&gt;
            - updated FreeType to current git HEAD:&lt;br /&gt;
                - fixed outline stroker for some broken fonts&lt;br /&gt;
&lt;br /&gt;
2011-06-16 - lachs0r&lt;br /&gt;
    * Version 0.22:&lt;br /&gt;
        - fixed hang when a glyph with zero dimensions was encountered&lt;br /&gt;
          (mostly vector clips)&lt;br /&gt;
&lt;br /&gt;
2011-06-08 - lachs0r &amp;lt;lachs0r@srsfckn.biz&amp;gt;&lt;br /&gt;
    * Version 0.21:&lt;br /&gt;
        - finally implemented proper subsampling for YV12&lt;br /&gt;
        - temporarily removed YV16 support&lt;br /&gt;
        - renamed parameter verbosity → debuglevel&lt;br /&gt;
        - code cleanups&lt;br /&gt;
        binary:&lt;br /&gt;
            - reverted to GCC 4.5.2 (4.6 miscompiles MinGW)&lt;br /&gt;
&lt;br /&gt;
2011-06-01 - lachs0r&lt;br /&gt;
    * Version 0.20:&lt;br /&gt;
        - fixed the masksub stuff&lt;br /&gt;
        - properly output debug messages to stderr instead of stdout&lt;br /&gt;
        - reformatted source and corrected/removed some comments&lt;br /&gt;
        - modified CMakeLists.txt to strip the binary by default&lt;br /&gt;
        binary:&lt;br /&gt;
            - now built with GCC 4.6 instead of 4.5.2&lt;br /&gt;
            - included enca again&lt;br /&gt;
            - patched fontconfig:&lt;br /&gt;
                - prettier debug output&lt;br /&gt;
                - use the correct location for its cache&lt;br /&gt;
&lt;br /&gt;
2011-02-01 - lachs0r&lt;br /&gt;
    * Version 0.19:&lt;br /&gt;
        This is a bugfix/cleanup release.&lt;br /&gt;
        - fixed possible buffer overflows in timecodesv1 and SRT parsing&lt;br /&gt;
        - fixed random crashes on unloading&lt;br /&gt;
        - probably fixed compilation with MSVC (patch by TheFluff)&lt;br /&gt;
        - very slightly improved performance with GCC&lt;br /&gt;
        - various code cleanups&lt;br /&gt;
&lt;br /&gt;
2011-01-25 - lachs0r&lt;br /&gt;
    * Version 0.18:&lt;br /&gt;
        - improved YV12 support (should be somewhat usable now)&lt;br /&gt;
        - added support for RGB24, YV24, YV16 and Y8 (YUY2 coming soon)&lt;br /&gt;
        - added SRT subtitle format support&lt;br /&gt;
            additional parameter: srt_font (font to use for srt subs)&lt;br /&gt;
        - exposed some libass parameters:&lt;br /&gt;
            line_spacing (line spacing)&lt;br /&gt;
            dar, sar (aspect ratio)&lt;br /&gt;
            top, bottom, left, right (margins)&lt;br /&gt;
            fontdir (additional font directory)&lt;br /&gt;
        - masksub equivalent if used on a blankclip&lt;br /&gt;
            (still buggy - read source for details)&lt;br /&gt;
        - no more global variables&lt;br /&gt;
&lt;br /&gt;
2011-01-17 - lachs0r &lt;br /&gt;
    * Version 0.17:&lt;br /&gt;
        - added rudimentary YV12 support (chroma subsampling still needs work)&lt;br /&gt;
        - binary: Previously, I linked against a very old avisynth_c.lib - now&lt;br /&gt;
                  you shouldn’t get any error messages about “avisynth_c.dll”&lt;br /&gt;
        - tidied up the RGB32 blitter a bit&lt;br /&gt;
&lt;br /&gt;
2011-01-16 - lachs0r&lt;br /&gt;
    * Version 0.15:&lt;br /&gt;
        - reimplemented as AviSynth C plugin - this fixed several crashes and&lt;br /&gt;
          got rid of the major pain in the ass that is MSVC&lt;br /&gt;
        - binary: built with patched Fontconfig (no longer needs fonts.conf)&lt;br /&gt;
    * Version 0.16:&lt;br /&gt;
        - implemented VFRaC support via timecodes files (v1 and v2 supported)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!v0.25&lt;br /&gt;
|[http://srsfckn.biz/assrender/assrender-0.25.7z assrender-0.25.7z]&lt;br /&gt;
|[https://web.archive.org/web/20180118024447if_/http://srsfckn.biz/assrender/assrender-0.25.7z assrender-0.25.7z]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!--[http://encodan.srsfckn.biz/assrender/ C Plugin] - dead link ---&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
*[http://github.com/pinterf/assrender GitHub] - Updated version (v0.30+) &lt;br /&gt;
*[http://github.com/pingplug/assrender GitHub] - Updated version (v0.28), only source code available. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Subtitling|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/AssRender</id>
		<title>AssRender</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/AssRender"/>
				<updated>2021-03-04T14:08:24Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat6|External_filters|Plugins|Plugins_x64|Adjustment_filters|Subtitling|Deep_color_tools}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|1=pinterf, vadosnaprimer, Blitzker, pingplug, lachs0r, TheFluff&lt;br /&gt;
|2=v0.30&lt;br /&gt;
|3=[https://github.com/pinterf/assrender/releases/ assrender-0.35.7z]&lt;br /&gt;
|4=Subtitling&lt;br /&gt;
|5=Source code is MIT license, binaries are GPL&lt;br /&gt;
|6=[https://forum.doom9.org/showthread.php?t=148926 Doom9 Thread]}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
AssRender is an AviSynth plugin that renders ASS/SSA and SRT (without the HTML-like markup) subtitles. It uses libass to render the subtitles.&lt;br /&gt;
&lt;br /&gt;
This also means that it is much more picky about script syntax than VSFilter and friends, so keep that in mind before blaming the filter. Yes, people have reported a lot of errors that were actually the script author’s fault and libass vs VSFilter compatibility.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;'''Note:'''&amp;lt;/span&amp;gt; AssRender is a C-plugin so it must be loaded using [[Plugins#LoadCPlugin|LoadCPlugin]], except if you're using AviSynth+, it allows autoloading of C-plugins.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]&lt;br /&gt;
* [x64]: [[AviSynth+]] &lt;br /&gt;
* Supported color formats: [[RGB24]], [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
** AviSynth+: all [[planar]] formats (8/10/12/14/16bit, Y/YUV/RGB with or without alpha) are supported. [[RGB48]] and [[RGB64]] are also supported.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|assrender (clip, string file, string &amp;quot;vfr&amp;quot;, int &amp;quot;hinting&amp;quot;, float &amp;quot;scale&amp;quot;, float &amp;quot;line_spacing&amp;quot;, float &amp;quot;dar&amp;quot;, float &amp;quot;sar&amp;quot;, int &amp;quot;top&amp;quot;, int &amp;quot;bottom&amp;quot;, int &amp;quot;left&amp;quot;, int &amp;quot;right&amp;quot;, string &amp;quot;charset&amp;quot;, int &amp;quot;debuglevel&amp;quot;, string &amp;quot;fontdir&amp;quot;, string &amp;quot;srt_font&amp;quot;, string &amp;quot;colorspace&amp;quot;) }}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2||clip| }}&lt;br /&gt;
:::Input clip.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2||string|}}&lt;br /&gt;
:::Your subtitle file. May be ASS, SSA or SRT.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|vfr|string| }}&lt;br /&gt;
:::Specify timecodes v1 or v2 file when working with VFRaC.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|hinting|int|0}}&lt;br /&gt;
:::Font hinting mode. Choose between: &lt;br /&gt;
:::*none (0, default), light (1), normal (2) and Freetype native (3) autohinting.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|scale|float|1.0}}&lt;br /&gt;
:::Font scale. Defaults to 1.0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|line_spacing|float|1.0}}&lt;br /&gt;
:::Line spacing in pixels. Defaults to 1.0 and won’t be scaled with frame size. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|dar|float| }}&lt;br /&gt;
::{{Par2|sar|float| }}&lt;br /&gt;
:::Aspect ratio. Of course you need to set both parameters.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|top|int|0}}&lt;br /&gt;
::{{Par2|bottom|int|0}}&lt;br /&gt;
::{{Par2|left|int|0}}&lt;br /&gt;
::{{Par2|right|int|0}}&lt;br /&gt;
:::Margins. They will be added to the frame size and may be negative.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|charset|string|&amp;quot;UTF-8&amp;quot;}}&lt;br /&gt;
:::Character set to use, in GNU iconv or enca format. Defaults to UTF-8.&lt;br /&gt;
:::Example enca format: enca:pl:cp1250 (guess the encoding for Polish, fall back on cp1250)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|debuglevel|int|0}}&lt;br /&gt;
:::How much crap assrender is supposed to spam to stderr.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|fontdir|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
:::Additional font directory.&lt;br /&gt;
:::Useful if you are lazy but want to keep your system fonts clean.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|srt_font|string|&amp;quot;Sans&amp;quot;}}&lt;br /&gt;
:::Font to use for SRT subtitles. Defaults to whatever Fontconfig chooses for “Sans”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|colorspace|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
:::The color space of your (YUV) video. Possible values:&lt;br /&gt;
:::* &amp;quot;Rec2020&amp;quot;, &amp;quot;BT.2020&amp;quot;&lt;br /&gt;
:::* &amp;quot;Rec709&amp;quot;, &amp;quot;BT.709&amp;quot;&lt;br /&gt;
:::* &amp;quot;Rec601&amp;quot;, &amp;quot;BT.601&amp;quot;&lt;br /&gt;
:::* &amp;quot;PC.709&amp;quot;&lt;br /&gt;
:::* &amp;quot;PC.601&amp;quot;&lt;br /&gt;
:::* &amp;quot;TV.fcc&amp;quot;, &amp;quot;PC.fcc&amp;quot;&lt;br /&gt;
:::* &amp;quot;TV.240m&amp;quot;, &amp;quot;PC.240m&amp;quot;&lt;br /&gt;
:::* &amp;quot;none&amp;quot;, &amp;quot;guess&amp;quot;&lt;br /&gt;
:::Default is to use the ASS script's &amp;quot;YCbCr Matrix&amp;quot; or &amp;quot;Video Colorspace&amp;quot; property.&lt;br /&gt;
:::Recognized .ASS properties: &amp;quot;TV.601&amp;quot; &amp;quot;TV.709&amp;quot;, &amp;quot;PC.601&amp;quot; &amp;quot;PC.709&amp;quot; &amp;quot;TV.240m&amp;quot; &amp;quot;PC.240m&amp;quot; &amp;quot;TV.fcc&amp;quot; &amp;quot;PC.fcc&amp;quot; and &amp;quot;none&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:::&amp;quot;none&amp;quot; and &amp;quot;guess&amp;quot; decides upon on video resolution: width &amp;gt; 1280 or height &amp;gt; 576 → BT.709, else → BT.601. When no hint found in ASS script and 'colorspace' parameter is empty then the default is BT.601.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
 [[AviSource]](&amp;quot;Blah.avi&amp;quot;)&lt;br /&gt;
 AssRender(&amp;quot;subtitles.ass&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
2021-03-04 - pinterf&lt;br /&gt;
     * Version 0.35:&lt;br /&gt;
        - Windows MSVC: Update to libass v0.15 (git submodule update --init --recursive --remote) For changes since v0.14 see https://github.com/libass/libass/blob/master/Changelog&lt;br /&gt;
        - don't guess base on video resolution (realfinder) if .ass file has no Matrix info then it should be treated as it &amp;quot;Rec601&amp;quot; to maintain compatibility&lt;br /&gt;
        - Parameter 'colorspace' default value is no longer &amp;quot;guess&amp;quot;&lt;br /&gt;
        - Add more color options: PC.709, PC.601, TV.fcc, PC.fcc, TV.240m, PC.240m, none. &amp;quot;none&amp;quot; and &amp;quot;guess&amp;quot; implies &amp;quot;guess-by-resolution&amp;quot;.&lt;br /&gt;
        - Fix: possible crash on initializing phase (buffer overread, linux crashed, Windows was just lucky)&lt;br /&gt;
&lt;br /&gt;
2021-03-01 - pinterf&lt;br /&gt;
     * Version 0.34:&lt;br /&gt;
        - Fix the fix: revert matrix change made in 0.33&lt;br /&gt;
        - Fix: Check matrix from .ASS file &amp;quot;YCbCr Matrix:&amp;quot; section besides &amp;quot;Video Colorspace:&amp;quot; Recognized values are &amp;quot;tv.601&amp;quot; and &amp;quot;tv.709&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2021-02-28 - pinterf&lt;br /&gt;
     * Version 0.33:&lt;br /&gt;
        - Fix: wrong Bt.709 matrix (it wasn't :) )&lt;br /&gt;
&lt;br /&gt;
2021-02-27 - pinterf&lt;br /&gt;
     * Version 0.32:&lt;br /&gt;
        - Fix: treat I420 variant as YV12 instead of unsupported color space&lt;br /&gt;
&lt;br /&gt;
2021-02-18 - pinterf&lt;br /&gt;
     * Version 0.31:&lt;br /&gt;
        - Fix colors for planar RGB&lt;br /&gt;
        - code: hidden ifdef FOR_AVISYNTH_26_ONLY for Avisynth 2.6-only build&lt;br /&gt;
&lt;br /&gt;
2021-02-17 - pinterf&lt;br /&gt;
     * Version 0.30:&lt;br /&gt;
        - 10-16 bit support (including RGB48 and RGB64)&lt;br /&gt;
        - YV411, Planar RGB support&lt;br /&gt;
&lt;br /&gt;
2021-02-16 - pinterf&lt;br /&gt;
     * Version 0.29:&lt;br /&gt;
        - project moved to https://github.com/pinterf/assrender from https://github.com/vadosnaprimer/assrender&lt;br /&gt;
        - Move to Visual Studio 2019 - v142 platform toolset&lt;br /&gt;
        - Add .def module definition file for Avisynth 2.6 std compatibility (function name mangling)&lt;br /&gt;
        - Update Avisynth C headers&lt;br /&gt;
        - Check Linux and gcc-MinGW CMake build&lt;br /&gt;
        - Add build instructions and change log to README&lt;br /&gt;
&lt;br /&gt;
2019-01-14 - vadosnaprimer&lt;br /&gt;
        - https://github.com/vadosnaprimer/assrender/&lt;br /&gt;
        - add batch that lets not to change deps sdk and vs version copied from SMP libass&lt;br /&gt;
        - update SMP submodules&lt;br /&gt;
&lt;br /&gt;
2016-10-18 - Blitzker&lt;br /&gt;
        - https://github.com/Blitzker/assrender&lt;br /&gt;
        - Visual Studio 2015 support&lt;br /&gt;
&lt;br /&gt;
2012-04-20 - lachs0r &lt;br /&gt;
    * Version 0.25:&lt;br /&gt;
        - code restructured&lt;br /&gt;
        - added support for the BT.709 color space and the “Video Colorspace”&lt;br /&gt;
          property that has been introduced with recent versions of Aegisub.&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated everything, switched to MinGW-w64&lt;br /&gt;
              (same toolchain as mplayer2 now)&lt;br /&gt;
&lt;br /&gt;
2011-09-22 - lachs0r &lt;br /&gt;
    * Version 0.24.1:&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated libass to current git HEAD&lt;br /&gt;
            - switched Harfbuzz to libass’ compatibility branch&lt;br /&gt;
            - compiled Harfbuzz without Uniscribe backend&lt;br /&gt;
              fixes lots of crashes and misbehavior&lt;br /&gt;
&lt;br /&gt;
2011-07-29 - lachs0r&lt;br /&gt;
    * Version 0.24:&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated libass to current git HEAD:&lt;br /&gt;
                - fixed performance regression&lt;br /&gt;
&lt;br /&gt;
2011-07-29 - lachs0r&lt;br /&gt;
    * Version 0.23:&lt;br /&gt;
        - disabled font hinting by default&lt;br /&gt;
        binary:&lt;br /&gt;
            - updated libass to current git HEAD and included Harfbuzz:&lt;br /&gt;
                - added support for bidirectional text, Arabic shaping etc.&lt;br /&gt;
                - added proper support for @fonts (vertical writing)&lt;br /&gt;
                - slight performance regression&lt;br /&gt;
                  (glyph cache not hooked up with Harfbuzz yet)&lt;br /&gt;
            - updated FreeType to current git HEAD:&lt;br /&gt;
                - fixed outline stroker for some broken fonts&lt;br /&gt;
&lt;br /&gt;
2011-06-16 - lachs0r&lt;br /&gt;
    * Version 0.22:&lt;br /&gt;
        - fixed hang when a glyph with zero dimensions was encountered&lt;br /&gt;
          (mostly vector clips)&lt;br /&gt;
&lt;br /&gt;
2011-06-08 - lachs0r &amp;lt;lachs0r@srsfckn.biz&amp;gt;&lt;br /&gt;
    * Version 0.21:&lt;br /&gt;
        - finally implemented proper subsampling for YV12&lt;br /&gt;
        - temporarily removed YV16 support&lt;br /&gt;
        - renamed parameter verbosity → debuglevel&lt;br /&gt;
        - code cleanups&lt;br /&gt;
        binary:&lt;br /&gt;
            - reverted to GCC 4.5.2 (4.6 miscompiles MinGW)&lt;br /&gt;
&lt;br /&gt;
2011-06-01 - lachs0r&lt;br /&gt;
    * Version 0.20:&lt;br /&gt;
        - fixed the masksub stuff&lt;br /&gt;
        - properly output debug messages to stderr instead of stdout&lt;br /&gt;
        - reformatted source and corrected/removed some comments&lt;br /&gt;
        - modified CMakeLists.txt to strip the binary by default&lt;br /&gt;
        binary:&lt;br /&gt;
            - now built with GCC 4.6 instead of 4.5.2&lt;br /&gt;
            - included enca again&lt;br /&gt;
            - patched fontconfig:&lt;br /&gt;
                - prettier debug output&lt;br /&gt;
                - use the correct location for its cache&lt;br /&gt;
&lt;br /&gt;
2011-02-01 - lachs0r&lt;br /&gt;
    * Version 0.19:&lt;br /&gt;
        This is a bugfix/cleanup release.&lt;br /&gt;
        - fixed possible buffer overflows in timecodesv1 and SRT parsing&lt;br /&gt;
        - fixed random crashes on unloading&lt;br /&gt;
        - probably fixed compilation with MSVC (patch by TheFluff)&lt;br /&gt;
        - very slightly improved performance with GCC&lt;br /&gt;
        - various code cleanups&lt;br /&gt;
&lt;br /&gt;
2011-01-25 - lachs0r&lt;br /&gt;
    * Version 0.18:&lt;br /&gt;
        - improved YV12 support (should be somewhat usable now)&lt;br /&gt;
        - added support for RGB24, YV24, YV16 and Y8 (YUY2 coming soon)&lt;br /&gt;
        - added SRT subtitle format support&lt;br /&gt;
            additional parameter: srt_font (font to use for srt subs)&lt;br /&gt;
        - exposed some libass parameters:&lt;br /&gt;
            line_spacing (line spacing)&lt;br /&gt;
            dar, sar (aspect ratio)&lt;br /&gt;
            top, bottom, left, right (margins)&lt;br /&gt;
            fontdir (additional font directory)&lt;br /&gt;
        - masksub equivalent if used on a blankclip&lt;br /&gt;
            (still buggy - read source for details)&lt;br /&gt;
        - no more global variables&lt;br /&gt;
&lt;br /&gt;
2011-01-17 - lachs0r &lt;br /&gt;
    * Version 0.17:&lt;br /&gt;
        - added rudimentary YV12 support (chroma subsampling still needs work)&lt;br /&gt;
        - binary: Previously, I linked against a very old avisynth_c.lib - now&lt;br /&gt;
                  you shouldn’t get any error messages about “avisynth_c.dll”&lt;br /&gt;
        - tidied up the RGB32 blitter a bit&lt;br /&gt;
&lt;br /&gt;
2011-01-16 - lachs0r&lt;br /&gt;
    * Version 0.15:&lt;br /&gt;
        - reimplemented as AviSynth C plugin - this fixed several crashes and&lt;br /&gt;
          got rid of the major pain in the ass that is MSVC&lt;br /&gt;
        - binary: built with patched Fontconfig (no longer needs fonts.conf)&lt;br /&gt;
    * Version 0.16:&lt;br /&gt;
        - implemented VFRaC support via timecodes files (v1 and v2 supported)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!v0.25&lt;br /&gt;
|[http://srsfckn.biz/assrender/assrender-0.25.7z assrender-0.25.7z]&lt;br /&gt;
|[https://web.archive.org/web/20180118024447if_/http://srsfckn.biz/assrender/assrender-0.25.7z assrender-0.25.7z]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!--[http://encodan.srsfckn.biz/assrender/ C Plugin] - dead link ---&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
*[http://github.com/pinterf/assrender GitHub] - Updated version (v0.30+) &lt;br /&gt;
*[http://github.com/pingplug/assrender GitHub] - Updated version (v0.28), only source code available. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Subtitling|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2020-06-26T03:41:17Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, real.finder&lt;br /&gt;
| v3.364s&lt;br /&gt;
| 3=[https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[https://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[https://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[https://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[https://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared.avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi GitHub]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/Asd-g/AviSynth-EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[https://github.com/pinterf/EEDI3/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[https://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[https://github.com/pinterf/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[https://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|&amp;lt;strike&amp;gt;Not necessarily required but may improve speed when working with a [[YUY2]] source.&amp;lt;/strike&amp;gt; Don't use it in avs+ for now&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[https://github.com/pinterf/TIVTC/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[https://github.com/Asd-g/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/MSharpen</id>
		<title>MSharpen</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/MSharpen"/>
				<updated>2020-06-11T18:55:36Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: the real threshold is not 10 (from the Source code)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Plugins|Plugins_x64|Adjustment_filters|Sharpeners}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
| {{Author/tp7}}&lt;br /&gt;
| v0.9&lt;br /&gt;
|[http://github.com/tp7/msharpen/releases/download/0.9/msharpen-x86.zip msharpen-x86.zip] &lt;br /&gt;
[http://github.com/tp7/msharpen/releases/download/0.9/msharpen-x64.zip msharpen-x64.zip]&lt;br /&gt;
| Sharpeners &lt;br /&gt;
| [http://opensource.org/licenses/MIT MIT] but binaries are [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=169832 Doom9 Thread]}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;tt&amp;gt;MSharpen&amp;lt;/tt&amp;gt; is a very simple masked sharpening plugin for AviSynth. This version is a reimplementation of neuron2's [http://rationalqm.us/msharpen/msharpen.html old &amp;lt;tt&amp;gt;MSharpen&amp;lt;/tt&amp;gt;] plugin. It features better performance, x64 compatibility and less bugs.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater&lt;br /&gt;
* x64 version requires [http://forum.doom9.org/showthread.php?t=168856 AviSynth+ r1576] or later&lt;br /&gt;
* Supported color formats: [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* [http://www.microsoft.com/en-us/download/details.aspx?id=30679 Microsoft Visual C++ 2012 Redistributable Package (x86 / x64)]&lt;br /&gt;
:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;***&amp;lt;/span&amp;gt; &amp;lt;tt&amp;gt;vcredist_x86.exe&amp;lt;/tt&amp;gt; is required for &amp;lt;tt&amp;gt;vinverse-x86&amp;lt;/tt&amp;gt;&lt;br /&gt;
:&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;***&amp;lt;/span&amp;gt; &amp;lt;tt&amp;gt;vcredist_x64.exe&amp;lt;/tt&amp;gt; is required for &amp;lt;tt&amp;gt;vinverse-x64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef|MSharpen (clip, int &amp;quot;threshold&amp;quot;, int &amp;quot;strength&amp;quot;, bool &amp;quot;highq&amp;quot;, bool &amp;quot;mask&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
:::Input clip&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|threshold|int|15}}&lt;br /&gt;
:::Determines what is detected as edge detail and thus sharpened. To see what edge detail areas will be sharpened, use the 'mask' parameter.&lt;br /&gt;
:::Range: 0 to 255&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|strength|int|100}}&lt;br /&gt;
:::Strength of the sharpening to be applied to the edge detail areas. It is applied only to the edge detail areas as determined by the threshold parameter. Strength 255 is the strongest sharpening.&lt;br /&gt;
:::Range: 0 to 255&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|highq|bool|true}}&lt;br /&gt;
:::Lets you tradeoff speed for quality of detail detection. Set it to true for the best detail detection. Set it to false for maximum speed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|mask|bool|false}}&lt;br /&gt;
:::When set to true, the areas to be sharpened are shown in white against a black background. Use this to set the level of detail to be sharpened. This function also makes a basic edge detection filter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples == &lt;br /&gt;
&amp;lt;tt&amp;gt;MSharpen&amp;lt;/tt&amp;gt; with default settings:&lt;br /&gt;
 [[AviSource]](&amp;quot;blah.avi&amp;quot;)&lt;br /&gt;
 MSharpen(threshold=10, strength=100, highq=true, mask=false)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
 v0.9         11/28/2013      - Initial release. Only Avisynth+ and Avisynth 2.6 are supported.&lt;br /&gt;
                              - YUY2 support and MMX code path removed.&lt;br /&gt;
                              - All code paths are faster than before, planar processing in SSE2-optimized. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;400px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Source Code&lt;br /&gt;
|-&lt;br /&gt;
!v0.9&lt;br /&gt;
|[http://github.com/tp7/msharpen/releases/download/0.9/msharpen-x86.zip msharpen-x86.zip] &lt;br /&gt;
[http://github.com/tp7/msharpen/releases/download/0.9/msharpen-x64.zip msharpen-x64.zip] &lt;br /&gt;
|[http://github.com/tp7/msharpen/archive/0.9.zip msharpen-0.9.zip]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
*[http://github.com/tp7/msharpen GitHub] - Source code repository.&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=42839 Doom9 Forum] - Original MSharpen discussion.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Sharpeners|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2020-05-05T18:15:10Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, real.finder&lt;br /&gt;
| v3.364s&lt;br /&gt;
| 3=[https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[http://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[http://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[http://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[http://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared.avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi github]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/avisynth-repository/EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[http://github.com/Elegant996/EEDI3/releases/ GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[http://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[http://github.com/Khanattila/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[http://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|Not necessarily required but may improve speed when working with a [[YUY2]] source.&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[http://avisynth.nl/index.php/TDeint 32-bit] /// [http://www.mediafire.com/download/kmcztm1xzjm/TDeinterlace_3-14-2010.rar 64-bit]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[http://github.com/chikuzen/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2020-05-05T18:12:51Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Optional Plugins and Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, real.finder&lt;br /&gt;
| v3.364s&lt;br /&gt;
| 3=[https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[http://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[http://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[http://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[http://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared.avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi github]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
SMDegrain Requirements Plugins not needed for QTGMC, only SMDegrain.avsi is needed since it has shared functions that used in QTGMC, same things for any Required Script for QTGMC&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/avisynth-repository/EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[http://github.com/Elegant996/EEDI3/releases/ GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[http://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[http://github.com/Khanattila/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[http://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|Not necessarily required but may improve speed when working with a [[YUY2]] source.&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[http://avisynth.nl/index.php/TDeint 32-bit] /// [http://www.mediafire.com/download/kmcztm1xzjm/TDeinterlace_3-14-2010.rar 64-bit]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[http://github.com/chikuzen/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/QTGMC</id>
		<title>QTGMC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/QTGMC"/>
				<updated>2020-05-05T18:11:56Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Core Plugins and scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat4|External_filters|Scripts|Restoration_filters|Deinterlacers}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
| Vit, real.finder&lt;br /&gt;
| v3.364s&lt;br /&gt;
| 3=[https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.6%20and%20up/QTGMC.avsi QTGMC.avsi] &lt;br /&gt;
| 4=Deinterlacers&lt;br /&gt;
| 5=&lt;br /&gt;
| 6=[http://forum.doom9.org/showthread.php?t=156028 Doom9 Thread (original)]&amp;lt;br&amp;gt;[http://forum.doom9.org/showthread.php?t=174544 Update (real.finder mod)]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A very high quality deinterlacer with a range of features for both quality and convenience. These include a simple presets system, extensive noise processing capabilities, support for repair of progressive material, precision source matching, shutter speed simulation, etc. Originally based on [[TempGaussMC]] by Didée.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
QTGMC requires the latest version of the following plugins:&lt;br /&gt;
&lt;br /&gt;
====Core Plugins and scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[MaskTools2]]&lt;br /&gt;
|[http://github.com/pinterf/masktools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[MVTools|MVTools2]]&lt;br /&gt;
|[http://github.com/pinterf/mvtools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[nnedi3]]&lt;br /&gt;
|[http://github.com/jpsdr/NNEDI3/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[RgTools]]&lt;br /&gt;
|[http://github.com/pinterf/RgTools/releases GitHub]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Zs_RF_Shared.avsi]]&lt;br /&gt;
|[https://github.com/realfinder/AVS-Stuff/raw/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi github]&lt;br /&gt;
|This script is required from now on.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
SMDegrain Requirements Plugins not needed for QTGMC, only SMDegrain.avsi is needed since it has shared functions that used in QTGMC, same things for any Required Script for QTGMC&lt;br /&gt;
&lt;br /&gt;
====Optional Plugins and Scripts====&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!! style=&amp;quot;width: 113px&amp;quot; | Wiki page&lt;br /&gt;
!! style=&amp;quot;width: 175px&amp;quot; | Download&lt;br /&gt;
!! style=&amp;quot;width: 575px&amp;quot; | Comments&lt;br /&gt;
|-&lt;br /&gt;
|[[AddGrainC]]&lt;br /&gt;
|[https://github.com/pinterf/AddGrainC/releases GitHub]&lt;br /&gt;
|Only required if &amp;lt;code&amp;gt;NoiseDeint=&amp;quot;Generate&amp;quot;&amp;lt;/code&amp;gt; is selected for noise bypass.&lt;br /&gt;
|-&lt;br /&gt;
|[[dfttest]]&lt;br /&gt;
|[https://github.com/pinterf/dfttest/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[EEDI2]]&lt;br /&gt;
|[https://github.com/avisynth-repository/EEDI2/releases GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[eedi3|EEDI3]]&lt;br /&gt;
|[http://github.com/Elegant996/EEDI3/releases/ GitHub]&lt;br /&gt;
|Only required if selected directly or via a source-match preset.&lt;br /&gt;
|-&lt;br /&gt;
|[[FFT3DFilter]]&lt;br /&gt;
|[http://github.com/pinterf/fft3dfilter/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing.&lt;br /&gt;
|-&lt;br /&gt;
|[[KNLMeansCL]]&lt;br /&gt;
|[http://github.com/Khanattila/KNLMeansCL/releases GitHub]&lt;br /&gt;
|Only required if selected for noise processing. &lt;br /&gt;
|-&lt;br /&gt;
|[[PlanarTools]]&lt;br /&gt;
|[http://github.com/chikuzen/PlanarTools/releases GitHub]&lt;br /&gt;
|Not necessarily required but may improve speed when working with a [[YUY2]] source.&lt;br /&gt;
|-&lt;br /&gt;
|[[TDeint]]&lt;br /&gt;
|[http://avisynth.nl/index.php/TDeint 32-bit] /// [http://www.mediafire.com/download/kmcztm1xzjm/TDeinterlace_3-14-2010.rar 64-bit]&lt;br /&gt;
|Only required if selected directly or via a source-match preset. &lt;br /&gt;
|-&lt;br /&gt;
|[[yadifmod2]]&lt;br /&gt;
|[http://github.com/chikuzen/yadifmod2/releases GitHub]&lt;br /&gt;
|Only required for &amp;lt;code&amp;gt;Preset=&amp;quot;Ultra Fast&amp;quot;&amp;lt;/code&amp;gt; or if selected directly.&lt;br /&gt;
|-&lt;br /&gt;
|[[AnimeIVTC]]&lt;br /&gt;
|[http://pastebin.com/raw/z976zmzj pastebin] [https://forum.doom9.org/attachment.php?attachmentid=16317&amp;amp;d=1524003741 Doom9]&lt;br /&gt;
|Script is only required when working with a [[YUY2]] source.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dfttest, FFT3DFilter and MVTools2 need the [http://www.fftw.org/ FFTW3 library] ([http://www.fftw.org/install/windows.html windows builds]). On a 64-bit Windows OS, extract the 32-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''SysWow64'' folder. &lt;br /&gt;
&lt;br /&gt;
If you want to use the 64-bit libfftw3f-3.dll versions then extract the 64-bit &amp;lt;code&amp;gt;libfftw3f-3.dll&amp;lt;/code&amp;gt;. Make a copy of it and rename it as &amp;quot;FFTW3.dll&amp;quot;. Place the files &amp;quot;libfftw3f-3.dll&amp;quot; and &amp;quot;FFTW3.dll&amp;quot; in the ''System32'' folder.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YourSource(&amp;quot;yourfile&amp;quot;)    # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot; )&lt;br /&gt;
SelectEven()              # Add this line to keep original frame rate, leave it out for smoother doubled frame rate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this script with an &amp;quot;.avs&amp;quot; extension. You can now use it as an AVI source for encoding.&lt;br /&gt;
&lt;br /&gt;
''Most users should only use presets.'' The &amp;quot;Preset&amp;quot; used selects sensible settings for a given speed. Choose from:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;quot;Placebo&amp;quot; • &amp;quot;Very Slow&amp;quot; • &amp;quot;Slower&amp;quot; • &amp;quot;Slow&amp;quot; • &amp;quot;Medium&amp;quot; • &amp;quot;Fast&amp;quot; • &amp;quot;Faster&amp;quot; • &amp;quot;Very Fast&amp;quot; • &amp;quot;Super Fast&amp;quot; • &amp;quot;Ultra Fast&amp;quot; • &amp;quot;Draft&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The default preset is '''&amp;quot;Slower&amp;quot;'''. Don't be obsessed with using the slowest settings, the differences can be very small for a huge increase in time. In particular HD material benefits less from extreme settings. HD is 6-8 times as slow as SD.&lt;br /&gt;
&lt;br /&gt;
There are many settings for tweaking this script, full details are provided in this documentation. The settings have been divided into categories, which each having key points, a detailed description, settings specifications/defaults, and several examples. The key points and examples should get you going. You can display settings currently being used with ''ShowSettings'':&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, ShowSettings=true )&lt;br /&gt;
&lt;br /&gt;
===Multi-Threaded Usage===&lt;br /&gt;
&lt;br /&gt;
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need one of the &amp;quot;MT&amp;quot; versions of Avisynth from the [[Main Page]], only [http://forum.doom9.org/showthread.php?t=148782 2.6.0 MT by SEt] is supported. Use the multithreaded plugin pack in this case.&lt;br /&gt;
&lt;br /&gt;
You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):&lt;br /&gt;
&lt;br /&gt;
 SetMTMode(5, ''X'')        # See ''X'' below&lt;br /&gt;
 SetMemoryMax(''M'')        # Optional line. Leave it out at first. See ''M'' below&lt;br /&gt;
 YourSource(&amp;quot;yourfile&amp;quot;) # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires&lt;br /&gt;
 SetMTMode(2)&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiThreads=''Y'' ) # Choose preset based on overall speed/quality you want. See ''Y'' below&lt;br /&gt;
 Distributor()          # This line may or may not be necessary, try removing it and see if you get more speed&lt;br /&gt;
&lt;br /&gt;
====SetMTMode ''X''====&lt;br /&gt;
* Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)&lt;br /&gt;
* If it crashes, decrease 1 at a time&lt;br /&gt;
* Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down&lt;br /&gt;
&lt;br /&gt;
====EdiThreads ''Y''====&lt;br /&gt;
* Start at about half number of cores and tweak upwards or downwards (but don't choose 0)&lt;br /&gt;
* Reducing this value may help stability, and might allow you to increase X for an overall speedup&lt;br /&gt;
&lt;br /&gt;
====SetMemoryMax ''M''====&lt;br /&gt;
* First try without the SetMemoryMax line&lt;br /&gt;
* However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings&lt;br /&gt;
* Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup&lt;br /&gt;
&lt;br /&gt;
====Notes====&lt;br /&gt;
* '''Do not use MT()'''.&lt;br /&gt;
* There are occasional instabilities with multi-threading, because AviSynth and plugins are not quite thread-safe. These instabilities affect different users in different ways: some report no issues, others can barely get multi-threading to work at all. But do try it as the speed increase can be considerable.&lt;br /&gt;
&lt;br /&gt;
==Features / Settings==&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': For basic usage, ''select a preset and leave the core settings alone''.&lt;br /&gt;
&lt;br /&gt;
===Core Settings===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Most useful setting is TR2, which controls smoothing of output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| TR0&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used to create motion search clip. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR1&lt;br /&gt;
| (1,2)&lt;br /&gt;
| Temporal binomial smoothing radius used on interpolated clip for inital output. In general 2=quality, 1=speed&lt;br /&gt;
|-&lt;br /&gt;
| TR2&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Temporal linear smoothing radius used for final stablization / denoising. Increase for smoother output&lt;br /&gt;
|-&lt;br /&gt;
| Rep0&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair motion search clip (0 = off): repair unwanted blur after temporal smooth TR0&lt;br /&gt;
|-&lt;br /&gt;
| Rep1&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair initial output clip (0 = off): repair unwanted blur after temporal smooth TR1&lt;br /&gt;
|-&lt;br /&gt;
| Rep2&lt;br /&gt;
| (int)&lt;br /&gt;
| Repair final output clip (0 = off): unwanted blur after temporal smooth TR2 (will also repair TR1 blur if Rep1 not used)&lt;br /&gt;
|-&lt;br /&gt;
| RepChroma&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether the repair modes affect chroma. Default: '''True'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
RepX syntax: first digit (0-5): how wide thin shimmering lines can be and still get removed, from 1px to ~3px; second digit (0-3): to restore a bit beyond the detected lines. A single digit counts as the first digit.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, TR2=3 )  # Strong final smooth (e.g. noisy / shimmery source)&lt;br /&gt;
&lt;br /&gt;
====Algorithm Details====&lt;br /&gt;
&lt;br /&gt;
The core algorithm is this:&lt;br /&gt;
&amp;lt;ol start=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Bob the source clip. Temporally smooth the bob to remove shimmer then analyse its motion&lt;br /&gt;
&amp;lt;li&amp;gt; More accurately interpolate the source clip (e.g. NNEDI3). Use the motion analysis from previous step to temporally smooth this interpolate with motion compensation. This removes shimmer whilst retaining detail. Resharpen the result to counteract any blurring&lt;br /&gt;
&amp;lt;li&amp;gt; A final light temporal smooth to clean the result&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stages 0 &amp;amp; 1 use a binomial smooth (similar to a Gaussian) to remove deinterlacing shimmer. Stage 2 uses a simple linear smoothing. Each stage's temporal radius (the number of frames out from the current) is given in the settings '''TR0''', '''TR1''' and '''TR2'''.&lt;br /&gt;
&lt;br /&gt;
The shimmer reduction is critical for the algorithm so TR0 and TR1 should be at least 1. TR0 only affects the motion analysis and is only indirectly visible, increasing it to 2 will generally give a better motion match. Increasing TR1 and TR2 will create a smoother and more stable output and more strongly denoise; the downside is increased blurring and possibly lost detail, and potentially can cause stronger artifacts where motion analysis is inaccurate. The blur is partially counteracted by the sharpening settings.&lt;br /&gt;
&lt;br /&gt;
The deinterlacer primarily tries to reduce &amp;quot;bob shimmer&amp;quot;: horizontal lines of shimmer created when interpolating an interlaced stream. Consequently any changes made to the initial interpolation (e.g. NNEDI3) are expected to be horizontal lines of change only. The repair stages '''Rep0''', '''Rep1''' and '''Rep2''' occur after each temporal smooth. They only allow such horizontal lines of change - shimmer fixes, discarding other changes. This prevents the motion blur&lt;br /&gt;
that temporal smoothing could generate. The repX settings control the size of areas to allow through. (See the ''QTGMC_KeepOnlyBobShimmerFixes'' function comments for more detail.)&lt;br /&gt;
&lt;br /&gt;
===Motion Analysis===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': The presets make sensible choices for motion analysis. Some sources or requirements may require tweaks, but read these and MVTools2 docs first.&lt;br /&gt;
&lt;br /&gt;
The bobbed source clip is sent to the MVTools2 plugin to perform motion analysis. Almost all these settings are used directly in MVTools2 functions. Read the MVTools2 documentation for more details on their purpose. Some settings can be altered for a speed / accuracy tradeoff. Less accurate motion search can result in blurring and/or oversharpening (in different circumstances) as well as slight distortions of visual elements. The faster presets gain speed by simplifying the motion search parameters, use the &amp;quot;ShowSettings&amp;quot; parameter or look at the table a short way into the script to see how.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| SrchClipPP&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Pre-filtering for motion search clip, 0 = none, 1 = simple blur, 2 = Gauss blur, 3 = Gauss blur + edge soften&lt;br /&gt;
|-&lt;br /&gt;
| SubPel&lt;br /&gt;
| (1,2,4)&lt;br /&gt;
| Sub-pixel accuracy for motion analysis (1 = 1 pixel, 2 = 1/2 pixel, 4 = 1/4 pixel)&lt;br /&gt;
|-&lt;br /&gt;
| SubPelInterp&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Interpolation used for sub-pixel motion analysis: 0 = bilinear (soft), 1 = bicubic (sharper), 2 = Weiner (sharpest) Default: '''2'''&lt;br /&gt;
|-&lt;br /&gt;
| Blocksize&lt;br /&gt;
| (4,8,16,32)&lt;br /&gt;
| Size of blocks that are matched during motion analysis&lt;br /&gt;
|-&lt;br /&gt;
| Overlap&lt;br /&gt;
| (0-Blocksize/2)&lt;br /&gt;
| How much to overlap motion analysis blocks (requires more blocks, but essential to smooth block edges in motion compenstion)&lt;br /&gt;
|-&lt;br /&gt;
| Search&lt;br /&gt;
| (0...5)&lt;br /&gt;
| Search method used for matching motion blocks - see MVTools2 documentation for available algorithms&lt;br /&gt;
|-&lt;br /&gt;
| SearchParam&lt;br /&gt;
| (0...)&lt;br /&gt;
| Parameter for search method chosen. For default search method (hexagon search) it is the search range&lt;br /&gt;
|-&lt;br /&gt;
| PelSearch&lt;br /&gt;
| (0...)&lt;br /&gt;
| Search parameter (as above) for the finest sub-pixel level (see SubPel)&lt;br /&gt;
|-&lt;br /&gt;
| ChromaMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to consider chroma when analyzing motion. Setting to false gives good speed-up, but may very occasionally make incorrect motion decision.&lt;br /&gt;
|-&lt;br /&gt;
| TrueMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to use the 'truemotion' defaults from MAnalyse (see MVTools2 documentation) Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Lambda&lt;br /&gt;
| (0...)&lt;br /&gt;
| Motion vector field coherence - how much the motion analysis favors similar motion vectors for neighboring blocks. Should be scaled by BlockSize*BlockSize/64&lt;br /&gt;
|-&lt;br /&gt;
| LSAD&lt;br /&gt;
| (0...)&lt;br /&gt;
| How much to reduce need for vector coherence (i.e. Lambda above) if prediction of motion vector from neighbors is poor, typically in areas of complex motion. This value is scaled in MVTools (unlike Lambda)&lt;br /&gt;
|-&lt;br /&gt;
| PNew&lt;br /&gt;
| (0...)&lt;br /&gt;
| Penalty for choosing a new motion vector for a block over an existing one - avoids chosing new vectors for minor gain&lt;br /&gt;
|-&lt;br /&gt;
| PLevel&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Mode for scaling lambda across different sub-pixel levels - see MVTools2 documentation for choices&lt;br /&gt;
|-&lt;br /&gt;
| GlobalMotion&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to estimate camera motion to assist in selecting block motion vectors. Default: '''True'''&lt;br /&gt;
|-&lt;br /&gt;
| DCT&lt;br /&gt;
| (0...10)&lt;br /&gt;
| Modes to use DCT (frequency analysis) or SATD as part of the block matching process - see MVTools2 documentation for choices.  Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on shimmer-removing temporal smooth (''TR1''). Increase to reduce bob-shimmer more (may smear/blur) Default: '''640'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSAD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| SAD threshold for block match on final denoising temporal smooth (''TR2''). Increase to strengthen final smooth (may smear/blur) Default: '''256'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD1&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 1 - see MVTools documentation. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ThSCD2&lt;br /&gt;
| (0...)&lt;br /&gt;
| Scene change detection parameter 2 - see MVTools documentation. Default: '''98'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Defaults: &lt;br /&gt;
&lt;br /&gt;
TrueMotion is false : Lambda = '''(1000 * BlockSize2)/64''', LSAD='''400''',  PNew='''25''', PLevel='''0'''&lt;br /&gt;
&lt;br /&gt;
TrueMotion is true  : Lambda = '''(100  * BlockSize2)/64''', LSAD='''1200''', PNew='''50''', PLevel='''1'''&lt;br /&gt;
&lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
===Interpolation===&lt;br /&gt;
&lt;br /&gt;
'''Key Points''': Interpolation affects quality and speed. The presets can be relied on to provide sensible defaults mostly using NNEDI3.&lt;br /&gt;
&lt;br /&gt;
The first step to create the deinterlaced output is to spatially interpolate a single half-height field into a full-height frame. A variety of interpolators are supported, with various settings to control the quality/speed of the output.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| EdiMode&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method, from &amp;quot;NNEDI3&amp;quot;, &amp;quot;NNEDI2&amp;quot;, &amp;quot;NNEDI&amp;quot;, &amp;quot;EEDI3+NNEDI3&amp;quot; (EEDI3 with sclip from NNEDI3), &amp;quot;EEDI3&amp;quot;, &amp;quot;EEDI2&amp;quot;, &amp;quot;Yadif&amp;quot;, &amp;quot;TDeint&amp;quot; or &amp;quot;RepYadif&amp;quot; (&amp;quot;repaired&amp;quot; Yadif), anything else uses &amp;quot;Bob&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ChromaEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Interpolation method used for chroma. Set to &amp;quot;&amp;quot; to use EdiMode above (default). Otherwise choose from &amp;quot;NNEDI3&amp;quot;, &amp;quot;Yadif&amp;quot; or &amp;quot;Bob&amp;quot; - all high speed variants. This can give a minor speed-up if using a very slow EdiMode (i.e. one of the EEDIx modes) Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| NNSize&lt;br /&gt;
| (0...6)&lt;br /&gt;
| Area around each pixel used as predictor for NNEDI3. A larger area is slower with better quality, read the NNEDI3 docs to see the area choices. Note: area sizes are not in increasing order (i.e. increased value doesn't always mean increased quality)&lt;br /&gt;
|-&lt;br /&gt;
| NNeurons&lt;br /&gt;
| (0...4)&lt;br /&gt;
| Controls number of neurons in NNEDI2 (0-2) &amp;amp; NNEDI3 (0-4), larger = slower and better quality but improvements are small&lt;br /&gt;
|-&lt;br /&gt;
| EdiQual&lt;br /&gt;
| (1,2,3)&lt;br /&gt;
| Quality setting for NNEDI2 (1,2,3) &amp;amp; NNEDI3 (1,2 only). Higher values for better quality - but improvements are marginal&lt;br /&gt;
|-&lt;br /&gt;
| EdiMaxD&lt;br /&gt;
| (1...)&lt;br /&gt;
| Spatial search distance for finding connecting edges in EEDI2 and EEDI3&lt;br /&gt;
|-&lt;br /&gt;
| EdiThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use in EEDI3 &amp;amp; NNEDI2/3, 0 = default = number of logical processors on system. Also affects source-match interpolations. Source-match can add 2 further interpolations per frame, adjusting this setting can help balance system load. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| EdiExt&lt;br /&gt;
| (clip)&lt;br /&gt;
| Provide externally created interpolated clip rather than use one of the above modes. Default: '''undefined'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, EdiMode=&amp;quot;EEDI3&amp;quot;, EdiMaxD=16 ) # Use EEDI3 with an explicit search radius&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Very Slow&amp;quot;, EdiThreads=2 )           # Specify number of threads (with default NNEDI3) useful to tweak if using SetMTMode or source-match&lt;br /&gt;
&lt;br /&gt;
===Sharpness===&lt;br /&gt;
&lt;br /&gt;
Key Points: Always consider adjusting the Sharpness setting to taste. The default 1.0 is fairly sharp. If using source-match the default is 0.2&lt;br /&gt;
&lt;br /&gt;
The core of the algorithm involves a binomial smooth to remove shimmer. So the result needs to be resharpened to counteract this blur. The main setting Sharpness defaults to 1.0, which is a level designed to retain the sharpness of stable areas. However, this level can cause moving areas to be oversharpened so you may wish to reduce the value depending on source. Sharpness when using source-match behaves differently, see that section. The sharpness processing for a given setting is tweaked to remain roughly similar regardless of other settings. However, there will be minor differences, so always consider adjusting sharpness if you tweak other major settings.&lt;br /&gt;
&lt;br /&gt;
Oversharpening is limited either spatially (SLMode = 1,3) or temporally (SLMode = 2,4). Temporal limiting is more &amp;quot;correct&amp;quot; but also more aggressive in preventing sharpening. It's also slower. You can set a small value in the overshoot setting (SOvs) to give the temporal limiting a bit of &amp;quot;headroom&amp;quot;. You can also perform sharpness limiting later in the algorithm (SLMode = 3,4) for more sharpness, but with the potential for minor artefacts.&lt;br /&gt;
Settings 	  	 &lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Sharpness&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)&lt;br /&gt;
|-&lt;br /&gt;
| SMode&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Resharpening mode:  0 = none, 1 = difference from 3x3 blur kernel, 2 = vertical max/min average + 3x3 kernel&lt;br /&gt;
|-&lt;br /&gt;
| SLMode&lt;br /&gt;
| (0,1,2,3,4)&lt;br /&gt;
| Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth&lt;br /&gt;
|-&lt;br /&gt;
| SLRad&lt;br /&gt;
| (0...)&lt;br /&gt;
| Temporal or spatial radius used with sharpness limiting (depends on SLMode). Temporal radius can only be 0,1 or 3&lt;br /&gt;
|-&lt;br /&gt;
| SOvs&lt;br /&gt;
| (0...255)&lt;br /&gt;
| Amount of overshoot allowed with temporal sharpness limiting (SLMode = 2,4), i.e. allow some oversharpening. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| SVThin&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| How much to thin down 1-pixel wide lines that have been widened due to interpolation into neighboring field lines. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| Sbb&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Back blend (blurred) difference between pre &amp;amp; post sharpened clip (minor fidelity improvement): 0 = Off, 1 = before (1st) sharpness limiting, 2 = after (1st) sharpness limiting, 3 = both. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
Other settings defaults are determined by preset.&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=0.4 )           # Reduce oversharpening&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slow&amp;quot;, Sharpness=1.2, SLMode=1 ) # Increase sharpness, use spatial sharpness limiting (which typically allows more sharpening)&lt;br /&gt;
&lt;br /&gt;
===Source Match / Lossless===&lt;br /&gt;
&lt;br /&gt;
Very detailed section for new feature [documentation likely to be thinned as feature matures]&lt;br /&gt;
Note: the effects of this feature are both subtle and precise, intended only for exacting detail. Make sure you can see exacting detail first.&lt;br /&gt;
&lt;br /&gt;
Key Points: Source-match creates higher fidelity output with extra processing. Enable with SourceMatch = 1,2 or 3. Higher values are slower and more accurate. Can combine with Lossless setting (especially Lossless=2) for more detail again. Tweak speed with MatchPreset (like Preset). Will honor artefacts in source, so best used with quality sources. By default Sharpness becomes 0.2 &amp;amp; sharpness limiting (SLMode) is switched off, so adjust sharpness carefully.&lt;br /&gt;
&lt;br /&gt;
Quickstart: The templates below increase in both quality and slowness. Choose a preset as required, the very fastest presets are not suitable though. The default Sharpness=0.2 but you may wish to increase it slightly. Set TR2=1 for clean source, set TR2=2 or TR2=3 (slower) if more denoising required or use noise processing&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X )             # Basic mode, fastest&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=1, Sharpness=XXX, TR2=X, Lossless=2 ) # Good quality, efficient, minor residual combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=2, Sharpness=XXX, TR2=X )             # Good quality, slower, no combing&lt;br /&gt;
 QTGMC( Preset=XXXX, SourceMatch=3, Sharpness=XXX, TR2=X, Lossless=2 ) # Best quality, slowest, very minor residual combing&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Intuitively, a deinterlacer should just inject new fields into the source, leaving the original pixels untouched. The temporal blur/resharpen in this script means that doesn't happen - the source pixels are changed in the output. The (optional) source-match steps attempt to fix this and make the result closer to the source. They work by looking at the difference between output and source at different points in the algorithm and correcting for that difference.&lt;br /&gt;
&lt;br /&gt;
Matching to the source will capture more source detail and reduce oversharpening / haloing. Caveat: the default algorithm temporally smooths but with source-matching much less so (by necessity / design). Source-matching may faithfully recreate artefacts in the source (e.g blocking, banding &amp;amp; some noise) so it's better for quality sources. The SourceMatch setting sets the mode: 0=off (standard [Q]TGMC algorithm), 1,2,3 for progressively more accurate but slower processing. Modes 2 &amp;amp; 3 restore almost exact source detail but are sensitive to noise &amp;amp; introduce occasional aliasing (mode 3 is less affected). Mode 1 is a more conservative halfway stage that rarely introduces artefacts.&lt;br /&gt;
&lt;br /&gt;
Since source-matching recovers sharpness, the Sharpness default is reduced to 0.2. Source-matching may initially appear less sharp than standard processing because it will not oversharpen. However, be careful if raising the sharpness, because sharpness limiting is switched off by default. This is because sharpness limiting reduces the the accuracy of these modes. Use the MatchEnhance setting to exaggerate additional detail found by modes 2 &amp;amp; 3. This gives a sharpening / detail enhancing effect and works well at sensible levels - but it's a slight cheat that should be used with care as it can easily enhance noise. Since source-match is sensitive to source noise you may want to set TR2 to 2 or 3 and/or use some noise processing (see below).&lt;br /&gt;
&lt;br /&gt;
The additional Lossless modes are designed to take source-match to its logical conclusion: Lossless mode 1 restores the *exact* pixels of the source into the output (provided NoiseRestore=0). This recovers a liitle more source detail but can introduce shimmering, minor combing, noise etc. Note the Sharpness and MatchEnhance settings have little effect in lossless mode 1. Lossless mode 2 makes the clip lossless before the sharpening &amp;amp; final temporal smooth. This removes most of the lossless artefacts and also allows sharpness control. This mode will not give an exactly lossless output but it will gain a little more detail.&lt;br /&gt;
&lt;br /&gt;
The source-match settings introduce further processing. SourceMatch mode 1 requires a second interpolation (e.g. NNEDI3), but it can use a lower quality settings than the main stage. SourceMatch mode 2 requires yet another interpolation, but works effectively with just a bob (but using a better interpolator can reduce occasional aliasing). Mode 3 adds just a little more processing and is usually worth it as it reduces artefacts. There is no exact control over the interpolations used (too many settings required), instead there are MatchPresets that work in a similar way to the main Preset. The extra processing suggests much slower speeds, but actually using higher speed presets (both MatchPreset and Preset) with source-matching can give results comparable to slower presets without it. Having said that, the extra detail from source-matching is too subtle to significantly affect very high speed main presets.&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SourceMatch&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Source-matching off (standard algorithm), 1 = basic source-match, 2 = refined match, 3 = twice refined match&lt;br /&gt;
|-&lt;br /&gt;
| Lossless&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Puts exact source fields into result &amp;amp; cleans any artefacts. 0=off, 1=after final temporal smooth, 2=before resharpening. Adds some extra detail but: mode 1 gets shimmer / minor combing, mode 2 is more stable/tweakable but not exactly lossless. Default: '''0'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=1,2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for basic source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Ideal choice is the same as main preset, but can choose a faster setting (but not slower). Default: '''3 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi&lt;br /&gt;
| (string)&lt;br /&gt;
| Override default interpolation method for basic source-match. Default method is same as main EdiMode setting (usually NNEDI3). Only need to override if using slow method for main interpolation (e.g. EEDI3) and want a faster method for source-match. Default: '''EdiMode'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;for SourceMatch=2,3&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| MatchPreset2&lt;br /&gt;
| (string)&lt;br /&gt;
| Speed/quality for refined source-match processing, select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; (no &amp;quot;Draft&amp;quot;). Faster settings are usually sufficient, but slower settings are useful if you get extra aliasing. Default: '''2 steps faster than MatchPreset'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEdi2&lt;br /&gt;
| (string)&lt;br /&gt;
| Override interpolation method for refined source-match. Can be a good idea to pick MatchEdi2=&amp;quot;Bob&amp;quot; for speed. Default: '''NNEDI3'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchTR2&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius for refined source-matching. 2=smoothness, 1=speed/sharper, 0=not recommended. Differences are very marginal. Basic source-match doesn't need this setting as its temporal radius must match TR1 core setting (i.e. there is no MatchTR1). Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| MatchEnhance&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Enhance the detail found by source-match modes 2 &amp;amp; 3. A slight cheat - will enhance noise if set too strong. Best set &amp;lt; 1.0. Default: '''0.5'''&lt;br /&gt;
|}&lt;br /&gt;
  	  	 &lt;br /&gt;
Defaults changes:&lt;br /&gt;
* MatchEdi is &amp;quot;Yadif&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
* MatchEdi2 is &amp;quot;TDeint&amp;quot; when MatchPreset=&amp;quot;Super Fast&amp;quot;, or &amp;quot;Bob&amp;quot; when MatchPreset=&amp;quot;Ultra Fast&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1 )                # Enable basic source-match. Result somewhat closer to source.&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Sharpness=0.4 ) # Basic source-match but sharper (up from 0.2). Be careful as sharpness limiting defaults to off&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=1, Lossless=2 )    # Basic source-match with &amp;quot;fake&amp;quot; lossless. Efficient setting for quality, may bring minor combing&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Medium&amp;quot;, SourceMatch=2, TR2=2 )       # Refined source-match, closer to source with no combing, slower. Increased TR2 reduces noise&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3 )              # Twice refined source-match, higher quality than mode 2, but a little bit slower again&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=2 )  # Twice refined source-match with fake lossless. Almost perfect fidelity mode with few artefacts&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, SourceMatch=3, Lossless=1 )  # Twice refined source-match with true lossless. Exact detail, but likely combing and shimmer&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75 ) # Further enhance detail found by refined match, a little sharper, may be noisier&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slow&amp;quot;, SourceMatch=3, Lossless=2, MatchEnhance=0.75, NoiseProcess=1, NoiseRestore=0.7, Sigma=1.5 ) # As above, denoise a little to help&lt;br /&gt;
 &lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Very Fast&amp;quot;, SourceMatch=1 ) # Faster basic source-match preset (defaults to 3 steps faster than main Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Faster&amp;quot;, MatchPreset2=&amp;quot;Ultra Fast&amp;quot;, SourceMatch=3 ) # Faster refined source-match preset as well&lt;br /&gt;
                                                                                         # (defaults to 2 steps faster than basic match Preset)&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, MatchPreset=&amp;quot;Slow&amp;quot;, MatchPreset2=&amp;quot;Slow&amp;quot;, SourceMatch=3 ) # Or use slower source-match presets (usually unnecessary)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Noise Bypass / Denoising===&lt;br /&gt;
&lt;br /&gt;
Key Points: QTGMC can remove, retain or strengthen noise and very fine detail. Has automatic &amp;quot;EZ&amp;quot; settings for simple operation. Refer to examples below&lt;br /&gt;
&lt;br /&gt;
The use of multiple temporal smooths means that this script denoises by default. QTGMC can extract some noise/grain from the source at the start, then optionally restore some of it back in again at the end. This allows either denoising, or for the grain/noise from the source to be retained. For simplest operation use one of the two automatic &amp;quot;EZ&amp;quot; modes, EZDenoise or EZKeepGrain (can only use one at once) and select a NoisePreset. For manual operation there are two modes: NoiseProcess=1 actually denoises at the start, whereas NoiseProcess=2 just identifies the noise in the source without removing it. NoiseProcess=1 is typically used for stronger denoising of the output, and NoiseProcess=2 is used to retain grain or for a very light denoise.&lt;br /&gt;
&lt;br /&gt;
Manual operation: after selecting a mode, set a Sigma value to estimate the level of source noise. Use the ShowNoise setting to help in this choice. Then decide how much of that noise to restore after the deinterlace. There are two restore points called GrainRestore/NoiseRestore, the amount of noise restored depends on their sum. For full denoising set them both to 0. For grain retention, a good starting point is 0.7/0.3 for NoiseProcess=1, and 0.3/0.1 for NoiseProcess=2. GrainRestore restores more stable &amp;quot;grain-like&amp;quot; detail. NoiseRestore restores finer more fluctuating noise. Usually best if GrainRestore is greater than NoiseRestore unless you want a very noisy look. Too high restoral values will give grain exaggeration and even luma changes.&lt;br /&gt;
&lt;br /&gt;
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur&lt;br /&gt;
{|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Quick Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| EZDenoise&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to denoise source. Set &amp;gt; 0.0 to enable. Higher values denoise more. Can use ShowNoise to help choose value. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| EZKeepGrain&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Automatic setting to retain source grain/detail. Set &amp;gt; 0.0 to enable. Higher values retain more grain. A good starting point = 1.0. Default: '''0.0'''&lt;br /&gt;
|-&lt;br /&gt;
| NoisePreset&lt;br /&gt;
| (string)&lt;br /&gt;
| Automatic setting for quality of noise processing. Choices: &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, and &amp;quot;Faster&amp;quot;. Default: '''&amp;quot;Fast&amp;quot;'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Full Settings&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| NoiseProcess&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Bypass mode: 0 = disable, 1 = denoise source &amp;amp; optionally restore some noise back at end of script [use for stronger denoising], 2 = identify noise only &amp;amp; optionally restore some after QTGMC smoothing [for grain retention / light denoising]. Default: '''0''' (Very Slow: '''2''')&lt;br /&gt;
|-&lt;br /&gt;
| ChromaNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| When processing noise (NoiseProcess &amp;gt; 0), whether to process chroma noise or not (luma noise is always processed). Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Removing Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Denoiser&lt;br /&gt;
| (string)&lt;br /&gt;
| Select denoiser to use for noise bypass / denoising. Select from &amp;quot;dfttest&amp;quot; or &amp;quot;fft3dfilter&amp;quot;. dfttest is better, but slower. Unknown value selects &amp;quot;fft3dfilter&amp;quot;. Default: '''fft3dfilter'''&lt;br /&gt;
|-&lt;br /&gt;
| DftThreads&lt;br /&gt;
| (0...)&lt;br /&gt;
| Number of threads to use if using &amp;quot;dfttest&amp;quot; for Denoiser, 0 = number of logical processors on system. Default: '''EdiThreads'''&lt;br /&gt;
|-&lt;br /&gt;
| DenoiseMC&lt;br /&gt;
| (bool)&lt;br /&gt;
| Whether to provide a motion-compensated clip to the denoiser for better noise vs detail detection (will be a little slower). Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| NoiseTR&lt;br /&gt;
| (0,1,2)&lt;br /&gt;
| Temporal radius used when analyzing clip for noise extraction. Higher values better identify noise vs detail but are slower. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| Sigma&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Amount of noise known to be in the source, sensible values vary by source and denoiser, so experiment. Use ShowNoise to help. Default: '''2.0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShowNoise&lt;br /&gt;
| (bool / 0.0...)&lt;br /&gt;
| Display extracted and &amp;quot;deinterlaced&amp;quot; noise rather than normal output. Set to true or false, or set a value (around 4 to 16) to specify contrast for displayed noise. Visualising noise helps to determine suitable value for Sigma or EZDenoise - want to see noise and noisy detail, but not too much clean structure or edges - fairly subjective. Pause the video when checking this. Default: '''False'''&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
|colspan=2| &amp;lt;small&amp;gt;Restoring Noise&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| GrainRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore before final temporal smooth. Retain &amp;quot;stable&amp;quot; grain and some detail (effect depends on TR2). Default: '''0.0''' (Very Slow: '''0.3''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseRestore&lt;br /&gt;
| (0.0...1.0...)&lt;br /&gt;
| How much removed noise/grain to restore after final temporal smooth. Retains any kind of noise. Default: '''0.0''' (Very Slow: '''0.1''')&lt;br /&gt;
|-&lt;br /&gt;
| NoiseDeint&lt;br /&gt;
| (string)&lt;br /&gt;
| When noise is taken from interlaced source, how to 'deinterlace' it before restoring. &amp;quot;Bob&amp;quot; &amp;amp; &amp;quot;DoubleWeave&amp;quot; are fast but with minor issues: &amp;quot;Bob&amp;quot; is coarse and &amp;quot;Doubleweave&amp;quot; lags by one frame. &amp;quot;Generate&amp;quot; is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects &amp;quot;DoubleWeave&amp;quot;. Default: '''&amp;quot;&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| StabilizeNoise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for &amp;quot;Generate&amp;quot; mode. Default: '''False'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
* EZDenoise and EZKeepGrain set automatic values for NoiseProcess, NoiseRestore/GrainRestore and Sigma&lt;br /&gt;
* Denoiser, DenoiseMC, NoiseTR, NoiseDeint and StabilizeNoise settings are determined by NoisePreset&lt;br /&gt;
* If using manual settings be sure to override *all* the values you are interested in&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Automatic Settings&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZDenoise=2.5,   NoisePreset=&amp;quot;Slow&amp;quot;   ) # Automatic denoising, value is denoising strength, preset is quality/speed tradeoff&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, EZKeepGrain=1.0, NoisePreset=&amp;quot;Faster&amp;quot; ) # Automatic grain retention - retain all source grain&lt;br /&gt;
&lt;br /&gt;
# Denoising&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Sigma=4.0 ) # Fully denoise, strength of denoising depends on Sigma setting&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=0.0, Denoiser=&amp;quot;dfttest&amp;quot;, DenoiseMC=true, NoiseTR=2, Sigma=4.0 ) # More &amp;quot;accurate&amp;quot; denoising (slower)&lt;br /&gt;
&lt;br /&gt;
# Retain Noise / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 ) # Retain *all* the noise / fine detail of a less noisy source&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=1, GrainRestore=1.0, Sigma=2.0 ) # Similar to above but only keep the more &amp;quot;stable&amp;quot; noise elements (depends on TR2)&lt;br /&gt;
 &lt;br /&gt;
# Strong Detail / Grain&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.5, NoiseRestore=0.1, Sigma=2.5 ) # Using stronger mode 2, retains noise and sharpens slightly&lt;br /&gt;
QTGMC( Preset=&amp;quot;Slower&amp;quot;, NoiseProcess=2, GrainRestore=0.4, NoiseRestore=0.2, Sigma=1.8, \&lt;br /&gt;
       NoiseDeint=&amp;quot;Generate&amp;quot;, StabilizeNoise=true )  # As above with better quality, more stable detail and grain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Progressive Input===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can remove horizontal shimmering effects from progressive sources. Experiment with InputType=1, 2 or 3 for best results. FPS will not be doubled&lt;br /&gt;
&lt;br /&gt;
This script is designed for deinterlacing and so by default expects an interlaced clip. However, much of its operation concerns the reduction of horizontal shimmering. It is possible to use the script to remove similar shimmer from a progressive clip by using the InputType setting. InputType=1 is used for general progressive material that contains less severe problems. InputType=2,3 are designed for badly deinterlaced material with considerable horizontal artefacts. These modes drop half the fields and recreate an interlaced stream from the others, which is then treated in the normal way. Mode 3 differs from mode 2 only in that it complements field parity of the input. Generally mode 1 will retain more detail, but repair less artefacts than modes 2,3. You may consider setting TR2 to a higher value (e.g. 2 or 3) when repairing progressive material.&lt;br /&gt;
&lt;br /&gt;
SourceMatch and Lossless modes are supported for progressive material. It works well for InputType=2,3, where the input is converted to an interlaced stream, and helps in detail retention. Source-match is much less useful for InputType=1&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| InputType&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Default = 0 for interlaced input. Settings 1,2 &amp;amp; 3 accept progressive input for deshimmer or repair. Frame rate of progressive source is not doubled. Mode 1 is for general progressive material. Modes 2 &amp;amp; 3 are designed for badly deinterlaced material. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ProgSADMask&lt;br /&gt;
| (0.0...)&lt;br /&gt;
| Only applies to InputType=2,3. If ProgSADMask &amp;gt; 0.0 then blend InputType modes 1 and 2/3 based on block motion SAD. Higher values help recover more detail, but repair less artefacts. Reasonable range about 2.0 to 20.0, or 0.0 for no blending. Default: '''10.0''' ('''0.0''' for &amp;quot;Fast&amp;quot; and faster.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=1 )                   # Process progressive source, it will be temporally smoothed / deshimmered&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2, ProgSADMask=12.0 ) # Process progressive source with major artefacts, slightly favoring detail over repairs&lt;br /&gt;
&lt;br /&gt;
===Shutter Speed Motion Blur / Frame Rate===&lt;br /&gt;
&lt;br /&gt;
Key Points: Can output video at single or double-frame rate. For smoother playback of single-rate output there are settings to add light motion blur to simulate different shutter angles (shutter speeds)&lt;br /&gt;
&lt;br /&gt;
By default QTGMC outputs video at &amp;quot;double-rate&amp;quot;, twice the frame rate of the source. This is because there are two separate images (fields) in every frame, which the deinterlacing process restores in full. By setting FPSDivisor to 2, every second frame is dropped and the output frame rate is the same as the source (&amp;quot;single-rate&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Single-rate output may look a little stuttery, depending on how the source was filmed/created. Adding motion blur to each frame can help with this, smoothing the feel of the slower rate playback. This is done by setting ShutterBlur to 1,2 or 3, then specifying the shutter angle that you wish the output to simulate. However, as there may be some motion blur already in the source you also need to specify/estimate the shutter angle used in the source. Shutter angles range from 0 to 360, with 0 being perfectly sharp and 360 being fully blurred from one frame to next (artificial output shutter angles &amp;gt; 360 are supported to a very limited degree). Motion-blur can also be applied to double-rate output, but the effect is less noticable.&lt;br /&gt;
&lt;br /&gt;
As motion analysis is block-based, motion blur of an object can &amp;quot;bleed&amp;quot; into surrounding, more static areas. This can be reduced using the slower ShutterBlur modes or by increasing the SBlurLimit setting (which is enabled and set to 4 by default). Both repair methods may reduce the level of motion blur a little though. In situations of complex motion the motion analysis can be incorrect, which can lead to inappropriate blurring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| FPSDivisor&lt;br /&gt;
| (1,2...)&lt;br /&gt;
| 1 = Double-rate output, 2 = Single-rate output. Higher values can be used too (e.g. 60fps &amp;amp; FPSDivisor=3 gives 20fps output). '''Important:''' You do not need SelectEven() in the calling script if you use FPSDivisor=2. Default: '''1'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterBlur&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| 0 = Off, 1 = Enable, 2,3 = Higher precisions (slower). Higher precisions reduce blur &amp;quot;bleeding&amp;quot; into static areas a little. Default: '''0'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleSrc&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle used in source. If necessary, estimate from motion blur seen in a single frame: 0=pin-sharp, 360=fully blurred from frame to frame. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| ShutterAngleOut&lt;br /&gt;
| (0...360)&lt;br /&gt;
| Shutter angle to simulate in output. Extreme values may be rejected (depends on other settings). Cannot reduce motion blur already in the source. Default: '''180'''&lt;br /&gt;
|-&lt;br /&gt;
| SBlurLimit&lt;br /&gt;
| (0...)&lt;br /&gt;
| Limit motion blur where motion lower than given value. Increase to reduce blur &amp;quot;bleeding&amp;quot;. 0=Off. Sensible range around 2-12. Default: '''4'''&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=30,  ShutterAngleOut=180 ) # Smooth single-rate output, when input has little blur&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=1, ShutterAngleSrc=180, ShutterAngleOut=180 ) # Keep &amp;quot;film&amp;quot; look on single-rate output, &amp;quot;film&amp;quot; input&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=2, ShutterBlur=2, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8 ) # Same but srongly reduce blur &amp;quot;bleeding&amp;quot;&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Slower&amp;quot;, FPSDivisor=1, ShutterBlur=1, ShutterAngleSrc=0,   ShutterAngleOut=720 ) # Blur some high shutter-speed footage, keep double rate&lt;br /&gt;
                                                                                                # [Use of artificially high shutter angles is limited]&lt;br /&gt;
&lt;br /&gt;
===Miscellaneous Settings===&lt;br /&gt;
&lt;br /&gt;
Settings not covered above. Note that Border is false by default, which differs from TempGaussMC&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Border&lt;br /&gt;
| (bool)&lt;br /&gt;
| Pad a little vertically while processing (doesn't affect output size) - set true you see flickering on the very top or bottom line of the output. If you have wider edge effects than that, you should crop afterwards instead. Be wary of this setting if reusing QTGMC motion vectors in the calling script. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| Precise&lt;br /&gt;
| (bool)&lt;br /&gt;
| Set to false to use faster algorithms with *very* slight imprecision in places&lt;br /&gt;
|-&lt;br /&gt;
| Preset&lt;br /&gt;
| (string)&lt;br /&gt;
| Sets a range of defaults for different encoding speeds. Select from &amp;quot;Placebo&amp;quot;, &amp;quot;Very Slow&amp;quot;, &amp;quot;Slower&amp;quot;, &amp;quot;Slow&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;Fast&amp;quot;, &amp;quot;Faster&amp;quot;, &amp;quot;Very Fast&amp;quot;, &amp;quot;Super Fast&amp;quot;, &amp;quot;Ultra Fast&amp;quot; &amp;amp; &amp;quot;Draft&amp;quot;. Default: '''&amp;quot;Slower&amp;quot;'''&lt;br /&gt;
|-&lt;br /&gt;
| Tuning&lt;br /&gt;
| (string)&lt;br /&gt;
| Tweaks the defaults for different source types. Choose from &amp;quot;None&amp;quot;, &amp;quot;DV-SD&amp;quot;, &amp;quot;DV-HD&amp;quot;. Default: '''&amp;quot;None&amp;quot;''' [An idea for development based on the x264 approach, but as I don't work with many source types it has seen little development]&lt;br /&gt;
|-&lt;br /&gt;
| ShowSettings&lt;br /&gt;
| (bool)&lt;br /&gt;
| Display all the current parameter values - useful to find preset defaults. Default: '''False'''&lt;br /&gt;
|-&lt;br /&gt;
| GlobalNames&lt;br /&gt;
| (string)&lt;br /&gt;
| The name used to expose intermediate clips to calling script. See External Linkage section. Default: '''QTGMC'''&lt;br /&gt;
|-&lt;br /&gt;
| PrevGlobals&lt;br /&gt;
| (string)&lt;br /&gt;
| What to do with global variables from earlier QTGMC call that match above name. Either &amp;quot;Replace&amp;quot;, or &amp;quot;Reuse&amp;quot; (for a speed-up). Default: '''Undefined'''&lt;br /&gt;
|-&lt;br /&gt;
| ForceTR&lt;br /&gt;
| (0,1,2,3)&lt;br /&gt;
| Ensure globally exposed motion vectors are calculated to this radius even if not needed by QTGMC. 0 = disabled. Default: '''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Default for Precise depends on Preset.&lt;br /&gt;
&lt;br /&gt;
==External Linkage==&lt;br /&gt;
===Accessing QTGMC Motion Vectors===&lt;br /&gt;
QTGMC now exposes its motion vectors and other intermediate clips to the calling script through global variables. These globals are uniquely named. By default they begin with the prefix &amp;quot;QTGMC_&amp;quot;. The available clips are:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Backward motion vectors&lt;br /&gt;
| bVec1, bVec2, bVec3 (temporal radius 1 to 3)&lt;br /&gt;
|-&lt;br /&gt;
| Forward motion vectors&lt;br /&gt;
| fVec1, fVec2, fVec3&lt;br /&gt;
|-&lt;br /&gt;
| Filtered clip used for motion analysis&lt;br /&gt;
| srchClip&lt;br /&gt;
|-&lt;br /&gt;
| MVTools &amp;quot;super&amp;quot; clip for filtered clip&lt;br /&gt;
| srchSuper&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Not all these clips are necessarily created - it depends on your QTGMC settings. To ensure motion vector creation to radius X, set ForceTR=X&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
&lt;br /&gt;
 QTGMC( Preset=&amp;quot;Medium&amp;quot;, ForceTR=2, SubPel=2 )  # Ensure we get temporal radius of at least 2, read note below regarding SubPel&lt;br /&gt;
 super = MSuper( pel=2, levels=1 )              # Faster to use levels=1, don't usually need more levels once you have the vectors&lt;br /&gt;
 MDegrain2( super, QTGMC_bVec1,QTGMC_fVec1, QTGMC_bVec2,QTGMC_fVec2 )  # Use QTGMC-created motion vectors&lt;br /&gt;
&lt;br /&gt;
====Important Notes====&lt;br /&gt;
&lt;br /&gt;
* The SubPel setting to QTGMC must match the pel setting in MVTools or you will get visual errors or crashes. Default SubPel in QTGMC varies depending on Preset, &amp;quot;Medium&amp;quot; and quicker settings get SubPel=1, slower settings get SubPel=2. Default pel in MVTools is 2&lt;br /&gt;
* Do not use Border=true if using motion vectors in this way, or the clips exposed will have an 8 pixel border top and bottom (i.e. they won't match your source)&lt;br /&gt;
&lt;br /&gt;
===Multiple QTGMC Calls===&lt;br /&gt;
The section above showed how global variables are used to expose the workings of QTGMC. However, if there are multiple calls to QTGMC in your script then you should consider whether they should work together with their exposed globals. By default the globals for each call to QTGMC will overwrite the globals from previous calls. However there are actually three options in this case:&lt;br /&gt;
&lt;br /&gt;
* Use the setting GlobalNames to make unique global names for each call. E.g. if you set GlobalNames=&amp;quot;TestA&amp;quot; you will receive a global called TestA_bVec1.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Reuse&amp;quot; to reuse existing similar named globals for this run &amp;amp; not recalculate motion vectors etc. This will improve performance.&lt;br /&gt;
* Set PrevGlobals=&amp;quot;Replace&amp;quot; to overwrite similar named globals from a previous run. This is the default and easiest option for most use cases.&lt;br /&gt;
&lt;br /&gt;
Here's an artifical example of multiple calls in a script to show the options:&lt;br /&gt;
&lt;br /&gt;
 q1 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # QTGMC_bVec1 and similar variables are created&lt;br /&gt;
 q2 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot; )  # Recalculates and replaces variables QTGMC_bVec1 and similar with new values (same as setting PrevGlobals=&amp;quot;Replace&amp;quot;)&lt;br /&gt;
 q3 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot;   )  # Reuses QTGMC_bVec1 motion vectors from q2 above. Doesn't recalculate, improving performance&lt;br /&gt;
 q4 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;   )  # Creates new variables called TestA_bVec1...&lt;br /&gt;
 q5 = c.QTGMC( Preset=&amp;quot;Medium&amp;quot;, GlobalNames=&amp;quot;TestA&amp;quot;, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuses the TestA_bVec1 motion vectors&lt;br /&gt;
&lt;br /&gt;
Here's a realistic example. This simple script repairs progressive material with very bad deinterlacing artefacts. It needs two calls to QTGMC:&lt;br /&gt;
&lt;br /&gt;
 t = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=2 )&lt;br /&gt;
 b = QTGMC( Preset=&amp;quot;Slower&amp;quot;, InputType=3, PrevGlobals=&amp;quot;Reuse&amp;quot; ) # Reuse motion vectors from first call for a good speed-up&lt;br /&gt;
 Repair( t, b, 1 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TempGaussMC Notes==&lt;br /&gt;
In its default setup this script is very similar in operation to TempGaussMC_beta2. The call QTGMC() is very similar to:&lt;br /&gt;
&lt;br /&gt;
 TempGaussMC_beta2( 2,2,1, Border=false, SVthin=0.0 )&lt;br /&gt;
&lt;br /&gt;
There are a few key differences:&lt;br /&gt;
&lt;br /&gt;
* QTGMC typically uses &amp;quot;NNEDI3&amp;quot; for interpolation (TempGaussMC_beta2 uses &amp;quot;EEDI2&amp;quot; by default)&lt;br /&gt;
* Sharpness default in QTGMC is always 1.0 (or 0.2 if using source-match) - adjusted internally to give very roughly the same sharpness across settings / presets&lt;br /&gt;
* In QTGMC, SVThin defaults to 0, Border defaults to false&lt;br /&gt;
* Lossless and Draft modes are supported but in a different way&lt;br /&gt;
* The parameter order is the same up to EdiMode, a couple of 'lesser' parameters have had name changes for consistency&lt;br /&gt;
&lt;br /&gt;
==Acknowledgements==&lt;br /&gt;
Thanks go to Didée for the script from where this began.&lt;br /&gt;
&lt;br /&gt;
Also thanks to the plugin coders: Manao, Fizick, Tritical, Kassandro, Tsp, SEt, Tom Barry, Foxyshadis, TSchniede, Kurosu, mg262 and any others...&lt;br /&gt;
&lt;br /&gt;
And to the many people who have given feedback, reported bugs and offered suggestions to help improve the script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# v3.357s&lt;br /&gt;
# - high bit depth now basically work in avs+&lt;br /&gt;
#&lt;br /&gt;
# v3.354s&lt;br /&gt;
# - added optional chikuzen PlanarTools for YUY2 using nonyuy2clipin/nonyuy2clipout in AnimeIVTC() v2.20&lt;br /&gt;
#&lt;br /&gt;
# v3.353s&lt;br /&gt;
# - added ndjamena suggestion for maximum temporal radius&lt;br /&gt;
# - added DftDither to controle dfttest dither Parameter&lt;br /&gt;
#&lt;br /&gt;
# v3.352s&lt;br /&gt;
# - added useEdiExt&lt;br /&gt;
# - added tr0=-1 to use the EdiExt clip (if there is no EdiExt clip then it will not work)&lt;br /&gt;
# - rep0 now will be 0 if tr0 &amp;lt; 1&lt;br /&gt;
#&lt;br /&gt;
# v3.347s&lt;br /&gt;
# - fix SourceMatch (bug after new YUY2 method, thanks to ndjamena for report it)&lt;br /&gt;
#&lt;br /&gt;
# v3.346s&lt;br /&gt;
# - EEDI3+NNEDI3 bug fix by ndjamena&lt;br /&gt;
# - Renamed DftThreads parameter to FftThreads, to set the ncpu argument of FFT3DFilter (from VS)&lt;br /&gt;
# - FFT3DFilter will work now in YUY2, use it with Denoiser=&amp;quot;fft3df&amp;quot; (or use NoisePreset)&lt;br /&gt;
#&lt;br /&gt;
# v3.345s&lt;br /&gt;
# - work with SMDegrain_KNLMeansCL now to process chroma too&lt;br /&gt;
#&lt;br /&gt;
# v3.343s&lt;br /&gt;
# - edit in ChromaEdi&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.34s (mod) 2016 12 18 (ravewulf idea in another way)&lt;br /&gt;
# - Added yadifmod2 (if you need old one use it like this EdiMode=&amp;quot;cYadif&amp;quot; or EdiMode=&amp;quot;RepcYadif&amp;quot;)&lt;br /&gt;
# - fast and clean up YUY2 (will work in x64 now, no need to SSETools)&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 12 06&lt;br /&gt;
# - Add TR2=4 and TR2=5&lt;br /&gt;
# - add TV_range bool and dither_luma_rebuild (from SMDegrain) Str and Amp&lt;br /&gt;
# - for avsplus now QTGMC_Bob is ready for any 420, not only yv12&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 04 11&lt;br /&gt;
# - Add KNLMeansCL as another Denoiser to NoiseProcess&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2016 01 19&lt;br /&gt;
# - make QTGMC_deflate/QTGMC_inflate work with YUY2 using masktool2 for avs 2.60&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 10 23&lt;br /&gt;
# - revert to QTGMC_deflate/QTGMC_inflate quoted from Dogway&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 9 10&lt;br /&gt;
# - fix Multiple QTGMC Calls&lt;br /&gt;
# - others fix&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 6&lt;br /&gt;
# - some changes in bob to speed up&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod) 2015 8 4&lt;br /&gt;
# - fix bug in YUY2 with SourceMatch&lt;br /&gt;
# - add slice=false to ditherpost to avoid artefacts&lt;br /&gt;
#&lt;br /&gt;
# v3.33s (mod)&lt;br /&gt;
# - fix bob chroma&lt;br /&gt;
# - work with new masktool2 for avs 2.60 in YUY2&lt;br /&gt;
#&lt;br /&gt;
# v3.33d (mod)&lt;br /&gt;
# - Added 32 bit precision option through the lsbd (for dfttest and knlmeanscl) and lsb (mdegrain) options.&lt;br /&gt;
# - optimized some mask handling a bit as originally suggested by Vit&lt;br /&gt;
# - others&lt;br /&gt;
#&lt;br /&gt;
# v3.33&lt;br /&gt;
# - Increased maximum value for Rep0, Rep1 and Rep2 to 7 (from 5). Higher values help with flicker on static detail, potential for minor motion blur&lt;br /&gt;
# - Bug fix for the fact that Bob always outputs a BFF clip regardless of field order of input (thanks ajp_anton)&lt;br /&gt;
# - Improved generation of noise (NoiseDeint=&amp;quot;Generate&amp;quot;) for noise bypass / EZKeepGrain&lt;br /&gt;
# - Minor change to denoising&lt;br /&gt;
#&lt;br /&gt;
# v3.32&lt;br /&gt;
# - Bugfix with shutter blur and ChromaMotion (thanks Heaud)&lt;br /&gt;
# - Tweaked vector recalculation for shutter motion blur&lt;br /&gt;
# - Changed defaults for TR2 when using source-match&lt;br /&gt;
# - Minor bugfix with SLMode/SLRad on pass-through settings&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==External Links:==&lt;br /&gt;
*[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar Spanish Instructions (3.32)] by Overdrive80&lt;br /&gt;
*[http://forum.doom9.org/showpost.php?p=1732845&amp;amp;postcount=2041 QTGMC-3.33s] by A.SONY&lt;br /&gt;
&amp;lt;!--[http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip Download (v3.32), with English instructions] [[Media:QTGMC-3.32.avsi| QTGMC-3.32.avsi]] [http://www.spirton.com/uploads/QTGMC/QTGMC-3.33.avsi QTGMC-3.33.avsi]--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Deinterlacing|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Dither_tools</id>
		<title>Dither tools</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Dither_tools"/>
				<updated>2019-09-14T00:38:23Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:External_filters]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;br /&gt;
'''Dither — high-bit-depth tools for AviSynth'''&lt;br /&gt;
&lt;br /&gt;
This package offers a set of tools to manipulate Stacked Hacked [[High_bit-depth_Support_with_Avisynth|high-bit-depth]] (16 bits per plane) video clips. The most prominent features are color banding artifact removal, dithering to 8 bits, colorspace conversions and resizing.&lt;br /&gt;
&lt;br /&gt;
Additionally, some existing filters ([[dfttest]], MDegrain from [[MVTools]], etc) have been modified to handle 16-bit clips. See [[High_bit-depth_Support_with_Avisynth|High bit-depth Support with Avisynth]] for more information.&lt;br /&gt;
&lt;br /&gt;
{{Filter&lt;br /&gt;
|Firesledge (aka {{Author/cretindesalpes}})&lt;br /&gt;
|1.27.2&lt;br /&gt;
|[http://ldesoras.free.fr/prod.html#src_ditheravsi http://ldesoras.free.fr/prod.html]&lt;br /&gt;
|[[:Category:Deep_color_tools|Deep color tools]]&lt;br /&gt;
|[[Planar]] colorspace, &lt;br /&gt;
* [[MaskTools2|Masktools 2]] '''alpha 48''' or later ([https://github.com/tp7/masktools/releases tp7 version] strongly recommended), &lt;br /&gt;
* [[RemoveGrain]] 1.0b “beta” or later (same here, use the [[RgTools]] version), &lt;br /&gt;
* [[AddGrainC]] 1.5.1 or later &lt;br /&gt;
|[http://www.wtfpl.net/ WTFPL]&lt;br /&gt;
|7=[http://forum.doom9.org/showpost.php?p=1386559 doom9.org]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Formats ===&lt;br /&gt;
As Avisynth (not AvisynthPlus) doesn't support natively high bit-depth, a specific format named [[Stack16]] aka lsb is introduced. The picture is made of two parts, one containing the highest 8 bits (MSB) stacked on top of another containing the lowest 8 bits (LSB) for each pixel. When previewing the video stored in stack16 format, the top part looks quite like the original picture and the bottom one generally looks like psychedelic garbage.&lt;br /&gt;
&lt;br /&gt;
Some functions may also use an MSB/LSB decomposition as interleaved aka Double-Width pictures, but this format should be considered deprecated and is only supported for backward compatibility.&lt;br /&gt;
&lt;br /&gt;
Finally, there are a few other formats made specifically for encoding, allowing Avisynth to send more than 8 bits per plane by faking raw data characteristics on the codec side.&lt;br /&gt;
&lt;br /&gt;
When working with 16-bit clips, it’s important to know exactly which format a function takes as input and output. Specifically, you cannot process directly 16-bit clips with the usual 8-bit Avisynth filters, because they will interpret the LSB and MSB parts as regular data and mess everything. However there are various workarounds to mix 8- and 16-bit processing with minimal quality loss, please refer to the example section.&lt;br /&gt;
&lt;br /&gt;
Outputting [[High_bit-depth_Support_with_Avisynth|high-bit-depth]] clips to encode in 10 bits or more has become possible and is now quite common and supported by various encoding tools. However there is no practical mean to load a high-bit-depth media into Avisynth at this time. Regardless, [http://github.com/SAPikachu/ SAPikachu] hacked [[FFmpegSource|FFmpegSource2]] to load 10-bit clips using a special parameter ''enable10bithack=true'', resulting in stack16 output. See the latest ffms2 release [http://www.sapikachu.net/%E8%BF%91%E6%9C%9Fep%E4%BD%9C%E5%93%81%E6%B1%87%E6%80%BB/ here]. Patch source code [https://github.com/SAPikachu/ffms2_hacks/ here].&lt;br /&gt;
&lt;br /&gt;
=== Debanding and dithering ===&lt;br /&gt;
The main reason this package has been made is to address the color banding problem. Color banding generally occurs on low gradients or almost flat colors covering large areas, which is often the case in cartoons and animes. Because of the limited video bit-depth, the gradient color values show staircases in its curve, making apparent the discontinuity between two adjacent color steps.&lt;br /&gt;
&lt;br /&gt;
These artifacts can appear at various stages:&lt;br /&gt;
&lt;br /&gt;
* It can be already present in the source, &lt;br /&gt;
* created during a filtering pass &lt;br /&gt;
* or added by the final codec because of bitrate starvation or inappropriate encoding settings. &lt;br /&gt;
&lt;br /&gt;
Debanding functions helps to remove the banding from a source. Using high-bit-depth processing prevents the banding from appearing during filtering. Finally, appropriate dithering helps to avoid banding during the conversion to 8 bits and the encoding stage.&lt;br /&gt;
&lt;br /&gt;
Generally, film grain and video noise act as natural dithering. Filtering them out also removes this dithering and thus creates color banding. That’s why some denoising filters have been modified, in order to work as reversed dithering, outputting smooth 16-bit gradients from a noisy 8-bit source.&lt;br /&gt;
&lt;br /&gt;
=== Colorspace conversions ===&lt;br /&gt;
Using 16-bit data helps working with curves without creating steps or holes in the histogram, which often are a sign of color banding. Colorspace conversion has the same kind of issues, and benefits from accurate 16-bit calculations too.&lt;br /&gt;
&lt;br /&gt;
It makes possible to handle the picture information in “linear light” (without gamma correction), increasing the accuracy of some operations when processing pictures exhibiting high contrast.&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
The functions are spread across dither.dll and dither.avsi. There are other files:&lt;br /&gt;
&lt;br /&gt;
* mt_xxpand_multi.avsi, containing utility functions not specifically related to dithering (they rather are [[MaskTools2|Masktools]] extensions). &lt;br /&gt;
* [[AVSTP|avstp.dll]], to make dither.dll support native multi-threading. If this avstp is missing, the functions will still work but will be limited to single-threading only. &lt;br /&gt;
&lt;br /&gt;
You may already have obtained them by other means. Put all these files in your AviSynth 2.5\plugins\ directory. The package also contains [[Modulo|“mod16”]]-modified denoising plug-ins to directly generate 16-bit data in a much more efficient way.&lt;br /&gt;
&lt;br /&gt;
Functions implemented in dither.dll should be compatible with all the MT modes (including mode 1) and accept any planar colorspace. On this topic, scripted functions are limited by their external dependencies. YV12 colorspace and MT mode 2 should always work fine, anyway.&lt;br /&gt;
&lt;br /&gt;
=== Considerations ===&lt;br /&gt;
If you’re going [http://forum.doom9.org/showthread.php?t=148782 multi-threaded using the MT command], make sure you have set ''splitvertical''=true for two reasons:&lt;br /&gt;
&lt;br /&gt;
* The functions may have to change the clip height &lt;br /&gt;
* Stacked LSB and MSB of a given pixel must not be separated. &lt;br /&gt;
&lt;br /&gt;
== Examples of use ==&lt;br /&gt;
=== Use of modified denoisers ===&lt;br /&gt;
There are specifically modified denoising plug-ins allowing 16-bit output (I called them [[Modulo|“mod16”]]), currently [[dfttest]], [[MVTools|MDegrain1, MDegrain2 and MDegrain3]]. They are included in the Dither package and can safely replace the regular versions, when up-to-date. Use the named parameter ''lsb=true'' to enable 16 bit output. Then, MSB is stacked on top of the LSB.&lt;br /&gt;
&lt;br /&gt;
 dfttest (lsb=true) # The output contains stacked MSB-LSB on the same frame.&lt;br /&gt;
 DitherPost ()&lt;br /&gt;
&lt;br /&gt;
=== Transdithering using a non-modified temporal denoiser ===&lt;br /&gt;
An effective but very slow way to remove low noise while avoiding the introduction of color banding artifacts and keeping an excellent compressability. Actually, better quality could be achieved with motion compensation but this is not the scope of this example. It shows how to use Dither2Pre to create a 16-bit clip with a 8-bit denoiser. Here, the default TTempSmooth parameters have been multiplied by 4 to adapt to the internal scale of pixel values.&lt;br /&gt;
&amp;lt;pre&amp;gt;o = last&lt;br /&gt;
Dither2Pre (&lt;br /&gt;
\   &amp;quot;TTempSmooth (lthresh=16, cthresh=20, lmdiff=8, cmdiff=12, scthresh=48)&amp;quot;,&lt;br /&gt;
\   overlap=0, tvopt=true)&lt;br /&gt;
ref = last&lt;br /&gt;
mask = DitherPost (mode=-1).mt_edge (mode=&amp;quot;min/max&amp;quot;, thY1=0, thY2=255, thC1=0, thC2=255)&lt;br /&gt;
mask = mask.mt_binarize (1, u=3, v=3).mt_expand (u=3, v=3).mt_expand (u=3, v=3)&lt;br /&gt;
mask = mask.RemoveGrain (20).RemoveGrain (20)&lt;br /&gt;
Dither_bilateral16 (radius=16, thr=1.5, wmin=1, flat=0.75)&lt;br /&gt;
Dither_bilateral16 (radius=8, thr=2.5, wmin=1, flat=0.33, ref=ref)&lt;br /&gt;
Dither_limit_dif16 (ref, thr=0.3)&lt;br /&gt;
DitherPost ()&lt;br /&gt;
mt_merge (last, o, mask, u=3, v=3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Combining 8- and 16-bit processing ===&lt;br /&gt;
==== Generic method ====&lt;br /&gt;
There is often a need to mix 8- and 16-bit processing because only a few filters are available in 16 bits. Below is a little template to achieve this. This is not a perfect solution but work quite well. It’s possible to lower a bit the Dither_limit_dif16 ''thr'' parameter. You can repeat the steps as many times you need to alternate 8 and 16 bits.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dfttest (lsb=true) # or whatever generating stack16 data&lt;br /&gt;
&lt;br /&gt;
# Insert 16-bit filters here&lt;br /&gt;
&lt;br /&gt;
s16 = last&lt;br /&gt;
DitherPost (mode=-1)&lt;br /&gt;
&lt;br /&gt;
# Insert 8-bit filters here&lt;br /&gt;
&lt;br /&gt;
Dither_convert_8_to_16 ()&lt;br /&gt;
s16.Dither_limit_dif16 (last, thr=1.0, elast=2.0)&lt;br /&gt;
&lt;br /&gt;
# Insert 16-bits filters again…&lt;br /&gt;
&lt;br /&gt;
# Finally&lt;br /&gt;
DitherPost () # or Dither_out ()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== Filtering in 16 bits with basic sharpening ====&lt;br /&gt;
The example below shows how to use a 8-bit sharpener with a 16-bit clip. This method guarantees that the dithering pattern will not be sharpened. This is an alternative method to the proposed above. The rationale is: going back to 8-bit without dithering (mode = -1), doing stuff, compute the difference between processed and unprocessed clips, dither the 16-bit clip and add the previously computed difference to the result. This method can be applied to some other kinds of processing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dfttest (lsb=true)&lt;br /&gt;
f = DitherPost (mode=-1)&lt;br /&gt;
s = f.Sharpen ()&lt;br /&gt;
d = mt_makediff (s, f)&lt;br /&gt;
DitherPost ()&lt;br /&gt;
mt_adddiff (last, d, u=2, v=2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Debanding a clip ===&lt;br /&gt;
Without filtering:&lt;br /&gt;
&lt;br /&gt;
 GradFun3 ()&lt;br /&gt;
&lt;br /&gt;
Advanced multi-pass filtering for a source containing both noise and banding. This script requires the modified version of the MVTools2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Your favourite 8-bit denoiser here, doing the main job&lt;br /&gt;
denoised = dfttest (sigma=16)&lt;br /&gt;
&lt;br /&gt;
# Restores a bit of noise&lt;br /&gt;
mt_lutxy (last, denoised, expr=&amp;quot;x y &amp;lt; y 1 - x y &amp;gt; y 1 + y ? ?&amp;quot;, y=3, u=3, v=3)&lt;br /&gt;
&lt;br /&gt;
super   = last.MSuper ()&lt;br /&gt;
super_a = denoised.MSuper ()&lt;br /&gt;
&lt;br /&gt;
# You could also reuse the vectors found in a previous processing stage&lt;br /&gt;
vf1 = super_a.MAnalyse (isb=false, delta=1, overlap=4, blksize=16)&lt;br /&gt;
vb1 = super_a.MAnalyse (isb=true,  delta=1, overlap=4, blksize=16)&lt;br /&gt;
&lt;br /&gt;
# Turns remaining noise into 16-bit gradients&lt;br /&gt;
cf1 = MCompensate (super, vf1, thSAD=200)&lt;br /&gt;
cb1 = MCompensate (super, vb1, thSAD=200)&lt;br /&gt;
Interleave (cf1, last, cb1)&lt;br /&gt;
dfttest (sigma=1.0, tbsize=3, lsb=true)&lt;br /&gt;
SelectEvery (3, 1)&lt;br /&gt;
&lt;br /&gt;
# Additional smoothing pass and back to 8 bits&lt;br /&gt;
GradFun3 (thr=0.25, lsb_in=true)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
When a clip contains sharpening overshoots, the color banding may be resilient to [[GradFun3]], even with high thresholds (&amp;gt; 1.5). The following script helps to remove it without loosing too much details. You may have to adapt some values. Display mask_details.GreyScale() to check the mask. It shouldn’t show the color band boundaries (or just marginally).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;lvl_overshoot = 3.5&lt;br /&gt;
lvl_details   = 2&lt;br /&gt;
&lt;br /&gt;
o = last&lt;br /&gt;
w = Width ()&lt;br /&gt;
h = Height ()&lt;br /&gt;
&lt;br /&gt;
edges   = mt_edge (mode=&amp;quot;prewitt&amp;quot;, thY1=0, thY2=255)&lt;br /&gt;
details = mt_edge (mode=&amp;quot;min/max&amp;quot;, thY1=0, thY2=255)&lt;br /&gt;
&lt;br /&gt;
mask_lines     = edges.mt_lut (&amp;quot;x 6 - 50 *&amp;quot;)&lt;br /&gt;
mask_lines     = mask_lines.mt_expand ().mt_expand ().mt_expand ().mt_expand ()&lt;br /&gt;
mask_overshoot = edges.mt_lut (&amp;quot;x &amp;quot;+String(lvl_overshoot)+&amp;quot; - 2 ^ 40 *&amp;quot;)&lt;br /&gt;
mask_overshoot = mask_overshoot.mt_inpand ().RemoveGrain (12, -1)&lt;br /&gt;
mask_overshoot = mt_logic (mask_overshoot, mask_lines, mode=&amp;quot;max&amp;quot;)&lt;br /&gt;
mask_details   = details.mt_binarize (lvl_details)&lt;br /&gt;
mask_details   = mask_details.RemoveGrain (21 ,-1).mt_expand ()&lt;br /&gt;
mask_final     = mt_logic (mask_overshoot, mask_details, mode=&amp;quot;min&amp;quot;)&lt;br /&gt;
mask_final     = mask_final.RemoveGrain (20, -1).RemoveGrain (20, -1)&lt;br /&gt;
&lt;br /&gt;
o&lt;br /&gt;
BicubicResize (w/16 * 4, h/16 * 4, 1, 0).BicubicResize (w, h, 1, 0)&lt;br /&gt;
GradFun3 (radius=4, thr=0.6, mask=0, mode=6)  # Huge blur&lt;br /&gt;
mt_merge (last, o, mask_overshoot, luma=true) # W/o overshoot&lt;br /&gt;
GradFun3 (thr=0.6, mask=0)                    # W/o banding&lt;br /&gt;
mt_merge (last, o, mask_final, luma=true)     # Details protected&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Working with curves ===&lt;br /&gt;
The following examples are designed for TV-range data (luma in 16–235).&lt;br /&gt;
&lt;br /&gt;
Denoises very slightly, debands and protects the darkest shades by increasing the dynamic range for low luma values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;a = 0.5    # The smaller, the greater the protection&lt;br /&gt;
sa = String (a)&lt;br /&gt;
sd = String (Pow (219*256, 1 - 1.0/a))&lt;br /&gt;
dfttest (sigma=0.25, lsb=true)&lt;br /&gt;
Dither_lut16 (&amp;quot;x 4096 - 0 max &amp;quot;+sd+&amp;quot; / &amp;quot;+sa+&amp;quot; ^&amp;quot;, y=3, u=2, v=2) # Direct&lt;br /&gt;
SmoothGrad ()&lt;br /&gt;
Dither_lut16 (&amp;quot;x 1 &amp;quot;+sa+&amp;quot; / ^ &amp;quot;+sd+&amp;quot; * 4096 +&amp;quot;, y=3, u=2, v=2)   # Inverse&lt;br /&gt;
DitherPost ()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Blending 8-bit pictures in linear light:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Blending amount for the first clip&lt;br /&gt;
bl   = 0.75&lt;br /&gt;
bls1 = String (    bl)&lt;br /&gt;
bls2 = String (1 - bl)&lt;br /&gt;
&lt;br /&gt;
# 8-bit clips converted to linear 16-bit full range (gamma undone)&lt;br /&gt;
ug = &amp;quot; 16 - 0 max 1.41624 / 2.2 ^ &amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Redo the gamma, result in 16 bits YUV&lt;br /&gt;
rg = &amp;quot; 0.454545 ^ 362.5585 * 4096 +&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Blend&lt;br /&gt;
Dither_lutxy8 (src1, src2,&lt;br /&gt;
\   expr =&amp;quot;x     &amp;quot; + bls1 + &amp;quot; * y     &amp;quot; + bls2 + &amp;quot; * + 256 *&amp;quot;,&lt;br /&gt;
\   yexpr=&amp;quot;x&amp;quot; + ug + bls1 + &amp;quot; * y&amp;quot; + ug + bls2 + &amp;quot; * +&amp;quot; + rg,&lt;br /&gt;
\   y=3, u=3, v=3)&lt;br /&gt;
&lt;br /&gt;
# Back to 8 bits&lt;br /&gt;
DitherPost ()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Resizing in 16 bits ===&lt;br /&gt;
Simple resize:&lt;br /&gt;
&lt;br /&gt;
 Dither_convert_8_to_16 ()&lt;br /&gt;
 Dither_resize16 (1280, 720)&lt;br /&gt;
 DitherPost ()&lt;br /&gt;
&lt;br /&gt;
Sharpening the luma using the convolver of the resizer:&lt;br /&gt;
&lt;br /&gt;
 Dither_convert_8_to_16 ()&lt;br /&gt;
 Dither_resize16 (Width (), Height () / 2, kernel=&amp;quot;impulse -1 6 -1&amp;quot;,&lt;br /&gt;
 \                fh=-1, fv=-1, cnorm=true, center=false, y=3, u=2, v=2)&lt;br /&gt;
 DitherPost ()&lt;br /&gt;
&lt;br /&gt;
Restoring the original size of a picture using kernel inversion:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Input in 8 bits&lt;br /&gt;
w = Width ()  # Original size&lt;br /&gt;
h = Height () #&lt;br /&gt;
BilinearResize (w * 3 / 2, h * 3 / 2) # Upscale&lt;br /&gt;
&lt;br /&gt;
Dither_convert_8_to_16 ()&lt;br /&gt;
Dither_resize16 (w, h, kernel=&amp;quot;bilinear&amp;quot;, invks=true)&lt;br /&gt;
DitherPost ()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Resizing in linear light with protection against ringing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Y'Cb'Cr' input in 16 bits&lt;br /&gt;
Dither_convert_yuv_to_rgb (matrix=&amp;quot;709&amp;quot;, output=&amp;quot;rgb48y&amp;quot;, lsb_in=true)&lt;br /&gt;
Dither_y_gamma_to_linear (tv_range_in=false, tv_range_out=false, curve=&amp;quot;709&amp;quot;, sigmoid=true)&lt;br /&gt;
Dither_resize16nr (1280, 720, kernel=&amp;quot;spline36&amp;quot;)&lt;br /&gt;
Dither_y_linear_to_gamma (tv_range_in=false, tv_range_out=false, curve=&amp;quot;709&amp;quot;, sigmoid=true)&lt;br /&gt;
r = SelectEvery (3, 0)&lt;br /&gt;
g = SelectEvery (3, 1)&lt;br /&gt;
b = SelectEvery (3, 2)&lt;br /&gt;
Dither_convert_rgb_to_yuv (r, g, b, matrix=&amp;quot;709&amp;quot;, lsb=true)&lt;br /&gt;
# Y'Cb'Cr' output in 16 bits&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Colorspace conversions ===&lt;br /&gt;
Color conversions of 8-bit clips:&lt;br /&gt;
&lt;br /&gt;
 BlankClip () # Assumes RGB&lt;br /&gt;
 Dither_convert_rgb_to_yuv ()&lt;br /&gt;
 Dither_convert_yuv_to_rgb ()&lt;br /&gt;
&lt;br /&gt;
Upscaling in 16 bits a SD video to HD with correct color matrix conversion (slow way), output dithered to 8 bits ready for encoding:&lt;br /&gt;
&lt;br /&gt;
 MPEG2Source (&amp;quot;video_sd.d2v&amp;quot;)&lt;br /&gt;
 Dither_convert_8_to_16 ()&lt;br /&gt;
 Dither_resize16 (1280, 720)&lt;br /&gt;
 Dither_convert_yuv_to_rgb (matrix=&amp;quot;601&amp;quot;, output=&amp;quot;rgb48y&amp;quot;, lsb_in=true)&lt;br /&gt;
 r = SelectEvery (3, 0)&lt;br /&gt;
 g = SelectEvery (3, 1)&lt;br /&gt;
 b = SelectEvery (3, 2)&lt;br /&gt;
 Dither_convert_rgb_to_yuv (r, g, b, matrix=&amp;quot;709&amp;quot;, lsb=false, mode=0)&lt;br /&gt;
&lt;br /&gt;
Another possibility, with the resizing function operating in RGB land:&lt;br /&gt;
&lt;br /&gt;
 MPEG2Source (&amp;quot;video_sd.d2v&amp;quot;)&lt;br /&gt;
 Dither_convert_yuv_to_rgb (matrix=&amp;quot;601&amp;quot;, output=&amp;quot;rgb48y&amp;quot;)&lt;br /&gt;
 Dither_resize16 (1280, 720, y=3, u=1, v=1)&lt;br /&gt;
 r = SelectEvery (3, 0)&lt;br /&gt;
 g = SelectEvery (3, 1)&lt;br /&gt;
 b = SelectEvery (3, 2)&lt;br /&gt;
 Dither_convert_rgb_to_yuv (r, g, b, matrix=&amp;quot;709&amp;quot;, lsb=false, mode=0)&lt;br /&gt;
&lt;br /&gt;
Displaying a preview of a YUV stream with automatic matrix detection, conversion to sRGB with correct transfer curve, non-ringing scaling to 1080 lines in RGB linear colorspace and anamorphic correction:&lt;br /&gt;
&lt;br /&gt;
 MPEG2Source (&amp;quot;anything.d2v&amp;quot;)&lt;br /&gt;
 Dither_srgb_display (h=1080, dar=1.778)   # or 1.333 for 4:3 AR&lt;br /&gt;
&lt;br /&gt;
=== Special output to high-bit-depth ===&lt;br /&gt;
Simple denoising, quick debanding and direct 16-bit output for x264-10bit. Make sure reading the important remarks in the Dither_out function description:&lt;br /&gt;
&lt;br /&gt;
 dfttest (lsb=true)&lt;br /&gt;
 SmoothGrad ()&lt;br /&gt;
 Dither_out ()&lt;br /&gt;
&lt;br /&gt;
Same as above, but outputting 10-bit data aligned on 16-bit words (still needs --input-depth 16 in x264. Use ''reducerange=true'' for real 10-bit input):&lt;br /&gt;
&lt;br /&gt;
 dfttest (lsb=true)&lt;br /&gt;
 SmoothGrad ()&lt;br /&gt;
 Dither_quantize (10, mode=6)&lt;br /&gt;
 Dither_out ()&lt;br /&gt;
&lt;br /&gt;
Simple debanding with RGB48 output (needs specific encoding step):&lt;br /&gt;
&lt;br /&gt;
 Dither_convert_8_to_16 ()&lt;br /&gt;
 SmoothGrad ()&lt;br /&gt;
 Dither_convert_yuv_to_rgb (lsb_in=true, output=&amp;quot;rgb48y&amp;quot;)&lt;br /&gt;
 r = SelectEvery (3, 0)&lt;br /&gt;
 g = SelectEvery (3, 1)&lt;br /&gt;
 b = SelectEvery (3, 2)&lt;br /&gt;
 Dither_convey_rgb48_on_yv12 (r, g, b)&lt;br /&gt;
&lt;br /&gt;
== Common parameters ==&lt;br /&gt;
Exactly like [[MaskTools2|Masktools 2]], Dither has functions sharing common parameters.&lt;br /&gt;
&lt;br /&gt;
;int y (3), int u (3), int v (3)&lt;br /&gt;
&lt;br /&gt;
: These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''-255...0 or -65535...0'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| All the pixels of the plane will be set to -x. The range depends whether the output clip is a stack16 or a regular 8-bit clip.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane will not be processed. That means the content of the plane after the filter is pure garbage.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane of the first input clip will be copied.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane will be processed with the processing the filter is designed to do.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| When applicable, the plane of the second input clip will be copied.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| When applicable, the plane of the third input clip will be copied.&lt;br /&gt;
|}&lt;br /&gt;
Unlike Masktools 2, all the planes are processed by default.&lt;br /&gt;
&lt;br /&gt;
== Filters description ==&lt;br /&gt;
=== DitherPost ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;DitherPost (&lt;br /&gt;
    clip  m,&lt;br /&gt;
    clip  clsb (undefined),&lt;br /&gt;
    int   mode (0),&lt;br /&gt;
    float ampo (1),&lt;br /&gt;
    float ampn (0),&lt;br /&gt;
    int   pat (1),&lt;br /&gt;
    bool  dyn (false),&lt;br /&gt;
    bool  prot (false),&lt;br /&gt;
    clip  mask (undefined),&lt;br /&gt;
    float thr (-1),&lt;br /&gt;
    bool  stacked (true),&lt;br /&gt;
    bool  interlaced (false),&lt;br /&gt;
    int   y (3),&lt;br /&gt;
    int   u (3),&lt;br /&gt;
    int   v (3),&lt;br /&gt;
    bool  staticnoise (false),&lt;br /&gt;
    bool  slice (true)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Adds the dither, turning a 16-bit clip generated by Dither1Pre, Dither2Pre or a mod16 denoiser into a regular 8-bit clip.&lt;br /&gt;
&lt;br /&gt;
Pure ordered dithering seems to be retained better than noise or error diffusion during video compression. Therefore this is the recommended method to avoid color banding, unless you encode at very high bitrates. If you don’t care about video compression, error diffusion gives the most accurate results. To avoid discontinuities between purely flat areas and dithered areas, you can add a bit of noise.&lt;br /&gt;
&lt;br /&gt;
Important note: the colorbanding removal is not done by the dithering stage, but by the filtering stage. The latter rebuilds the fine gradients in the 16-bit land. The dithering helps converting the picture data to something watchable, in 8 bits, while preserving a preceptually high colordepth, thus preventing the colorbanding to appear.&lt;br /&gt;
&lt;br /&gt;
;m&lt;br /&gt;
:If ''clsb'' is defined, contains the main picture data (MSB). If ''clsb'' is not defined, it contains both MSB and LSB clips as interleaved frames (same format as the first pass output), or as stacked frames, depending on the ''stacked'' value.&lt;br /&gt;
&lt;br /&gt;
;clsb&lt;br /&gt;
:Contains the residual information (LSB) if defined.&lt;br /&gt;
&lt;br /&gt;
;mode&lt;br /&gt;
:Dithering method:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''-1'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| no dither, round to the closest value&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''0'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 8-bit ordered dither + noise.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 1-bit dither&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 2-bit dither, light&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 2-bit dither, medium&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''4'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 2-bit dither, strong&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''5'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 2-bit dither, stronger&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''6'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Serpentine Floyd-Steinberg error diffusion + noise. Well-balanced algorithm.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''7'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Stucki error diffusion + noise. Looks “sharp” and preserve light edges and details well.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''8'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Atkinson error diffusion + noise. Generates distinct patterns but keeps clean the flat areas.&lt;br /&gt;
|}&lt;br /&gt;
Modes 1 to 5 have no real interest over mode 0 and can be considered deprecated.&lt;br /&gt;
&lt;br /&gt;
;ampo&lt;br /&gt;
:The ordered dither peak-to-peak amplitude, on an 8 bit scale. = 0. On error diffusion algorithms, it increases the collected error amount, helping to extend the range of the dithering while preserving its natural pattern (especially Atkinson’s). This gives a better looking result than just adding noise.&lt;br /&gt;
&lt;br /&gt;
;ampn&lt;br /&gt;
:The noise peak-to-peak amplitude, on an 8 bit scale. = 0. Currently, the maximum value is 4.&lt;br /&gt;
&lt;br /&gt;
;pat&lt;br /&gt;
:is the dither pattern type for 2-bit dither:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''0'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Regular&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Alternate V&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Alternate H&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;dyn&lt;br /&gt;
:Indicates if the ordered dither pattern is dynamic. If so, the pattern is rotated each frame.&lt;br /&gt;
&lt;br /&gt;
;prot&lt;br /&gt;
:Enables the protection against MSB-LSB inconsistencies, which can occur when the main picture (MSB only) is processed.&lt;br /&gt;
&lt;br /&gt;
;mask&lt;br /&gt;
:If defined, dithering is applied where the pixel values are lower than 128. Must be defined for all the planes. You can build the mask with [[#DitherBuildMask|DitherBuildMask]].&lt;br /&gt;
&lt;br /&gt;
;thr&lt;br /&gt;
:Threshold below which no dither occurs, in pixel value units on an 8 bit scale. It helps to keep calm flat areas where the LSB content is just low-level residual noise. Works only for dithering mode 0. Ranges from 0 to 0.5. -1 = disabled.&lt;br /&gt;
&lt;br /&gt;
;stacked&lt;br /&gt;
:When ''clsb'' is undefined, true indicates that the clip is composed of the MSB part stacked on top of the LSB part. false indicates that MSB and LSB are interleaved.&lt;br /&gt;
&lt;br /&gt;
;interlaced&lt;br /&gt;
:Indicates that the clip is interlaced and that the dither should be applied on each field separately.&lt;br /&gt;
&lt;br /&gt;
;staticnoise&lt;br /&gt;
:If set to true, the noise generated with ''ampn'' is static.&lt;br /&gt;
&lt;br /&gt;
;slice&lt;br /&gt;
:Set it to false to disable plane slicing. Slicing is used in multithreading and can create artifacts at slice boundaries with error-diffusion algorithms. Disabling slicing reduces the threading performances.&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== DitherBuildMask ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;DitherBuildMask (&lt;br /&gt;
    clip cnew,&lt;br /&gt;
    clip cold (undefined),&lt;br /&gt;
    int  edgelvl (8),&lt;br /&gt;
    int  radius (2)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function builds a mask to use in [[#DitherPost|DitherPost]]. It helps avoiding artifacts during the dithering when the picture was processed between the [[Dither_tools#Dither1Pre.2C_Dither2Pre|DitherXPre]] and DitherPost operations. It also helps to preserve detailed areas from dithering. Call this function right before DitherPost and pass the result in the mask parameter.&lt;br /&gt;
&lt;br /&gt;
;cnew&lt;br /&gt;
:The MSB part of the processed clip.&lt;br /&gt;
&lt;br /&gt;
;cold&lt;br /&gt;
:The original MSB part of the clip. If this argument is specified, cold must be of the same size as cnew. Pixel which are different are set in the mask and are expanded like the edges.&lt;br /&gt;
&lt;br /&gt;
;edgelvl&lt;br /&gt;
:Threshold for the edge detection (0–255). The lower, the more edges it detects.&lt;br /&gt;
&lt;br /&gt;
;radius&lt;br /&gt;
:Minimum distance in pixels separating the dithered zones from the detected edges and potential artifacts (1–8).&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== SmoothGrad ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;SmoothGrad (&lt;br /&gt;
    clip  m,&lt;br /&gt;
    clip  clsb (undefined),&lt;br /&gt;
    int   radius (16),&lt;br /&gt;
    float thr (0.25),&lt;br /&gt;
    bool  stacked (true),&lt;br /&gt;
    clip  ref (undefined),&lt;br /&gt;
    float elast (3),&lt;br /&gt;
    int   y (3),&lt;br /&gt;
    int   u (3),&lt;br /&gt;
    int   v (3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
SmoothGrad smooths the low gradients or flat areas of a 16-bit clip. It proceeds by applying a huge blur filter and comparing the result with the input data for each pixel. If the difference is below the specified threshold, the filtered version is taken into account, otherwise the input pixel remains unchanged.&lt;br /&gt;
&lt;br /&gt;
;m&lt;br /&gt;
:If ''clsb'' is defined, contains the main picture data (MSB). If ''clsb'' is not defined, it contains both clips. In this case, its format depends on the ''stacked'' parameter.&lt;br /&gt;
&lt;br /&gt;
;clsb&lt;br /&gt;
:Contains the residual information (LSB) if defined.&lt;br /&gt;
&lt;br /&gt;
;radius&lt;br /&gt;
:Radius in pixels of the smoothing filter. &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
;thr&lt;br /&gt;
:Threshold between reference data and filtered data, on an 8-bit scale. &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
;stacked&lt;br /&gt;
:When ''clsb'' is undefined, true indicates that the clip is composed of the MSB part stacked on top of the LSB part. False indicates that MSB and LSB are interleaved.&lt;br /&gt;
&lt;br /&gt;
;ref&lt;br /&gt;
:Reference clip for the filter output comparison. Specify here the input clip when you cascade several [[#SmoothGrad|SmoothGrad]] calls. It is always a stacked or interleaved LSB/MSB combination, depending on the ''stacked'' parameter. When undefined, the input clip is taken as reference.&lt;br /&gt;
&lt;br /&gt;
;elast&lt;br /&gt;
:To avoid artifacts, the threshold has some kind of elasticity. Value differences falling over this threshold are gradually attenuated, up to ''thr'' * ''elast'' &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== GradFun3 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;GradFun3 (&lt;br /&gt;
    clip  src,&lt;br /&gt;
    float thr (0.35),&lt;br /&gt;
    int   radius (12),&lt;br /&gt;
    float elast (3),&lt;br /&gt;
    int   mask (2),&lt;br /&gt;
    int   mode (undefined),&lt;br /&gt;
    float ampo (undefined),&lt;br /&gt;
    float ampn (undefined),&lt;br /&gt;
    int   pat (undefined),&lt;br /&gt;
    bool  dyn (undefined),&lt;br /&gt;
    float dthr (undefined),&lt;br /&gt;
    int   smode (0),&lt;br /&gt;
    float wmin (1.0),&lt;br /&gt;
    float thr_det (2),&lt;br /&gt;
    float thr_edg,&lt;br /&gt;
    int   debug (0),&lt;br /&gt;
    float subspl (0),&lt;br /&gt;
    bool  lsb (false),&lt;br /&gt;
    bool  lsb_in (false),&lt;br /&gt;
    bool  staticnoise (undefined),&lt;br /&gt;
    float thrc (thr),&lt;br /&gt;
    int   radiusc (radius),&lt;br /&gt;
    float elastc (elast)&lt;br /&gt;
    int   y (3),&lt;br /&gt;
    int   u (3),&lt;br /&gt;
    int   v (3),&lt;br /&gt;
    clip  ref,&lt;br /&gt;
    bool  slice (true)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function is equivalent to GradFun2db and helps removing the existing color banding from a source, dithered or not. The default dithering pattern is ordered and should be more resilient to lossy codec quantification than the other patterns. But to keep all the advantages of the gradient smoothing and dithering, you should make GradFun3 the very last filter of your encoding chain, or use masking methods to safeguard the dither patterns.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:The input clip.&lt;br /&gt;
&lt;br /&gt;
;thr, thrc&lt;br /&gt;
:Filter threshold. Below this value, the changes made by the banding filter on pixel values are not attenuated. The higher, the more effective the filter will be, but details will be smoothed and artifacts will appear near the edges between two flat areas. ''thrc'' is the parameter for the chroma planes. Keep it below 1.0. Range: 0.1–10.0.&lt;br /&gt;
&lt;br /&gt;
;radius, radiusc&lt;br /&gt;
:Filter radius, in pixels. Basically, this is the extent of artifical gradient introduced on the band edges. ''radiusc'' is the parameter for the chroma planes. The default value is tuned for SD video and 720p, but you might probably want to increase it to 16 for 1080p video. Range: 1–68 for ''smode=0'', 1–128 for ''smode=1'' and =&amp;amp;nbsp;3 for ''smode=2''.&lt;br /&gt;
&lt;br /&gt;
;elast, elastc&lt;br /&gt;
:Elasticity of the filter attenuation. It’s a multiplier on the threshold. A pixel difference above ''thr'' * ''elast'' won’t have any effect. ''elastc'' is the parameter for the chroma planes. Good values are in the range 1.25–4.&lt;br /&gt;
&lt;br /&gt;
;mask&lt;br /&gt;
:Depth in pixels of the detail/edge masking. Set it to 0 to disable it.&lt;br /&gt;
&lt;br /&gt;
;thr_det&lt;br /&gt;
:Local contrast threshold for detail detection and masking. The lower, the better the details will be protected, but the lower the smoothing efficiency. Must be &amp;gt; 0, and above the height of a color-banding step. When kept unspecified, it more or less follows the main debanding threshold ''thr''.&lt;br /&gt;
&lt;br /&gt;
;thr_edg&lt;br /&gt;
:Unused. Kept for backward compatibility purpose.&lt;br /&gt;
&lt;br /&gt;
;smode&lt;br /&gt;
:Indicates which filter to use for gradient smoothing.   &lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''0'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Box filter. Very fast, whatever the radius. Drawback: can introduce slight but large halos, especially with high thresholds. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;code&amp;gt;dfttest&amp;lt;/code&amp;gt;. Much slower, but less prone to artefacts and halos than the box filter. This is the prefered mode for high quality results with acceptable processing time. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''2'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bilateral filter. Very slow, and slower for bigger radius, but much less prone to artefacts than the box filter. Almost haloless, even for high thresholds. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''3'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Undocumented mode. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;wmin&lt;br /&gt;
:For ''smode'' 2 (bilateral filter), this parameter prevents the filter to totally flatten the small areas of nearly uniform color. It ranges between 0.0 (normal bilateral filtering) and 1.0 (protection fully activated).&lt;br /&gt;
&lt;br /&gt;
;debug&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''0'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Normal output, without debugging information. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''1'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Shows the detail/edge mask. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;subspl&lt;br /&gt;
:Subsampling rate for the bilateral filter. Set it to 0 to adjust it automatically to the radius. Disable it with 1. Normal subsampling values should be greater or equal to 4. The maximum value depends on the radius.&lt;br /&gt;
&lt;br /&gt;
;lsb&lt;br /&gt;
:When set to true, leaves the 16-bit data instead of dithering them to 8 bits.&lt;br /&gt;
&lt;br /&gt;
;lsb_in&lt;br /&gt;
:When set to true, works on 16-bit input.&lt;br /&gt;
&lt;br /&gt;
;ref&lt;br /&gt;
:Reference clip used to limit changes. Allows cascading multiple GradFun3 calls (for example by combining small and large radius settings) without going too far from the original picture. ''ref'' must have the same format as the input clip. When not specified, the reference clip is the input.&lt;br /&gt;
&lt;br /&gt;
;other parameters&lt;br /&gt;
:The other parameters are directly transmitted to DitherPost. ''dthr'' is translated to ''thr''.&lt;br /&gt;
&lt;br /&gt;
Here is a table showing the equivalent parameters in GradFun3 and GradFun2DBmod:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''GradFun3'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;center&amp;gt;'''Conversion'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;center&amp;gt;'''GradFun2DBmod'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;''thr''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;nowiki&amp;gt;= 0.3 *&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ''thr''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;''mask''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ''radius''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;''thr_det''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ''range''&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_box_filter16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_box_filter16 (&lt;br /&gt;
    clip src,&lt;br /&gt;
    int  radius (16),&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (3),&lt;br /&gt;
    int  v (3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Performs a box filtering on the input clip. Box filtering consists in averaging all the pixels in a square area whose center is the output pixel. This filter is very fast to compute and its speed doesn’t depend on its radius. You can approximate a large gaussian filtering by cascading a few box filters.&lt;br /&gt;
&lt;br /&gt;
Both input and output are vertically stacked 16-bit clips.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:Input clip to be filtered.&lt;br /&gt;
&lt;br /&gt;
;radius&lt;br /&gt;
:Size of the averaged square. Its width is radius*2-1. Range: 2–91.&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== Dither_bilateral16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_bilateral16 (&lt;br /&gt;
    clip  src,&lt;br /&gt;
    clip  ref (undefined),&lt;br /&gt;
    int   radius (16),&lt;br /&gt;
    float thr (2.5),&lt;br /&gt;
    float flat (0.4),&lt;br /&gt;
    float wmin (0.0),&lt;br /&gt;
    float subspl (0),&lt;br /&gt;
    int   y (3),&lt;br /&gt;
    int   u (3),&lt;br /&gt;
    int   v (3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Performs a bilateral filtering on the input clip. A bilateral filter is like a gaussian filter, but values of the filtering window are weighted with a gaussian curve, depending of their proximity with the center pixel. The closer the values, the more weight has the value in the final sum. Bilateral filters are very efficient to remove noise on flat areas and smooth gradients without being disturbed by surrounding areas of different colors or high contrast lines. The result of a bilateral filtering is indeed cartoonish and waxy, therefore it does a very good job at gradient smoothing, without producing halos like the box filter. However, this is a very slow filter.&lt;br /&gt;
&lt;br /&gt;
Actually, this implementation is an approximation of a bilateral filter, like many other image processing tools do. The spatial weighting is not a gaussian curve but a box, and the value weighting is a trapezoid. Cascading several function calls leads to a better approximation of the gaussian shape.&lt;br /&gt;
&lt;br /&gt;
If you plan to use this filter for debanding, do not use it alone. It has no protection against oversmoothing. You should first apply [[#Dither_limit_dif16|Dither_limit_dif16]] on its result, exactly like with pp#Dither_box_filter16|Dither_box_filter16]], then use a mask to protect the finest details. The [[#GradFun3|GradFun3]] code is a good example to refer to.&lt;br /&gt;
&lt;br /&gt;
This function works only on 16-bit stacked clips.&lt;br /&gt;
&lt;br /&gt;
If you [http://forum.doom9.org/showthread.php?t=148782 MT()] the function, make sure to have an horizontal overlap greater or equal to twice the radius. Anyway, this is certainly not the most efficient way to get the processing multithreaded. Prefer using SetMTMode 1 or 2.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:Clip to be filtered.&lt;br /&gt;
&lt;br /&gt;
;ref&lt;br /&gt;
:When computing the value weighting, pixels of this clip are taken for reference. When cascading several calls to the function, set the original clip as reference to avoid the result drifting to something superflat.&lt;br /&gt;
&lt;br /&gt;
;radius&lt;br /&gt;
:Size of the averaged square. Its width is radius*2-1. Must be = 2.&lt;br /&gt;
&lt;br /&gt;
;thr&lt;br /&gt;
:Pixels whose difference of value with the center pixel is over ''thr'' will be discarded. The parameter ranges on an 8 bit scale. Must be stricly positive.&lt;br /&gt;
&lt;br /&gt;
;flat&lt;br /&gt;
:Determines the shape of the trapezoid weighting of the value differences. Close to 0, the shape is triangular. Close to 1, the shape is a rectangle, like a box filter with a hard threshold. Range: 0.0–1.0&lt;br /&gt;
&lt;br /&gt;
;wmin&lt;br /&gt;
:The partial or missing pixels are completed with the center pixel to match the ''wmin'' fraction of the filter window at full weight. At 0.0, it acts like a classic bilateral filter. Raising the total weight helps preventing the filter to completely flatten the small areas of close colors. Range: 0.0–1.0. Values over 1 are tolerated, they are equivalent to keep ''wmin'' to 1 while reducing the overall strength of the filter.&lt;br /&gt;
&lt;br /&gt;
;subspl&lt;br /&gt;
:Subsampling rate. When this parameter is activated, only a few pixels randomly chosen from the search window are taken into account. This leads to significative speed improvment, with only a minor quality loss. A value equal to twice the radius looks like a good compromise. Normal subsampling values should be greater or equal to 4. Below, subsampling is disabled. Set ''subspl'' to 0 to let the filter adjust the subsampling rate automatically, depending on the radius. The number of subsampling points is limited to 4096. The random pattern is the same for all the frames and planes.&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== Dither_limit_dif16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_limit_dif16 (&lt;br /&gt;
    clip  flt,&lt;br /&gt;
    clip  src,&lt;br /&gt;
    clip  ref (undefined),&lt;br /&gt;
    float thr (0.25),&lt;br /&gt;
    float elast (3.0),&lt;br /&gt;
    int   y (3),&lt;br /&gt;
    int   u (3),&lt;br /&gt;
    int   v (3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function compare a filtered clip with its original version, and keeps the filtered pixels only if the difference between the filtered pixel and the reference pixel is below the given threshold. This is a building block of SmoothGrad and GradFun3.&lt;br /&gt;
&lt;br /&gt;
This function works only on 16-bit stacked clips.&lt;br /&gt;
&lt;br /&gt;
;flt&lt;br /&gt;
:Filtered clip.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:Original clip.&lt;br /&gt;
&lt;br /&gt;
;ref&lt;br /&gt;
:Reference clip for the filter output comparison. Specify here the first original clip when you cascade several limited filters. When undefined, the ''src'' clip is taken as reference.&lt;br /&gt;
&lt;br /&gt;
;thr&lt;br /&gt;
:Thershold between reference data and filtered data, on an 8-bit scale. &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
;elast&lt;br /&gt;
:To avoid artifacts, the threshold has some kind of elasticity. Value differences falling over this thershold are gradually attenuated, up to ''thr'' * ''elast''. &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== Dither_resize16, Dither_resize16nr ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_resize16 (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    int    width,&lt;br /&gt;
    int    height,&lt;br /&gt;
    float  src_left (0),&lt;br /&gt;
    float  src_top (0),&lt;br /&gt;
    float  src_width (0),&lt;br /&gt;
    float  src_height (0),&lt;br /&gt;
    string kernel (&amp;quot;spline36&amp;quot;),&lt;br /&gt;
    float  fh (1.0),&lt;br /&gt;
    float  fv (1.0),&lt;br /&gt;
    int    taps (4),&lt;br /&gt;
    float  a1 (undefined),&lt;br /&gt;
    float  a2 (undefined),&lt;br /&gt;
    float  a3 (undefined),&lt;br /&gt;
    int    kovrspl (1),&lt;br /&gt;
    bool   cnorm (true),&lt;br /&gt;
    bool   center (true),&lt;br /&gt;
    string cplace (&amp;quot;MPEG2&amp;quot;),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (3),&lt;br /&gt;
    int    v (3),&lt;br /&gt;
    string kernelh (&amp;quot;&amp;quot;),&lt;br /&gt;
    string kernelv (&amp;quot;&amp;quot;),&lt;br /&gt;
    float  totalh (0),&lt;br /&gt;
    float  totalv (0),&lt;br /&gt;
    bool   invks (false),&lt;br /&gt;
    bool   invksh (invks),&lt;br /&gt;
    bool   invksv (invks),&lt;br /&gt;
    int    invkstaps (5),&lt;br /&gt;
    string cplaces (cplace),&lt;br /&gt;
    string cplaced (cplace),&lt;br /&gt;
    string csp (undefined)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_resize16nr (&lt;br /&gt;
    …&lt;br /&gt;
    (same arguments as Dither_resize16)&lt;br /&gt;
    …&lt;br /&gt;
    bool   noring (true)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Resizes a 16-bit clip.&lt;br /&gt;
&lt;br /&gt;
The function can resize interlaced content, but only if presented as separated, interleaved fields. It uses the Avisynth parity information to detect fields and maintain the correct chroma and luma positions. If this behaviour is not desired, add an AssumeFrameBased() before the resizing call.&lt;br /&gt;
&lt;br /&gt;
The function can also be used to compute horizontal and vertical convolutions. If you do so, don’t forget to set:&lt;br /&gt;
&lt;br /&gt;
:* ''fh'' or ''fv'' to -1 to make sure the clip is processed even if its size doesn’t change, &lt;br /&gt;
:* ''cnorm'' to false to avoid automatic kernel normalisation if your impulse is already normalised, or specify ''totalv'' or ''totalh'' if the normalisation factor is not the sum of the impulse &lt;br /&gt;
:* and ''center'' to false to keep the desired spacing between the sampling points. &lt;br /&gt;
&lt;br /&gt;
This function works only on 16-bit stacked clips.&lt;br /&gt;
&lt;br /&gt;
The Dither_resize16nr function is a wrapper over Dither_resize16, adding a ringing-cancellation algorithm.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:Clip to be resized. Mandatory.&lt;br /&gt;
&lt;br /&gt;
;width, height&lt;br /&gt;
:New picture width and height in pixels, &amp;gt; 0. Mandatory.&lt;br /&gt;
&lt;br /&gt;
;src_left, src_top&lt;br /&gt;
:Coordinate of the top-left corner of the picture sub-area used as source for the resizing. They can be fractional. If negative, the picture is extended by replicating the left pixel column.&lt;br /&gt;
&lt;br /&gt;
;src_width, src_height&lt;br /&gt;
:Size in pixels of the sub-area to resize. They can be fractional. If 0, the area has the same size as the source clip. If negative, they define coordinates relative to the bottom-right corner, in a [[Crop]]-like manner.&lt;br /&gt;
&lt;br /&gt;
;kernel&lt;br /&gt;
:Kernel used by the resizer. Possible values are: &lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;point&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Nearest neighbour interpolation. Same as [[PointResize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;rect&amp;quot; or &amp;quot;box&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Box filter.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;linear&amp;quot; or&amp;quot;bilinear&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bilinear interpolation. Same as [[BilinearResize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;cubic&amp;quot; or&amp;quot;bicubic&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bicubic interpolation. Same as [[BicubicResize]](). The ''b'' and ''c'' variables are mapped on ''a1'' and ''a2'' and are both set to 1/3 by default.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;lanczos&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| [[Resampling#Sinc_resampler|Sinc]] function windowed by the central lobe of a sinc. Use ''taps'' to specify its impulse length. Same as [[LanczosResize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;blackman&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| [[Resampling#Blackman_resampler|Blackman-Harris]] windowed sinc. Use ''taps'' to control its length. Same as [[BlackmanResize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;blackmanminlobe&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Another kind of Blackman windowed sinc, with a bit less ringing. Use ''taps'' for you know what.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;spline16&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Cubic spline based kernel, 4 sample points. Same as [[Spline16Resize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;spline36&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Spline, 6 sample points. Same as [[Spline36Resize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;spline64&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Spline, 8 sample points. Same as [[Spline64Resize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;spline&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Generic splines, number of sample points is twice the ''taps'' parameter, so you can use ''taps&amp;amp;nbsp;= 6'' to get a [[SplineResize|Spline144Resize]]() equivalent.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;gauss&amp;quot; or&amp;quot;gaussian&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| [[Resampling#Gaussian_resampler|Gaussian]] kernel. The p parameter is mapped on ''a1'' and controls the curve width. The higher p, the sharper. It is set to 30 by default. This resizer is the same as [[GaussResize]](), but ''taps'' offers a control on the filter impulse length. For low p values (soft and blurry), it’s better to increase the number of taps to avoid truncating the gaussian curve too early and creating artifacts.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;sinc&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Truncated sinc function. Use ''taps'' to control its length. Same as [[SincResize]]().&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;impulse&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Offers the possibility to create your own kernel (useful for convolutions). Add your coefficents in the string after “impulse”, separated with spaces (ex: &amp;quot;impulse 1 2 1&amp;quot;). The number of coefficients must be odd. The curve is linearly interpolated between the provided points. You can oversample the impulse by setting ''kovrspl'' to a value &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;fh, fv&lt;br /&gt;
:Horizontal and vertical frequency factors, also known as inverse kernel support. They are multipliers on the theoretical kernel cutoff frequency in both directions. Values below 1.0 spatially expand the kernel and blur the picture. Values over 1.0 shrink the kernel and let higher frequencies pass. The result will look sharper but more aliased. The multiplicator is applied after the kernel scaling in case of downsizing. Negative values force the processing, even if the horizontal size doesn’t change. The filter will use the absolute parameter value.&lt;br /&gt;
&lt;br /&gt;
;taps&lt;br /&gt;
:Some kernels have a variable number of sample points, given by this parameter. Actually this counts half the number of lobes (or equivalent)&amp;amp;nbsp;; in case of downscaling, the actual number of sample points may be greater than the specified value. Range: 1–128&lt;br /&gt;
&lt;br /&gt;
;a1, a2, a3&lt;br /&gt;
:Specific parameters, depending on the selected kernel.&lt;br /&gt;
&lt;br /&gt;
;kovrspl&lt;br /&gt;
:Specifies here how many times the kernel is oversampled when you provide a custom impluse response. = 1.&lt;br /&gt;
&lt;br /&gt;
;cnorm&lt;br /&gt;
:If set to true, the impulse sum is normalised to 1 for each pixel. This is the normal behaviour when resizing, to make sure the energy is constant for all pixels. If you use the resizer as a convolution engine, it is advised to disable the normalisation.&lt;br /&gt;
&lt;br /&gt;
;center&lt;br /&gt;
:Like the Avisynth resizers, this resizer preserves the position of the picture center. Disable this parameter if you may want to resize by preserving the top-left corner position. Similarly, if you are convolving without resizing, setting it to false ensures you that the same kernel will be applied to all pixels.&lt;br /&gt;
&lt;br /&gt;
;cplace, cplaces, cplaced&lt;br /&gt;
:Placement of the chroma samples. ''cplaces'' and ''cplaced'' allow specifying different placements for source and destination clips and take precedence over ''cplace''. Can be one of these strings:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;MPEG1&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:2:0 subsampling used in MPEG-1. Chroma samples are located on the center of each group of 4 pixels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;MPEG2&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Subsampling used in MPEG-2 4:2:x and most other formats. Chroma samples are located on the left pixel column of the group.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;DV&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| For 4:2:0 modes, it’s like MPEG-2 but U and V channels are “co-sited” vertically: V on the top row, and U on the bottom row. For 4:1:1, chroma is located on the leftmost column.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
The chroma placement is ignored when ''center'' is set to false or ''kernel'' to &amp;quot;point&amp;quot;. You’ll find below an overview of common chroma placement and subsampling combinations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Avisynth source code:&lt;br /&gt;
StackVertical (&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;Y8&amp;quot;,    &amp;quot;MPEG2&amp;quot;, &amp;quot;4:0:0&amp;quot;,         false, 0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV24&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:4:4&amp;quot;,         false, 0)&lt;br /&gt;
\   ),&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV12&amp;quot;,  &amp;quot;MPEG1&amp;quot;, &amp;quot;4:2:0 MPEG-1&amp;quot;,  false, 0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV12&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:2:0 MPEG-2&amp;quot;,  false, 0)&lt;br /&gt;
\   ),&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV12&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:2:0 MPEG-2&amp;quot;,  true,  0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV12&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:2:0 MPEG-2&amp;quot;,  true,  1)&lt;br /&gt;
\   ),&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV12&amp;quot;,  &amp;quot;DV&amp;quot;,    &amp;quot;4:2:0 DV-PAL&amp;quot;,  true,  0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV12&amp;quot;,  &amp;quot;DV&amp;quot;,    &amp;quot;4:2:0 DV-PAL&amp;quot;,  true,  1)&lt;br /&gt;
\   ),&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV411&amp;quot;, &amp;quot;DV&amp;quot;,    &amp;quot;4:1:1 DV-NTSC&amp;quot;, true,  0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV411&amp;quot;, &amp;quot;DV&amp;quot;,    &amp;quot;4:1:1 DV-NTSC&amp;quot;, true,  1)&lt;br /&gt;
\   ),&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV411&amp;quot;, &amp;quot;DV&amp;quot;,    &amp;quot;4:1:1 DV-NTSC&amp;quot;, false, 0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV16&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:2:2&amp;quot;,         false, 0)&lt;br /&gt;
\   ),&lt;br /&gt;
\   StackHorizontal (&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV16&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:2:2&amp;quot;,         true,  0),&lt;br /&gt;
\       show_chroma_ss (&amp;quot;YV16&amp;quot;,  &amp;quot;MPEG2&amp;quot;, &amp;quot;4:2:2&amp;quot;,         true,  1)&lt;br /&gt;
\   )&lt;br /&gt;
\ )&lt;br /&gt;
&lt;br /&gt;
Function show_chroma_ss (string colorspace, string cplace, string dispname, bool itl, int field)&lt;br /&gt;
{&lt;br /&gt;
    scale = 24&lt;br /&gt;
    bkg   = $FFFFFF&lt;br /&gt;
    shrp  = true&lt;br /&gt;
&lt;br /&gt;
    Y = (itl)                                           ? &amp;quot;  y 2 / floor  &amp;quot; : &amp;quot;y&amp;quot;&lt;br /&gt;
    X = (itl &amp;amp;&amp;amp; colorspace == &amp;quot;YV12&amp;quot; &amp;amp;&amp;amp; cplace == &amp;quot;DV&amp;quot;) ? &amp;quot;x y 2 / floor +&amp;quot; : &amp;quot;x&amp;quot;&lt;br /&gt;
    BlankClip (pixel_type=colorspace, length=1, color_yuv=$EB8080, width=64, height=64, fps=1)&lt;br /&gt;
    cy = ConvertToYV12 ()&lt;br /&gt;
    cy = cy.mt_lutspa (relative=false, expr=&amp;quot;x &amp;quot;+Y+&amp;quot; + 2 % 128 * 64 +&amp;quot;)&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
        cu = UToY ().ConvertToYV12 ()&lt;br /&gt;
        cv = VToY ().ConvertToYV12 ()&lt;br /&gt;
        cu = cu.mt_lutspa (relative=false, expr=X+&amp;quot;        2 %  80 * 88 +&amp;quot;)&lt;br /&gt;
        cv = cv.mt_lutspa (relative=false, expr=Y+&amp;quot;        2 %  80 * 88 +&amp;quot;)&lt;br /&gt;
        YToUV (cu, cv, cy)&lt;br /&gt;
    }&lt;br /&gt;
    catch (e)&lt;br /&gt;
    {&lt;br /&gt;
        cy.ConvertToY8 ()&lt;br /&gt;
    }&lt;br /&gt;
    Crop (0, 0, 8, 8)&lt;br /&gt;
    bor = 4&lt;br /&gt;
    AddBorders (bor, bor, bor, bor, bkg)&lt;br /&gt;
    w = Width ()&lt;br /&gt;
    h = Height ()&lt;br /&gt;
    Dither_convert_8_to_16 ()&lt;br /&gt;
    (itl) ? AssumeFrameBased ().AssumeTFF ().SeparateFields () : last&lt;br /&gt;
    fx = (shrp) ? 8 : 1&lt;br /&gt;
    Dither_resize16 (w * scale, h * scale, kernel=&amp;quot;gaussian&amp;quot;, a1=80, fh=fx, fv=fx, cplace=cplace)&lt;br /&gt;
    (itl) ? SelectEvery (2, field) : last&lt;br /&gt;
    Dither_convert_yuv_to_rgb (lsb_in=true, mode=0, ampn=0, chromak=&amp;quot;point&amp;quot;)&lt;br /&gt;
    bs = bor * scale&lt;br /&gt;
    mask = Crop (bs, bs, -bs, -bs)&lt;br /&gt;
    mask = mask.BlankClip (color=$000000)&lt;br /&gt;
    bf = (scale + 31) / 32&lt;br /&gt;
    mask = mask.AddBorders (bf, bf, bf, bf, $FFFFFF)&lt;br /&gt;
    bsf = bs - bf&lt;br /&gt;
    mask = mask.AddBorders (bsf, bsf, bsf, bsf, $000000)&lt;br /&gt;
    Overlay (last.BlankClip (), mask=mask)&lt;br /&gt;
    b2s = (bor - 2) * scale&lt;br /&gt;
    Crop (b2s, b2s, -b2s, -b2s)&lt;br /&gt;
    ftx = (field == 1) ? &amp;quot;bottom&amp;quot; : &amp;quot;top&amp;quot;&lt;br /&gt;
    Subtitle (&lt;br /&gt;
\       dispname + (itl ? &amp;quot;, &amp;quot; + ftx + &amp;quot; field&amp;quot; : &amp;quot;&amp;quot;),&lt;br /&gt;
\       text_color=$00000000, halo_color=$FF000000, align=8, size=scale*0.85&lt;br /&gt;
\   )&lt;br /&gt;
}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;chroma_placement&amp;quot;&amp;gt;You’ll find below an overview of common chroma placement and subsampling combinations (click to enlarge)&lt;br /&gt;
::[[File:Colorspace-subsampling.png|171px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;kernelh, kernelv&lt;br /&gt;
:''kernel'' parameter specialisation for a given direction (horizontal or vertical). An empty string means that the ''kernel'' value is used.&lt;br /&gt;
&lt;br /&gt;
;totalh, totalv&lt;br /&gt;
:When ''cnorm'' is activated, these parameters specify the normalisation value for the corresponding kernel. 0 means that the normalisation value is the sum of the coefficients. The [[MaskTools2|Masktools’]] mt_convolution function has a single parameter for this use: ''total''&amp;amp;nbsp;= ''totalh'' × ''totalv''. Because the convolution is computed with floating point data, there is no saturation of intermediate results, therefore the balance between ''totalh'' and ''totalv'' is not important, only their product will be taken into account.&lt;br /&gt;
&lt;br /&gt;
;invks, invksh, invksv&lt;br /&gt;
:Activates the kernel inversion mode for the specified direction (use ''invks'' for both). Inverting the kernel allows to “undo” a previous upsizing by compensating the loss in high frequencies, giving a sharper and more accurate output than classic kernels, closer to the original. This is particularly useful for clips upscaled with a bilinear kernel. All the kernel-related parameters specify the kernel to undo. The target resolution must be as close as possible to the initial resolution. The kernel inversion is mainly intended to downsize an upscaled picture. Using it for upsizing will not restore details but will give a sligthly sharper look, at the cost of a bit of aliasing and ringing. This mode is somewhat equivalent to the debilinear plug-in but works with a different principle.&lt;br /&gt;
&lt;br /&gt;
;invkstaps&lt;br /&gt;
:In kernel inversion mode (''invks=true''), this parameter sets the number of taps for the inverted kernel. Use it as a tradeoff between softness and ringing. Range: 1–128&lt;br /&gt;
&lt;br /&gt;
;csp&lt;br /&gt;
:Target colorspace. Can only change the chroma subsampling. You can convert only to a planar colorspace, keeping the same number of planes. Supporte values:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;YV12&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:2:0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;YV16&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:2:2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;YV24&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:4:4&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;YV411&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:1:1&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;Y8&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| No chroma&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
;noring&lt;br /&gt;
:A ringing cancellation algorithm is additionnaly used when set to true. Note: the ringing cancellation actually works only for low scaling ratios.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_convert_yuv_to_rgb ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_convert_yuv_to_rgb (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    string matrix (undefined),&lt;br /&gt;
    bool   interlaced (false),&lt;br /&gt;
    bool   tv_range (true),&lt;br /&gt;
    string cplace (&amp;quot;MPEG2&amp;quot;),&lt;br /&gt;
    string chromak (&amp;quot;bicubic&amp;quot;),&lt;br /&gt;
    float  fh (undefined),&lt;br /&gt;
    float  fv (undefined),&lt;br /&gt;
    int    taps (undefined),&lt;br /&gt;
    float  a1 (undefined),&lt;br /&gt;
    float  a2 (undefined),&lt;br /&gt;
    float  a3 (undefined),&lt;br /&gt;
    bool   lsb_in (false),&lt;br /&gt;
    int    mode (undefined or 6),&lt;br /&gt;
    float  ampn (undefined or 0.5),&lt;br /&gt;
    string output (&amp;quot;rgb32&amp;quot;),&lt;br /&gt;
    int    ampo (undefined),&lt;br /&gt;
    bool   staticnoise (undefined),&lt;br /&gt;
    bool   noring (false),&lt;br /&gt;
    bool   slice (undefined)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Converts a YUV clip to RGB using high-bit-depth calculations. By default, 8 bit RGB output is dithered using error diffusion + noise to get the maximum visual quality.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
: An 8 or 16-bit YUV clip to be converted to RGB. If the clip is 16-bit stacked, set the ''lsb_in'' parameter to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;matrix&lt;br /&gt;
: The matrix used to convert the Y’CbCr pixels to computer RGB. Possible values are:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;601&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.601 / ITU-R BT.470-2 / SMPTE 170M. For Standard Definition content.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;709&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.709. For High Definition content.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;2020&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.2020, non constant luminance mode. For UHDTV content.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;240&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| SMPTE 240M&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;FCC&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| FCC (where does that come from?)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;YCgCo&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| YCgCo&lt;br /&gt;
|}&lt;br /&gt;
When the parameter is not defined, ITU-R BT.601 and ITU-R BT.709 are automatically selected depending on the clip definition (considered as HD if ≥ 600 lines).&lt;br /&gt;
&lt;br /&gt;
;interlaced&lt;br /&gt;
: Indicates that the input clip is interlaced.&lt;br /&gt;
&lt;br /&gt;
;tv_range&lt;br /&gt;
: &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if input clip has TV range pixel values, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; if it uses the full range (PC scale).&lt;br /&gt;
&lt;br /&gt;
;cplace&lt;br /&gt;
: Placement of the chroma samples. Can be one of these strings:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;MPEG1&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:2:0 subsampling used in MPEG-1. Chroma samples are located on the center of each group of 4 pixels.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;MPEG2&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Subsampling used in MPEG-2 4:2:x and most other formats. Chroma samples are located on the left pixel column of the group.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;DV&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| For 4:2:0 modes, it’s like MPEG-2 but U and V channels are &amp;quot;co-sited&amp;quot; vertically: V on the top row, and U on the bottom row. For 4:1:1, chroma is located on the leftmost column.&lt;br /&gt;
|}&lt;br /&gt;
;chromak&lt;br /&gt;
: Kernel used to shift and resize the chroma plane to full resolution before conversion.&lt;br /&gt;
&lt;br /&gt;
;fh, fv, taps, a1, a2, a3&lt;br /&gt;
: Chroma resampling parameters. See [[#dither_resize16|Dither_resize16()]] for more information.&lt;br /&gt;
&lt;br /&gt;
;lsb_in&lt;br /&gt;
: Indicates that the input clip is stack16.&lt;br /&gt;
&lt;br /&gt;
;mode, ampo, ampn, staticnoise&lt;br /&gt;
: Dithering parameters, for 8 bit output. See [[#ditherpost|DitherPost()]]. When ''and ampn are not defined, they are set to the specified default value.''&lt;br /&gt;
&lt;br /&gt;
;output&lt;br /&gt;
: Output format. Possible values are:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;rgb32&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Regular RGB32 colorspace.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;rgb24&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Regular RGB24 colorspace.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;rgb48yv12&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 48-bit RGB [[#dither_convey_rgb48_on_yv12|conveyed on YV12]]. Use it for rawvideo export only. Not suitable for display or further processing (it will look like garbage).&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;tt&amp;gt;'''&amp;quot;rgb48y&amp;quot;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 48-bit RGB. The components R, G and B are conveyed on three YV12 or Y8 (if supported) stack16 clips interleaved on a frame basis.&lt;br /&gt;
|}&lt;br /&gt;
;noring&lt;br /&gt;
: A ringing cancellation algorithm is used to upscale the chroma when this parameter set to true.&lt;br /&gt;
&lt;br /&gt;
;slice&lt;br /&gt;
: TODO&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_convert_rgb_to_yuv ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_convert_rgb_to_yuv (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    clip   g (undefined),&lt;br /&gt;
    clip   b (undefined),&lt;br /&gt;
    string matrix (undefined),&lt;br /&gt;
    bool   interlaced (false),&lt;br /&gt;
    bool   tv_range (true),&lt;br /&gt;
    string cplace (&amp;quot;MPEG2&amp;quot;),&lt;br /&gt;
    string chromak (&amp;quot;bicubic&amp;quot;),&lt;br /&gt;
    float  fh (undefined),&lt;br /&gt;
    float  fv (undefined),&lt;br /&gt;
    int    taps (undefined),&lt;br /&gt;
    float  a1 (undefined),&lt;br /&gt;
    float  a2 (undefined),&lt;br /&gt;
    float  a3 (undefined),&lt;br /&gt;
    bool   lsb (undefined),&lt;br /&gt;
    int    mode (undefined),&lt;br /&gt;
    float  ampn (undefined),&lt;br /&gt;
    string output (&amp;quot;yv12&amp;quot;),&lt;br /&gt;
    int    ampo (undefined),&lt;br /&gt;
    bool   staticnoise (undefined),&lt;br /&gt;
    bool   noring (false),&lt;br /&gt;
    bool   slice (undefined)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Converts an RGB clip to YUV using high-bit-depth calculations.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:An 8 or 16-bit RGB clip to be converted to RGB. if only ''src'' is defined, the clip is considered as 8-bit RGB. If ''g'' and ''b'' are defined too, the three are assumed as 16-bit stacked clips containing the red, green and blue channels. They might be the deinterleaved result of [[#dither_convert_yuv_to_rgb|Dither_convert_yuv_to_rgb()]] with &amp;quot;rgb48y&amp;quot; as ''output'' string.&lt;br /&gt;
&lt;br /&gt;
;matrix&lt;br /&gt;
:The matrix used to convert the R’G’B’ pixels to Y’CbCr. Possible values are:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;601&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.601 / ITU-R BT.470-2 / SMPTE 170M. For Standard Definition content.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;709&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.709. For High Definition content.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;2020&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.2020, non constant luminance mode. For UHDTV content.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;240&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| SMPTE 240M&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;FCC&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| FCC (where does that come from?)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;YCgCo&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| YCgCo&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When the parameter is not defined, ITU-R BT.601 and ITU-R BT.709 are automatically selected depending on the clip definition (considered as HD if = 600 lines).&lt;br /&gt;
&lt;br /&gt;
;interlaced&lt;br /&gt;
:Indicates that the input clip is interlaced.&lt;br /&gt;
&lt;br /&gt;
;tv_range&lt;br /&gt;
:true if output clip has TV range pixel values, false if it uses the full range (PC scale).&lt;br /&gt;
&lt;br /&gt;
;cplace&lt;br /&gt;
:Placement of the chroma samples. Can be one of these strings:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;MPEG1&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| 4:2:0 subsampling used in MPEG-1. Chroma samples are located on the center of each group of 4 pixels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;MPEG2&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Subsampling used in MPEG-2 4:2:x and most other formats. Chroma samples are located on the left pixel column of the group.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;DV&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| For 4:2:0 modes, it’s like MPEG-2 but U and V channels are &amp;quot;co-sited&amp;quot; vertically: V on the top row, and U on the bottom row. For 4:1:1, chroma is located on the leftmost column.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;chromak&lt;br /&gt;
:Kernel used to shift and resize the chroma plane to full resolution before conversion.&lt;br /&gt;
&lt;br /&gt;
;fh, fv, taps, a1, a2, a3&lt;br /&gt;
:Chroma resampling parameters. See [[#dither_resize16|Dither_resize16]] for more information.&lt;br /&gt;
&lt;br /&gt;
;lsb&lt;br /&gt;
:Indicates if the output clip is stack16 (true) or 8 bits. If not defined, it depends on the input bit-depth.&lt;br /&gt;
&lt;br /&gt;
;mode, ampo, ampn, staticnoise, slice&lt;br /&gt;
:Dithering parameters, for 8 bit output. See [[#ditherpost|DitherPost]].&lt;br /&gt;
&lt;br /&gt;
;output&lt;br /&gt;
:Output format, 8 or 16-bit stacked. Possible values are:&lt;br /&gt;
:* &amp;quot;YV12&amp;quot; &lt;br /&gt;
:* &amp;quot;YV16&amp;quot; &lt;br /&gt;
:* &amp;quot;YV24&amp;quot; &lt;br /&gt;
:* &amp;quot;YV411&amp;quot; &lt;br /&gt;
:* &amp;quot;Y8&amp;quot; &lt;br /&gt;
&lt;br /&gt;
;noring&lt;br /&gt;
:A ringing cancellation algorithm is used to downscale the chroma when this parameter set to true.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_srgb_display ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_srgb_display (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    int    debug (0),&lt;br /&gt;
    bool   lsb_in (false),&lt;br /&gt;
    string matrix (undefined),&lt;br /&gt;
    bool   tv_range (undefined),&lt;br /&gt;
    string chromak (undefined),&lt;br /&gt;
    int    w (undefined),&lt;br /&gt;
    int    h (undefined),&lt;br /&gt;
    string kernel (&amp;quot;spline36&amp;quot; or &amp;quot;spline64&amp;quot;),&lt;br /&gt;
    int    taps (undefined),&lt;br /&gt;
    bool   noring (true),&lt;br /&gt;
    bool   precrop (depends),&lt;br /&gt;
    bool   autopar (true),&lt;br /&gt;
    float  par (undefined),&lt;br /&gt;
    int    parnum (undefined),&lt;br /&gt;
    int    parden (undefined),&lt;br /&gt;
    float  dar (undefined),&lt;br /&gt;
    int    darnum (undefined),&lt;br /&gt;
    int    darden (undefined),&lt;br /&gt;
    float  src_left (0),&lt;br /&gt;
    float  src_top (0),&lt;br /&gt;
    float  src_width (0),&lt;br /&gt;
    float  src_height (0),&lt;br /&gt;
    float  gamma (2.2)&lt;br /&gt;
    bool   center (true),&lt;br /&gt;
    bool   lsb (false),&lt;br /&gt;
    string cplace (undefined),&lt;br /&gt;
    int    bkgcolor (undefined),&lt;br /&gt;
    bool   sigmoid (undefined),&lt;br /&gt;
    bool   slice (undefined),&lt;br /&gt;
    int    dispm (-1)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Converts a Y’CbCr or Y clip to sRGB for display on a computer. The purpose of this function is to be as simple as possible. Some clip characteristics are automatically detected but may be overriden if necessary.&lt;br /&gt;
&lt;br /&gt;
The function first performs a conversion to gamma-corrected R’G’B’, then reverts the original transfer curve to get linear RGB values, scales the clip to its final resolution possibly using a non-ringing resize, and finally applies the sRGB transfer curve.&lt;br /&gt;
&lt;br /&gt;
The function is well suited for screen captures. Similarly, this is recommended for enlarging SD pictures for previewing instead of the built-in pointresize-style zoom in video applications.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:The clip to display.&lt;br /&gt;
&lt;br /&gt;
;debug&lt;br /&gt;
:Overlays debug information if set to 1.&lt;br /&gt;
&lt;br /&gt;
;lsb_in, matrix, tv_range, chromak&lt;br /&gt;
:These parameters are passed to the Dither_convert_yuv_to_rgb function called internally.&lt;br /&gt;
&lt;br /&gt;
;w, h&lt;br /&gt;
:Display size of the clip. It’s possible to specify only one dimension. In this case, DAR and PAR information are used to compute the other dimension. If both dimensions are specified and if the PAR is available, pillarboxing or letterboxing may be used to satisfy the requirements.&lt;br /&gt;
&lt;br /&gt;
;kernel, taps, src_left, src_top, src_width, src_height, cplace&lt;br /&gt;
:These parameters are passed to the Dither_resize16 function called internally.&lt;br /&gt;
&lt;br /&gt;
;noring&lt;br /&gt;
:In case of resizing, indicates that a non-ringing algorithm must be used. Default kernel is set to &amp;quot;spline64&amp;quot; for non-ringing algorithms and &amp;quot;spline36&amp;quot; for normal resizing.&lt;br /&gt;
&lt;br /&gt;
;precrop&lt;br /&gt;
:When this flag is set, if 1. the clip is detected as SD (Standard Definition) and 2. PAR or display height only is specified, the source is automatically cropped to the active zone (704 pixels)&lt;br /&gt;
&lt;br /&gt;
;autopar&lt;br /&gt;
:Allows the function to automatically select a PAR, referring to standardized picture sizes and other information like the DAR.&lt;br /&gt;
&lt;br /&gt;
;par&lt;br /&gt;
:Decimal value for PAR (Pixel Aspect Ratio, a.k.a. Sample Aspect Ratio). Depending on the other parameters, the clip may be resized for square pixel display.&lt;br /&gt;
&lt;br /&gt;
;parnum, parden&lt;br /&gt;
:Numerator and denominator for PAR specification in form of a fraction. You cannot set both the PAR as a fraction and as decimal.&lt;br /&gt;
&lt;br /&gt;
;dar&lt;br /&gt;
:Decimal value for DAR (Display Aspect Ratio). Depending on other parameters, this allows the function to display the clip in square pixels in case of anamorphic storage. 1.778 and 1.333 are fine for 16:9 and 4:3 DAR.&lt;br /&gt;
&lt;br /&gt;
;darnum, darden&lt;br /&gt;
:Numerator and denominator for DAR specification in form of a fraction. You cannot set both the DAR as a fraction and as decimal.&lt;br /&gt;
&lt;br /&gt;
;gamma&lt;br /&gt;
:Sets the gamma for target display. A gamma of 2.1 is recommended for common practical viewing conditions in an office (200–300 lx ambiant light) and 2.2 (default) for viewing conditions specified by the sRGB standard (64 lx ambiant light). Changing the default value forces linear processing.&lt;br /&gt;
&lt;br /&gt;
;center&lt;br /&gt;
:Indicates that clipping, pillarboxing or letterboxing should be centered. Otherwise, the top-left corner of the picture is preserved.&lt;br /&gt;
&lt;br /&gt;
;lsb&lt;br /&gt;
:When true, the output is in the stack16 RGB32 format.&lt;br /&gt;
&lt;br /&gt;
;bkgcolor&lt;br /&gt;
:Color value for the added borders, black is the default. It works like the color parameter in AddBorders(). It depends on the colorspace and possibly the value range (TV or full).&lt;br /&gt;
&lt;br /&gt;
;sigmoid&lt;br /&gt;
:When set, use the sigmoidal curve to convert to and from linear light for the resizing.&lt;br /&gt;
&lt;br /&gt;
;slice&lt;br /&gt;
:Parameter for DitherPost.&lt;br /&gt;
&lt;br /&gt;
;dispm&lt;br /&gt;
:Sets the transfer curve to use for gamma to linear conversions. 0 and 1 set the regular BT.1886 transfer curve, and 2 sets the alternative BT.1886 tranfer curve. The latter is a closer emulation of a reference CRT display, using a gamma between 2.6 and 3. -1 activates the old conversion method, using BT.709 transfer curve for both directions. Non-zero values force linear processing.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_quantize ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_quantize (&lt;br /&gt;
    clip  src,&lt;br /&gt;
    int   bitdepth,&lt;br /&gt;
    bool  reducerange (false),&lt;br /&gt;
    int   mode,&lt;br /&gt;
    float ampo,&lt;br /&gt;
    float ampn, &lt;br /&gt;
    int   pat,&lt;br /&gt;
    bool  dyn,&lt;br /&gt;
    bool  prot,&lt;br /&gt;
    clip  mask,&lt;br /&gt;
    float thr,&lt;br /&gt;
    bool  interlaced,&lt;br /&gt;
    int   y,&lt;br /&gt;
    int   u,&lt;br /&gt;
    int   v,&lt;br /&gt;
    bool  staticnoise&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Dither a clip to a given bit-depth. It’s possible to keep the resulting clip at the initial bit-depth of 16 or to reduce it to the specified depth.&lt;br /&gt;
&lt;br /&gt;
To encode a clip in 10 bits using x264, set ''bitdepth=10'' and ''reducerange=true'', followed by Dither_out and set --input-depth 10 in the x264 parameters.&lt;br /&gt;
&lt;br /&gt;
'''NB:''' Dither_quantize is known to be slightly buggy when the dither amplitude is greater than unity (ampo&amp;amp;nbsp;&amp;amp;plus; ampn&amp;amp;nbsp;&amp;gt; 1). In this case, there is a risk of getting some artefacts in the result. When reducing to 10 bits, it affects a small range of pixel values below any multiple of 16 (on an 8-bit scale). Keeping ampo&amp;amp;nbsp;&amp;amp;plus; ampn&amp;amp;nbsp;= 1 shouldn’t create any noticeable artefact.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:Clip to dither. Must be in stack16 format.&lt;br /&gt;
&lt;br /&gt;
;bitdepth&lt;br /&gt;
:Desired bit depth, in range 8–14.&lt;br /&gt;
&lt;br /&gt;
;reducerange&lt;br /&gt;
:Indicates if the output value range must be reduced. Even if reduced, the output clip is still in the regular stack16 format.&lt;br /&gt;
&lt;br /&gt;
;mode, ampo, ampn…&lt;br /&gt;
:The other parameters are the same as in DitherPost.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_out ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_out (&lt;br /&gt;
    clip src,&lt;br /&gt;
    bool bigendian (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_convey_yuv4xxp16_on_yvxx (&lt;br /&gt;
    clip src,&lt;br /&gt;
    bool bigendian (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function allows Avisynth to output 16-bit YUV pixel components. This is achieved by sending fake YV12 data, containing actually yuv420p16 data. Frame serving should be done via a rawvideo pipe, so the encoding application relies on information provided by the user, not Avisynth directly.&lt;br /&gt;
&lt;br /&gt;
Dither_convey_yuv4xxp16_on_yvxx is the same as Dither_out and remains for compatibility purpose.&lt;br /&gt;
&lt;br /&gt;
This function works only on 16-bit stacked clips.&lt;br /&gt;
&lt;br /&gt;
;src&lt;br /&gt;
:Stack-16 YUV data to encode.&lt;br /&gt;
&lt;br /&gt;
;bigendian&lt;br /&gt;
:Indicates that the output stream is big endian (MSB-LSB order, yuv4xxp16be instead of yuv4xxp16le).&lt;br /&gt;
&lt;br /&gt;
Category: plugin.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
This can be done this way with avs2yuv and 10-bit x264:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;avs2yuv -raw &amp;quot;script.avs&amp;quot; -o - | x264-10bit --demuxer raw --input-depth 16&lt;br /&gt;
                        --input-res 1280x720 --fps 24 --output &amp;quot;out.mp4&amp;quot; -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is actually a single line which has been split for convenient display. Note the minus sign at the end of the line. Of course, you’ll have to change and specify FPS, video resolution and interlacing information. Don’t do any further pixel processing after having called this function. Be sure to use the raw video trick for encoding, otherwise you’ll only get garbage.&lt;br /&gt;
&lt;br /&gt;
To encode 4:4:4 10-bit video, you’ll need to add both --input-csp i444 and --output-csp i444 to the x264-10bit command line.&lt;br /&gt;
&lt;br /&gt;
It’s also possible to dither to the exact target bit-depth, while keeping data in the 16-bit range for piping. You can use this little code snippet, here for a bit-depth of 10:&lt;br /&gt;
&lt;br /&gt;
 Dither_quantize (bitdepth=10) &lt;br /&gt;
 Dither_out ()&lt;br /&gt;
&lt;br /&gt;
However it is not necessary. Just go with Dither_out() in 16 bits and let x264 do the conversion.&lt;br /&gt;
&lt;br /&gt;
=== Dither_convey_rgb48_on_yv12 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_convey_rgb48_on_yv12 (&lt;br /&gt;
    clip r,&lt;br /&gt;
    clip g,&lt;br /&gt;
    clip b,&lt;br /&gt;
    bool bigendian (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function provides the same kind of functionality as [[#Dither_out|Dither_out]], but spits RGB48 pixels instead of YUV.&lt;br /&gt;
&lt;br /&gt;
This function works only on 16-bit stacked clips.&lt;br /&gt;
&lt;br /&gt;
;r, g, b&lt;br /&gt;
:Three YUV stack16 clips containing the red, green and blue channels in their luma plane. &lt;br /&gt;
&lt;br /&gt;
;bigendian&lt;br /&gt;
:Indicates that MSB must be stored before the LSB (rgb48be instead of rgb48le). &lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
Here is a command line to pipe the result to ImageMagick:&lt;br /&gt;
&lt;br /&gt;
 avs2yuv -raw &amp;quot;script.avs&amp;quot; -o - | convert -depth 16 -size 1280x720 rgb:- &amp;quot;out-%06d.png&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
The same with FFmpeg, although current releases don’t support completely the RGB48 reading and round the data to 8 bits:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;avs2yuv -raw &amp;quot;script.avs&amp;quot; -o - | ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt rgb48le&lt;br /&gt;
                             -s 1280x720 -aspect 1:1 -y -i - -f image2 &amp;quot;out-%06d.png&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is actually a single line which has been split for convenient display.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_removegrain16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_removegrain16 (&lt;br /&gt;
    clip src,&lt;br /&gt;
    int  mode (2),&lt;br /&gt;
    int  modeU (mode),&lt;br /&gt;
    int  modeV (modeU)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is the 16-bit equivalent of the RemoveGrain plug-in. It applies various kinds of smoothing to the input clip by combining each pixel with its 8 neighbours. As in the original RemoveGrain, the borders rows and columns (1-pixel thick) are not processed.&lt;br /&gt;
&lt;br /&gt;
;mode&lt;br /&gt;
:The smoothing mode. It can apply to all the planes or to the Y plane only, depending on the values of ''modeU'' and ''modeV''. Some of the RemoveGrain modes have not been ported yet (25 and above). The available ones are listed below.&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;-'''1'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane is not touched at all and may contain garbage on output.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''0'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane is copied without being processed.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''1'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the pixel with the minimum and maximum of the 8 neighbour pixels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''2'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''3'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''4'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels, which is equivalent to a median filter.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''5'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping giving the minimal change.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''6–8'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping, intermediate.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''9'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping on a line where the neighbours pixels are the closest.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''10'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Replaces the target pixel with the closest neighbour.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''11'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| [1 2 1] horizontal and vertical kernel blur. Similar to Blur(1).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''12'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Same as mode 11.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''13'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bob mode, interpolates top field from the line where the neighbours pixels are the closest.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''14'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bob mode, interpolates bottom field from the line where the neighbours pixels are the closest.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''15'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bob mode, interpolates top field. Same as 13 but with a more complicated interpolation formula.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''16'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Bob mode, interpolates bottom field. Same as 14 but with a more complicated interpolation formula.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''17'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the pixel with the minimum and maximum of respectively the maximum and minimum of each pair of opposite neighbour pixels.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''18'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping using opposite neighbours whose greatest distance from the current pixel is minimal.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''19'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Replaces the pixel with the average of its 8 neighbours.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''20'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Averages the 9 pixels ([1 1 1] horizontal and vertical blur). Similar to Blur(1.58).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''21'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips pixels using the averages of opposite neighbour&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''22'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Same as mode 21 but simpler and faster.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''23'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Small edge and halo removal, but reputed useless.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''24'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Small edge and halo removal, but reputed useless.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;modeU, modeV&lt;br /&gt;
:Same as ''mode'' but for U and V planes. If not defined, they use the same value as ''mode''.&lt;br /&gt;
&lt;br /&gt;
Category: plug-in.&lt;br /&gt;
&lt;br /&gt;
=== Dither_repair16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_repair16 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    int  mode (2),&lt;br /&gt;
    int  modeU (mode),&lt;br /&gt;
    int  modeV (modeU)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is the 16-bit equivalent of the Repair plug-in. It can repair the artifacts generated by a processing by applying a RemoveGrain-like treatment on the input clip to fix the ouput clip.&lt;br /&gt;
&lt;br /&gt;
;src1&lt;br /&gt;
:The clip to repair.&lt;br /&gt;
&lt;br /&gt;
;src2&lt;br /&gt;
:The reference clip. Must have the same format as ''src1''.&lt;br /&gt;
&lt;br /&gt;
;mode&lt;br /&gt;
:The repairing mode. It can apply to all the planes or to the Y plane only, depending on the values of ''modeU'' and ''modeV''. The available ones are listed below. These modes are similar to the RemoveGrain modes but include the center pixel of the reference clip for min/max calculation. &lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;-'''1'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane is not touched at all and may contain garbage on output.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''0'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| The plane is copied without being processed.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''1–4'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the source pixel with the Nth minimum and maximum found on the 3×3-pixel square from the reference clip.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''5'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping giving the minimal change.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''6–8'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping, intermediate.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''9'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Line-sensitive clipping on a line where the neighbours pixels are the closest.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''10'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Replaces the target pixel with the closest pixel from the 3×3-pixel reference square.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''11–14'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Same as modes 1–4 but uses min(Nth_min, c) and max(Nth_max, c) for the clipping, where c is the value of the center pixel of the reference clip.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''15, 16'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the source pixels using a clipping pair from the RemoveGrain modes 5 and 6.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| &amp;lt;div align=&amp;quot;right&amp;quot;&amp;gt;'''17, 18'''&amp;lt;/div&amp;gt;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Clips the source pixels using a clipping pair from the RemoveGrain modes 17 and 18.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;modeU, modeV&lt;br /&gt;
:Same as ''mode'' but for U and V planes. If not defined, they use the same value as ''mode''.&lt;br /&gt;
&lt;br /&gt;
Category: plug-in.&lt;br /&gt;
&lt;br /&gt;
=== Dither_median16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_median16 (&lt;br /&gt;
    clip src,&lt;br /&gt;
    int  rx (1),&lt;br /&gt;
    int  ry (1),&lt;br /&gt;
    int  rt (0),&lt;br /&gt;
    int  ql (undefined),&lt;br /&gt;
    int  qh (undefined),&lt;br /&gt;
    int  y,&lt;br /&gt;
    int  u,&lt;br /&gt;
    int  v&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This filter performs quantile clipping, and more specifically can work as a median filter. It is quite slow, not optimised at all.&lt;br /&gt;
&lt;br /&gt;
;rx, ry&lt;br /&gt;
:Horizontal and vertical radius of the workarea. Positive values. The middle pixel value is clipped by the lower and higher quantiles found in the defined group of pixels. With ''rx&amp;amp;nbsp;= 2'' and ''ry&amp;amp;nbsp;= 3'', the input area is 5×7 pixels.&lt;br /&gt;
&lt;br /&gt;
;rt&lt;br /&gt;
:Temporal radius. Positive value. If set to 0, the filter is spatial only.&lt;br /&gt;
&lt;br /&gt;
;ql, qh&lt;br /&gt;
:Low and high clipping quantiles. The filter chooses two pixels defined by their rank in the group of neighbours. Let’s call vl and vh the values corresponding to the ''ql''-th and ''qh''-th ranks. Pixel values outside the vl to vh range are clipped. ''ql'' and ''qh'' must be positive or null and less than (''rx''×2&amp;amp;nbsp;+ 1)&amp;amp;nbsp;× (''ry''×2&amp;amp;nbsp;+ 1)&amp;amp;nbsp;× (''rt''×2&amp;amp;nbsp;+ 1). Also, ''ql'' = ''qh''. If these parameters are set to a negative value or undefined, they are internally set to the middle of the range, performing a median filtering.&lt;br /&gt;
&lt;br /&gt;
Category: plug-in.&lt;br /&gt;
&lt;br /&gt;
=== DitherTestPatterns ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;DitherTestPatterns (&lt;br /&gt;
    int size (192),&lt;br /&gt;
    int mag (1),&lt;br /&gt;
    int amp (1),&lt;br /&gt;
    int len (24),&lt;br /&gt;
    int luma (128)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Shows all the dithering patterns in the same picture.&lt;br /&gt;
&lt;br /&gt;
;size&lt;br /&gt;
:Width in pixels of a single test pattern.&lt;br /&gt;
&lt;br /&gt;
;mag&lt;br /&gt;
:Magnification factor, &amp;gt; 0. Global picture size is unchanged. Recommended value: 3.&lt;br /&gt;
&lt;br /&gt;
;amp&lt;br /&gt;
:Amplification factor, &amp;gt; 0. Useful to actually see the patterns without hurting your eyes. Recommended value: 32.&lt;br /&gt;
&lt;br /&gt;
;len&lt;br /&gt;
:Number of frames to generate, &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
;luma&lt;br /&gt;
:Average luma value used for the tests (0–255).&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither1Pre, Dither2Pre ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither1Pre (&lt;br /&gt;
    clip   m,&lt;br /&gt;
    string flt (&amp;quot;dfttest (sigma=64)&amp;quot;),&lt;br /&gt;
    bool   stacked (true),&lt;br /&gt;
    float  overlap (0.5),&lt;br /&gt;
    bool   tvopt (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither2Pre (&lt;br /&gt;
    clip   m,&lt;br /&gt;
    string flt (&amp;quot;dfttest (sigma=256)&amp;quot;),&lt;br /&gt;
    bool   stacked (true),&lt;br /&gt;
    float  overlap (0.5),&lt;br /&gt;
    bool   tvopt (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Filters a 8-bit clip and outputs the result with 1 or 2 extra bits of accuracy. This function allows using 8-bit denoisers which have not been modified to support stack16 format.&lt;br /&gt;
&lt;br /&gt;
The MSB part is stacked onto the LSB part. They can be separated later into two clips using the utility functions. You can also choose to interleave the MSB and the LSB data instead of stacking them on the same frame.&lt;br /&gt;
&lt;br /&gt;
This function works by splitting the picture histogram in slices of equal width, stretching the slices to the full range, filtering them and recombining them all into a higher bit-depth clip. The stretch scale is x2 for Dither1Pre and x4 for Dither2Pre. In order to ensure the continuity, the slices are overlapped. 3 slices are used for 1 extra bit, and 7 slices for 2 extra bits (50&amp;amp;nbsp;% overlap). Compared to the normal CPU load of the provided filter, computation times are multiplied respectively by 3 and 5. It is possible to change the overlap amount to save CPU.&lt;br /&gt;
&lt;br /&gt;
Because of this histogram split, keep any motion compensation code out of the function. Just provide a raw filter here. As another consequence of the split, only filters processing the luma and chroma planes independently will work correctly. Fortunately, most of them do. Filters internally converting pixels to RGB or doing similar things will likely fail.&lt;br /&gt;
&lt;br /&gt;
Note that these functions are dirty hacks. First, they are not efficient, because they have to run multiple times the specified noise filter. Also, the slicing may introduce artifacts, depending on the behavious of the specified filter. It is strongly recommended to use a modified denoiser to generate the 16-bit data instead of DitherNPre. Use these functions only when there is no other way to achieve the desired filtering.&lt;br /&gt;
&lt;br /&gt;
If you are using MT, additionnaly to the splitvertical=true requirement, you must be aware that stacked=false in this case may lead to temporal artifacts for some unknown reason (thanks to Dogway on the Doom9 forum for investigating all these issues). Correct example:&lt;br /&gt;
&lt;br /&gt;
 MT (&amp;quot;&amp;quot;&amp;quot;Dither1Pre (flt=&amp;quot;tnlmeans()&amp;quot;)&amp;quot;&amp;quot;&amp;quot;, 2, 2, true)&lt;br /&gt;
&lt;br /&gt;
;m&lt;br /&gt;
:The original, noisy clip.&lt;br /&gt;
&lt;br /&gt;
;flt&lt;br /&gt;
:An optional string containing the filter command. You can insert double quotes (&amp;quot;) in the parameters with Chr(34) sequences. Beware: filter parameters must be set according to their new input range. In Dither1Pre, all amplitude-relative parameters must be doubled, and powers quadrupled. In Dither2Pre, all amplitudes are quadrupled and powers multiplied by 16. Spatial and temporal values can be left unchanged.&lt;br /&gt;
&lt;br /&gt;
;stacked&lt;br /&gt;
:Indicates that the MSB and LSB data must be vertically stacked instead of being interleaved.&lt;br /&gt;
&lt;br /&gt;
;overlap&lt;br /&gt;
:The slice overlap rate. The greater, the lower the risk of artifacts. The required number of slices is deduced from the overlap rate parameter. Overlap ranges from 0 (no additional slice) to 0.5 (50&amp;amp;nbsp;% overlap, number of slices almost doubled). When ''tvopt'' is false, the minimum number of additional slices is restricted to one instead of zero.&lt;br /&gt;
&lt;br /&gt;
;tvopt&lt;br /&gt;
:Can increase the actual overlap for a fixed number of slices in presence of TV-scale values (luma in the 16–235 range, and chroma in 16–240) by reducing the slice covering to the visible range. This means super blacks and super whites are clipped. The option is useful with small overlap rates.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
== Utility functions ==&lt;br /&gt;
=== Dither_get_msb, Dither_get_lsb ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_get_msb (clip src)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_get_lsb (clip src)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Extracts the MSB or the LSB from the stacked 16-bit frame ''src''.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_gen_null_lsb ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_gen_null_lsb (clip src)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Generates a LSB clip set to 0 for the non-stacked ''src'' clip, which can be a MSB or a standard 8-bit clip.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_convert_8_to_16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_convert_8_to_16 (clip src)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Converts the 8-bit ''src'' clip into a 16-bit stacked clip. For the inverse operation, just call DitherPost (mode=-1).&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_crop16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_crop16 (&lt;br /&gt;
    clip src,&lt;br /&gt;
    int  left,&lt;br /&gt;
    int  top,&lt;br /&gt;
    int  width,&lt;br /&gt;
    int  height,&lt;br /&gt;
    bool align&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Crops a 16-bit stacked clip. Coordinates are related to the real picture (half-height). Parameters are the same as the Avisynth Crop function.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_addborders16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_addborders16 (&lt;br /&gt;
    clip src,&lt;br /&gt;
    int  left,&lt;br /&gt;
    int  top,&lt;br /&gt;
    int  right,&lt;br /&gt;
    int  bottom,&lt;br /&gt;
    int  color_yuv (undefined)&lt;br /&gt;
    int  color (undefined)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add borders to a 16-bit stacked clip. Coordinates are related to the real picture (half-height).&lt;br /&gt;
&lt;br /&gt;
;left, top, right, bottom&lt;br /&gt;
:Border sizes, same as the Avisynth AddBorders function.&lt;br /&gt;
&lt;br /&gt;
;color_yuv, color&lt;br /&gt;
:Filling color. Default is black, in TV-range. Actually you can use both value whatever the colorspace (color_yuv is left only for backward compatibility).&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_lut8, Dither_lutxy8, Dither_lutxyz8 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_lut8 (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    string expr (&amp;quot;x&amp;quot;),&lt;br /&gt;
    string yexpr (undefined),&lt;br /&gt;
    string uexpr (undefined),&lt;br /&gt;
    string vexpr (undefined),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (1),&lt;br /&gt;
    int v (1)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_lutxy8 (&lt;br /&gt;
    clip   src1,&lt;br /&gt;
    clip   src2,&lt;br /&gt;
    string expr (&amp;quot;x&amp;quot;),&lt;br /&gt;
    string yexpr (undefined),&lt;br /&gt;
    string uexpr (undefined),&lt;br /&gt;
    string vexpr (undefined),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (1),&lt;br /&gt;
    int    v (1)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_lutxyz8 (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    clip   src2,&lt;br /&gt;
    clip   src3,&lt;br /&gt;
    string expr (&amp;quot;x&amp;quot;),&lt;br /&gt;
    string yexpr (undefined),&lt;br /&gt;
    string uexpr (undefined),&lt;br /&gt;
    string vexpr (undefined),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (1),&lt;br /&gt;
    int    v (1)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These functions are the equivalent of the [[MaskTools2|Masktools]] mt_lut, mt_lutxy and mt_lutxyz functions. Here, they generate 16-bit data from 8-bit clips. The output of the final function is rounded to the nearest integer and clipped into the [0; 65535] range. The result is stored into a 16-bit stacked clip.&lt;br /&gt;
&lt;br /&gt;
If ''y'', ''u'' or ''v'' are defined to 2, 4 or 5 (copy plane from the Nth clip), the plane is converted to 16-bit with a null LSB.&lt;br /&gt;
&lt;br /&gt;
Please refer to the Masktools documentation for more information about these functions.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_lut16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_lut16 (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    string expr (&amp;quot;x&amp;quot;),&lt;br /&gt;
    string yexpr (undefined),&lt;br /&gt;
    string uexpr (undefined),&lt;br /&gt;
    string vexpr (undefined),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (1),&lt;br /&gt;
    int    v (1)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works like the [[MaskTools2|Masktools]] mt_lut, except that both input and output are 16-bit values.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_add16, Dither_sub16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_add16 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    bool wrap (false),&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (3),&lt;br /&gt;
    int  v (3),&lt;br /&gt;
    bool dif (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_sub16 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    bool wrap (false),&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (3),&lt;br /&gt;
    int  v (3),&lt;br /&gt;
    bool dif (false)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Adds or subtract two 16-bit clips, pixel per pixel, plane per plane.&lt;br /&gt;
&lt;br /&gt;
Dither_sub16(dif=true) is the 16-bit equivalent to mt_makediff().Dither_add16(dif=true) is the 16-bit equivalent to mt_adddiff().&lt;br /&gt;
&lt;br /&gt;
;wrap&lt;br /&gt;
:Indicates if the value should wrap in case of overflow instead of being clipped in 0–65535.&lt;br /&gt;
&lt;br /&gt;
;dif&lt;br /&gt;
:Indicates that ''src2'' is considered as a &amp;quot;difference&amp;quot; clip, 32768 (128 * 256) being the neutral value. The actual operation is src1 + src2 - 32768 (add) or src1 - src2 + 32768 (sub).&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== Dither_max_dif16, Dither_min_dif16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_max_dif16 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    clip ref,&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (3),&lt;br /&gt;
    int  v (3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_min_dif16 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    clip ref,&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (3),&lt;br /&gt;
    int  v (3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Compares pixel per pixel ''src1'' and ''src2'' to ''ref'' and takes the pixel with the greatest amplitude difference (or the smallest for Dither_min_dif16).&lt;br /&gt;
&lt;br /&gt;
Category: dll.&lt;br /&gt;
&lt;br /&gt;
=== Dither_merge16, Dither_merge16_8 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_merge16 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    clip mask,&lt;br /&gt;
    bool luma (false),&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (2 or 3),&lt;br /&gt;
    int  v (2 or 3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_merge16_8 (&lt;br /&gt;
    clip src1,&lt;br /&gt;
    clip src2,&lt;br /&gt;
    clip mask,&lt;br /&gt;
    bool luma (false),&lt;br /&gt;
    int  y (3),&lt;br /&gt;
    int  u (2 or 3),&lt;br /&gt;
    int  v (2 or 3)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These functions work like the [[MaskTools2|Masktools’]] mt_merge. The output is a blend between src1 and src2, depending on each ''mask'' pixel values. The bigger the mask value, the more the second clip will be taken into account.&lt;br /&gt;
&lt;br /&gt;
All clips are 16-bit stacked. With Dither_merge16_8, ''mask'' is a regular 8-bit clip.&lt;br /&gt;
&lt;br /&gt;
The default value for ''u'' and ''v'' are 2 (copy plane from ''src1'') excepted when ''luma&amp;amp;nbsp;= true''. In this case, chroma is always processed.&lt;br /&gt;
&lt;br /&gt;
Category: Dither_merge16: dll, Dither_merge16_8: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_y_gamma_to_linear, Dither_y_linear_to_gamma ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_y_gamma_to_linear (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    bool   tv_range_in (true),&lt;br /&gt;
    bool   tv_range_out (true),&lt;br /&gt;
    string curve (&amp;quot;srgb&amp;quot;),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (2),&lt;br /&gt;
    int    v (2),&lt;br /&gt;
    float  gcor (1.0),&lt;br /&gt;
    bool   sigmoid (false),&lt;br /&gt;
    float  thr (depends),&lt;br /&gt;
    float  cont (depends)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_y_linear_to_gamma (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    bool   tv_range_in (true),&lt;br /&gt;
    bool   tv_range_out (true),&lt;br /&gt;
    string curve (&amp;quot;srgb&amp;quot;),&lt;br /&gt;
    int    y (3),&lt;br /&gt;
    int    u (2),&lt;br /&gt;
    int    v (2),&lt;br /&gt;
    float  gcor (1.0),&lt;br /&gt;
    bool   sigmoid (false),&lt;br /&gt;
    float  thr (depends),&lt;br /&gt;
    float  cont (depends)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Dither_y_gamma_to_linear converts the luma channel to linear light, and Dither_y_linear_to_gamma converts back a clip to gamma-corrected luma. The chroma channels remain untouched.&lt;br /&gt;
&lt;br /&gt;
This function works only on 16-bit stacked clips.&lt;br /&gt;
&lt;br /&gt;
Note: usually gamma compression applies to RGB channels, not Y’CbCr. Therefore this function should be used with RGB48Y clips, obtained from Dither_convert_yuv_to_rgb for example.&lt;br /&gt;
&lt;br /&gt;
;clip&lt;br /&gt;
:The clip to be converted.&lt;br /&gt;
&lt;br /&gt;
;tv_range_in&lt;br /&gt;
:Specifies if the luma range is 16-bit TV (16*256 to 235*256 inclusive) or full range (false)&lt;br /&gt;
&lt;br /&gt;
;tv_range_out&lt;br /&gt;
:Same, but for output.&lt;br /&gt;
&lt;br /&gt;
;curve&lt;br /&gt;
:Type of gamma mapping. Possible values:&lt;br /&gt;
:{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;709&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.709 transfer curve for digital video&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;601&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.601 transfer curve, same as &amp;quot;709&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;170&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| SMPTE 170M, same as &amp;quot;709&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;240&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| SMPTE 240M (1987)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;srgb&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| sRGB curve&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;2020&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.2020 transfer curve, for 12-bit content. For sources of lower bit-depth, use the &amp;quot;709&amp;quot; curve.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;1886&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| ITU-R BT.1886 transfer curve, for flat panel display used in HDTV production, approximating a CRT characteristic.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| '''&amp;quot;1886a&amp;quot;'''&lt;br /&gt;
| style=&amp;quot;border:none;padding:0.0194in;&amp;quot;| Curve given as example of better match to a CRT in recommendation ITU-R BT.1886 &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- MATLAB code:&lt;br /&gt;
x = linspace (0, 1, 10001);&lt;br /&gt;
ysrgb = (x &amp;lt;= 0.04045) .* (x / 12.92) + (x &amp;gt; 0.04045) .* (((x + 0.055 ) / 1.055 ) .^ 2.4    );&lt;br /&gt;
y709  = (x &amp;lt;= 0.081  ) .* (x / 4.5  ) + (x &amp;gt; 0.081  ) .* (((x + 0.099 ) / 1.099 ) .^ 2.22222);&lt;br /&gt;
y240m = (x &amp;lt;= 0.099  ) .* (x / 4.0  ) + (x &amp;gt; 0.099  ) .* (((x + 0.1115) / 1.1115) .^ 2.22222);&lt;br /&gt;
plot (x, ysrgb, x, y240m, x, y709);&lt;br /&gt;
grid on; legend ('sRGB', 'SMPTE 240M', 'BT.709', 2); title ('Transfer characteristics');&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
::[[File:Transfer.png|280px]]&lt;br /&gt;
&lt;br /&gt;
;gcor&lt;br /&gt;
:Gamma correction, applied on the linear part.&lt;br /&gt;
&lt;br /&gt;
;sigmoid&lt;br /&gt;
:When set, applies a sigmoidal curve after the power-like curve (or before when converting from linear to gamma-corrected). This helps reducing the dark halo artefacts around sharp edges caused by resizing in linear luminance.&lt;br /&gt;
&lt;br /&gt;
;thr&lt;br /&gt;
:Mid-point position of the sigmoid curve. Between 0 and 1, usually close to 0.5. The default value depends on the selected curve so the sigmoid tries to match the lower half of the standard curve with the contrast doubled.&lt;br /&gt;
&lt;br /&gt;
;cont&lt;br /&gt;
:Contrast of the sigmoid curve. Must be &amp;gt; 0, and is usually set between 5 and 8. The default value depends on the selected curve so the sigmoid tries to match the lower half of the standard curve with the contrast doubled.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_sigmoid_direct, Dither_sigmoid_inverse ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_sigmoid_direct (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    float  thr (0.5),&lt;br /&gt;
    float  cont (6.5),&lt;br /&gt;
    int    u (2),&lt;br /&gt;
    int    v (2)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_sigmoid_inverse (&lt;br /&gt;
    clip   src,&lt;br /&gt;
    float  thr (0.5),&lt;br /&gt;
    float  cont (6.5),&lt;br /&gt;
    int    u (2),&lt;br /&gt;
    int    v (2)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dither_sigmoid_inverse applies the inverse sigmoid curve to a clip in linear luminance in order to lessen the ringing when resizing it. Dither_sigmoid_direct converts back a clip to linear luminance. The chroma channels remain untouched.&lt;br /&gt;
&lt;br /&gt;
;thr&lt;br /&gt;
:Mid-point position of the sigmoid curve. Between 0 and 1, usually close to 0.5. The default value depends on the selected curve so the sigmoid tries to match the lower half of the standard curve with the contrast doubled.&lt;br /&gt;
&lt;br /&gt;
;cont&lt;br /&gt;
:Contrast of the sigmoid curve. Must be &amp;gt; 0, and is usually set between 5 and 8. The default value depends on the selected curve so the sigmoid tries to match the lower half of the standard curve with the contrast doubled.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
=== Dither_add_grain16 ===&lt;br /&gt;
&amp;lt;pre style=&amp;quot;max-width:33em;border:1px solid blue;background-color:#F8F8FF;&amp;quot;&amp;gt;Dither_add_grain16 (&lt;br /&gt;
    clip  src,&lt;br /&gt;
    float var (1),&lt;br /&gt;
    float uvar (0),&lt;br /&gt;
    float soft (1),&lt;br /&gt;
    int   maxts (5),&lt;br /&gt;
    bool  replace (false),&lt;br /&gt;
    bool  lsb_in (true),&lt;br /&gt;
    int   seed (undefined)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Generates and adds 16-bit grain to a clip, with optional temporal stabilization. The output is always a stack16 clip.&lt;br /&gt;
&lt;br /&gt;
;var&lt;br /&gt;
:Standard deviation of the luma noise. = 0.&lt;br /&gt;
&lt;br /&gt;
;uvar&lt;br /&gt;
:Standard deviation of the chroma noise. = 0.&lt;br /&gt;
&lt;br /&gt;
;soft&lt;br /&gt;
:Noise temporal stability. This is actually the regeneration period of the noise, in frames. Set to 100 or above, the grain becomes static.&lt;br /&gt;
&lt;br /&gt;
;maxts&lt;br /&gt;
:Maximum radius for the temporal softening of the noise, in frames. Larger radii smooth very slow grain with a higher quality, but they are more resource-demanding.&lt;br /&gt;
&lt;br /&gt;
;replace&lt;br /&gt;
:Set to true, the noise is generated on a mid-grey clip instead of being added to the ''src'' clip. The new clip has the same properties as the source clip.&lt;br /&gt;
&lt;br /&gt;
;lsb_in&lt;br /&gt;
:Indicates that the input clip is stack16.&lt;br /&gt;
&lt;br /&gt;
;seed&lt;br /&gt;
:If defined and not negative, forces a seed for the random number generator used in grain generation. This ensures that the produced grain remains the same each time the script is executed.&lt;br /&gt;
&lt;br /&gt;
Category: script.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
'''The resulting picture appears to be cut at half height.'''&lt;br /&gt;
&lt;br /&gt;
You surely applied DitherPost twice, or use it on a regular 8-bit clip. Please check your script. Apply DitherPost only on 16-bit clips generated by the modified plug-ins with ''lsb=true'' or by the other dedicated functions outputing 16-bit stacked data.&lt;br /&gt;
&lt;br /&gt;
'''[[GradFun3]] and some other functions always output a green screen.'''&lt;br /&gt;
&lt;br /&gt;
You surely have an old [[MaskTools2|Masktools 2]] version installed somewhere and autoloaded by Avisynth. Search on your disks the filenames mt_masktools.dll, mt_masktools-25.dll and mt_masktools-26.dll. Remove the culprits and install the latest Masktools version from [https://github.com/tp7/masktools/releases there].&lt;br /&gt;
&lt;br /&gt;
Still not working? Remove all the mt_masktools dll you can found. If you did it well, running your script must make Avisynth complain about missing masktools function. If this is not the case, search again, there is a masktool file hidden somewhere in your filesystem.&lt;br /&gt;
&lt;br /&gt;
'''Error message&amp;amp;nbsp;— Script error: [[dfttest]] does not have a named argument &amp;quot;lsb&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
Remove your dfttest.dll and install the modified one, contained in this package.&lt;br /&gt;
&lt;br /&gt;
'''Error message&amp;amp;nbsp;— [[Removegrain|RemoveGrain]]: invalid mode ##'''&lt;br /&gt;
&lt;br /&gt;
Your RemoveGrain version is too old. Remove RemoveGrain*.dll, Repair*.dll and SSE?Tools.dll and install [[RgTools]].&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
'''v1.27.2, 2015.12.30'''&lt;br /&gt;
&lt;br /&gt;
* Fixed Dither_crop16 which wasn’t passing the align parameter if there was no horizontal cropping. Thanks to Reel.Deel for making me check.&lt;br /&gt;
* Fixed Dither_srgb_display with autopar=false and 1440×1080 input.&lt;br /&gt;
* Fixed Dither_quantize with reducerange=true, some rare pixel values were wrongly quantized. Thanks to _08 for reporting this bug.&lt;br /&gt;
* Fixed a picture corruption in Dither_bilateral16. Thanks to _08 for reporting what was actually a combination of two different bugs.&lt;br /&gt;
&lt;br /&gt;
'''v1.27.1, 2015.07.16'''&lt;br /&gt;
&lt;br /&gt;
* Fixed a wrong code path in Dither_limit_dif16 causing a crash on CPU without AVX2 instruction set. Thanks to real.finder and Groucho2004 for their report. &lt;br /&gt;
* Documentation typos fixed thanks to Colours. &lt;br /&gt;
&lt;br /&gt;
'''v1.27.0, 2015.07.12'''&lt;br /&gt;
&lt;br /&gt;
* Added ''cplaces'', ''cplaced'' and ''csp'' to Dither_resize16. &lt;br /&gt;
* Backported some code from [http://forum.doom9.org/showthread.php?t=166504 fmtconv] to Dither_resize16. &lt;br /&gt;
* Added the ''slice'' parameter to disable multi-threaded slicing for error-diffusion dithering (DitherPost and related functions). &lt;br /&gt;
* Added Dither_min_dif16. &lt;br /&gt;
* AVX2 optimisations for Dither_resize16, Dither_add16, Dither_sub16, Dither_median16, Dither_max_dif16, Dither_min_dif16 and Dither_limit_dif16. &lt;br /&gt;
* Added the BT.1886 transfer cruve to the gamma conversion functions. &lt;br /&gt;
* Added the ''dispm'' parameter to change the conversion mode in Dither_srgb_display. &lt;br /&gt;
* Improved the quality of the subsampling in Dither_bilateral16. &lt;br /&gt;
* Radius is no longer limited in Dither_bilateral16 as well as in GradFun3 in ''smode'' 2. &lt;br /&gt;
* Fixed a bug in the chroma filling (''u'' or ''v'' &amp;lt; 0) with non-YV12 colorspaces. &lt;br /&gt;
&lt;br /&gt;
'''v1.26.5, 2014.09.23'''&lt;br /&gt;
&lt;br /&gt;
* Fixed Dither_resize16 to make pure vertical resizing multi-threaded. &lt;br /&gt;
&lt;br /&gt;
'''v1.26.4, 2014.09.22'''&lt;br /&gt;
&lt;br /&gt;
* Fixed bug in Dither_limit_dif16 and SmoothGrad when ''thr'' and ''elast'' are both too low or too high. Thanks to mirkosp for reporting it. &lt;br /&gt;
* The ''radius'' value is more thoroughly checked in GradFun3 in order to make related error messages more explicit. &lt;br /&gt;
&lt;br /&gt;
'''v1.26.3, 2014.09.05'''&lt;br /&gt;
&lt;br /&gt;
* Fixed bug in Dither_box_filter16 shifting the frame to the right from the 2049th pixel column. Thanks to Motenai Yoda for reporting it. &lt;br /&gt;
&lt;br /&gt;
'''v1.26.2, 2014.08.29'''&lt;br /&gt;
&lt;br /&gt;
* Fixed an SSE2 bug in Dither_median16 for 3×3 spatial median. Thanks to TheProfileth for reporting it. &lt;br /&gt;
&lt;br /&gt;
'''v1.26.1, 2014.06.05'''&lt;br /&gt;
&lt;br /&gt;
* Fixed a wrong saturation in Dither_sub16 on the last pixels of a clip whose width is not mod-8. &lt;br /&gt;
&lt;br /&gt;
'''v1.26.0, 2014.06.03'''&lt;br /&gt;
&lt;br /&gt;
* Modded versions of dfttest and MVTools2 aren’t bundled with Dither anymore. Get them separately. &lt;br /&gt;
* Added sigmoid curves to Dither_y_gamma_to_linear and Dither_y_linear_to_gamma. &lt;br /&gt;
* Added Dither_sigmoid_direct and Dither_sigmoid_inverse functions. &lt;br /&gt;
* Added the ''sigmoid'' parameter to Dither_srgb_display. &lt;br /&gt;
* Dither_y_gamma_to_linear and Dither_y_linear_to_gamma now process data contained in the chroma planes when ''u'' or ''v'' are set to 3, instead of just copying them. &lt;br /&gt;
&lt;br /&gt;
'''v1.25.1, 2014.03.03'''&lt;br /&gt;
&lt;br /&gt;
* Fixed a regression introduced in Dither_merge16. &lt;br /&gt;
&lt;br /&gt;
'''v1.25.0, 2014.03.02'''&lt;br /&gt;
&lt;br /&gt;
* 64-bit version. Source code projects ported to M$VC 2012. &lt;br /&gt;
* Added modes 5–10 to Dither_repair16. &lt;br /&gt;
* Added ''ref'' clip to GradFun3. &lt;br /&gt;
* The order of the ''luma'', ''y'', ''u'' and ''v'' parameters in Dither_merge16 is now the same as in Dither_merge16_8. The documentation has been fixed accordingly. &lt;br /&gt;
* Slight speed improvement in Dither_srgb_display when there is no resizing nor gamma correction. &lt;br /&gt;
* Fixed a problem in Dither_lut16 with expressions containing two consecutive “x” arguments. &lt;br /&gt;
* Fixed artefacts (overflow occuring when input pixels are close to 0) and inaccuracy in mode 20 of Dither_removegrain16. &lt;br /&gt;
&lt;br /&gt;
'''v1.24.0, 2013.10.27'''&lt;br /&gt;
&lt;br /&gt;
* Added all modes up to 24 to Dither_removegrain16, thanks to tp7. Most of them are SSE2-optimised. &lt;br /&gt;
* Added modes 15–18 to Dither_repair16 (not optimised for SSE2). &lt;br /&gt;
&lt;br /&gt;
'''v1.23.0, 2013.08.04'''&lt;br /&gt;
&lt;br /&gt;
* Partial implementation of the BT.2020 color conversions. Only the non-constant luminance matrix is implemented. &lt;br /&gt;
* Optimized Dither_merge16 for SSE2. &lt;br /&gt;
* Fixed the ''radiusc'' type in GradFun3 (int), so it now should work correctly in Avisynth 2.6 alpha 4. &lt;br /&gt;
* Fixed a bug in Dither_merge16 affecting the chroma of YV12 clips with ''luma=true''. Thanks to tp7 for reporting these issues. &lt;br /&gt;
&lt;br /&gt;
'''v1.22.1, 2013.01.09'''&lt;br /&gt;
&lt;br /&gt;
* Fixed green frame output in Dither_resize16nr for some combination of the ''y'', ''u'' and ''v'' parameters. &lt;br /&gt;
* Fixed Dither_quantize for 14-bit output. It is not perfect but much better than before. &lt;br /&gt;
* Made the ''bitdepth'' parameter in Dither_quantize a named argument. &lt;br /&gt;
* Fixed ''var'' and ''uvar'' scaling in Dither_add_grain16 to match better AddGrainC. &lt;br /&gt;
&lt;br /&gt;
'''v1.22.0, 2012.12.31'''&lt;br /&gt;
&lt;br /&gt;
* Added temporal processing to Dither_median16. &lt;br /&gt;
* Added Dither_resize16nr, a simple ringing-cancellation wrapper around Dither_resize16. &lt;br /&gt;
* Added a ''noring'' parameter to conversion functions between YUV and RGB. &lt;br /&gt;
* Added ''lsb'', ''center'' and ''bkgcolor'' to Dither_srgb_display. &lt;br /&gt;
* Replaced Dither_convey_yuv4xxp16_on_yvxx with Dither_out, which also works correctly with YV16 input. The old function is still there for compatibility, mapped on the new one. &lt;br /&gt;
* Dither_addborders16 now works with RGB clips. &lt;br /&gt;
* Badly designed and buggy resizing functionalities in Dither_srgb_display were rewritten. &lt;br /&gt;
&lt;br /&gt;
'''v1.21.0, 2012.09.07'''&lt;br /&gt;
&lt;br /&gt;
* Added the ''seed'' parameter to Dither_add_grain16. &lt;br /&gt;
* Reworked Dither_srgb_display for mor accurate aspect ratios and transfer characteristics, added ''gamma'' parameter. &lt;br /&gt;
* Gamma transfer functions have now an optional gamma correction parameter. &lt;br /&gt;
* Added Dither_median16, but slow and without temporal component at the moment. &lt;br /&gt;
&lt;br /&gt;
'''v1.20.0, 2012.08.12'''&lt;br /&gt;
&lt;br /&gt;
* Added Dither_removegrain16 (modes 1–4, 11, 12, 19 and 20 only) and Dither_repair16 (modes 1–4 and 11–14 only). &lt;br /&gt;
* Added threshold, radius and elasticity settings for chroma to GradFun3, as well as the usual plane filters. Better compatibility with the 4:1:1 colorspace. &lt;br /&gt;
* Added Dither_sub16 and optimised Dither_add16 for SSE2. &lt;br /&gt;
* Fixed a regression for 4:2:0 DV-PAL chroma placement in Dither_resize16. &lt;br /&gt;
* Colorspace conversions using point-sampling for chroma are now more consistent regarding chroma placement. &lt;br /&gt;
&lt;br /&gt;
'''v1.19.0, 2012.07.18'''&lt;br /&gt;
&lt;br /&gt;
* Added kernel inversion to Dither_resize16. &lt;br /&gt;
* Added cropping parameters to Dither_srgb_display. &lt;br /&gt;
* Fixed a bug preventing to use the 4:1:1 colorspace in some scripted functions. &lt;br /&gt;
* Bug fixed in [[MVTools]] (v2.6.0.5). &lt;br /&gt;
&lt;br /&gt;
'''v1.18.1, 2012.06.15'''&lt;br /&gt;
&lt;br /&gt;
* Forgot to include AVSTP 1.0.1 in the previous release. &lt;br /&gt;
* The ''mode'' parameter in Dither_quantize was forgotten too… &lt;br /&gt;
* Detailed a few things in the documentations. &lt;br /&gt;
&lt;br /&gt;
'''v1.18.0, 2012.06.14'''&lt;br /&gt;
&lt;br /&gt;
* Added Dither_quantize to dither to bit-depths higher than 8. &lt;br /&gt;
* Added Dither_srgb_display for Y’CbCr preview and accurate screen captures. &lt;br /&gt;
* More meaningful error messages about wrong clip formats. &lt;br /&gt;
* SmoothGrad and Dither_box_filter16 now work correctly on picture of width &amp;gt; 2048 &lt;br /&gt;
* Fixed a bug in multithreaded Dither_resize16. &lt;br /&gt;
* Bug fixed in MVTools (v2.6.0.4). &lt;br /&gt;
&lt;br /&gt;
'''v1.17.0, 2012.05.13'''&lt;br /&gt;
&lt;br /&gt;
* Added the YCgCo matrix in RGB conversions. &lt;br /&gt;
* More dithering settings exposed in RGB conversions. &lt;br /&gt;
* Fixed BT.709 coefficients. &lt;br /&gt;
* Bug fixed in MVTools (v2.6.0.3). &lt;br /&gt;
&lt;br /&gt;
'''v1.16.0, 2012.05.01'''&lt;br /&gt;
&lt;br /&gt;
* Added generic spline kernel to Dither_resize16. &lt;br /&gt;
* Added the SMPTE 240M gamma curve and aliases for BT.601 and SMPTE 170M. &lt;br /&gt;
* Fixed a bug related to chroma subsampling and multi-threading in Dither_merge16. &lt;br /&gt;
* Bug fixed in MVTools (v2.6.0.2). &lt;br /&gt;
&lt;br /&gt;
'''v1.15.0, 2012.03.23'''&lt;br /&gt;
&lt;br /&gt;
* Added the ''luma'' parameter to Dither_merge16 and defaulted ''u'' and ''v'' to 2 (copy) excepted when ''luma&amp;amp;nbsp;= true'' (process). This behaviour is now identical to mt_merge. &lt;br /&gt;
* Added plane filtering in Dither_merge16_8. The function now internaly uses Dither_merge16 and is much faster (×20 on a 4-core CPU). &lt;br /&gt;
* Added support for negative plane filter values in Dither_lut16. Thanks to 06_taro for the suggestion. &lt;br /&gt;
* Set ''quiet&amp;amp;nbsp;= true'' as default in dfttest 1.9.2. &lt;br /&gt;
* Fixed a bug in Dither_resize16 making it crash for some combinations of source and destination sizes. &lt;br /&gt;
&lt;br /&gt;
'''v1.14.1, 2012.03.12'''&lt;br /&gt;
&lt;br /&gt;
* Bugs fixed in MVTools (v2.6.0.1). &lt;br /&gt;
&lt;br /&gt;
'''v1.14.0, 2012.03.11'''&lt;br /&gt;
&lt;br /&gt;
* Multi-threading: most dither.dll functions are now multi-threaded, excepted Dither_box_filter16 and SmoothGrad (later, maybe). Some MVTools v2.6.0.0 functions support multi-threading too. &lt;br /&gt;
* Fixed a bug in dfttest v1.9.1 &lt;br /&gt;
* Added ''staticnoise'' parameter to GradFun3. &lt;br /&gt;
* Documentation revisited. &lt;br /&gt;
&lt;br /&gt;
'''v1.13.2, 2011.12.13'''&lt;br /&gt;
&lt;br /&gt;
* Updated MVTools to v2.5.14.1 (bugfix) &lt;br /&gt;
&lt;br /&gt;
'''v1.13.1, 2011.11.28'''&lt;br /&gt;
&lt;br /&gt;
* Updated dfttest to v1.9 and MVTools to v2.5.14.0 &lt;br /&gt;
* Fixed height checks in DitherPost with interlaced content. &lt;br /&gt;
&lt;br /&gt;
'''v1.13.0, 2011.11.09'''&lt;br /&gt;
&lt;br /&gt;
* Added ''kernelh'', ''kernelv'', ''totalh'' and ''totalv'' to Dither_resize16. Please note that the custom convolution coefficients are now read in the correct order. &lt;br /&gt;
* Fixed an error with the plane selectors in the Dither_lut*8 functions. &lt;br /&gt;
* Updated MVTools to v2.5.13.1. &lt;br /&gt;
&lt;br /&gt;
'''v1.12.1, 2011.10.27'''&lt;br /&gt;
&lt;br /&gt;
* Fixed a bug with Dither_resize16, occuring with positive values for ''src_left'' or ''src_top''. &lt;br /&gt;
* Fixed other issues in Dither_resize16, related to huge differences between vertical and horizontal resizing ratios. It’s not perfect yet, but still much better than before. &lt;br /&gt;
* Dither_convert_yuv_to_rgb now supports RGB24 output colorspace. &lt;br /&gt;
* Simplified Dither_crop16 for pure horizontal cropping. &lt;br /&gt;
&lt;br /&gt;
'''v1.12.0, 2011.09.10'''&lt;br /&gt;
&lt;br /&gt;
* MVTools update again. &lt;br /&gt;
&lt;br /&gt;
'''v1.11.1, 2011.09.10'''&lt;br /&gt;
&lt;br /&gt;
* Fixed a bug in the MVTools. &lt;br /&gt;
&lt;br /&gt;
'''v1.11.0, 2011.09.10'''&lt;br /&gt;
&lt;br /&gt;
* Updated MVTools to v2.5.12.0. See the MVTools documentation for details. &lt;br /&gt;
&lt;br /&gt;
'''v1.10.0, 2011.08.24'''&lt;br /&gt;
&lt;br /&gt;
* Added Dither_addborders16. &lt;br /&gt;
* Added the BT 709 curve to Dither_y_gamma_to_linear and Dither_y_linear_to_gamma, as well as the plane selectors. &lt;br /&gt;
* Added the possibility to have static noise in DitherPost. &lt;br /&gt;
* Added Dither_add_grain16. &lt;br /&gt;
* Added a ''dif'' parameter to Dither_add16. &lt;br /&gt;
* Added the ''lsb'' and ''lsb_in'' parameters to GradFun3 to deal with 16-bit data. The function also accepts smaller radii than before. &lt;br /&gt;
&lt;br /&gt;
'''v1.9.5, 2011.07.21'''&lt;br /&gt;
&lt;br /&gt;
* Bug fixed in Dither_resize16(), displaying green bars when SSE2 optimisations are disabled. &lt;br /&gt;
* Better check of stack16 clip dimensions. &lt;br /&gt;
&lt;br /&gt;
'''v1.9.4, 2011.07.17'''&lt;br /&gt;
&lt;br /&gt;
* Bug fix again in Dither_resize16(). &lt;br /&gt;
&lt;br /&gt;
'''v1.9.3, 2011.07.13'''&lt;br /&gt;
&lt;br /&gt;
* Fixed crashes in Dither_bilateral16() occuring with subsampling using more than 32 reference pixels. This affected GradFun3(smode=2) with radii greater than 13. &lt;br /&gt;
* Fixed a mod4 check in Dither_convert_yuv_to_rgb(). &lt;br /&gt;
&lt;br /&gt;
'''v1.9.2, 2011.07.09'''&lt;br /&gt;
&lt;br /&gt;
* Fixed crashes and bugs in Dither_resize16(). &lt;br /&gt;
&lt;br /&gt;
'''v1.9.1, 2011.07.06'''&lt;br /&gt;
&lt;br /&gt;
* Improved memory usage and CPU load for the functions based on the 16-bit resizer. &lt;br /&gt;
* Simplified a bit the GradFun3() detail masking. &lt;br /&gt;
* Fixed a few glitches. &lt;br /&gt;
&lt;br /&gt;
'''v1.9, 2011.06.11'''&lt;br /&gt;
&lt;br /&gt;
* The threshold of the detail mask in GradFun3() now automatically adjusts to the debanding threshold. This helps removing serious color banding, when band boundaries are masked because they are detected as details. Also, the ''radius'' for ''smode'' 0 has been internally reduced to make the value reflect more accurately the actual range in pixels. &lt;br /&gt;
* Added an interlaced mode for DitherPost(). &lt;br /&gt;
* Added Dither_resize16(), a 16-bit resizer which can also work as a chained horizontal and vertical convolution engine. &lt;br /&gt;
* Added ''y'', ''u'' and ''v'' parameters to almost all the dither.dll functions. Their behaviour is the same as in masktools2. &lt;br /&gt;
* Added Dither_y_gamma_to_linear() and Dither_y_linear_to_gamma(), for gamma ? linear conversions in 16 bits. &lt;br /&gt;
* Added Dither_convey_yuv4xxp16_on_yvxx() and Dither_convey_rgb48_on_yv12(), functions to export clips with 16 bits per component when Avisynth’s output is read as rawvideo via a pipe. &lt;br /&gt;
* Added Dither_convert_yuv_to_rgb() and Dither_convert_rgb_to_yuv() to convert 8 or 16 bits YUV to RGB and back with dithering. It’s also possible to output RGB48 conveyed on YV12 via a rawvideo pipe. &lt;br /&gt;
* Added Dither_max_dif16() to get from two clips the pixels having the maximum difference with a third reference clip. &lt;br /&gt;
* Fixed an error message about wrong colorspace. &lt;br /&gt;
* Bugfix: removed artifacts on flat pure white areas (luma == 255) when using error diffusion dithering (modes 6–8). &lt;br /&gt;
* Non-YV12 planar Y(UV) colorspaces should now work correctly on Avisynth 2.6.0. &lt;br /&gt;
&lt;br /&gt;
'''v1.8.1, 2011.05.28'''&lt;br /&gt;
&lt;br /&gt;
* Optimised Dither_bilateral16 with SSE and by introducing a subsampling parameter. Also, fixed a bug related to the use of a ''ref'' clip. &lt;br /&gt;
* Added a troubleshooting section to the documentation. &lt;br /&gt;
&lt;br /&gt;
'''v1.8, 2011.05.15'''&lt;br /&gt;
&lt;br /&gt;
* Dfttest has been modified to make it accept 16-bit input clips (v1.8 mod16b). It’s now possible to apply a curve on the input and the inverse curve to the output to protect dark shades for example, without resolution loss or risk of color banding. &lt;br /&gt;
* Made available the two internal components of the SmoothGrad function: Dither_box_filter16 and Dither_limit_dif16. &lt;br /&gt;
* Added Dither_bilateral16, a bilateral filter giving cleaner results than the box filter for gradient smoothing. &lt;br /&gt;
* Improved GradFun3: &lt;br /&gt;
** Better detail/edge masking with adjustable thresholds and optional mask display for debugging purpose. &lt;br /&gt;
** Added two smoothing modes using the modified dfttest and the new bilateral filter. The latter is slow as hell and should be considered as experimental. &lt;br /&gt;
* Added a Dither_crop16 function to properly crop stacked 16-bit clips. &lt;br /&gt;
* Added a ''luma'' parameter to Dither_merge16_8 and fixed a slight chroma bug. &lt;br /&gt;
&lt;br /&gt;
'''v1.7.1, 2011.05.11'''&lt;br /&gt;
&lt;br /&gt;
* Dither.avsi doesn’t use Max anymore, so it can now run on Avisynth 2.5.7 or earlier. &lt;br /&gt;
* Bugfix in the modified MVTools2: the ''thSADC'' argument was ignored in MDegrain1/2/3. &lt;br /&gt;
&lt;br /&gt;
'''v1.7, 2011.04.27'''&lt;br /&gt;
&lt;br /&gt;
* Slightly improved Dither1Pre and Dither2Pre functions, added the ''overlap'' and ''tvopt'' parameters. &lt;br /&gt;
* People complained about GradFun3 being too strong and washing fine shades away, so I changed the default parameter values for a better match with the gradfun2db default settings. ''thr'' is set to 0.35 and ''radius'' to 12. &lt;br /&gt;
&lt;br /&gt;
'''v1.6, 2011.04.10'''&lt;br /&gt;
&lt;br /&gt;
* Masktools 2 a48 is now the minimum requirement because some Dither functions use the new bitwise operators. I don’t know how to automatically detect the Masktools version, so be sure to update your Masktools before installing this Dither version. &lt;br /&gt;
* The modified MVTools2 has been synchronised with the latest official release (2.5.11.2 beta) &lt;br /&gt;
* Renamed the ''rem'' parameters into ''clsb'' in DitherPost and SmoothGrad functions &lt;br /&gt;
* Changed the default for the ''stacked'' (now true) and ''prot'' (now false) parameters. &lt;br /&gt;
* Added various utility functions, mainly Dither_lut8, Dither_lut16, Dither_add16 and Dither_merge16. &lt;br /&gt;
&lt;br /&gt;
'''v1.5, 2010.11.07'''&lt;br /&gt;
&lt;br /&gt;
* Added error diffusion algorithms (Floyd-Steinberg, Stucki and Atkinson). &lt;br /&gt;
* Fixed the internal noise generator, now with a better randomness. &lt;br /&gt;
&lt;br /&gt;
'''v1.4, 2010.09.24'''&lt;br /&gt;
&lt;br /&gt;
* Added SmoothGrad as pre-processor to smooth the gradients before dithering. &lt;br /&gt;
* Added GradFun3, a tool derived from SmoothGrad for color-banding removal. &lt;br /&gt;
* Added the ''stacked'' parameter to DitherPost, for an easier use with the other functions. &lt;br /&gt;
* Changed the documentation. &lt;br /&gt;
* Fixed wrong output FPS in DitherPost when the input is submitted as an interleaved MSB-LSB clip. &lt;br /&gt;
&lt;br /&gt;
'''v1.3, 2010.07.16'''&lt;br /&gt;
&lt;br /&gt;
* DitherPost is now a plug-in instead of a script function. Doesn’t require NoiseGenerator anymore. &lt;br /&gt;
* Synchronised modified plug-ins: mvtools 2.5.10.1 and dfttest 1.8 &lt;br /&gt;
&lt;br /&gt;
'''v1.2, 2010.06.20'''&lt;br /&gt;
&lt;br /&gt;
* Synchronised the modified mvtools2 with the latest official release. &lt;br /&gt;
&lt;br /&gt;
'''v1.1, 2010.05.06'''&lt;br /&gt;
&lt;br /&gt;
* Merged the DitherPost functions into a single one. &lt;br /&gt;
* Fixed the static pattern for chroma in 1-bit dithering. &lt;br /&gt;
* Strengthened the protection method and made it optional &lt;br /&gt;
* Added new dithering patterns and a test function. &lt;br /&gt;
* Added a masking function &lt;br /&gt;
&lt;br /&gt;
'''v1.0, 2009.12.25'''&lt;br /&gt;
&lt;br /&gt;
* Initial release&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/High_bit-depth_Support_with_Avisynth</id>
		<title>High bit-depth Support with Avisynth</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/High_bit-depth_Support_with_Avisynth"/>
				<updated>2019-09-14T00:29:18Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
Currently, Avisynth (not AvisynthPlus) only supports 8-bit video.  Nevertheless, through various utilities, plugins, and scripts, Avisynth can be used to import, process, and export high bit-depth video.  There has been some effort to update Avisynth itself to support high bit-depth, but there has been no progress as of 2012 (http://forum.doom9.org/showthread.php?t=162436).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is Deep Color? ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
Deep Color refers to using more than 8 bits of data to represent each color channel.  It is also referred to as high bit-depth color.  Basically, deep color allows finer graduations of color, smoother gradients and more detail. Please refer to this short, easy to understand article:  [http://www.pcworld.com/article/171223/what_is_10bit_color.html PCWorld: What is 10-bit Color?]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Use Deep Color? ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
*Higher internal precision, using high-bit depth color, when processing an image in a filter, gives a higher quality (8-bit) output.&lt;br /&gt;
*If a video filter uses linear gamma internally, there can be noticeable differences in the image.  A linear gamma representation is best supported with a high bit-depth. See the illustration for [http://int64.org/projects/resamplehq/ ResampleHQ].&lt;br /&gt;
*If you encode high-bit depth video, you can get better compression (reportedly up to 30%) and less banding.  &lt;br /&gt;
*Banding is one of the most serious liabilities of 8-bit depth.  Refer to the following references for an explanation of why 10-bit encodes compress better:&lt;br /&gt;
**[http://x264.nl/x264/10bit_02-ateme-why_does_10bit_save_bandwidth.pdf Why does 10-bit save bandwidth (even when content is 8-bit)?.pdf]&lt;br /&gt;
**[http://x264.nl/x264/10bit_01-ateme_pierre_larbier_422_10-bit.pdf Using 10-bit AVC/H.264 Encoding with 4:2:2 for Broadcast Contribution.pdf]&lt;br /&gt;
**[http://x264.nl/x264/10bit_03-422_10_bit_pristine_video_quality.pdf Keeping Video Quality Pristine throughout the Production Process: 4:2:2 10-bit AVC/H.264 encoding.pdf]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== AviSynth+ Native Deep Color Support ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
Since [https://github.com/pinterf/AviSynthPlus/releases/tag/r2290-MT r2290] (October 2016), {{AvsPluscon}} supports deep color &amp;amp;ndash; 10, 12, 14, 16 and 32-bit (floating point) RGB &amp;amp;amp; YUV color spaces. All AVS+ color spaces are listed [[Avisynthplus_color_formats|here]]. Support functions include [[ConvertBits]], [[ConvertStacked]], [[Extract]] and [[CombinePlanes]]. Deep color support has also been added to all [[Internal_filters|internal filters]] and many [[AviSynth%2B_x64_plugins|external plugins]]. &lt;br /&gt;
&lt;br /&gt;
'''''This feature greatly simplifies use of deep color and could make much of the information below obsolete.''''' &lt;br /&gt;
&lt;br /&gt;
See the [[AviSynth%2B|AviSynth+ main page]] for more information. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing High Bit-depth Video into AviSynth ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
For importing high bit depth video [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater is strongly recommended. AviSynth 2.6 adds the additional [[planar]] color spaces ([[Y8]],[[YV16]],[[YV24]], [[YV411]]) which makes it that much more compatible with all of the existing formats. &lt;br /&gt;
&lt;br /&gt;
=== [[FFmpegSource|FFMS2]] ===&lt;br /&gt;
'''Patched FFMS2''' - import DNxHD, ProRes, and other 10-bit videos in their native format (4:2:2 and 4:4:4 are also supported), output greater than 8-bits will always be in the [[Stack16]] format.&lt;br /&gt;
&lt;br /&gt;
*Source code: [http://github.com/SAPikachu/ffms2_hacks GitHub repository]&lt;br /&gt;
*Discussion: [http://forum.doom9.org/showthread.php?t=164841 Doom9 thread] - Importing DNxHD to Avisynth (some of the links may be outdated; see downloads below or [http://forum.doom9.org/member.php?u=135430 SAPikachu's signature] for latest versions)&lt;br /&gt;
&lt;br /&gt;
==== Download ====&lt;br /&gt;
Updated binaries: March 15, 2015 | [http://www.mediafire.com/folder/2izh9abzep52o/Video_works older versions]&lt;br /&gt;
* [http://www.nmm-hd.org/upload/get~t6gq8DWihBs/ffms2-6e0d654+a9fe004-ffmbc-FFmbc-0.7.1.7z ffms2-6e0d654+a9fe004-ffmbc-FFmbc-0.7.1.7z] | [http://web.archive.org/web/20150321005059/https://www.nmm-hd.org/upload/get~t6gq8DWihBs/ffms2-6e0d654+a9fe004-ffmbc-FFmbc-0.7.1.7z mirror] - This version uses [http://code.google.com/p/ffmbc/ FFmbc] as a decoder; may have better support for professional video formats like ProRes, DNxHD, etc.&lt;br /&gt;
* [http://www.nmm-hd.org/upload/get~BLsLZwgj5ps/ffms2-6e0d654+a9fe004-ffmpeg-1e4d049.7z ffms2-6e0d654+a9fe004-ffmpeg-1e4d049.7z] | [http://web.archive.org/web/20150321005255/https://www.nmm-hd.org/upload/get~BLsLZwgj5ps/ffms2-6e0d654+a9fe004-ffmpeg-1e4d049.7z mirror] - This version uses [http://en.wikipedia.org/wiki/FFmpeg FFmpeg] as a decoder; may be better for general (more common) formats.&lt;br /&gt;
* [http://www.nmm-hd.org/upload/get~Q4mZfV9y0Og/ffms2-6e0d654+a9fe004-libav-9a60b1f.7z ffms2-6e0d654+a9fe004-libav-9a60b1f.7z] | [http://web.archive.org/web/20150321005339/https://www.nmm-hd.org/upload/get~Q4mZfV9y0Og/ffms2-6e0d654+a9fe004-libav-9a60b1f.7z mirror] - This version uses [http://en.wikipedia.org/wiki/Libav Libav] as a decoder; may be better for general (more common) formats.&lt;br /&gt;
&lt;br /&gt;
These versions work just like the official [[FFmpegSource|FFMS2]], but includes the additional {{FuncDef3|enable10bithack}} parameter and support for the additional [[planar]] colorspaces available is AviSynth 2.6. &lt;br /&gt;
By default {{FuncDef3|enable10bithack}} is set to false so it will work just like the official FFMS2; to import high bit depth video set {{FuncDef3|enable10bithack}}&amp;lt;code&amp;gt;=true&amp;lt;/code&amp;gt;, output will be in the [[Stack16]] format.&lt;br /&gt;
See [http://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav FFmpeg versus Libav] for information on pros and cons and differences between the FFmpeg and Libav.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;!--===== Archived Downloads =====&lt;br /&gt;
* &amp;lt;code&amp;gt;[http://www.nmm-hd.org/upload/get~PbKYgPe2oKY/ffms2-9417b9c-ffmbc-FFmbc-0.7-rc8.7z ffms2-9417b9c-ffmbc-FFmbc-0.7-rc8.7z]&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;[http://www.nmm-hd.org/upload/get~fmbjO7t9dEg/ffms2-9417b9c-ffmpeg-8728360.7z ffms2-9417b9c-ffmpeg-8728360.7z]&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;[http://www.nmm-hd.org/upload/get~3O9tHZ9TJIM/ffms2-9417b9c-libav-aca2510.7z ffms2-9417b9c-libav-aca2510.7z]&amp;lt;/code&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[LSMASHSource]] ===&lt;br /&gt;
Another source filter to import regular 8-bit and high bit depth video. LSMASHSource includes these 2 fuctions to import video:&lt;br /&gt;
*[[LSMASHSource/LSMASHVideoSource|LSMASHVideoSource]] - This function uses [http://en.wikipedia.org/wiki/Libavcodec#Implemented_video_codecs libavcodec] as a video decoder and [http://github.com/l-smash/l-smash L-SMASH] as a demuxer. Recommended for MP4, MOV, [http://en.wikipedia.org/wiki/ISO_base_media_file_format ISO Base Media] and its derived file formats.&amp;lt;br/&amp;gt;&lt;br /&gt;
*[[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]] - This function uses [http://en.wikipedia.org/wiki/Libavcodec#Implemented_video_codecs libavcodec] as a video decoder and [http://www.ffmpeg.org/libavformat.html libavformat] as a demuxer.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[VapourSource]] ===&lt;br /&gt;
Can be used to import [http://www.vapoursynth.com/ VapourSynth] scripts into AviSynth. Video can be 8-bit or greater.&lt;br /&gt;
&lt;br /&gt;
=== ImageMagick ===&lt;br /&gt;
You can also import video or still via 16-bit PNG format pictures with the following [http://www.imagemagick.org/ ImageMagick] command lines.  &lt;br /&gt;
&lt;br /&gt;
Examples shown are for Windows. Requires the 16-bit version of ImageMagick; get it [http://www.imagemagick.org/script/binary-releases.php#windows here] (look for downloads with ''Q16'' in the file name)&lt;br /&gt;
&lt;br /&gt;
*Convert 16-bit to [[Stack16]] (high/low or stack16 format):&amp;lt;div {{BoxWidthIndent|60|1}} &amp;gt;&lt;br /&gt;
 convert 16bit.png -depth 16 ( +clone -evaluate and 255 -evaluate multiply 256 ) &lt;br /&gt;
         -append stacked.png&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Convert Stack16 (high/low) to 16bit:&amp;lt;div {{BoxWidthIndent|60|1}} &amp;gt;&lt;br /&gt;
 convert stacked.png -depth 16 -crop 100%x50% ( +clone -evaluate divide 256 ) &lt;br /&gt;
         -delete 1 -compose Add -composite -define png:bit-depth=16 16bit1.png&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further explanation of these command lines, please see the thread [http://forum.doom9.org/showthread.php?t=172846 ''Image Magick and stacked high bit-depth''] (doom9.org)&lt;br /&gt;
&lt;br /&gt;
=== Obsolete === &lt;br /&gt;
'''The following methods are obsolete! If you must, only use as a verification or as workaround:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?p=1526131#post1526131 Readv210mod] - Can read uncompressed v210 in .mov container as color.  Needs a manual setting skip the file header.  &lt;br /&gt;
&lt;br /&gt;
*[http://sites.google.com/site/ourenthusiasmsasham/soft Sashimi] - Sashimi 0.85 has different bit-depth support.  Please see OtherFormats/Read_v210.avs included in the package.&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=158985 ReadV210] - Can read uncompressed v210 in .mov container as greyscale.  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Alternative builds and methods of importing '''(also obsolete)''':&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?p=1528494 ffms2mod] - Can return most 10bit video in the Avisynth high bit-depth convention.&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=162598&amp;amp;page=2 RawSource with ffmpeg]  - shows an example of using ffmpeg to convert to a 16bit format which can be read by RawSource in Avisynth 2.6.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Processing High Bit-depth Video with AviSynth ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
Some plugins support processing internally in a higher bit-depth for better quality and return an 8-bit video.  Others support full high-bit processing and can retun a special format 16 bit video.&lt;br /&gt;
&lt;br /&gt;
Most developers have adopted a vertically stacked format known as [[Stack16]], where the high bits (MSB) are stored in the upper half of a video, and the lower bits (LSB) in the lower half of the video.&amp;lt;br&amp;gt;&lt;br /&gt;
This special format must be processed only with high-bit aware scripts and plugins.&amp;lt;br&amp;gt;&lt;br /&gt;
* Multipurpose&lt;br /&gt;
**'''[[Dither_tools|Dither]]''' - A set of scripts, original and modified plugins to process 16-bit clips. Some of the functions include 16-bit color space conversion, debanding, denoising, resizing, and dithering 16-bit to lower bit depths.&lt;br /&gt;
**'''[http://github.com/tp7/CLExpr/releases CLExpr]''' - OpenCl plugin for runtime calculation of expressions on 8 and 16-bit depths clips. Makes mt_lutxy and mt_lutxyz possible on 16-bit. More information [http://forum.doom9.org/showpost.php?p=1672638 here].&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=154971 SmoothAdjust]''' - High quality YUV color adjustment plugin. SmoothAdjust can input and output 16-bits; all calculations are internally done in 32-bit float to avoid rounding errors and artifacts.&lt;br /&gt;
&lt;br /&gt;
* Antialiasing&lt;br /&gt;
**'''[[Xaa]]''' - anti-aliasing and resizing script.&lt;br /&gt;
&lt;br /&gt;
* Color Correction&lt;br /&gt;
** '''[http://forum.doom9.org/showthread.php?t=167573 AutoAdjust]''' - Automatic color adjustment plugin.&lt;br /&gt;
** '''[http://www.snovidenie.com/plugins/hdr/ HDRMatrix]''' - Bt.601-Bt.709 conversion and RGB color correction filter, see [http://forum.doom9.org/showthread.php?t=172189&amp;amp;page=2#post1756038 discussion].&lt;br /&gt;
&lt;br /&gt;
* Debanding&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=161411 flash3kyuu_deband]''' - Debanding filter with 8/16 bit input/output. In addition flash3kyuu_deband can be used to dither 16-bit to lower bit depths. &lt;br /&gt;
&lt;br /&gt;
* Degraining&lt;br /&gt;
**'''[[SMDegrain]]''' - mvtools+mdegrain denoising with 16-bit input and output.&lt;br /&gt;
&lt;br /&gt;
* Denoising&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=162342 DenoiseMD]''' - 8/16-bit denoise.&lt;br /&gt;
**'''[[Dfttest]]''' - 8/16-bit 2D/3D frequency domain denoiser.&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=171379 KNLMeansCL]''' - OpenCL based Non Local Means denoising with support for 16-bit input and output.&lt;br /&gt;
**'''[http://forum.videohelp.com/threads/369142-Simple-MDegrain-Mod-v2-2d-A-Quality-Denoising-Solution SMDegrainMod]''' - 8/16 bit denoising with additional features like sharpening. [http://web.archive.org/web/20131210170708/http://doom10.org/index.php?topic=2178.0 Original Doom10 archived page.]&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=167032 TempLinearApproximate]''' - 8/16 bit filter for temporal linear approximation between pixels . Meant mainly for denoising aid in motion compensated clips.&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=172966 xNLMeans]''' - Implementation of the Non Local Means denoising algorithm, as described by Buades et al. Includes support for 16-bit input and output.&lt;br /&gt;
&lt;br /&gt;
* Deringing&lt;br /&gt;
**[[HQDering_mod|'''HQDeringMod''']] - Deringing script with 16-bit input and output.&lt;br /&gt;
&lt;br /&gt;
* Effects&lt;br /&gt;
**'''[[f3kgrain]]''' - Luma adaptive grain generator with 8/16-bit input and output.&lt;br /&gt;
**[http://www.snovidenie.com/plugins/hdr/ HDRNoise] - Random noise and film grain library, see [http://forum.doom9.org/showthread.php?t=172189&amp;amp;page=2#post1756038 discussion.]&lt;br /&gt;
&lt;br /&gt;
* Frame Averaging&lt;br /&gt;
**'''[http://forum.doom9.org/showpost.php?p=1579509 AvgAll_16]''' - Average all frames in a clip with 16-bit accuracy.&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=168048 ClipBlend16]''' - Blend an specified amount of frames into a single frame with 16-bit accuracy.&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?t=163018 RedAverage]''' - 16-bit capable average with masking. Download latest version [http://chaosking.de/wp-content/uploads/avsfilters/Unclassified/RedAverage___(1.4.3_-_2011-12-02).7z here]&lt;br /&gt;
	&lt;br /&gt;
* Resizing&lt;br /&gt;
**'''[[Debicubic]]''' - This filter is designed to reverse the effects of bicubic upsampling. 8/16-bit input and output.&lt;br /&gt;
**'''[[Debilinear]]''' - This filter is designed to reverse the effects of bilinear upsampling. 8/16-bit input and output.    &lt;br /&gt;
**'''[[nnedi3_resize16]]''' - An advanced script for high quality image resizing and colorspace conversion. It supports 16-bit input and output.&lt;br /&gt;
**'''[http://svn.int64.org/viewvc/int64/resamplehq/doc/index.html ResampleHQ]''' - Provides gamma-aware resizing and color space conversion.  Uses 32-bit linear color internally but input and output is limited to 8-bit.&lt;br /&gt;
**'''[http://forum.videohelp.com/threads/369143-ResizersPack-MasksPack-PlaygroundPack-SmoothContrast-Logo-mod-functions?p=2364056 Resizers Functions Pack]''' - Includes LinearResize(), a function to resize in linear space. 8/16-bit input/output. [http://web.archive.org/web/20141105135234/http://doom10.org/index.php?topic=2182.0 Original Doom10 archived page.]&lt;br /&gt;
&lt;br /&gt;
* Support&lt;br /&gt;
**'''[http://www.snovidenie.com/plugins/hdr/ HDRCore]''' - Basic YUV bitdepth and range conversion filters, see [http://forum.doom9.org/showthread.php?t=172189 discussion].&lt;br /&gt;
&lt;br /&gt;
* Deprecated&lt;br /&gt;
**'''[http://forum.doom9.org/showthread.php?p=1467907#post1467907 Deep Color Tools]''' - This Script provides basic functions to import 10bit video, do color adjustments, and export to 8bit. (NOT RECOMMENDED, THERE ARE BETTER ALTERNATIVES)&lt;br /&gt;
&lt;br /&gt;
You can also check the [[External_filters#Deepcolor_Filters|External Filters: DeepColor]] section, and the [[:Category:Deep_color_tools|Deep Color Tools]] category for possibly more listings.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Codecs which support high bit-depth ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Animation_codec Apple Animation]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/DNxHD DNxHD] also supported by [http://code.google.com/p/ffmbc/ ffmbc]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/H.264 H.264] - 10-bit YUV 4:2:0/4:2:2/4:4:4 available via x264 (lossy/lossless compression supported).&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/High_Efficiency_Video_Coding HEVC] - 10-bit YUV 4:2:0/4:2:2/4:4:4 available via x265 (lossy/lossless compression supported).&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ProRes ProRes 422]&lt;br /&gt;
&lt;br /&gt;
*[http://www.videohelp.com/tools/Ut-Video-Codec-Suite Ut Video Codec Suite] - YUV 4:2:2 10bit (lossless compression).&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/VP9 VP9] - support for YUV 4:2:0/4:2:2/4:4:4 10-12bit encoding via [http://en.wikipedia.org/wiki/VP9#Profiles profiles 2 and 3.] &lt;br /&gt;
&lt;br /&gt;
*[http://azfcpug.org/wp-content/uploads/2011/02/Digital%20Video%20Acquisition%20Codecs.pdf Digital Video Acquisition Codecs.pdf] [http://web.archive.org/web/20141021023458/http://azfcpug.org/wp-content/uploads/2011/02/Digital%20Video%20Acquisition%20Codecs.pdf mirror]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exporting High Bit-depth Video ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
You can encode out of AviSynth to 10bit x264 via&lt;br /&gt;
&lt;br /&gt;
*[http://tmod.nmm-hd.org/x264/ x264-tMod] - A modification to the x264 encoder to enable various enhancements, especially for the use of high-bit depth input.  Supports the AviSynth high bit-depth convention, quality enhancements, bit-depth conversion, filters such as denoising and deinterlacing.&lt;br /&gt;
&lt;br /&gt;
10bit x264 command-line example:&amp;lt;div {{BoxWidthIndent|60|1}} &amp;gt;&lt;br /&gt;
 avs2yuv -raw &amp;quot;script.avs&amp;quot; -o - | x264-10bit --demuxer raw --input-depth 10 &lt;br /&gt;
         --input-res 1280x720 --fps 24 --output &amp;quot;out.mp4&amp;quot; -&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[[Avs2YUV]]&lt;br /&gt;
&lt;br /&gt;
*[[avs2pipemod]]&lt;br /&gt;
&lt;br /&gt;
*[[avs4x264mod]] - This command-line tool will directly convert from a high bit-depth convention Avisynth script to H.264 with x264, including the 10bit profile.  Please check the [http://astrataro.wordpress.com/category/encode/x264/avs4x26x/ blog] for updated versions.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;div {{BoxWidthIndent|60|1}} &amp;gt;&lt;br /&gt;
 avs4x264mod.exe --x264-binary “C:\x264_64-abc.exe” -o out.264 in.avs&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some tutorials on exporting high bit depth image sequences:&lt;br /&gt;
*[http://web.archive.org/web/20130914191039/http://blendervse.wordpress.com/2011/09/16/8bit-video-to-16bit-scene-referred-linear-exrs/ 8-bit video to 16-bit Scene Referred Linear .EXR’s]&lt;br /&gt;
*[http://web.archive.org/web/20131112191047/http://blendervse.wordpress.com/2013/03/23/pipe-to-rgb-quick-how-to/ Pipe To RGB – Quick How To]&lt;br /&gt;
*[http://web.archive.org/web/20131009105710/http://blendervse.wordpress.com/2013/03/12/pipe-to-rgb-avspmod-to-imagemagick/ Pipe To RGB – AvsPmod To ImageMagick]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Playback of High Bit-depth Videos ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
*Most of the time you will only get to see dithered 8-bit video, as equipment to truly display high bit-depths is not as common at the consumer level in 2014 ([http://4ktvblog.com/10-bit-monitor list of 10-bit monitors]).&lt;br /&gt;
&lt;br /&gt;
*The Blu-ray standard does not support high bit-depth video nor [http://en.wikipedia.org/wiki/XvYCC xvYCC] color space (full-range 8 bit video). On September 2014 it was announced that the up-and-coming [http://en.wikipedia.org/wiki/Blu-ray_Disc#4K_Blu-ray_Disc 4k Blu-ray] standard will support 10-bit video and a greater color gamut by using the [http://en.wikipedia.org/wiki/Rec._2020 Rec. 2020] color space.&lt;br /&gt;
&lt;br /&gt;
*Digital theaters project up to 12-bit video; for more information read the wiki article: [http://en.wikipedia.org/wiki/Digital_Cinema_Initiatives#Image_and_audio_capability_overview Digital Cinema Initiatives]&lt;br /&gt;
&lt;br /&gt;
=====Playback Software=====&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=146228 MadVR]&lt;br /&gt;
&lt;br /&gt;
*[http://mpc-hc.org/ MPC-HC]&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=171120 MPDN]&lt;br /&gt;
&lt;br /&gt;
*[http://www.videolan.org VLC]&lt;br /&gt;
&lt;br /&gt;
=====Other Software and Information=====&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=161548 Further information on high-bit playback]&lt;br /&gt;
&lt;br /&gt;
*[http://haruhichan.com/wpblog/?p=205 An excellent guide on 10-bit playback]&lt;br /&gt;
&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=161915 FFdshow builds with 10-bit support] (deprecated)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sample High Bit-Depth Videos ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
See this thread for links to examples.  There are also deepcolor versions of standard test clips (used in image processing research).  http://forum.doom9.org/showthread.php?t=158836&amp;amp;highlight=v210&lt;br /&gt;
&lt;br /&gt;
todo add: piping RGB48 data from avs2yuv and export 16bit image sequences in either .tif or .exr preferably using ImageMagick: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&amp;amp;t=18943 or .jp2 image sequences http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&amp;amp;t=24718&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced topics]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-14T00:23:09Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st examples of both Stacked and DoubleWidth below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## 16bit clip here&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[Hqdn3d16Y]]()&lt;br /&gt;
 '''ConvertFromDoubleWidth'''()&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:40:29Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:38:51Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:35:07Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Double-Width / interleaved format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2, Input_Depth=10, Output_Mode=2, Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:34:30Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Double-Width / interleaved format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16 bit clip with truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:31:20Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for examples below.&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false) #convey 10bit clip on 16 bit clip by set truerange=false&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:15:07Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Double-Width/interleaved format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width / interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:14:56Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Stacked/lsb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked / lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width/interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:14:32Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: /* Stack16/lsb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stacked/lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Double-Width/interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T22:12:42Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax and Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. see the 1st and 3rd example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Stack16/lsb ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::1st example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::2nd example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Double-Width/interleaved format ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
::3rd example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changes ==&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T21:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Syntax and Parameters ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}} Accepts a 16-bit (HBD) clip and returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}} Accepts a stacked clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}} Accepts a Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. For example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::another example of Stack16/lsb,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::Double-Width example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T21:50:28Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Syntax and Parameters ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
same as above but returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accepts a stacked/Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. For example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::another example of Stack16/lsb,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::Double-Width example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T20:25:22Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] aka stacked (or lsb) and interleaved format to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]] aka HBD. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
&lt;br /&gt;
*the '''Double-Width''' aka interleaved 16-bit is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&lt;br /&gt;
*both can be between 9-16 bits not only 16bit&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Syntax and Parameters ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
same as above but returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accepts a stacked/Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. For example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::another example of Stack16/lsb,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::Double-Width example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T06:32:34Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]]. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''' aka lsb, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
*the '''Double-Width''' is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Syntax and Parameters ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
same as above but returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accepts a stacked/Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. For example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::another example of Stack16/lsb,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::Double-Width example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/ConvertStacked</id>
		<title>ConvertStacked</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/ConvertStacked"/>
				<updated>2019-09-13T06:24:54Z</updated>
		
		<summary type="html">&lt;p&gt;AmjadSONY: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;max-width:82em; min-width:42em;&amp;quot; &amp;gt;&lt;br /&gt;
{{AvsPlusFilter}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
These conversion filters are to allow filters that [[High_bit-depth_Support_with_Avisynth#Processing_High_Bit-depth_Video_with_AviSynth|use 16-bit video in a pseudo-8-bit colorspace]] to interact with [[Avisynthplus_color_formats|AviSyth+ high bit depth formats]]. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:42em&amp;quot; &amp;gt;&lt;br /&gt;
*In '''[[Stack16]]''', the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.&lt;br /&gt;
*the '''Double-Width''' is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&amp;amp;nbsp;verify]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Syntax and Parameters ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
same as above but returns a Double-Width 8-bit clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Accepts a stacked/Double-Width clip and returns a HBD clip.&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}}&lt;br /&gt;
&lt;br /&gt;
:{{Par2|clip|clip|}}&lt;br /&gt;
::Source clip. Must be YV12, YV16, YV24 or Y8. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|bits|int|16}}&lt;br /&gt;
::Bit depth of returned clip. Must match the original bit depth. For example,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## Decoding 10bit, YUV 4:2:0 source&lt;br /&gt;
 ## this is not needed nowadays since LSMASHSource added HBD support&lt;br /&gt;
 ## so nowadays only [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;) will did the job&lt;br /&gt;
 ## but just for example, keep in mind that lsb is the slowest &lt;br /&gt;
 [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](&amp;lt;''path''&amp;gt;, stacked=true, format=&amp;quot;YUV420P10&amp;quot;)&lt;br /&gt;
 '''ConvertFromStacked'''(bits=10)&lt;br /&gt;
 ## the line below is only if you need to down to 8bit&lt;br /&gt;
 [[ConvertBits]](8, dither=0) # '0' means on, '-1' means off&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::another example of Stack16/lsb,&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## some 16bit HBD clip here&lt;br /&gt;
 '''ConvertToStacked'''()&lt;br /&gt;
 [[Dfttest]](lsb_in=true, lsb=true)&lt;br /&gt;
 '''ConvertFromStacked'''()&lt;br /&gt;
 ## Continue filtering with 16bit HBD&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::Double-Width example (F3KDB can work with lsb but Double-Width is faster than lsb),&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|46|4}} &amp;gt;&lt;br /&gt;
 ## this not needed since neo_f3kdb support HBD, but just for example&lt;br /&gt;
 ## 10bit clip here&lt;br /&gt;
 [[ConvertBits]](16, truerange=false)&lt;br /&gt;
 '''ConvertToDoubleWidth'''()&lt;br /&gt;
 [[F3KDB]](Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)&lt;br /&gt;
 '''ConvertFromDoubleWidth'''(bits=10)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
{|border=1 cellspacing=1 cellpadding=4&lt;br /&gt;
|-&lt;br /&gt;
| 20170310 r2440&lt;br /&gt;
| first added&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Internal_filters]]&lt;br /&gt;
[[Category:Colourspace_Conversion]]&lt;br /&gt;
[[Category:Avisynthplus]]&lt;br /&gt;
[[Category:Deep_color_tools]]&lt;/div&gt;</summary>
		<author><name>AmjadSONY</name></author>	</entry>

	</feed>