Avisynth TIVTC
TIVTC is the inverse telecine pair TFM + TDecimate by tritical: TFM matches fields to rebuild the progressive frames of telecined video, TDecimate then removes the duplicates (one in five for NTSC film, or down to any target rate). It can also handle sources that mix film and video.
Filtering → (De-)Interlace/Telecine → Deinterlacer (entry "TIVTC (Avisynth)")
What it does
Telecined film has fields of neighbouring film frames mixed into the video frames, see Interlace. For every frame TFM picks the field pairing with the least combing; frames that stay combed are post-processed (deinterlaced), either by TFM itself or with frames from a helper deinterlacer. TDecimate compares neighbouring frames and drops the most similar ones per cycle, or decimates to an arbitrary rate.
Requirements
- 8-bit material only. The FFTW library ships with Hybrid.
- OpenCL for the helper deinterlacers NNEDI3 and EEDI3 needs an OpenCL-capable GPU.
Settings
Options are only written when they differ from the plugin's defaults.
| Control | Parameter | Range / values | Hybrid default | Meaning |
|---|---|---|---|---|
| TFM | ||||
| Mode | mode | 0–7 | 1 (2-way match + 3rd match on combed) | Which matches are tried; higher modes try more and are more aggressive. |
| PP | PP | 0–7 | 6 (motion-adaptive cubic) | Post-processing: 0 none, 1 detect only, 2–4 dumb blend / cubic / modified ELA, 5–7 motion-adaptive blend / cubic / ELA. |
| MThresh | mthresh | 0–100 | 5 | Motion threshold of the motion-adaptive post-processing (PP 5–7). |
| FM Speed | slow | normal, slower, slowest | slower | Speed and accuracy of the match metric. |
| MChroma | mChroma | on/off | on | Include chroma in the match decision. |
| Mic match | micmatching | 0–4 | 1 | How the combing values are used to override match decisions. |
| Scene threshold | scthresh | 0–100 | 12 | Scene change threshold in percent. |
| U/B, Mic match (sco) | ubsco, mmsco | on/off | on / on | When on, u/b matches and mic-based match changes are only used at scene changes. |
| y0 / y1 | y0, y1 | 0–8192 | 0 / 0 | Rows excluded from the match decision (for example subtitles). |
| Metric | metric | 0–1 | 0 | Combing metric. |
| Block (X/Y) | blockx / blocky | 4–1024 | 16 / 16 | Block size of the combed-frame detection. |
| Chroma threshold | cthresh | −1–255 | 9 | Combing threshold (8-bit scale). |
| Chroma | chroma | on/off | off | Include chroma in the combed-frame detection. |
| MI | MI | up to Block X × Block Y | 80 | Combed pixels in one block above which a frame counts as combed. |
| Deinterlacer | clip2 | inner, QTGMC fast / medium / slow / Very Slow, nnedi3, Yadif, BWDIF, EEDI3 | inner | Source of the replacement frames for combed frames: TFM's own post-processing or a same-rate helper clip (QTGMC, NNEDI3, Yadif (YV12 only), BWDIF, EEDI3). |
| OpenCL / device | – | on/off, 0–15 | off / 0 | NNEDI3CL / EEDI3CL on the GPU for the helper clip. |
| TDecimate | ||||
| Mode | mode | 0, 1, 2, 7 | 0 | 0: drop the most similar frame of each cycle; 1: drop from the longest duplicate run; 2: arbitrary rate; 7: arbitrary rate with duplicate/video thresholds. |
| Cycle / CycleR | cycle, cycleR | 2–100 / 1–4 | 5 / 1 | Per Cycle frames, CycleR frames are dropped (modes 0 and 1). |
| Hybrid | hybrid | no handling, blend 30p→24p keep 24p, blend 24p→30p keep 30p | no handling | Handling of mixed film/video material (modes 0 and 1, CycleR 1). |
| no blend | noblend | on/off | on | Do not blend frames; only with Hybrid on no handling (modes 0 and 1). |
| VidDetect / ConCycle | vidDetect, conCycle | A, B, A or B, A and B, A and (B or C) / 1–2 | A and B / 1 | Tests that mark a cycle as video, and how many cycles in a row must be video (modes 0 and 1, hybrid handling). |
| SDLim | sdlim | −10–10 | 0 | Minimum distance between two dropped frames (CycleR above 1). |
| Rate | rate | frame rate list | 23.976 fps | Target frame rate (modes 2 and 7). |
| Max ndl | maxndl | 0–1024 | 0 | Largest number of non-duplicates in a row (mode 2; 0 = the plugin decides). |
| m2PA | m2PA | on/off | off | Mode 2 analyzes the whole cycle ahead (mode 2). |
| DupThresh | dupThresh | 0–100 | 1.1 (mode 1), 0.4 (mode 7) | Difference in percent below which a frame counts as a duplicate. Mode 1 only with CycleR 1 and hybrid handling; mode 7 always. Changing the mode sets the plugin's default for it. |
| VidThresh | vidThresh | 0–100 | 3.5 | Difference above which a frame counts as video (mode 7). |
| SceneThresh | sceneThresh | 0–100 | 15 | Difference that counts as a scene change (mode 7). |
| DenoiseThresh (check box + value) | nt | 0–10 | off / 0 | Noise threshold; only written when ticked. |
| Block (X/Y), Chroma, Denoise, SSD, Display | blockx / blocky, chroma, denoise, ssd, display | – | 32 / 32, on, off, off, off | Metric block size, chroma in the metrics, denoising before the metrics, squared differences, and printing the metrics onto the frame. |
Example
Default settings on a telecined 8-bit source with top field first (the sample is a PAL-sized 720×576 clip; Hybrid declares the field order first) and the conversion to 10 bit for the encoder:
# deinterlacing AssumeTFF() TFM().AssumeFrameBased() TDecimate() AssumeFrameBased() # Converting from 8 to 10bit for encoder ConvertBits(10)
How Hybrid calls it
- TIVTC works on 8-bit planar YUV (YV12, YV16, YV24, YV411); other formats are converted first.
- The field order is declared first from the scan type (
AssumeTFF()orAssumeBFF()). With a helper deinterlacer chosen, Hybrid builds a same-rate progressive clip first (QTGMC with half the frames, NNEDI3 or EEDI3 withfield=-1,Yadif(0),BWDIF(-1)) and passes it to TFM asclip2. - Values equal to the plugin's defaults are left out, so the default call is
TFM()andTDecimate(). Mode-dependent options are only written for their mode: modes 0 and 1 writecycleRandcycle; with CycleR 1 eithernoblendorhybridwithvidDetect,conCycle,sdlim(anddupThreshin mode 1); modes 2 and 7 writerate(if not 23.976) and their thresholds. - The result is progressive with reduced frame rate (29.97 → 23.976 fps with 5/1). Soft-telecined DGDecNV sources skip the inverse telecine. For plain NTSC telecine the automatic handling picks TIVTC.
Background
TIVTC was written by tritical (version 1.0.5); the current build is pinterf's TIVTC 1.0.32, which also has TDeint and TMM. The plugin has more options than Hybrid offers, for example the TDecimate modes 3 to 6 and the use of hint and override files.
See also: Vapoursynth TIVTC, Avisynth TDeint, Avisynth Decomb
Sources
- TIVTC on GitHub (TFM and TDecimate documentation)
- Doom9 thread: TDeint and TIVTC
- Hybrid's tooltips
- The AviSynth+ documentation does not cover TIVTC.