Vapoursynth DGSharpen

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

DGSharpen is a fast CUDA sharpener by Donald Graft from the DGDecNV package. It sharpens in the style of LimitedSharpenFaster, so no halos appear.

Filtering → Vapoursynth → Sharpen

DGSharpen controls in Hybrid
DGSharpen controls in Hybrid

What it does

The picture is sharpened and each sharpened pixel is clamped to the minimum and maximum of its neighborhood, so it cannot overshoot. It should be applied to progressive frames: deinterlace or IVTC first.

Requirements

  • Windows only (the plugin is a Windows DLL); on Linux and macOS the filter is locked, like the other DG filters.
  • An NVIDIA GPU with CUDA; Hybrid only enables the filter when such a card is found.

Settings

Control Parameter Range / values Hybrid default Meaning
Strength strength 0.01 – 100 0.25 Sharpening strength; must be above 0. Typical values are about 1 – 13; the effect saturates around 50.
GPU ID device 0 – 255 255 GPU to use; 255 takes the first one found.

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356):

# adjusting color space from YUV420P10 to YUV444P16 for vsDGSharpen
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)
# sharpening using DGSharpen
clip = core.dgsharpen.DGSharpen(clip)

How Hybrid calls it

  • DGSharpen accepts YUV 4:2:0 8 bit, YUV 4:2:0 16 bit and YUV 4:4:4 16 bit; other formats are converted first.
  • Both values are only written when they differ from the defaults, which equal the plugin's own defaults.
  • The allowed over- and undershoot and the border exclusion (top, bottom, left, right) are not offered; the plugin defaults (0) are used.
  • DGSharpen also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

Plugin

The manual that comes with the plugin names 6.0 as default and typical value, but the current plugin uses 0.25 when no strength is given. Its sample script uses strength 13 with some overshoot. Overshoot and undershoot allow values beyond the local limits; the border options exclude rows and columns, for example letterbox edges. The DGDecodeNV AviSynth build has the same filter.

Sources