What Is AV1 tune=vmaf and How It Affects AVIF
The tune=vmaf setting in AV1 encoders optimizes
compression decisions specifically to maximize the Video Multi-Method
Assessment Fusion (VMAF) metric rather than standard mathematical models
like PSNR. Because the AVIF image format uses AV1 intra-frame coding,
applying this tuning directly alters the visual balance of static images
by shifting how detail, sharpness, and compression artifacts are
prioritized across different frequencies and textures.
Understanding the tune=vmaf Setting
When encoding with AV1 libraries like libaom or
SVT-AV1, the encoder uses Rate-Distortion Optimization
(RDO) to determine how to compress image blocks within a given bitrate
budget. By default, encoders balance mathematical fidelity and visual
perception using metrics like Peak Signal-to-Noise Ratio (PSNR) or
structural similarity (SSIM).
The tune=vmaf option alters the internal cost functions
of the encoder. VMAF—developed by Netflix—combines multiple quality
metrics (such as Visual Information Fidelity and Detail Loss Metric)
alongside machine learning to approximate how the human visual system
perceives quality. When tune=vmaf is enabled, the encoder
chooses transform sizes, quantization levels, and prediction modes that
directly target a higher VMAF score.
How tune=vmaf Influences AVIF Visual Balance
Because an AVIF file is essentially an AV1 keyframe wrapped in an HEIF container, any encoder-level optimization alters the resulting still image. Tuning for VMAF impacts the visual characteristics of AVIF images in several distinct ways:
1. Edge Preservation and Sharpness
Standard mathematical metrics often favor slight blurring because
blur distributes error evenly, keeping PSNR high. In contrast, VMAF
heavily penalizes the loss of sharp structural boundaries. Under
tune=vmaf, AVIF encoders allocate more bits to prominent
edges and high-contrast transitions. This creates images that appear
sharper and clearer at lower bitrates compared to untuned or PSNR-tuned
encodes.
2. Texture Retention vs. Smoothing
VMAF incorporates detail loss evaluation, meaning
tune=vmaf attempts to prevent flat, blocky patches in
textured areas like foliage, fabric, and skin. However, since VMAF is
fundamentally designed for moving video where temporal masking hides
small spatial errors, static AVIF images tuned with VMAF can sometimes
exhibit uneven texture distribution. The encoder may over-allocate data
to keep one distinct texture sharp while aggressively smoothing an
adjacent, subtler gradient.
3. Metric Gaming and Visual Artifacts
Tuning strictly for an automated metric introduces the risk of
"metric gaming." The encoder optimizes for what satisfies the algorithm
rather than true human vision. In AVIF encoding, tune=vmaf
can produce specific visual trade-offs:
- Ringing Artifacts: To preserve edge contrast and score well on detail metrics, the encoder may produce faint halos around sharp edges.
- Chroma Smearing: Because standard VMAF focuses heavily on the luma (brightness) channel, color details in AVIF images can be disproportionately compressed, leading to desaturated or smeared colors in complex patterns.
- Banding in Gradients: Smooth areas like skies may suffer from subtle color banding as bits are aggressively stolen from low-variance blocks to boost high-frequency scores elsewhere.
When to Use tune=vmaf for AVIF
tune=vmaf is most effective when encoding AVIF assets at
low-to-medium bitrates where preserving perceived sharpness and contrast
is more important than absolute fidelity. It prevents the soft,
washed-out look typical of aggressive standard compression.
For photographic AVIF images at high quality levels, tuning for VMAF is generally less desirable than tuning for SSIM, modern perceptual metrics (like SSIMULACRA2), or using default psychovisual tunings. At high bitrates, VMAF-specific decisions can introduce unnatural sharpness halos and color trade-offs that become noticeable upon close inspection of a still photograph.