Vapoursynth DDD

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

DDD (Deep Deinterlacing) is a neural-network deinterlacer: temporally aware models rebuild every field as a full frame.

Filtering → (De-)Interlace/Telecine → Deinterlacer

DDD controls in Hybrid
DDD controls in Hybrid

What it does

The networks look at three neighboring fields at a time and reconstruct the missing lines of each field. The native output has one frame per field (double rate); Hybrid can drop every second frame to keep the source rate.

Requirements

  • Windows with the torch add-on.
  • An NVIDIA graphics card with CUDA.
  • Without the add-on's DDD models the entry is not offered.

Settings

Control Parameter Range / values Hybrid default Meaning
Method – (function) DDD, DeF DDD DDD is the fastest network with the lowest quality; DeF is slower and better.
Bob – on/off on On: keep all frames (double rate). Off: keep every second frame (source rate).
Field – even, odd even Which output frames are kept when Bob is off; only enabled then.
TTA tta on/off off Test-time augmentation: slightly better quality at about four times the cost.
FP16 fp16 on/off on Half-precision inference, roughly twice as fast.

Example

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

# adjusting color space from YUV420P8 to RGBS for vsDDD
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_in_s="limited", range_s="full")
clip = vs_deepdeinterlace.DDD(clip, tff=True, fp16=True, device="cuda")
# Making sure content is perceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive

How Hybrid calls it

  • The clip is converted to 32-bit float RGB (the only format the models accept), deinterlaced on the CUDA device, and converted back later.
  • Field order: taken from the detected scan type or Overwrite input scan type; bottom field first runs as BFF, every other interlaced scan type as TFF.
  • Output frame rate: double with Bob; otherwise every second frame is kept and the source rate stays.
  • Afterwards the clip counts as progressive. No decimation.
  • The same models can serve as the external interpolation (EdiExt) of QTGMC.

Background

The models come from pifroggi's vs_deepdeinterlace. The package has a third, best network, DfConvEkSA (five fields, optional motion compensation). Hybrid does not offer it: it needs mmcv 2.0.0 or newer, which caused problems.

Sources