Spatial Psychoacoustic Models in AVIF Encoding
This article examines the conceptual and technical relationship between sensory perceptual models and AVIF image compression. While psychoacoustic models fundamentally govern auditory perception rather than visual data, the mathematical principles of sensory masking frequently inform the psychovisual models used to adapt video encoders like AV1 for still images. Below, we break down the distinction between acoustic and visual models, how perceptual masking applies to static graphics, and how AV1 video encoders are reconfigured to produce high-fidelity AVIF stills.
Psychoacoustics vs. Psychovisual Modeling
In media compression, psychoacoustic models measure how the human auditory system perceives sound, relying on frequency masking, temporal masking, and spatial localization to discard inaudible audio data. Because the AV1 Image File Format (AVIF) is a container strictly designated for static or animated visual content derived from AV1 intra-frames, spatial psychoacoustic models play no operational role in the generation of AVIF files.
Instead, image compression relies on spatial psychovisual models. The overlap between the two domains lies in their shared signal-processing foundations. Both disciplines quantify the human brain’s perceptual thresholds using transform-domain masking, Just Noticeable Difference (JND) measurements, and bandwidth-reduction strategies tailored to human sensory limits.
How Perceptual Masking Translates to Static Images
In audio processing, a loud tone masks quieter adjacent frequencies in both pitch and time. Similarly, in spatial psychovisuals, high-frequency spatial detail or high-contrast texture masks compression noise and quantization artifacts in nearby pixels. This is known as visual spatial masking.
When configuring encoders for still images, perceptual algorithms analyze:
- Luminance Masking: The human visual system has lower sensitivity to noise in extremely bright or extremely dark regions compared to mid-tones.
- Texture and Edge Masking: High-texture regions (such as foliage or stone surfaces) can tolerate higher quantization error than smooth gradients or sharp edges, where banding and ringing artifacts are immediately noticeable.
- Contrast Sensitivity Function (CSF): Similar to equal-loudness contours in acoustics, the CSF measures how spatial frequency impacts visual perception, guiding the quantizer to allocate fewer bits to frequencies the eye cannot resolve.
Adapting AV1 Video Encoders for AVIF Stills
Video encoders such as libaom and SVT-AV1 are engineered primarily for moving pictures, where temporal masking operates heavily. In motion video, the human eye tolerates lower spatial fidelity per frame because motion blurs fine details and successive frames refresh rapidly.
When adapting these encoders for AVIF still images, the following structural adjustments must be made:
- Elimination of Temporal Masking: Because a still viewer can scrutinize an image indefinitely, temporal masking assumptions are invalid. Encoders must operate exclusively in intra-frame (all-intra) mode, where every pixel must hold up to static inspection.
- Recalibration of Adaptive Quantization (Delta-Q): Video rate control often averages distortion over time. For AVIF, spatial psychovisual tuning (such as variance-based or edge-directed adaptive quantization) must evaluate local spatial activity frame-by-frame, shifting bits from complex, heavily masked textures to vulnerable smooth areas to prevent contouring.
- In-Loop Filtering Adjustments: AV1 includes in-loop restoration, the Constrained Directional Enhancement Filter (CDEF), and the Deblocking Filter. While aggressive filtering prevents distracting temporal flicker in video, it can over-smooth fine details in stills. Encoders adapted for AVIF must tune these filters conservatively to preserve authentic micro-textures.
- Static Film Grain Synthesis: Instead of burning bits to encode high-frequency sensor noise or film grain, AV1 uses parametric grain synthesis. For stills, psychovisual algorithms estimate spatial noise characteristics to synthesize realistic grain at the decoder level, preventing plastic-looking flat regions without inflating file size.