Avisynth DeblockQED

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

DeblockQED (Deblock_QED) is Didée's "quantizer-estimated" deblocking: it combines a normal and a strong Deblock so that block borders are cleaned thoroughly while the inside of the blocks is only touched as much as needed.

Filtering → Avisynth → DeBlock

DeblockQED controls in Hybrid
DeblockQED controls in Hybrid

What it does

  1. Deblock runs twice: once normal (Edge quantizer, Border offsets) and once strong (Inner quantizer, Block offsets).
  2. On the 8×8 block borders the full change of the normal pass is used.
  3. Inside the blocks only a DCT-lowpassed version of the strong pass's change is used, so the block interiors are smoothed without losing much detail.
  4. Chroma is handled by the chosen Chroma method.

It adapts better to sources with varying blockiness than a single Deblock.

Requirements

The plugins masktools2, DCTFilter and Deblock, plus the script Deblock_QED_MT2.avsi.

Settings

Control Parameter Range Hybrid default Meaning
Edge quant1 2–60 24 Quantizer of the normal Deblock used for the block borders.
Inner quant2 2–60 26 Quantizer of the strong Deblock used for the block interiors.
Border (first value) aOff1 1–10 1 Border strength: halfway sensitivity, halfway strength modifier.
Border (second value) bOff1 1–10 2 Border sensitivity to detect blocking.
Block (first value) aOff2 1–10 1 Block interior strength: halfway sensitivity, halfway strength modifier.
Block (second value) bOff2 1–10 2 Block interior sensitivity to detect blocking.
Chroma uv −1–3 3 3: chroma is deblocked with the same border/interior method as luma. 2: chroma is copied from the source. 1 (and 0): chroma is taken from the normal Deblock, the fastest method. −1: chroma is taken from the strong Deblock.

Example

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

Deblock_QED()

How Hybrid calls it

  • Hybrid loads masktools2.dll, DctFilter.dll and Deblock.dll and imports Deblock_QED_MT2.avsi.
  • The function works on planar YUV and gray with 8–16-bit integer samples; other formats (including YUY2 and YV411) are converted first. The script pads the frame to a multiple of 8 itself and crops it back.
  • All values are only written when they differ from the defaults, which equal the script's defaults.
  • Interlaced input is not supported.
  • DeblockQED also offers the common options and can be added to the filter queue several times.

Background

  • The script is Didée's Deblock_QED from 2005, with later changes by 06_taro (2011) and A.SONY (2016), and a high-bit-depth version dated 2020. It also has the parameters exdeblock1 and exdeblock2, which Hybrid does not offer.
  • The DCT lowpass interpolates the border corrections over the block interior.

See also: Vapoursynth DeblockQED

Sources