Vapoursynth DGDecNV Crop/Resize: Difference between revisions

From wiki.selur.net
Jump to navigation Jump to search
New filter page (via create-page on MediaWiki MCP Server)
 
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server)
 
Line 17: Line 17:


== Example ==
== Example ==
With DGDecNV as source filter the crop and resize values go into the DGSource call itself (ct/cb/cl/cr, rw/rh) and no separate resize line is written. When the source is opened with another source filter, Hybrid writes the NNEDI3 fallback instead (10-bit YUV 4:2:0 source, 640x356 to 1280x712):
With DGDecNV as source filter the crop and resize values go into the DGSource call itself (ct/cb/cl/cr, rw/rh) and no separate resize line is written. When the source is opened with another source filter, Hybrid writes one plain resize with the kernel chosen on the Crop/Resize tab instead (10-bit YUV 4:2:0 source, 640x356 to 1280x712, kernel "10 - bicubic spline"):
<syntaxhighlight lang="python">
<pre>
# 'DGDecNV Crop/Resize' is selected, DGDecNV isn't used for the source using NNEDI3 for resizing as fallback,..
# 'DGDecNV Crop/Resize' is selected, DGDecNV isn't used for the source, using the resize kernel as fallback
# resizing using ZNEDI3
# Resizing using 10 - bicubic spline
# current: 640x356 target: 1280x712
clip = core.fmtc.resample(clip, kernel="spline16", w=1280, h=712, interlaced=False, interlacedd=False) # resolution 1280x712 before YUV420P10 after YUV420P16
clip = edi_rpow2.nnedi3_rpow2(clip, rfactor=2, qual=2, tools={'nnedi3': 'znedi3'}) # 1280x712
</pre>
</syntaxhighlight>


== How Hybrid calls it ==
== How Hybrid calls it ==
* Crop and Resize must be the first two active size-changing steps of the filter order; nothing may change the size before them.
* Crop and Resize must be the first two active size-changing steps of the filter order; nothing may change the size before them.
* Then the crop values (top, bottom, left, right) and the target width and height are passed to DGSource, and the normal resize step is skipped with a note in the script.
* Then the crop values (top, bottom, left, right) and the target width and height are passed to DGSource, and the normal resize step is skipped with a note in the script.
* If another source filter is used or the condition is not met, Hybrid writes a note and resizes with [[Vapoursynth NNEDI3 Resize|NNEDI3]] instead, using the settings of the NNEDI3 page.
* If another source filter is used or the condition is not met, Hybrid writes a note and resizes once with the normal resize kernel of the Crop/Resize tab (no NNEDI3, no Stepped Resize).
* It does not work in the crop view.
* It does not work in the crop view.



Latest revision as of 09:48, 16 November 2026

DGDecNV Crop/Resize lets the DGDecNV source filter crop and resize on the NVIDIA GPU while decoding, so the Vapoursynth script needs no separate crop and resize step. It only works when the source is loaded with DGDecNV.

Filtering → Vapoursynth → Frame → Resize

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

What it does

DGDecNV's source function can crop and scale the decoded frames on the GPU; resizing happens after DGDecNV's own deinterlacing. The scaler is DGDecNV's internal one, there is no kernel choice.

Requirements

  • Windows, an NVIDIA GPU with CUDA and a licensed, installed DGDecNV. The method is only offered when DGDecNV is available.
  • The source must be opened with DGDecNV (DGSource).

Settings

Tick Resizer in the Resizer page and pick DGDecNV Crop/Resize as method. The page itself has no controls: the crop values come from the crop and the size from the target size on the Crop/Resize tab. While this method is selected, Stepped Resize is disabled.

Example

With DGDecNV as source filter the crop and resize values go into the DGSource call itself (ct/cb/cl/cr, rw/rh) and no separate resize line is written. When the source is opened with another source filter, Hybrid writes one plain resize with the kernel chosen on the Crop/Resize tab instead (10-bit YUV 4:2:0 source, 640x356 to 1280x712, kernel "10 - bicubic spline"):

# 'DGDecNV Crop/Resize' is selected, DGDecNV isn't used for the source, using the resize kernel as fallback
# Resizing using 10 - bicubic spline
clip = core.fmtc.resample(clip, kernel="spline16", w=1280, h=712, interlaced=False, interlacedd=False) # resolution 1280x712 before YUV420P10 after YUV420P16

How Hybrid calls it

  • Crop and Resize must be the first two active size-changing steps of the filter order; nothing may change the size before them.
  • Then the crop values (top, bottom, left, right) and the target width and height are passed to DGSource, and the normal resize step is skipped with a note in the script.
  • If another source filter is used or the condition is not met, Hybrid writes a note and resizes once with the normal resize kernel of the Crop/Resize tab (no NNEDI3, no Stepped Resize).
  • It does not work in the crop view.

Background

DGDecodeNV

According to the DGDecodeNV manual, the crop values default to 0 and the resize only happens when both width and height are non-zero. Older DGDecNV versions used other parameter names for these options. DGDecNV is commercial software.

Sources

  • DGDecodeNV manual (DGDecodeNVManual.html, shipped with DGDecNV)
  • Hybrid's tooltips