Avisynth TTempSmooth

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

TTempSmooth is a motion-adaptive temporal smoother. It averages each pixel with the same pixel in neighboring frames, but leaves out neighbors that differ too much, so moving areas stay sharp while static noise is smoothed.

Filtering → Avisynth → DeNoise

TTempSmooth controls in Hybrid
TTempSmooth controls in Hybrid

What it does

Each pixel is averaged with the same pixel in up to Max radius frames before and after. A neighbor is used only if its difference is below the threshold. The bigger the difference or the temporal distance, the smaller its weight. A scene change threshold stops the averaging across cuts. Good for steady, low-level noise in clips with little motion.

Settings

Control Parameter Range Hybrid default Meaning
Max radius maxr 1–7 3 Maximum temporal radius (3 to 15 frames in the window). Higher is more stable but slower.
Strength strength 1–8 2 Shifts where the distance weights fall off; Max radius + 1 or higher gives equal weights.
Luma thresh / diff thresh / mdiff 1–256 / 0–255 4 / 2 Largest difference that is still used / differences up to this get full weight (8-bit scale).
Chroma thresh / diff thresh / mdiff 1–256 / 0–255 5 / 3 Same for U and V (one pair of controls for both).
Scene thresh scthresh 0–100 12.00 Scene change threshold, in percent of the maximum luma change; 0 switches scene change detection off.
Fix point average fp on/off on Weight not given to outer pixels is added back to the center pixel; usually better in motion.

Example

Default settings on a 10-bit YUV 4:2:0 source (no conversion is needed):

last.neo_smo_TTempSmooth()

How Hybrid calls it

  • Hybrid loads neo-smo.dll and calls neo_smo_TTempSmooth. neo-smo has no implicit last, so Hybrid writes last. in front when no variable is used.
  • Only values that differ from the defaults are written. Threshold and difference values are written as arrays (Y, U, V) on the 8-bit scale at every bit depth.
  • Gray and planar YUV with 8–16 bit integer or float samples are accepted, with even width and height. RGB and YUY2 are converted first.
  • There is no interlaced option; Hybrid splits fields for interlaced input before the filter.
  • TTempSmooth also offers the common options and can be added to the filter queue several times.

Background

The original TTempSmooth is by tritical and handles only 8-bit YV12 and YUY2. Hybrid uses the version in neo-smo (HomeOfAviSynthPlusEvolution), which is a port of the zsmooth plugin by adworacz. Its output matches the old plugin within ±2 on about 0.3 % of the pixels at 8 bit.

The plugin's scene change detection is built in, no extra plugin is needed. neo-smo also supports a prefilter clip and a plane selection, which Hybrid does not offer. Fix point average is a weighting rule, not a precision setting.

See also: Vapoursynth TTempSmooth

Sources