Avisynth Deen (new)

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

Deen (new) is a thresholded neighbourhood smoother with separate thresholds for luma and chroma. It is a fast, light denoiser, spatial or spatio-temporal.

Filtering → Avisynth → DeNoise

Deen (new) controls in Hybrid
Deen (new) controls in Hybrid

What it does

Every pixel is averaged with the pixels in a square window around it, but neighbours that differ by more than the threshold are not allowed to pull the result away. This smooths flat noisy areas and leaves edges alone. The 2d modes work inside one frame; the 3d modes also use the previous and next frame and have a scene change detector, so frames after a cut are not blended with frames before it.

Modes:

  • c: rejected pixels are replaced by the centre pixel, then the whole window is averaged.
  • a: the threshold shrinks with the distance from the centre and only accepted pixels are averaged.
  • w: rejected pixels are replaced by the centre pixel and the average is weighted by distance. In 3d modes the frames are weighted 2:1:1 (current, previous, next).

"Deen (new)" is not the old deen.dll. It uses the Deen function of the neo-smo plugin.

Settings

Control Parameter Range / values Hybrid default Meaning
Mode mode a2d, a3d, c2d, c3d, w2d, w3d c3d Averaging type (a, c, w) and spatial (2d) or spatio-temporal (3d) processing.
Radius radius 3×3, 5×5, 7×7, 9×9 (11×11, 13×13, 15×15 in 2d modes only) 3×3 Size of the window.
Luma threshold (Y/UV) threshold 0–255 / 0–255 7 / 9 Largest difference that is still averaged, for luma and for chroma (8-bit scale).
Temporal threshold (Y/UV) temporal_threshold 0–255 / 0–255 4 / 6 The same for the neighbouring frames; only in 3d modes.
Min minimum 0.0–1.0 0.5 Smallest factor the threshold shrinks to at the window edge; 1.0 = no shrinking. Only in a and w modes.
SCD scenechange 0–100 % 9 Percentage of changed luma at which a frame counts as scene change; only in 3d modes.

Example

Default settings on a 10-bit YUV 4:2:0 source (no conversions are added):

last.neo_smo_Deen(mode="c3d",scenechange=23)

How Hybrid calls it

  • Hybrid loads neo-smo.dll and calls neo_smo_Deen.
  • Mode is always written. Radius only when not 3×3. The thresholds are written as lists (luma, chroma, chroma) with scalep=true when they differ from 7/9 and 4/6, so they keep their 8-bit meaning at any bit depth. Min is only written in a and w modes when not 0.5.
  • In 3d modes SCD is always written, converted from percent to the plugin's 1–254 scale (9 % becomes 23).
  • Gray and planar YUV with 8–16 bit or float are accepted. RGB and YUY2 are converted first. Interlaced sources are processed field by field.
  • Deen (new) also offers the common options and can be added to the filter queue several times.

Background

  • neo-smo is a C++ port of zsmooth, available for AviSynth+ and VapourSynth in one DLL. Deen appeared in version 0.9.1; Hybrid ships 0.9.3.
  • The first and last frame fall back to 2d processing. If one neighbour frame lies across a cut, both temporal neighbours are dropped.
  • The plugin offers a separate radius per plane and the scene change modes off (0) and frame properties (−1); Hybrid does not offer them. The author notes that it is not a drop-in replacement for the old Deen.

Sources