Avisynth aSharp

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

aSharp is an adaptive unsharp mask that works on the luma plane only. It can sharpen less in flat areas and noise and avoid emphasizing compression block borders.

Filtering → Avisynth → Sharpen

aSharp controls in Hybrid
aSharp controls in Hybrid

What it does

Threshold sets the strength of a plain unsharp mask. With the adaptive mode on (Adaptive sharpening strength above 0), the limit is raised near edges, so flat areas and noise are sharpened less than edges; Threshold then acts as the ceiling. The optional block mode lowers the limit around the borders of 8×8 compression blocks, so blocks are not emphasized. Chroma is left untouched.

Typical uses:

  • Sharpen a slightly soft DVD or web source without boosting noise.
  • Sharpen MPEG-2 or MPEG-4 material with visible block structure.

Settings

Control Parameter Range Hybrid default Meaning
Threshold T 0–32 2 Strength of the unsharp mask. 0 does nothing; 1 equals the 1× contrast setting of the unsharp filter in ffdshow and VirtualDub.
Adaptive sharpening strength D 0–16 4 0 switches the adaptive mode off. Above 0 the limit varies per pixel and is higher near edges.
Block adaptive sharpening B −1–4 −1 Lowers the limit around block borders. Negative values switch it off. Only works with Adaptive sharpening strength above 0. Do not crop by amounts that are not a multiple of 8 between decoder and aSharp.
High quality block filtering hqbf on/off off Block based adaptive thresholding. Needs Adaptive sharpening strength above 0; the checkbox is disabled and off while it is 0.

Example

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

aSharp()

How Hybrid calls it

  • Loads ASharp.dll and calls aSharp(T, D, B, hqbf). Each parameter is only written when it differs from the default in the table; these are the plugin's own defaults.
  • The filter works on grey and planar YUV (4:2:0, 4:2:2, 4:4:4 and 4:1:1) at 8 to 16 bit integer. RGB and float input is converted first by Hybrid.
  • The filter is not treated as interlace-aware.
  • aSharp also offers the common options and can be added to the filter queue several times.

Background

  • ASharp.dll is Asd-g's AviSynth port of the VapourSynth ASharp plugin, which is based on Marc FD's asharp 0.95 (GPL-2.0). It needs the Visual C++ 2022 runtime.

Sources