Avisynth BiFrost

From wiki.selur.net
Revision as of 19:49, 21 November 2026 by Selur (talk | contribs) (Avisynth filter documentation (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BiFrost is a temporal filter against rainbows, the cross-colour shimmer that appears in the chroma of composite or poorly decoded video.

Filtering → Avisynth → DeRainbow

BiFrost controls in Hybrid
BiFrost controls in Hybrid

What it does

BiFrost works block by block. It looks for blocks where the luma stays almost the same between frames but the chroma flickers. Such blocks are treated as rainbows and their chroma is replaced using the neighbouring frames. Moving areas keep their chroma.

Settings

Control Parameter Range Hybrid default Meaning
Conservative mask conservative_mask on/off off On: only pixels detected as rainbow are processed. Off: pixels with rainbow above and below are processed too.
Luma threshold luma_thresh 0–255 10 Blocks whose luma changes less than this are treated as static and may be processed.
Variation variation 1–255 5 Chroma change needed to count as rainbow. Higher values give fewer false positives.
Block x/y blockx / blocky 4–254 (step 2) 4 / 4 Block size used for detection.

Example

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

# chroma denoising
BiFrost(interlaced=false)

How Hybrid calls it

  • Hybrid loads Bifrost.dll and calls BiFrost.
  • Accepted input: 8–16 bit YUV 4:2:0 only; other formats are converted first. The example needs no conversion.
  • luma_thresh, variation, conservative_mask, blockx and blocky are only written when they differ from the defaults, which equal the plugin's.
  • interlaced is always written: true for any non-progressive source, false for progressive.
  • BiFrost also offers the common options and can be added to the filter queue several times.

Background

  • The original AviSynth 1.1 plugin worked on whole frames. The block-based version with the interlaced and variation options is dubhater's port, which also exists for Vapoursynth.
  • The block size must be a multiple of the chroma subsampling and at least two chroma samples, so for 4:2:0 the smallest block is 4.

See also: Vapoursynth BiFrost, DeRainbow, DFM DeRainbow

Sources