View Single Post
Old 16th February 2015, 05:39   #2  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
scaling algorithms

Nearest Neighbor: {super fast} A low quality method, the value of the closest pixel is used. This looks very bad when not doing integer scaling (1x, 2x, 3x, etc.). Configure a custom keyboard shortcut to enable it.
Bilinear: {super fast} A low quality method. It is as fast as Nearest Neighbor because GPUs have hardware to do bilinear filtering in a single operation.
DXVA2: {very fast} Uses the GPU drivers to access hardware scaling. Transfer to and from hardware is done at the video bit depth so it may introduce banding or cause scaled dither noise. It can be very fast and low power. The quality varies between GPU brands and models but none are particularly good. Can do chroma upscaling as well so this option might override 'chroma upscaling'. Requires a restart of madVR to take effect. Does not bypass the graphics card's video (damage) algorithms so make sure they are off.
Cubic: {fast} [Bicubic60] Bicubic is b = 0, c = value / 100. SoftCubic is b = value / 100, c = 0. Mitchell-Netravali is b = 1/3, c = 1/3. Bicubic125 and 150 (c > 1) are special cases for downscaling because they have nasty artifacts when used for upscaling.
Lanczos: {medium} [3] A sharp sinc type
Spline: {medium} [3] A different sinc type
Jinc: {slow} A more advanced sinc type, uses 3-taps (based on an EWA LanczosSharp from ImageMagick)
Bilateral: {slow} A chroma scaler that uses the luma channel as reference. This can be very good but it can fail too.
Reconstruction: {very slow} [soft] Similar to Bilateral in that it uses luma channel information to aid chroma scaling. Soft is less prone to artifacts.
SSIM: {very slow} [1D-100%] Downscaling only. It is very sharp and detailed, especially useful with high downscaling ratios and fine details. with Shiandow
super-xbr: {very slow} [100] xBR means scale By Rules, it works by detecting edges and interpolating pixels along them. Can only perform a 2x upscale.
NGU Family: {variable super slow} [medium] madshi's own Next Generation Upscaling. A sharp doubling algorithm with minimal artifacts. NGU Soft, Standard, and Sharp can also quadruple the luma in one step. The Anti-Alias version is softer but reduces aliasing and is more tolerant of source artifacts. Works in Windows XP.

activate anti-ringing filter: [Disabled, relaxed] madshi's method to reduce ringing, the major artifact caused by sharp scalers. Designed to only remove the ringing introduced by the filter it accompanies.

A comparison of scaling algorithms made by Warner306

chroma upscaling [Bicubic60]
Cb and Cr are stored at half the resolution of Y in a standard YCbCr 4:2:0 source and this controls how madVR doubles their resolution in both dimensions to create YCbCr 4:4:4 for the conversion to RGB. When downscaling a lot this setting is used to bring the chroma to the target resolution, not the luma resolution, so the luma is downscaled before the conversion to RGB.

activate SuperRes filter, strength: [Disabled, 3] A special version of SuperRes designed for the chroma upscaling step. Not recommended with NGU.

image downscaling [Bicubic150]
How madVR scales to the target resolution if it is smaller than the source.

scale in linear light: [Disabled] Using linear light when downscaling produces a result more similar to what one would get with optical scaling; bright specks such as stars in a night sky are preserved much better. The chroma must be upscaled to match the luma before downscaling when using this option because linear light is only possible in RGB.
activate anti-bloating filter: [Disabled, 100%] A post process method to reduce the fatness created by downscaling with SSIM.

image upscaling [Lanczos 3]
How madVR scales to the target resolution if it is larger than the source.

scale in sigmoidal light: [Disabled] Linear light but for upscaling, applies a sigmoidal curve after the conversion to linear light. This reduces the dark halo artifacts around sharp edges caused by upscaling in linear light.

NGU or super-xbr: When choosing a doubling scaler the 'algorithm quality', 'activate doubling / quadrupling...', and 'if any (more) scaling needs to be done' options become available. Algorithm quality is much more important for luma than chroma. "let madVR decide" chooses options appropriate for the performance requirements of the chosen luma algorithm quality. It is recommended to turn the luma quality up as high as possible before adjusting other options.

