Vapoursynth CCD

From wiki.selur.net
Revision as of 09:47, 16 November 2026 by Selur (talk | contribs) (Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CCD (Camcorder Color Denoise) removes color noise and leaves the luma detail alone. It was written by Sergey Stolyarevsky for VirtualDub, originally for low-resolution camcorder footage.

Filtering → Vapoursynth → DeNoise

CCD controls in Hybrid
CCD controls in Hybrid

What it does

For each pixel, the color of a sparse set of neighbors is averaged – but only the neighbors whose color is within Threshold of the pixel. Colored edges therefore stay, while blotchy color noise is evened out. With a radius above 0 the neighbor frames are included.

Settings

Control Parameter Range / values Hybrid default Meaning
Threshold threshold 0.01 – 100 4 Color distance up to which a neighbor counts; higher denoises more (4–10 is a good range). Hybrid runs CCD on RGB, so this is an RGB distance.
Radius temporal_radius 0 – 10 0 Frames on each side; 0 = spatial only.
Points (low / medium / high) points on/off each on / on / off Which sampling points are used: near, middle and far ones. Far points catch coarse noise but let more color bleed across edges; with none ticked there is nothing to average.
Scale scale automatic, 1 – 10 automatic Size of the sampling matrix: 1 = 25×25, 2 = 50×50, …; automatic follows the frame height.
Tools: CCD – zsmooth, neo_smo zsmooth Plugin that provides CCD; both give the same result.

Example

Default settings on a 10-bit YUV 4:2:0 source:

# adjusting color space from YUV420P10 to RGB30 for vsCCD
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_in_s="limited", range_s="full")
# chroma denoising using CCD
clip = core.zsmooth.CCD(clip, threshold=4.00, points=[True,True,False])

How Hybrid calls it

  • CCD runs on RGB; Hybrid converts the clip to RGB before and back afterwards.
  • The threshold and the sampling points are always written, the radius only when it is not 0, the scale only when its check box is ticked. The plugin scales the threshold to the bit depth.
  • CCD also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

zsmooth and neo_smo

zsmooth's CCD accepts 8–16-bit integer and 16/32-bit float RGB or YUV clips; for YUV its documentation suggests about half the RGB threshold. It can also take a reference clip for the weights, which Hybrid does not use. neo_smo is a C++ port of zsmooth that offers the same function, also for AviSynth+.

Sources