Avisynth aWarpSharp

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

aWarpSharp is a warp sharpener: instead of adding brightness overshoot around edges, it pulls pixels towards the edges, which makes lines thinner and crisper without halos. This is the original interface with depth, blur level and threshold; aWarpSharp2 is the reworked one.

Filtering → Avisynth → Sharpen

aWarpSharp controls in Hybrid
aWarpSharp controls in Hybrid

What it does

The filter builds an edge map (the "bump map") from the picture, blurs it, and then moves each pixel a little along the slope of that map, towards the nearest edge. Edges become narrower and appear sharper. Because no bright or dark rim is added, the result has no halos.

The price is geometry: if the settings are too strong, lines bend and fine detail is thinned out. The filter is popular for anime and other line art.

Typical uses:

  • Make soft or upscaled line art crisper.
  • Combine a light warp with a normal sharpener for photographic material.
  • Use Show to look at the edge map while tuning Depth and Blur.

Settings

Control Parameter Range Hybrid default Meaning
Depth depth −64–64 16 How far pixels are pulled towards the edges; this is the real strength. Negative values warp the other way and soften the picture.
Blur blurlevel 1–4 2 Number of blur passes over the edge map. Higher values give a stronger effect and need more CPU time.
Thresh thresh 0.00–1.00 0.50 Saturation of the edge map. 0.5 is the recommended value; other values make the warp uneven between edges.
Chroma cm list enables chroma warping with luma bump map How the chroma planes are treated: disables chroma filtering; enables chroma warping with luma bump map; independent warping and bump map; chroma -> chroma.
Blur mode bm list fast 1-pass Blur used on the edge map: hq 3-pass, fast 3-pass, fast 1-pass or light blur.
Show show on/off off Shows the edge map instead of the picture.

Example

Default settings on a 10-bit YUV 4:2:0 source; the filter handles the format directly, so Hybrid adds no conversion:

aWarpSharp()

How Hybrid calls it

  • Loads aWarpSharpMT.dll and calls aWarpSharp(depth, blurlevel, thresh, cm, bm, show). Every parameter is only written when it differs from the default shown in the table; these are the plugin's own defaults, so the default call is a plain aWarpSharp().
  • The filter works on grey and planar YUV 4:2:0, 4:2:2 and 4:4:4 at 8 to 16 bit integer. Other formats (RGB, float) are converted first by Hybrid.
  • The filter is not treated as interlace-aware.
  • aWarpSharp also offers the common options and can be added to the filter queue several times.

Background

  • aWarpSharpMT.dll is a multi-threaded 64-bit port by jpsdr of aWarpSharp 2.x. It contains the new aWarpSharp2 family and keeps the old aWarpSharp call as a wrapper that translates the old parameters (threshold ×256, blur level to blur passes, depth scaled by the blur level). With the defaults the old call gives the same picture as the default call of aWarpSharp2.
  • The wrapper checks the product of Depth and Blur (depth × blur level / 2) against −128 to 127. Depth 64 together with Blur 4 is therefore rejected; Depth −64 works with every Blur value.
  • The original warpsharp plugin was written by Marc FD; the first AviSynth version needed YV12.
  • Plugin parameters Hybrid does not offer: original and the thread options.

Sources