Vapoursynth QTGMC

From wiki.selur.net
Jump to navigation Jump to search

QTGMC is a slow, very high quality motion-compensated bobber. It interpolates every field, removes bob shimmer with motion-compensated temporal smoothing, resharpens, and can denoise or keep grain. QTempGaussMC is a different filter with its own page: QTempGaussMC.

Filtering → (De-)Interlace/Telecine → Deinterlacer

QTGMC controls in Hybrid
QTGMC controls in Hybrid

What it does

QTGMC first bobs the clip (NNEDI3 by default) so that every field becomes a frame. A motion-compensated temporal blur then removes the up-and-down flicker of bobbed lines, and the result is resharpened and limited against the source. Optional stages denoise or keep the grain, and source matching and lossless modes bring the result closer to the original fields. The native output has one frame per field. To repair progressive material with the same filter, see QTGMC (denoise).

Settings

Main page

Control Parameter Range / values Hybrid default Meaning
Preset Preset Draft, Ultra Fast, Super Fast, Very Fast, Faster, Fast, Medium, Slow, Slower, Very Slow, Placebo, Custom, Fast - grain Fast Speed/quality preset; slower presets search motion more thoroughly and smooth more carefully. Custom opens the custom page; "Fast - grain" is Fast with a fixed set of settings that keep the grain (noise is restored, low sharpness, lossless after temporal smoothing).
Bob – on/off off On: keep every frame (double rate); off: keep one frame of each pair.
Select – Even, Odd Even Which frame of each pair is kept when Bob is off.
Pad mod16 – on/off off Pad the frame to a multiple of 16 before QTGMC (otherwise to the minimum the format needs).
Show settings ShowSettings on/off off Prints the settings onto the frame.
Show noise ShowNoise on/off off Shows the extracted noise instead of the picture.
Tools – mv, expr, rg, median, nnedi3, fft3d, dfttest, nlmeans, grain families – Implementations of the plugins QTGMC uses; GPU implementations also get a device choice.

Custom page

Only used with Preset Custom.

Control Parameter Range / values Hybrid default Meaning
Preset Preset Draft … Placebo Slower Base preset of the custom settings; changing it resets Final temporal smoothing.
Final temporal smoothing TR2 0 – 3 1 Radius of the final temporal smoothing; more is more stable and softer.
Sharpness Sharpness 0 – 1.9 1.0 (0.2 with source matching) Amount of resharpening; written only when the check box is ticked.
Source matching SourceMatch off, basic, refined, 2xrefined off Corrects the result back towards the original fields; refined modes are slower and more accurate.
Match preset / Match preset 2 MatchPreset, MatchPreset2 presets not slower than the base preset default Presets of the source matching passes; default lets QTGMC choose.
Match enhance MatchEnhance 0 – 1000 0.5 How strongly the refined source matching adds back detail.
Lossless Lossless off, after temporal smooth, before resharpening off Puts the original field lines back into the output: after the final smoothing (truly lossless, may show shimmer or combing), or before resharpening (more stable, not exactly lossless).
EZDenoise / EZKeepGrain EZDenoise, EZKeepGrain 0 – 100 off Denoise, or keep grain, by this amount; the two exclude each other.
Noise preset NoisePreset Slower … Faster Fast Speed of the noise processing; only with EZDenoise or EZKeepGrain.
Denoiser Denoiser auto, FFT3D, dfttest, KNLMeansCL auto Denoiser used by the noise processing; auto lets QTGMC choose.
EdiExt EdiExt BWDif; with the torch add-on (Windows only) also DDD, DeF, MFDIN(old), MFDIN(old)-TRT off Use an external interpolated clip instead of QTGMC's own interpolation.
Addition – text empty Further QTGMC arguments, appended to the call as written.

Presets

A preset only fills in the values that are not given; every value set explicitly in Hybrid (on the Custom page or in Addition) overrides the preset. With any preset other than Custom and "Fast - grain", Hybrid passes only the preset, so the values below apply unchanged.

Preset settings

