Avisynth Deblock

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

Deblock removes blocking artifacts with the in-loop deblocking filter of H.264, applied as a post-process. Its strength is controlled by a quantizer value, like the one an H.264 encoder would use.

Filtering → Avisynth → DeBlock

Deblock controls in Hybrid
Deblock controls in Hybrid

What it does

The edges of the 4×4 blocks are smoothed. Whether an edge counts as a blocking edge and how strongly it is smoothed depend on Quant and the two offsets: higher values find more edges and smooth them more. Planes that are not selected are copied unchanged.

Settings

Control Parameter Range Hybrid default Meaning
Quant quant 0–60 25 Quantizer the deblocking is based on; higher means stronger deblocking.
Planes Y / U / V planes on/off each all on Planes that are processed.
Offset A aOffset 0–60 0 Shifts the threshold that decides what counts as a blocking edge; higher values deblock more edges.
Offset B bOffset 0–60 0 Shifts both the detection and the strength; higher values deblock more strongly.

When Quant plus the offset is below 16, nothing is filtered.

Example

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

Deblock(planes="yuv")

How Hybrid calls it

  • Hybrid loads Deblock.dll. The plugin needs planar YUV or gray; other formats (including YUY2 and YV411) are converted first. Hybrid adds no bit-depth conversion.
  • Planes is always written, as the letters of the checked planes. Quant and the offsets are only written when they differ from the defaults.
  • If no plane is checked, no Deblock call is written; the script only gets a comment saying that the filter is skipped.
  • Deblock also offers the common options and can be added to the filter queue several times.

Background

  • The plugin is a port of the H.264 deblocking filter by Manao, maintained by Fizick and others. Its signature is Deblock(clip, int quant=25, int aOffset=0, int bOffset=0, string planes="yuv"). It rejects a quant above 60.
  • The plugin accepts negative offsets; Hybrid offers 0–60.
  • DeblockQED uses this plugin internally.

See also: Vapoursynth Deblock

Sources

  • The AviSynth+ documentation does not cover Deblock.
  • Hybrid's tooltips