Vapoursynth DAAMod

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

DAAMod is GMJCZP's modification of Didée's DAA: anti-aliasing by averaging two NNEDI3 field interpolations, followed by a cleaned contra-sharpening with a selectable Repair limit.

Filtering → Vapoursynth → Line

DAAMod controls in Hybrid
DAAMod controls in Hybrid

What it does

Like DAA, NNEDI3 rebuilds each frame from both fields and the two results are averaged, which removes aliasing. The contra-sharpening difference is first cleaned with VerticalCleaner and then limited with a Repair mode of your choice before it is added back.

Settings

Control Parameter Range / values Hybrid default Meaning
NSize nsize 8x6, 16x6, 32x6, 48x6, 8x4, 16x4, 32x4 32x4 Neighborhood the NNEDI3 predictor looks at.
NNS nns 16, 32, 64, 128, 256 32 Neurons in the predictor network; more is slower with small gains.
Quality qual 1 – 2 1 Number of network predictions that are blended.
PScrn pscrn no, old, level 0, level 1, level 2 level 0 NNEDI3 prescreener; with sneedif only old and level 0 are offered.
Exp exp 0 – 2 0 Accuracy of the exp approximation in the predictor (0 fastest, 2 most accurate); znedi3 only (enabled only with the znedi3 tool).
Repair rep 0 – 18 9 Repair mode that limits the contra-sharpening against the change to the source; 0 = no limiting.
Tools: NNEDI3 – znedi3, sneedif, nnedi3vk, vszipcu znedi3 Implementation: znedi3 (CPU, all settings), sneedif (OpenCL), nnedi3vk (Vulkan), vszipcu (NVIDIA CUDA); a Device field appears for the GPU ones.
Tools: RG – zsmooth, neo_smo zsmooth Repair/VerticalCleaner implementation.

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356):

# Anti Aliasing using DAAMod
clip = antiAliasing.daamod(clip, tools={'nnedi3': 'znedi3', 'rg': 'zsmooth'})

How Hybrid calls it

  • DAAMod works on 8–16-bit integer YUV clips with width and height divisible by 4; other formats are converted first.
  • Values are only written when they differ from the defaults (NNEDI3's own defaults and Repair 9). List values are passed as index numbers.
  • Exp is dropped when the chosen NNEDI3 implementation is not znedi3.
  • NNEDI3 runs in bob mode and reads the field order from the frame properties, which Hybrid's scripts set.
  • DAAMod also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

Difference to DAA

DAA always limits with Repair mode 13. DAAMod adds a VerticalCleaner (mode 2) pass on the sharpening difference and makes the Repair mode selectable. The sharpening blur is a 3×3 box above 1000 pixels width, otherwise a weighted 3×3 blur. DAAMod has no int16 options.

Sources