Values for Tuning "None" (QTGMC's default).

Setting Parameter Placebo Very Slow Slower Slow Medium Fast Faster Very Fast Super Fast Ultra Fast Draft
Motion search smoothing radius TR0 2 2 2 2 2 2 1 1 1 1 0
Shimmer removal smoothing radius TR1 2 2 2 1 1 1 1 1 1 1 1
Final temporal smoothing (Custom page) TR2 3 2 1 1 1 0 0 0 0 0 0
Repair of the motion search clip Rep0 4 4 4 4 3 3 0 0 0 0 0
Repair of the final output Rep2 4 4 4 4 4 4 4 4 3 3 0
Interpolation EdiMode NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 Bwdif Bob
NNEDI3 predictor area NNSize 1 (16x6) 1 (16x6) 1 (16x6) 1 (16x6) 5 (16x4) 5 (16x4) 4 (8x4) 4 (8x4) 4 (8x4) 4 (8x4) 4 (8x4)
NNEDI3 neurons NNeurons 2 (64) 2 (64) 1 (32) 1 (32) 1 (32) 0 (16) 0 (16) 0 (16) 0 (16) 0 (16) 0 (16)
EEDI3 search distance (only with an EEDI3 EdiMode) EdiMaxD 12 10 8 7 7 6 6 5 4 4 4
Resharpening mode SMode 2 2 2 2 2 2 2 2 2 2 0 (off)
Sharpness (Custom page) Sharpness 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0
Sharpness limiting SLMode 2 (temporal) 2 2 2 2 2 2 2 0 (off) 0 0
Sharpness limiting radius SLRad 3 1 1 1 1 1 1 1 1 1 1
Back blend Sbb 3 (both) 1 (before) 1 0 (off) 0 0 0 0 0 0 0
Motion search prefilter SrchClipPP 3 (Gauss + edge soften) 3 3 3 3 2 (Gauss) 2 2 1 (simple blur) 1 0 (none)
Sub-pixel accuracy SubPel 2 (1/2) 2 2 2 1 (full) 1 1 1 1 1 1
Block size BlockSize 16 16 16 16 16 16 32 32 32 32 32
Block overlap Overlap 8 8 8 8 8 8 16 8 8 8 8
Search method Search 5 (UMH) 4 (hexagon) 4 4 4 4 4 4 0 (one time) 0 0
Search range SearchParam 2 2 2 2 2 2 2 1 1 1 1
Search range at sub-pixel level PelSearch 2 2 2 2 1 1 1 1 1 1 1
Chroma in motion analysis ChromaMotion True True True False False False False False False False False
Vector coherence (from BlockSize) Lambda 400 400 400 400 400 400 1600 1600 1600 1600 1600
Precise algorithms Precise True True False False False False False False False False False
Noise processing (without EZDenoise/EZKeepGrain) NoiseProcess 2 (keep grain) 2 0 (off) 0 0 0 0 0 0 0 0
Match preset (default) MatchPreset Slow Medium Fast Faster Very Fast Super Fast Ultra Fast Ultra Fast Ultra Fast Ultra Fast –
Match preset 2 (default) MatchPreset2 Fast Faster Very Fast Super Fast Ultra Fast Ultra Fast Ultra Fast Ultra Fast Ultra Fast Ultra Fast –
  • With Source matching on, Sharpness defaults to 0.2 and SLMode to 0. Draft does not support source matching.
  • Tuning "DV-HD" (only through Addition) uses BlockSize 32 for every preset; Overlap is then 16 from Placebo to Faster.

Match preset settings

Interpolation values used by the source matching passes (Custom page, Source matching). The basic pass uses Match preset, the refined passes use Match preset 2; Draft is not available here.

Setting Parameter Placebo Very Slow Slower Slow Medium Fast Faster Very Fast Super Fast Ultra Fast
Interpolation of the basic pass MatchEdi same as EdiMode of the main preset Bwdif
Interpolation of the refined passes MatchEdi2 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 NNEDI3 Bob
NNEDI3 predictor area NNSize 1 (16x6) 1 (16x6) 1 (16x6) 1 (16x6) 5 (16x4) 5 (16x4) 4 (8x4) 4 (8x4) 4 (8x4) 4 (8x4)
NNEDI3 neurons NNeurons 2 (64) 2 (64) 1 (32) 1 (32) 1 (32) 0 (16) 0 (16) 0 (16) 0 (16) 0 (16)
EEDI3 search distance EdiMaxD 12 10 8 7 7 6 6 5 4 4

Noise preset settings

Used with EZDenoise or EZKeepGrain (Custom page, Noise preset), and with the noise processing that Placebo and Very Slow switch on (then always Fast). Denoiser auto takes the value of this table.

Setting Parameter Slower Slow Medium Fast Faster
Denoiser (Custom page) Denoiser dfttest dfttest dfttest FFT3D FFT3D
Motion-compensated denoising DenoiseMC True True False False False
Noise analysis radius NoiseTR 2 1 1 1 0
Deinterlacing of the noise NoiseDeint Generate Bob DoubleWeave DoubleWeave DoubleWeave
Noise stabilization StabilizeNoise True True True False False

EZDenoise and EZKeepGrain

Parameter neither (Placebo, Very Slow) EZDenoise = d EZKeepGrain = k
NoiseProcess 2 1 (denoise) 2 (keep grain)
Sigma 2.0 d 4 × k
GrainRestore 0.3 0.0 0.3 × √k
NoiseRestore 0.1 0.0 0.1 × √k

With the other presets and neither value set, noise processing is off.

Hybrid profile "Fast - grain"

"Fast - grain" runs Preset Fast and sets these values on top of it; everything not listed keeps the Fast value.

Setting Parameter Fast Fast - grain
Lossless Lossless 0 (off) 1 (after temporal smooth)
Sharpness Sharpness 1.0 0.3
Motion search smoothing radius TR0 2 2
Shimmer removal smoothing radius TR1 1 2
Repair of the motion search clip Rep0 3 1
Repair of the initial output Rep1 0 0
Repair of the final output Rep2 4 4
Block matching with DCT/SATD DCT 0 5
Scene change threshold 1 ThSCD1 180 300
Scene change threshold 2 ThSCD2 98 110
Back blend Sbb 0 0
Noise processing NoiseProcess 0 (off) 2 (keep grain)
Grain restored before final smoothing GrainRestore 0.0 0.0
Noise restored after final smoothing NoiseRestore 0.0 0.4
Noise stabilization StabilizeNoise False False
Noise analysis radius NoiseTR 0 (noise processing off) 0
Deinterlacing of the noise NoiseDeint DoubleWeave Bob

Example

Default settings on an 8-bit YUV 4:2:0 interlaced source (704x576, 25 fps, top field first):

# Deinterlacing using QTGMC
clip = qtgmc.QTGMC(clip, Preset="Fast", TFF=True, tools={'mv': 'mvutensils', 'expr': 'akarin', 'nnedi3': 'znedi3', 'eedi3': 'vszip', 'dfttest': 'neo_fft', 'nlmeans': 'knlm', 'bm3d': 'bm3d', 'rg': 'zsmooth', 'median': 'zsmooth', 'fft3d': 'neo_fft', 'grain': 'noise'}) # new fps: 50
# Making sure content is perceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
clip = clip[::2] # selecting previously even frames, new fps: 25

How Hybrid calls it

  • Field order: bottom field first sources run with TFF off, every other interlaced scan type with TFF on (detected scan type or Overwrite input scan type).
  • Output frame rate: QTGMC always doubles the frame rate; without Bob Hybrid keeps every second frame (Even or Odd), so the source rate stays.
  • Afterwards the clip counts as progressive. No decimation.
  • Works on 8–16-bit YUV (not 4:1:1) and 8-bit gray; 4:2:0 needs a frame size that is a multiple of 4.
  • With Custom, Hybrid always writes the base preset, Final temporal smoothing, Source matching and Lossless; Show settings and Show noise then only appear in the preview.
  • QTGMC is also used as the helper deinterlacer of TIVTC, VIVTC, TFMBob and Fix combed with deinterlacer.

Background

QTGMC (by -Vit-) is a rewrite of Didée's TempGaussMC for AviSynth; the VapourSynth version descends from the havsfunc port (QTGMC 3.33). Hybrid ships its own maintained copy of that script, in which the implementation of each plugin can be chosen. Presets are not case sensitive; every other argument overrides what the preset sets. QTempGaussMC from vs-jetpack is a separate rewrite with different parameters and scales; settings cannot be carried over between the two.

Sources