Vapoursynth LUTDeCrawl: Difference between revisions

From wiki.selur.net
Jump to navigation Jump to search
New filter page (via create-page on MediaWiki MCP Server)
 
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server)
 
Line 19: Line 19:
| Max diff (checkbox) || usemaxdiff || on/off || on || Use the current-frame limit; off is about 30 % faster but gives more artifacts.
| Max diff (checkbox) || usemaxdiff || on/off || on || Use the current-frame limit; off is about 30 % faster but gives more artifacts.
|-
|-
| Max diff || maxdiff || 0 – 255 || 50 || Largest luma difference between the current pixel and the neighbor frames that still counts as dot crawl; should not be below Threshold (Y).
| Max diff || maxdiff || 0 – 255 || 50 || Largest luma difference between the current pixel and the neighbor frames that still counts as dot crawl; Hybrid keeps it at or above Threshold (Y).
|-
|-
| Scene change || scnchg || 0 – 100 || 25 || Scene change threshold (8-bit scale); frames that are a scene change to the previous or next frame are not processed.
| Scene change || scnchg || 0 – 255 || 25 || Scene change threshold (8-bit scale); frames that are a scene change to the previous or next frame are not processed. Disabled with the SCD tool mv.
|-
|-
| Mask || mask || on/off || off || Shows the detection mask in the preview instead of the picture, to tune the thresholds; scene changes are not shown.
| Mask || mask || on/off || off || Shows the detection mask in the preview instead of the picture, to tune the thresholds; scene changes are not shown.
Line 27: Line 27:
| Tools: Expr || – || akarin, cranexpr, std || akarin || Expression backend; akarin needs AVX2.
| Tools: Expr || – || akarin, cranexpr, std || akarin || Expression backend; akarin needs AVX2.
|-
|-
| Tools: SCD || – || scd, misc, std, mv || scd || Scene change detection; misc is Windows only, with mv fixed motion thresholds are used and Scene change is ignored.
| Tools: SCD || – || scd, misc, std, mv || scd || Scene change detection; misc is Windows only. With mv the motion thresholds thSCD1 / thSCD2 are used instead of Scene change.
|-
| Tools: thSCD1 / thSCD2 || scd_thscd1, scd_thscd2 || 1 – 16320 / 0 – 255 || 400 / 130 || Scene change thresholds of the SCD tool mv (SAD per block, and the share of changed blocks on a 0 – 255 scale); only enabled with mv, written when they differ from the defaults.
|}
|}


== Example ==
== Example ==
Default settings on a 10-bit YUV 4:2:0 source (640x356):
Default settings on a 10-bit YUV 4:2:0 source (640x356):
<syntaxhighlight lang="python">
<pre>
# anti decrawling using LUTDeCrawl
# anti decrawling using LUTDeCrawl
clip = decrawl.LUTDeCrawl(clip, tools={'expr': 'akarin', 'scd': 'scd'})
clip = decrawl.LUTDeCrawl(clip, tools={'expr': 'akarin', 'scd': 'scd'})
</syntaxhighlight>
</pre>


== How Hybrid calls it ==
== How Hybrid calls it ==

Latest revision as of 09:50, 16 November 2026

LUTDeCrawl is Scintilla's temporal dot crawl remover: luma pixels that look like crawl are replaced by a mix of the current frame and the average of its neighbors.

Filtering → Vapoursynth → DeCrawl

LUTDeCrawl controls in Hybrid
LUTDeCrawl controls in Hybrid

What it does

A luma pixel counts as dot crawl when its values in the previous and the next frame are close (Y threshold), the chroma in those frames is close as well (C threshold) and – with Max diff on – the current pixel does not differ too much from either neighbor. Such pixels get the average of the previous and next luma, mixed 50/50 with the current luma. Chroma is never changed, and frames next to a scene change are left alone.

Settings

Control Parameter Range / values Hybrid default Meaning
Threshold (Y) ythresh 0 – 255 10 Largest luma difference between the previous and next frame for a pixel to count; higher catches more crawl but adds artifacts (original advice: not above about 20).
Threshold (C) cthresh 0 – 255 10 The same test for the chroma (U and V); always applied.
Max diff (checkbox) usemaxdiff on/off on Use the current-frame limit; off is about 30 % faster but gives more artifacts.
Max diff maxdiff 0 – 255 50 Largest luma difference between the current pixel and the neighbor frames that still counts as dot crawl; Hybrid keeps it at or above Threshold (Y).
Scene change scnchg 0 – 255 25 Scene change threshold (8-bit scale); frames that are a scene change to the previous or next frame are not processed. Disabled with the SCD tool mv.
Mask mask on/off off Shows the detection mask in the preview instead of the picture, to tune the thresholds; scene changes are not shown.
Tools: Expr – akarin, cranexpr, std akarin Expression backend; akarin needs AVX2.
Tools: SCD – scd, misc, std, mv scd Scene change detection; misc is Windows only. With mv the motion thresholds thSCD1 / thSCD2 are used instead of Scene change.
Tools: thSCD1 / thSCD2 scd_thscd1, scd_thscd2 1 – 16320 / 0 – 255 400 / 130 Scene change thresholds of the SCD tool mv (SAD per block, and the share of changed blocks on a 0 – 255 scale); only enabled with mv, written when they differ from the defaults.

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356):

# anti decrawling using LUTDeCrawl
clip = decrawl.LUTDeCrawl(clip, tools={'expr': 'akarin', 'scd': 'scd'})

How Hybrid calls it

  • LUTDeCrawl works on 8- and 10-bit YUV; other formats are converted first. It expects progressive material.
  • Thresholds are entered on the 8-bit scale; the script scales them to the bit depth, and the scene change value is turned into a fraction (25 ≈ 0.098).
  • The mask is only shown in the preview; an encode always gets the filtered picture with its chroma.
  • Values are only written when they differ from the defaults, which equal the script's own defaults.
  • LUTDeCrawl also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

The script

LUTDeCrawl was written for AviSynth by Scintilla in 2008 and ported to VapourSynth in havsfunc; the current havsfunc no longer documents it, and Hybrid uses its own copy. The original documentation rates its speed as medium (faster than VagueDenoiser, slower than HQDN3D).

Sources