Skip to content

Nvvfx videosuperres - #797

Open
cyj98 wants to merge 4 commits into
rigaya:masterfrom
cyj98:nvvfx-videosuperres
Open

Nvvfx videosuperres#797
cyj98 wants to merge 4 commits into
rigaya:masterfrom
cyj98:nvvfx-videosuperres

Conversation

@cyj98

@cyj98 cyj98 commented Sep 10, 2026

Copy link
Copy Markdown

Summary

Adds a new resize algorithm nvvfx-videosuperres using the VideoSuperRes effect
introduced in NVIDIA MAXINE VideoEffects SDK 1.2 (in SDK 1.0/1.1 the same feature
was named SuperRes).

  • New parameter videosuperres-quality=<int> (1 - 19, except 5 - 7, default = 1):
    • 1 - 4 = superres (Low / Medium / High / Ultra)
    • 8 - 11 = denoise
    • 12 - 15 = deblur
    • 16 - 19 = high-bitrate detail restoration (SDK 1.2 or later)
  • Modes 8 - 15 (denoise/deblur) do not resize the frame. The resize filter is
    created even when no resize is requested, and an explicit --output-res
    matching the input resolution is required. Modes 1 - 4 and 16 - 19 are
    upscalers and follow the normal resize rules (intermediate ratio search like
    nvvfx-superres).
  • SDK 1.2 requires RGBA/BGRA U8 interleaved buffers for this effect. On older
    runtimes the filter falls back to the legacy BGR F32 planar buffers and warns.
  • Unlike the NGX path, the VFX runtime's input size limits apply to this filter.
  • Help text and docs updated (NVEncC_Options.en.md / .ja.md / .zh-cn.md).

Design note

SDK 1.2 renamed SuperResolution to VideoSuperResolution and changed both the
parameter semantics (quality levels replacing mode/strength) and the required
buffer format (RGBA8). I therefore added a separate nvvfx-videosuperres
algorithm instead of extending nvvfx-superres with runtime version detection,
so users on SDK 1.0/1.1 are unaffected. If you would rather have a single
nvvfx-superres algorithm that switches on the SDK version, I'm happy to
rework it that way.

Testing

  • Built with VS2022 + CUDA, tested on RTX 2080 (Turing) with VFX SDK 1.2.0.0.
  • Verified: quality 1 - 4 upscaling, 8 - 15 same-res runs with explicit
    --output-res, 16 - 19 upscaling; same-res mode without --output-res
    correctly errors out.

Notes

Related PR: ngx-vsr quality 8 - 19 support (the same SDK 1.2 dll also exposes
these modes through the NGX path)

Runtime / SDK

Install the Video Effects SDK Core,
then run install_feature.ps1 with the feature name nvvfxvideosuperres.
Per the SDK docs, the effect's GPU buffers are BGRA/RGBA interleaved 8-bit
(what the filter uses on SDK 1.2+ runtimes), and the suggested minimum input
resolution is 360p.

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

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

There are confirmed logic issues in the NVVFX path (misleading global runtime buffer logs/warnings and a width/height check that can skip the NVVFX pass).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new NVVFX-based resize algorithm nvvfx-videosuperres (MAXINE VideoEffects SDK 1.2 “VideoSuperRes”) to NVEnc’s NVEncCore resize pipeline, including CLI parameter plumbing and documentation/help updates.

Changes:

  • Introduces RGY_VPP_RESIZE_NVVFX_VIDEO_SUPER_RES + nvvfx-videosuperres option and wires it through resize selection/printing.
  • Adds videosuperres-quality=<int> parsing and command/help/doc generation.
  • Implements NVEncFilterNvvfxVideoSuperRes, including RGBA U8 (SDK 1.2+) vs legacy BGR F32 (older runtime) buffer handling and ratio-search initialization.
