Vapoursynth SangNom

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

SangNom is an edge-directed single-field interpolator. Used on its own it is a simple and fast anti-aliasing filter: it keeps one field and rebuilds the other lines along the detected edge directions.

Filtering → Vapoursynth → Line

SangNom controls in Hybrid
SangNom controls in Hybrid

What it does

SangNom drops every second line and interpolates it again, following the direction of the edges around it. Jagged lines come out smoother. Because only one field of the original lines is kept, fine vertical detail can suffer. AAF, MAA and Santiag use SangNom internally in both directions with extra protection.

Settings

Control Parameter Range / values Hybrid default Meaning
Order order 1, 2 1 Field that is kept: 1 = top field, 2 = bottom field; the other one is interpolated.
AA aa (luma) 0 – 128 48 Anti-aliasing strength on the luma.
AAC aa (chroma) 0 – 128 0 Anti-aliasing strength on the chroma.

Example

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

# applying AA using SangNom
clip = core.sangnom.SangNom(clip, aa=[48,0])

How Hybrid calls it

  • SangNom works on 8–16-bit integer and 32-bit float YUV clips with width and height divisible by 4 (every plane needs an even height); other formats are converted first.
  • Hybrid runs it on progressive video (after deinterlacing); the frame count does not change.
  • Order is only written when it is not 1. AA and AAC are always written; AAC applies to both chroma planes.
  • The strengths are given on the 8-bit scale; the plugin scales them itself.
  • SangNom also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

Plugin

VapourSynth-SangNom by dubhater is a port of SangNom2 for AviSynth. The plugin also has an order 0 that doubles the frame rate and needs a field-separated, double-woven clip; Hybrid does not offer it. The plugin's own default strength is 48 on every plane; SangNom2 used 48 for luma and 0 for chroma, like Hybrid's defaults.

Sources