ngx-vsr: support VFX SDK 1.2 nvngx_vsr.dll quality modes 8-19 - #796
ngx-vsr: support VFX SDK 1.2 nvngx_vsr.dll quality modes 8-19#796cyj98 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
It lacks an explicit validation enforcing the documented “quality 8–15 requires input=output resolution” constraint and leaves the option Markdown docs inconsistent with the updated CLI help/PR description.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends NVEnc’s NGX VSR integration to support NVIDIA Maxine VFX SDK 1.2 nvngx_vsr.dll quality modes 8–19, and adjusts filter instantiation so NGX VSR can run when output resolution equals input resolution (enabling 1:1 denoise/deblur modes).
Changes:
- Update CLI help text to document the extended
vsr-qualityranges and mode meanings. - Expand
vsr-qualityvalidation to allow1–4and8–19(rejecting0and5–7). - Ensure the resize/NGX VSR filter path can be created even when no scaling occurs for
quality 8–15.
File summaries
| File | Description |
|---|---|
| NVEncCore/rgy_cmd.cpp | Updates --help text for vsr-quality to include 8–19 and mode descriptions. |
| NVEncCore/NVEncFilterNGX.cpp | Expands vsr-quality numeric validation for NGX VSR to include new SDK 1.2 modes. |
| NVEncCore/NVEncCore.cpp | Adjusts resize-filter creation condition so NGX VSR can run at input=output resolution for quality 8–15. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (prm->ngxvsr.quality < 1 || 19 < prm->ngxvsr.quality | ||
| || (5 <= prm->ngxvsr.quality && prm->ngxvsr.quality < 8)) { | ||
| AddMessage(RGY_LOG_ERROR, _T("Invalid quality value %d, must be in the range of 1 to 4 or 8 to 19.\n"), prm->ngxvsr.quality); | ||
| return RGY_ERR_INVALID_PARAM; | ||
| } | ||
| return RGY_ERR_NONE; |
| _T(" vsr-quality=<int>\n") | ||
| _T(" quality for ngx-vsr\n")); | ||
| _T(" quality for ngx-vsr (1 - 4 or 8 - 19, default = 1)\n") | ||
| _T(" 8-11 = denoise, 12-15 = deblur, 16-19 = high-bitrate detail restoration\n") | ||
| _T(" modes 8-19 require nvngx_vsr.dll from VFX SDK 1.2 or later\n")); |
…docs - reject quality 8-15 (denoise/deblur) when output resolution differs from input, with a clear error instead of relying on runtime behavior - document quality 8-19 modes and the 8-15 same-resolution constraint in NVEncC_Options.en.md / .ja.md
|
Thank you for the pull request. I'll have them merged after releasing NVEnc 9.35, I plan to add it as NVEnc 9.36 feature. |
Summary
The
nvngx_vsr.dllruntime bundled with NVIDIA MAXINE Video Effects SDK 1.2 introduces new processing modes beyond the legacy quality levels1 - 4:8 - 11: Denoise (Low / Medium / High / Ultra)12 - 15: Deblur (Low / Medium / High / Ultra)16 - 19: High-bitrate detail restoration (Low / Medium / High / Ultra)Reference: NVIDIA Maxine Video Effects SDK Documentation - Video Super Resolution
Key Changes
NVEncFilterNGX.cpp:vsr-qualityrange to1 - 4and8 - 19.0and5 - 7) with an explicit parameter error.8 - 15run only when output resolution matches input resolution (scaling is unsupported in denoise/deblur modes per SDK specs).NVEncCore.cpp:rgy_cmd.cpp& Documentation:--helptext and option Markdown documents (NVEncC_Options.*.md) to reflect the supported quality modes and constraints.Runtime & Compatibility Notes (
nvngx_vsr.dllfrom VFX SDK 1.2)1 - 4produce identical bitstreams compared to earlier DLL versions (verified by frame-by-frame comparison).nvngx_vsr.dllalongsideNVEncC64.exeis sufficient.NVVFXSuperResolution path (clamped to 3840×2160 input), the NGX pipeline supports non-standard and large resolutions (verified with a 2560×4608 portrait stream).Verification & Testing
nvngx_vsr.dll).quality=8(1:1 Denoise): Processed and encoded successfully at native resolution.quality=16(2× High-bitrate Upscale): Scaled and encoded properly.quality=5 - 7(Invalid ranges): Immediately caught and rejected with clear error messages.quality=1 - 4(Legacy VSR): Verified identical output against dll obtained from rtx video sdk.Related PR
nvvfx-videosuperresfilter PR (VFX SDK 1.2 exposes identical processing modes via the NVVFX API path).Obtaining the 1.2 nvngx_vsr.dll for testing
The dll ships with the VFX SDK 1.2 installer (https://catalog.ngc.nvidia.com/orgs/nvidia/maxine/collections/nvvfxvideosuperres).
For a quick test without installing the SDK, NVIDIA also publishes it in their
public Python package index; the dll can be extracted from the wheel below
(path inside the archive:
nvvfx/libs/nvngx_vsr.dll, ~45 MB, just open the .whl file in unzip software like winrar):https://pypi.nvidia.com/nvidia-vfx/nvidia_vfx-0.1.0.1-cp312-abi3-win_amd64.whl
SHA-256 of the extracted dll:
dcd47a599d3ec250ca4f9c70e14cd7475e2fefb7f1c3dc81a0ca6490b32a1458Place it next to NVEncC64.exe, as with the current ngx-vsr dll. (Version-pinned
link as of this writing — NVIDIA may re-publish newer versions at the same index.)