QTGMC
QTGMC Deinterlacing Script (v3.32)
QTGMC is a very high quality deinterlacer for YV12 or YUY2 input, originally developed from TempGaussMC_beta2. It has a range of new features for the highest quality output and a convenient presets system to select processing speed. As well as interlaced input, it can also process progressive material for removal of interlacing or other shimmering artefacts. Extensive instructions on how to use all the settings are provided with the script.
Contents |
Links:
Download (3.32), with English instructions
Spanish Instructions (3.32)
Requirements:
Plugin Package with all Requirements
Plugin Package for multithreading
Main Downloads
QTGMC v3.32 + English Instructions Latest: v3.30:Speed-ups for many presets and a bug-fix in MVTools. v3.31: A minor bug fix. v3.32: A couple more minor tweaks and fixes. Used Windows line breaks.
Updated: Plugins Package All the required plugin files for the script - follow the instructions inside. Individual plugin / source code links below. [Updated to include NNEDI3 0.9.4]
Updated: Modded Plugins Package Same as above, but these plugins contain threading fixes that can improve stability under MT. [Updated to include NNEDI3 0.9.4]
Other Downloads
Spanish instructions (v3.32) Thanks Overdrive80!
Presets Detail (v3.32): Compared to "Faster" | Compared to "Medium" | Noise Presets Thanks nhope!
Previous Version of QTGMC (v3.25)
Basic Usage
Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:
YourSource("yourfile") # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires QTGMC( Preset="Slow" ) SelectEven() # Add this line to keep original frame rate, leave it out for smoother doubled frame rate
Save this script with an ".avs" extension. You can now use it as an AVI source for encoding.
The "Preset" used selects sensible settings for a given encoding speed. Choose a preset from:
"Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast" & "Draft"
The default preset is "Slower", which is very close to the TempGaussMC_beta2 defaults
Don't be obsessed with running at the slowest possible settings. HD content especially doesn't need that precision and it will be very slow. More modest settings will give good speed and you may not even be able to tell the quality difference.
There are many settings to tweak the behavior of the script, full details are provided in the documentation that comes with the script. For example, to reduce sharpness a little: Code:
QTGMC( Preset="Very Fast", Sharpness=0.75 )
Multi-Threaded Usage
QTGMC is very demanding on your system. For best performance try using it multi-threaded. You will need an "MT" version of avisynth and there are several versions. I recommend one of SEt's versions but if you get stability problems (crashes) then try the others. These are the options (try them in this order): SEt's 2.6MT, SEt's 2.58MT (get the latest) or Standard 2.57MT. Or you can convert to a completely 64-bit workflow (must also get 64-bit versions of all plugins): x64-2.58MT, although this version is no longer active and has less plugin support.
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):
SetMemoryMax(M) # Optional line. Leave it out at first. See below for value M SetMTMode(5, X) # See below for value X YourSource("yourfile") # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires SetMTMode(2) QTGMC( Preset="Slow", EdiThreads=Y ) # Choose preset based on overall speed/quality you want. See below for value Y Distributor() # This line may or may not be necessary, try removing it and see if you get more speed
Setting X
- Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)
- If it crashes, decrease 1 at a time
- Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down
Setting Y
- Start at about half number of cores and tweak upwards or downwards (but don't choose 0)
- Reducing this value may help stability, and might allow you to increase X for an overall speedup
Setting M
- First try without the SetMemoryMax line
- However, selecting a good SetMemoryMax value might better utilise memory and increase stability. Particularly important for slower settings
- Try values 400,600,800,1000 etc. Sometimes reducing this value can allow you to increase X for a speedup
Notes
You can only use QTGMC with SetMTMode(...), do not use MT(...).. There are occasional instabilities with multi-threading, because AviSynth and the way it interfaces with plugins is 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.
Speed Guidance
On my i7 930@3.7Ghz I get from 24fps to 210+fps at 720x480 YV12 across the presets ("Placebo" to "Ultra Fast") using tweaked multi-threaded scripts as described below. It's about 7 times slower at 1920x1080. Obviously adding source-match, noise-bypass, motion-blur or other extras will make things slower. If you get poor speeds by comparison then check the instructions below - use multi-threading and tweak the values. Update your plugins, try a different source filter, or a different AviSynth, or a different encoding GUI. Don't use overkill settings. Upgrade your system.
Full Plugin List
This is a full list of all the plugins use by QTGMC. For convenience, you can get all of these in the Plugin Package at the top of this post. The source code for several of the plugins can be found in these links.
Core plugins
- MVTools2 (2.5.11.2 or above)
- MaskTools v2 (recommend 2.0a48 or above)
- NNEDI3 (recommend 0.9.4 or above for speed)
- RemoveGrain + Repair (extract only the SSE2 versions, some SSE3 versions have a bug and give no real benefit)
- SSE2Tools for YUY2 support (take only SSE2Tools.dll from this zip - do not take the SSE3 version nor the RemoveGrain or Repair dlls)
Additional plugins depending on settings
- [NNEDI2, NNEDI, EEDI3, EEDI2, TDeInt] - if selected directly or via a source-match preset
- Yadif - for Preset="Ultra Fast" or if selected directly (this plugin cannot be autoloaded, it must be loaded in the calling script)
- VerticalCleaner - for SVThin or lossless modes
- AddGrainC (or here) - for Preset="Placebo" or NoiseDeint="Generate" selected for noise processing
- FFT3DFilter - if selected for noise processing
- dfttest - if selected for noise processing
(**) For FFT3DFilter and ddftest you also need the FFTW3 library (main page / windows zips). On Windows the file needed for both is libfftw3f-3.dll. However for FFT3DFilter, it needs to be called FFTW3.dll, so you will need two copies and rename one. On Windows put the files in your System32 or SysWow64 folder (which depends on your OS and the version of AviSynth that you're running)
Notes
Comparison with TGMC The default behaviour of QTGMC is almost identical to TempGaussMC_beta2 with particular settings. All the important defaults are effectively identical (including sharpness). However, some lesser settings have different defaults and some settings operate a little differently. There is a dedicated section on the comparison with TGMCb2 in the instructions.
Finally
Thanks go to Didée for the script from where this began, and to all the plugin scripters/coders involved too...
-Vit-