algorithm quality:
<-- luma: The option used for doubling or quadrupling the resolution of the colorless component of the video (Y).
<-- chroma: The option used for doubling the resolution of color components of the video (Cb & Cr).
activate doubling / quadrupling...: Changes the scaling ratio required before doubling or quadrupling activates. When not active the option set in 'if any (more) scaling needs to be done' is used to scale to the display resolution, if required. 'let madVR decide' uses 1.2x and 2.4x respectively (when using direct 4x NGU quadrupling "if any upscaling past 2.0x is needed" is used instead) so set these to 2.0x and 4.0x if you want to avoid doubling or quadrupling to a resolution larger than the display and downscaling.
if any (more) scaling needs to be done:
<-- upscaling algo: The option used for upscaling, if required, after doubling or quadrupling.
<-- downscaling algo: The option used for downscaling if the display resolution is lower than the doubled or quadrupled resolution.

upscaling refinement [All Disabled]
These are applied as part of upscaling or supersampling.

sharpen edges: [1.0] Only sharpens edges instead of textures like skin or cloth. Avoids sharpening artifacts too much.
crispen edges: [1.0] A tamed version of FineSharp, a sharpener originally by Didée that attempts to keep local energy close to the original. Better used with higher quality sources because it sharpens artifacts.
thin edges: [1.0] As its name implies. Good for SD Anime or cartoons.
enhance detail: [1.0] Sharpens textures like skin or cloth, also sharpens artifacts.
soften edges: [1] Applied as part of NGU. Useful for large upscaling ratios with this very sharp upscaler.
add grain: [1] Applied as part of NGU. Useful for large upscaling ratios with this very sharp upscaler. Combats the artificial flat look caused by the combination of a lack of detail in non-edge textures with very sharp upscaling of edges.
LumaSharpen: [0.65] Blurs the original pixel with the surrounding pixels and then subtracts the blur. Avoids sharpening artifacts.
AdaptiveSharpen: [0.5] Tries to sharpen medium sharp edges the most, it avoids sharpening near flat areas and very sharp edges. From bacondither
activate anti-bloating filter: A post process method to reduce the fatness created by line sharpeners. Not needed for crispen edges, which is already "skinny."
activate anti-ringing filter: A post process method to reduce ringing due to sharpening.
SuperRes: [3] A post process method from Shiandow. Not recommended in combination with NGU.
----use linear light: Ideally use the same method that the source was originally downscaled with when it was mastered. This is usually not known but gamma light might be more likely. When enabled the image may be slightly darker and dark lines slightly fatter.
  1. Calculate an initial guess (using the configured upscaler)
  2. Downscale and calculate differences with original image.
  3. Scale those differences to the final size (SoftCubic50)
  4. Improve guess by:
    • Softening the image
    • Subtracting differences with the original image
    • Sharpening
    • Removing aliasing
    • Removing ringing
  5. Repeat steps 2-4 several times.

rendering

general settings

delay playback start until render queue is full: [Disabled] Pauses playback until all the buffers are full. With this option disabled only the present buffer needs to fill before playback starts.
enable windowed overlay (Windows 7 and newer): [Disabled] Only available on Nvidia and Intel GPUs. Uses a low level overlay method which bypasses the GPU LUT (monitor profile) so madVR emulates it when using this option, this is done in 16-bit so madVR can provide better quality than the GPU. Overlay also bypasses the OS to a large extent; screen-shots are not possible. D3D9 Only. Incompatible with 'fullscreen exclusive mode'.
enable automatic fullscreen exclusive mode: [Enabled] madVR has exclusive access to the display, nothing else can draw to the display without dropping out of this mode. This is the most stable mode for madVR because it has the most control over when and how video frames are displayed. There is a slight flicker and delay as madVR enters and exits this mode. Required for 10 bit in Windows 7 or 8.
disable desktop composition (Vista and Windows 7): [Disabled] Disables Aero which has its own v-sync that can conflict with madVR’s. This option cannot disable desktop composition on Windows 8 or 10 but desktop composition also works better on 8 and 10.
use Direct3D 11 for presentation (Windows 7 and newer): [Disabled] Use Direct3D 11 instead of D3D9. Requires a restart of madVR to take effect. Required for >8 bit output. Slightly more responsive than D3D9. Overrides windowed overlay.
present a frame for every VSync: [Enabled] when disabled madVR only presents new frames when needed, relying on D3D11 to repeat frames for each VSync. Disabled may improve performance but may also cause presentation glitches.
use a separate device for presentation (Vista and newer): [Disabled] Might improve performance slightly, or it might hurt it slightly.
use a separate device for DXVA processing (Vista and newer): [Disabled] Might improve performance slightly, or it might hurt it slightly.
CPU queue size: [16] The buffer in system memory for decoded video and xySubFilter subtitles.
GPU queue size: [8] The buffer in the graphics memory for madVR’s rendering.

