Vapoursynth DAA

From wiki.selur.net
Revision as of 09:48, 16 November 2026 by Selur (talk | contribs) (New filter page (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

DAA is Didée's anti-aliasing with contra-sharpening: NNEDI3 interpolates both fields, the two results are averaged, and a limited sharpening step brings back the lost detail.

Filtering → Vapoursynth → Line

DAA controls in Hybrid
DAA controls in Hybrid

What it does

NNEDI3 bobs the clip, so each frame is rebuilt once from its top and once from its bottom field. Averaging the two blurs the aliasing away. The difference between the averaged picture and a blurred copy is added back as contra-sharpening, limited by Repair (mode 13) against the change to the source, so it cannot sharpen more than the averaging removed. DAA helps against aliasing from poor deinterlacing or upscaling.

Settings

All settings except the Tools are passed to NNEDI3.

Control Parameter Range / values Hybrid default Meaning
NSize nsize 8x6, 16x6, 32x6, 48x6, 8x4, 16x4, 32x4 32x4 Neighborhood the predictor network 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 Prescreener that decides which pixels get the network and which a simple cubic interpolation. With sneedif only old and level 0 are offered.
PreScreener (int16) int16_prescreener on/off on Prescreener uses 16-bit integer instead of float arithmetic; znedi3 only.
Predictor (int16) int16_predictor on/off on Predictor uses 16-bit integer instead of float arithmetic; znedi3 only.
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).
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 implementation.

Example

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

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

How Hybrid calls it

  • DAA works on 8–16-bit integer YUV and RGB clips with width and height divisible by 4; other formats are converted first.
  • Values are only written when they differ from the defaults, which equal the NNEDI3 plugin defaults. List values are passed as index numbers.
  • Settings the chosen NNEDI3 implementation does not know (Exp and the int16 options outside znedi3) are left out of the call.
  • NNEDI3 runs in bob mode and reads the field order from the frame properties, which Hybrid's scripts set.
  • DAA also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

The script

The VapourSynth version comes from the old havsfunc collection. Its notes explain that the two interpolations work between pixels an odd distance apart, so their average blurs enough to need contra-sharpening. The sharpening uses a 3×3 box blur for clips wider than 1100 pixels, otherwise a weighted 3×3 blur. DAAMod is a modified variant.

Sources