File summaries
File Description
NVEncCore/rgy_prm.h Adds the new resize enum + string mapping and exposes videosuperres-quality as a resize parameter.
NVEncCore/rgy_cmd.cpp Extends --vpp-resize help text with videosuperres-quality semantics and constraints.
NVEncCore/NVEncFilterResize.cu Adds initialization path and runtime execution support for the new NVVFX VideoSuperRes resize filter.
NVEncCore/NVEncFilterParam.h Adds VppNvvfxVideoSuperRes and default quality constant to the shared VPP parameter model.
NVEncCore/NVEncFilterParam.cpp Implements printing/comparison, parses videosuperres-quality, and emits it in generated command lines.
NVEncCore/NVEncFilterNvvfx.h Adds VideoSuperRes effect selectors + new parameter/filter class declarations and RGBA buffer support members.
NVEncCore/NVEncFilterNvvfx.cpp Implements the VideoSuperRes NVVFX effect, including buffer allocation/conversion changes.
NVEncCore/NVEncFilter.h Extends resize filter params/state to carry the new NVVFX VideoSuperRes configuration and instance.
NVEncCore/NVEncCore.cpp Ensures NVVFX is enabled for the new algorithm and enforces same-res creation behavior for quality 8–15.
NVEncC_Options.en.md Documents nvvfx-videosuperres and videosuperres-quality usage/constraints (English).
NVEncC_Options.ja.md Documents nvvfx-videosuperres and videosuperres-quality usage/constraints (Japanese).
NVEncC_Options.zh-cn.md Documents nvvfx-videosuperres and videosuperres-quality usage/constraints (Simplified Chinese).
Review details
  • Files reviewed: 12/12 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 +2020 to +2022
if (pResizeParam->frameOut.width != ppOutputFrames[0]->width
&& pResizeParam->frameOut.height != ppOutputFrames[0]->height) {
int nvvfxOutputNum = 0;
Comment on lines +183 to +204
// VFX SDK 1.2+ expects RGBA U8 interleaved buffers for VideoSuperRes,
// while pre-1.2 runtimes (0.7.x) only accept the legacy BGR F32 planar
// layout. Pick the buffer format by the loaded runtime version so that
// behavior on older runtimes stays identical to the legacy format.
{
uint32_t vfxVersion = 0;
if (err_to_rgy(NvVFX_GetVersion(&vfxVersion)) == RGY_ERR_NONE
&& vfxVersion >= ((1u << 24) | (2u << 16))) {
AddMessage(RGY_LOG_DEBUG, _T("nvvfx runtime version %d.%d: using RGBA U8 buffers.\n"),
(vfxVersion >> 24) & 0xff, (vfxVersion >> 16) & 0xff);
} else {
m_bgraU8 = false;
AddMessage(RGY_LOG_WARN, _T("nvvfx runtime version %d.%d does not support RGBA U8 buffers (requires 1.2+), using legacy BGR F32 planar buffers.\n"),
(vfxVersion >> 24) & 0xff, (vfxVersion >> 16) & 0xff);
if (auto prmVsr = dynamic_cast<const NVEncFilterParamNvvfxVideoSuperRes*>(pParam.get());
prmVsr != nullptr && prmVsr->nvvfxVideoSuperRes.quality >= 8) {
AddMessage(RGY_LOG_ERROR, _T("quality 8-19 requires VFX SDK 1.2 or later, but the loaded nvvfx runtime is %d.%d. Please install or update the NVIDIA Video Effects runtime, or use quality 1-4.\n"),
(vfxVersion >> 24) & 0xff, (vfxVersion >> 16) & 0xff);
return RGY_ERR_UNSUPPORTED;
}
}
}
…log to VideoSuperRes

- run the post-resize nvvfx pass when either output dimension differs
  from the target: the previous && condition (inherited from upstream)
  silently skipped the AI pass when only one dimension differed
- perform the RGBA U8 runtime-version detection only for the
  VideoSuperRes effect, so other nvvfx effects no longer log misleading
  buffer-format messages
@rigaya

rigaya commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Thank you for the pull request!

I don't think retaining backward compatibility is necessary in this case.
Therefore, I think that we can simply update to SDK 1.2 (so we don't need to maintain 2 versions).

Therefore, I'm sorry for the extra work, but would you please remove the current codes for SDK 1.0-1.1, and replace nvvfx-superres to your new implementation?

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