windowed and exclusive mode settings

present several frames in advance: [Enabled] Uses a new method for presenting frames in advance instead of using a back-buffer queue.
how many video frames shall be presented in advance or how many backbuffers shall be used: [8 or 3] The present queue, a final buffer in DirectX, after madVR sends completed frames to Windows.
when and how shall the GPU be flushed: [flush, flush & wait (sleep), don't flush, don't flush] To be able to display rendering times in the OSD the '... after last render step' must be one of the 'flush & wait' options.

stereo 3d
madVR only supports frame packed 3D with the LAV video decoder.

enable stereo 3d playback: [Enabled] Allow madVR to output stereoscopic 3D content. 3D output is currently limited to 1080p23 with smooth motion automatically disabled.
when playing 2d content: [Disabled, disable os stereo 3d support for all displays] Change the stereo 3D setting in the OS when playing 2D content.
when playing 3d content: [Disabled, enable] Change the stereo 3D setting in the OS when playing 3D content. Depending on the display and GPU, 3D support may not need to be enabled in the OS to display 3D content.
restore os stereo 3d settings when media player is closed: [Disabled]

smooth motion [Disabled]
Uses frame blending to perfectly display the video’s frame rate at the display’s refresh rate without any dropped or repeated frames and while staying in sync with the audio. This eliminates frame time judder in exchange for slightly increased blurring due to the frame blending. The blurring is more visible when the refresh rate matches the source frame rate because all the frames will be blended frames. The blurring is less visible on higher refresh rate displays because fewer frames will be blended frames. Smooth motion will harm motion interpolation, do not use them at the same time.

only if there would be motion judder without it...: [Default] Smooth motion will activate when the refresh rate is not close to a multiple of the frame rate, e.g. it activates for 23.976 fps at 60Hz but not for 29.976 fps at 60Hz.
... or if the display refresh rate is an exact multiple of the movie frame rate: Smooth motion will always activate unless the frame rate matches the refresh rate, e.g. it will also activate for 29.976 fps at 60Hz but will still not activate for 23.976 fps at 24Hz.
always: Smooth motion is always active. This allows no dropped or repeated frames even when the source frame rate is very close, but not quite equal to, the real refresh rate of the display. Note that smooth motion has less blurring when displaying 23.976 fps at 60 Hz than 23.976 fps at 24 Hz so this option is not recommended unless you cannot increase the display's refresh rate.

dithering
Dithering is performed as the very last step in madVR to convert its internal 16 bit data to the bit depth set for the display. Any time madVR does anything to the video high bit depth information is created and dithering allows much of this information to be preserved when displayed at a lower bit depth. For example, the conversion of 8-bit YCbCr to RGB generates >8-bit RGB data. The higher the output bit-depth, as set in madVR's 'devices' -> 'properties', the less important dithering quality is.

None: Only use for testing, it is never useful for normal use, banding.
Random Dithering: Highest noise, but it is also the fastest option.
Ordered Dithering: [Default] This option has the lowest visible dithering noise. It uses a fixed dither texture that was optimized for low visible noise and offers high quality dithering with a low performance hit.
Error Diffusion: Uses DirectCompute to perform very high quality error diffusion dithering, similar to the Floyd–Steinberg or Sierra dithering algorithms. Test option 1 and 2 for yourself (or pick one randomly). They are both very good and my preference seems to change depending on the display.
use colored noise: [Enabled] Uses an inverted dither pattern for green which reduces luma noise but adds chroma noise. I like this option disabled, but test it for yourself.
change dither for every frame: [Enabled] Uses a new dither seed for every frame or, for ordered dithering, adds a random offset and rotates the dither texture 90° between every frame.

Last edited by Asmodian; 21st January 2019 at 23:46.
Asmodian is offline   Reply With Quote