Table of Contents

Class MaxineUpscaleSettings

Namespace
VisioForge.Core.Types
Assembly
VisioForge.Core.dll

Configures the NVIDIA Maxine Upscale effect, which increases video resolution and enhances details.

public class MaxineUpscaleSettings : IVideoResizeSettings

Inheritance

Implements

Inherited Members

Remarks

The VisioForge.Core.Types.MaxineUpscaleSettings class provides configuration for NVIDIA's Maxine Upscale technology, which combines traditional upscaling with AI-powered detail enhancement. Unlike the Super Resolution effect, this approach allows fine-tuning of the enhancement strength, making it suitable for scenarios where subtle improvements are preferred over aggressive AI processing.

This class allows you to define the target height for upscaling, the strength of the enhancement effect, and the location of the Maxine SDK models. A strength of 0 performs upscaling without enhancement (similar to bicubic interpolation), while 1 provides maximum enhancement.

Key differences from Super Resolution:

  • Adjustable enhancement strength for more control
  • Generally faster processing with lower GPU requirements
  • Better suited for real-time applications
  • More predictable results with less aggressive AI processing

Requirements:

  • NVIDIA GPU (GTX 1050 or newer)
  • NVIDIA Maxine SDK with upscale models
  • DirectX 11 or newer on Windows

Constructors

MaxineUpscaleSettings(string, int, float)

Initializes a new instance of the VisioForge.Core.Types.MaxineUpscaleSettings class.

public MaxineUpscaleSettings(string modelsDir, int height, float strength = 0.4)

Parameters

modelsDir string

The directory path containing the NVIDIA Maxine SDK models. Must be a valid directory with read permissions containing the upscale model files.

height int

The target height for the upscaled video in pixels. Must be a positive value, typically greater than the source height.

strength float

The strength of the enhancement effect, from 0 to 1. Defaults to 0.4f for balanced enhancement. Values outside the 0-1 range will be clamped.

Exceptions

ArgumentNullException

Thrown when modelsDir is null or empty.

ArgumentOutOfRangeException

Thrown when height is less than or equal to zero.

Properties

Height

Gets the target height for the upscaled video.

public int Height { get; }

Property Value

int

ModelsDir

Gets or sets the directory path where the NVIDIA Maxine SDK models are located.

public string ModelsDir { get; set; }

Property Value

string

Remarks

The models directory should contain the upscale models provided with the NVIDIA Maxine SDK. These are typically TensorRT (.trt) or ONNX (.onnx) files optimized for GPU inference.

Example path: @"C:\Program Files\NVIDIA Corporation\Maxine SDK\models\upscale"

Strength

Gets or sets the strength of the upscaling enhancement.

public float Strength { get; set; }

Property Value

float

Methods

CalculateWidth(Size)

Calculates the output width required to maintain the original aspect ratio based on the target height.

public int CalculateWidth(Size sourceSize)

Parameters

sourceSize Size

The size of the original source video, containing both width and height dimensions. Both dimensions must be positive values.

Returns

int

The calculated width for the upscaled video, rounded to the nearest integer pixel value. This ensures the aspect ratio is preserved during the upscaling process.

Remarks

This method preserves the aspect ratio using the formula: newWidth = (sourceWidth * targetHeight) / sourceHeight

The result is rounded to prevent sub-pixel artifacts in the output video. For best results, ensure the calculated dimensions are compatible with your video encoder requirements (e.g., divisible by 2 for H.264).

ToString()

Returns a string that represents the current upscale settings.

public override string ToString()

Returns

string

A string formatted as "Upscale (Nvidia Maxine) - [Height]p", where [Height] is the target resolution height. For example: "Upscale (Nvidia Maxine) - 1080p".

See Also