Vapoursynth STPresso

From wiki.selur.net
Revision as of 09:53, 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

STPresso ("Spatio-Temporal Pressdown") by Didée dampens grain only a little: the original look stays, but the clip becomes noticeably easier to compress.

Filtering → Vapoursynth → DeGrain

STPresso controls in Hybrid
STPresso controls in Hybrid

What it does

  1. A limited spatial pass (RemoveGrain or a median): at most Limit change, of which Bias percent is applied.
  2. A limited temporal pass with FluxSmoothT on motion-compensated neighbor frames: threshold Threshold, at most Limit change, Bias percent applied.
  3. A Back step that pulls every change back toward the source.

Settings

Control Parameter Range / values Hybrid default Meaning
Limit limit 1 – 100 3 Maximum change of the spatial part (8-bit scale).
Bias bias 1 – 100 24 Percentage of the spatial filter that is applied; 20 is light, 33 already strong.
RemoveGrain RGmode 0 – 24 4 Spatial filter: mode 4 is a median, 11/12/19/20 a convolution, other modes RemoveGrain.
Planes planes all, chroma only, luma only, only U, only V, only Y,U, only Y,V all Planes that are processed.
Temporal threshold tthr 0 – 64 12 FluxSmooth threshold; can be set higher than usual. 0 skips the temporal part.
Temporal limit tlimit 1 – 100 3 Maximum change of the temporal part (8-bit scale).
Temporal bias tbias 1 – 100 49 Percentage of the temporal filter that is applied.
Back back 0 – 100 1 How far every change is pulled back toward the source; 0 skips this step.
Tools: MV tools mvutensils, mv, mvgpu mvutensils (mvgpu with a discrete GPU on R82) Motion vector implementation.
Tools: Expr tools akarin, cranexpr, std akarin (std without AVX2) Expression evaluator.
Tools: RG / Median / FluxSmooth tools zsmooth, neo_smo / zsmooth, std / zsmooth zsmooth Implementations of the spatial and temporal filters.

Example

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

# removing grain using STPresso
clip = degrain.STPresso(clip, tools={'mv': 'mvutensils', 'expr': 'akarin', 'rg': 'zsmooth', 'median': 'zsmooth', 'fluxsmooth': 'zsmooth'})

How Hybrid calls it

  • STPresso works on 8–16-bit integer YUV; Limit, Temporal threshold, Temporal limit and Back are on the 8-bit scale and scaled by the script.
  • All values are only written when they differ from the defaults; the Tools choice is always written.
  • STPresso also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

The script

The VapourSynth port follows Didée's AviSynth STPresso. The motion search uses block size 16 with overlap 8 and one frame on each side.

Sources