Skip to content

ngx-vsr: support VFX SDK 1.2 nvngx_vsr.dll quality modes 8-19 - #796

Open
cyj98 wants to merge 2 commits into
rigaya:masterfrom
cyj98:ngx-vsr-vfx12
Open

ngx-vsr: support VFX SDK 1.2 nvngx_vsr.dll quality modes 8-19#796
cyj98 wants to merge 2 commits into
rigaya:masterfrom
cyj98:ngx-vsr-vfx12

Conversation

@cyj98

@cyj98 cyj98 commented Sep 10, 2026

Copy link
Copy Markdown

Summary

The nvngx_vsr.dll runtime bundled with NVIDIA MAXINE Video Effects SDK 1.2 introduces new processing modes beyond the legacy quality levels 1 - 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:
    • Extend valid vsr-quality range to 1 - 4 and 8 - 19.
    • Reject invalid/undocumented values (quality 0 and 5 - 7) with an explicit parameter error.
    • Enforce that modes 8 - 15 run only when output resolution matches input resolution (scaling is unsupported in denoise/deblur modes per SDK specs).
  • NVEncCore.cpp:
    • Allow the NGX VSR filter to instantiate even when input resolution equals output resolution (enabling standalone 1:1 denoise/deblur without requiring a scale factor).
  • rgy_cmd.cpp & Documentation:
    • Update CLI --help text and option Markdown documents (NVEncC_Options.*.md) to reflect the supported quality modes and constraints.

Runtime & Compatibility Notes (nvngx_vsr.dll from VFX SDK 1.2)

  • Drop-in Replacement: Fully backward-compatible. Quality modes 1 - 4 produce identical bitstreams compared to earlier DLL versions (verified by frame-by-frame comparison).
  • Standalone Usage: Operates standalone without installing the full Maxine SDK / Models installer. Placing nvngx_vsr.dll alongside NVEncC64.exe is sufficient.
  • Resolution Support: Unlike the legacy NVVFX SuperResolution path (clamped to 3840×2160 input), the NGX pipeline supports non-standard and large resolutions (verified with a 2560×4608 portrait stream).
  • Backward Compatibility: dll obtained from rtx video sdk and Pre-1.2 DLLs fail gracefully during NGX effect initialization with the standard NGX error code.

Verification & Testing

  • Environment: NVIDIA GeForce RTX 2080 (Turing), VFX SDK 1.2.0.0 (nvngx_vsr.dll).
  • Tests:
    • 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

  • Related: nvvfx-videosuperres filter 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:
dcd47a599d3ec250ca4f9c70e14cd7475e2fefb7f1c3dc81a0ca6490b32a1458

Place 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.)

Copilot AI lite review requested due to automatic review settings September 10, 2026 06:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-quality ranges and mode meanings.
  • Expand vsr-quality validation to allow 1–4 and 8–19 (rejecting 0 and 5–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.

Comment on lines +514 to 519
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;
Comment thread NVEncCore/rgy_cmd.cpp
Comment on lines 17556 to +17559
_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
@rigaya

rigaya commented Sep 11, 2026

Copy link
Copy Markdown
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants