Avisynth DGDecNV Crop/Resize

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

DGDecNV Crop/Resize lets the DGDecNV source filter crop and resize the picture on the NVIDIA GPU while it decodes, so no separate Crop and Resize step is needed in the script.

Filtering → Avisynth → Frame → Resize (tick Resizer: and choose DGDecNV Crop/Resize)

DGDecNV Crop/Resize in Hybrid
DGDecNV Crop/Resize in Hybrid

What it does

DGSource accepts crop values (ct, cb, cl, cr) and a target size (rw, rh). Both are applied on the GPU, the resize after DGDecNV's own deinterlacing. The scaler is fixed; there is no kernel choice. Hybrid takes the crop values and the target size from the Crop/Resize tab.

DGSource does the crop and resize only when all of this holds:

  • Resizer: is ticked and DGDecNV Crop/Resize is selected,
  • the clip is loaded with DGDecNV (DGSource),
  • Crop and Resize are the first two geometry steps of the filter chain (for example, no Rotation in front of them).

Then the source line contains the crop and size values, Hybrid treats the clip as already cropped and resized, and no Crop or resize call follows. Otherwise DGSource gets no crop/size values, Crop runs normally and the resize falls back to BicubicResize.

Requirements

  • A licensed DGDecNV and an NVIDIA GPU with CUDA. The entry is only listed when DGDecNV is available.

Settings

The entry has no controls of its own.

Control Parameter Range Hybrid default Meaning
Resizer: / DGDecNV Crop/Resize – – – Crop and size come from the Crop/Resize tab. ResampleMT is not available for this entry.

Example

In the test clip the source is not loaded with DGDecNV, so DGDecNV cannot crop or resize and Hybrid uses the fallback BicubicResize (640x352 → 1280x704):

# current resolution: 640x352
# scaling to 1280x704
# DGDecNV Crop/Resize is selected, but DGDecNV isn't used, using fallback BicubicResize
BicubicResize(1280,704)

With DGSource as source and the conditions above, the script contains only the source line, in the form DGSource(dgi="…", ct=…, cb=…, cl=…, cr=…, rw=…, rh=…), and no Crop or resize call.

How Hybrid calls it

  • The crop and size values are written into DGSource together with the usual deinterlace/field options.
  • With another source filter, or when another geometry step comes before Crop or Resize, the script gets the comment shown in the example and BicubicResize is used without parameters.
  • DGDecNV Crop/Resize also offers the common options and can be added to the filter queue several times.

Background

  • DGDecNV is a commercial CUDA decoder plugin by Donald Graft (neuron2). If either rw or rh is 0, no resizing is done; the crop values default to 0.

See also: Vapoursynth DGDecNV Crop/Resize, Avisynth Resizer

Sources

  • DGDecNV manual (shipped with the plugin)
  • Hybrid's tooltips
  • The AviSynth+ documentation does not cover DGDecNV.