Avisynth HQDering
HQDering removes ringing, the ripples next to sharp edges that come from compression or oversharpening. It is mawen1250's HQDering mod script.
Filtering → Avisynth → DeRing

What it does
The script builds an edge mask from the luma and derives a ring zone near the edges. Only that zone is smoothed (with MinBlur or dfttest). Optionally the result is sharpened again (contra-sharpening) and details are repaired. The amount of change is limited and the result is merged back. Flat areas and the edges themselves stay mostly untouched.
Requirements
- Windows, CPU only.
- The plugins the script needs (masktools2, dfttest, RgTools and others) are shipped with Hybrid.
Settings
| Control | Parameter | Range | Hybrid default | Meaning |
|---|---|---|---|---|
| Y / U / V | Y / U / V | on/off | Y on, U off, V off | Planes to filter. A plane that is not ticked is copied from the source. |
| Mask thresh | mthr | 0–255 | 60 | Threshold of the edge mask (Prewitt). Lower values give more aggressive processing. |
| Mask rad | mrad | 0–64 | 1 | Radius of the ring mask. Higher values give more aggressive processing; 0 means no mask expansion. |
| Denoiser | nrmode | −1–3 | −1 | Smoothing used in the ring zone. −1 is automatic (mode 2 for clips of 1280 × 720 or larger, otherwise 1). 0 is dfttest, 1–3 are MinBlur with radius 1–3. |
| Sharpening | sharp | 0–3 | 1 | Radius of the contra-sharpening that restores sharpness after smoothing. 0 is off. |
| Show | show | on/off | off | Shows the ring mask instead of the video. |
Example
Default settings on a 10-bit YUV 4:2:0 source:
HQDeringmod()
How Hybrid calls it
- Hybrid loads masktools2, dfttest, RgTools, SmoothAdjust and the scripts
HQDeringmod.avsianddither.avsi, then callsHQDeringmod. - The script accepts Y8, YV12, YV16, YV24 and YV411; the width and height must be divisible by 2. The example needs no conversion.
- Parameters are only written when they differ from the defaults:
Y=2when Y is off,U=3andV=3when ticked,mthr,mrad,nrmode,sharpandshow. Values are passed unchanged. tv_range=falseis added when the source is flagged as full (PC) range.- HQDering also offers the common options and can be added to the filter queue several times.
Background
- HQDering mod v1.8 by mawen1250 (2020.05.28). The script lists masktools2, dither, dfttest (or neo-dfttest), RgTools, MedianBlur2 and SmoothAdjust as requirements.
- The script parameters
msmooth,incedge,minp,thr,elast,darkthranddrrepare not offered; their script defaults apply (the Vapoursynth version offers more of them).
See also: Vapoursynth HQDering
Sources
- The AviSynth+ documentation does not cover HQDering.
- Header of the script
HQDeringmod.avsi - Doom9: HAvsFunc thread (changelog of the Vapoursynth port of the same function)
- Hybrid's tooltips