Avisynth CCD

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

CCD (Camcorder Color Denoise) removes blotchy color noise, as typical for camcorder and similar sources. On YUV input it leaves the luma untouched.

Filtering → Avisynth → DeNoise

CCD controls in Hybrid
CCD controls in Hybrid

What it does

For each pixel, CCD looks at a sparse set of neighboring points and averages their color. Only neighbors whose color is within the Threshold of the pixel are used, so colored edges stay sharp. With a Radius above 0, neighboring frames take part as well.

  • On YUV input only the chroma planes (U and V) are filtered.
  • On RGB input all three planes are filtered.

The original algorithm is by Sergey Stolyarevsky, from a VirtualDub filter.

Settings

Control Parameter Range Hybrid default Meaning
Threshold threshold 0.01–100 4.00 Largest color distance at which a neighbor still counts. Higher values denoise more. The distance is measured in the clip's own color space, so YUV needs about half the value that RGB needs.
Radius temporal_radius 0–10 0 Number of frames on each side that are included. 0 means spatial only.
Points low / medium / high points on/off each on / on / off Which sampling points are used: four near points (low), eight middle points (medium), twelve far points (high). At least one has to be on.
Scale scale 1–10 off (automatic) Multiplier of the 25×25 sampling matrix (1 = 25×25, 2 = 50×50). The value box is only active while the check box is ticked. When off, the scale is chosen from the frame height and never goes below 1.

Example

Default settings on a 10-bit YUV 4:2:0 source. No conversion is needed:

last.neo_smo_CCD(threshold=4.00,scale=last.zNeoSmoCCDScale())

How Hybrid calls it

  • Hybrid loads neo-smo.dll and calls its neo_smo_CCD function. The plugin has no implicit last, so Hybrid writes it explicitly.
  • The threshold and the scale are always written. In automatic mode the scale comes from a helper function that follows the plugin's own rule (frame height ÷ 240, for YUV the chroma height) but never goes below 1, because the plugin refuses smaller scales. temporal_radius and points are only written when they differ from the defaults.
  • Accepted formats: planar YUV (including 4:1:1) and planar RGB, 8–16 bit and float. Gray is not supported. Hybrid adds no conversion.
  • CCD has no interlaced mode.
  • CCD also offers the common options and can be added to the filter queue several times.

Background

CCD comes from the neo-smo plugin (spatial and temporal filtering, GPL), which ports filters from zsmooth. It replaces the old VirtualDub-based CCD. Threshold values of the old filter cannot be reused: an old value of 30 on chroma roughly corresponds to 4 here on 4:4:4.

For subsampled YUV the luma is bilinearly resized to the chroma size and used as reference, so results can differ slightly from Vapoursynth CCD. That filter has the same parameters, ranges and defaults, but converts the clip to RGB first and so denoises all planes.

The plugin also accepts a separate reference clip, which Hybrid does not use.

Sources

  • neo-smo (README and CCD documentation)
  • Hybrid's tooltips
  • The AviSynth+ documentation does not cover CCD.