RenderQuality

data class RenderQuality(val dither: Boolean = false, val deband: Boolean = false, val debandThreshold: Float = 48.0f, val debandRange: Float = 16.0f, val debandGrain: Float = 48.0f, val scaler: VideoScaler = VideoScaler.Bilinear, val linearLight: Boolean = false, val animationUpscaler: AnimationUpscaler = AnimationUpscaler.Off)

How much work a renderer spends on the picture beyond decoding it correctly.

These are the passes a viewer notices and that FFmpeg cannot do for us, because they belong on the GPU next to the draw: removing the banding an 8-bit write creates, removing the banding the source already carries, scaling with something better than the sampler's bilinear, and enlarging animation with a network trained on it.

Every field's default is the behaviour the engine had before this type existed, and a renderer reads isNeutral to skip the work entirely. That is deliberate and is the ladder's first law: DISABLED IS BIT-EXACT. A build that turns nothing on writes the same pixels it always did, which is what makes each pass measurable on its own and what keeps the colour instruments honest.

Not every renderer can honour these. A renderer applies what it can and ignores the rest; the engine neither asks nor promises. On Android the shipping interop path decodes straight to a Surface with no shader of its own, so nothing here reaches it.

Constructors

Link copied to clipboard
constructor(dither: Boolean = false, deband: Boolean = false, debandThreshold: Float = 48.0f, debandRange: Float = 16.0f, debandGrain: Float = 48.0f, scaler: VideoScaler = VideoScaler.Bilinear, linearLight: Boolean = false, animationUpscaler: AnimationUpscaler = AnimationUpscaler.Off)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Enlarges animation with a small neural network trained on line art and flat colour, which is what a photographic kernel renders soft.

Link copied to clipboard

Smooths banding the SOURCE carries, which dithering cannot touch because it is already in the decoded samples.

Link copied to clipboard

Grain added back after smoothing, in 1/16384 of full scale. mpv's 48.

Link copied to clipboard

How far the ring reaches, in source pixels, at the first iteration. mpv's 16.

Link copied to clipboard

How flat a neighbourhood must be to count as a band, in 1/16384 of full scale. mpv's 48.

Link copied to clipboard

Adds a tiny ordered pattern before the 8-bit write, so a smooth ramp stops collapsing into visible steps.

Link copied to clipboard

True for the value that reproduces the plain decoded picture exactly, byte for byte.

Link copied to clipboard

Scales in LIGHT-linear space rather than in the transfer curve's space.

Link copied to clipboard

Which kernel resamples the picture when it is not drawn at its own size.