Expand description
Psycho-visual masking model for perceptual rate control.
This module implements a visibility threshold model for per-block quantization decisions. The human visual system (HVS) is less sensitive to distortion in:
- High-texture regions (spatial masking)
- Bright regions (luminance masking — Weber’s law)
- High temporal activity (temporal masking)
- Near strong edges (edge masking)
The combined Just-Noticeable Difference (JND) threshold drives a QP delta that can be added to the base quantisation parameter. A positive delta means the block can tolerate more distortion (higher QP); negative means it needs finer coding (lower QP).
§Reference
Watson, A.B. (1993). DCTune: A technique for visual optimization of DCT quantization matrices. Society for Information Display Digest of Technical Papers, 24, 946–949.
Structs§
- Block
Mask Stats - Per-block statistics gathered during analysis (before encoding).
- Psycho
Visual Config - Configuration for the psycho-visual masking model.
- Psycho
Visual Model - Psycho-visual masking model that computes per-block QP deltas.
- PvsModel
- Simplified psycho-visual sensitivity (PVS) model.
Constants§
- CHROMA_
VISIBILITY_ THRESHOLDS - Chrominance visibility thresholds per DCT frequency (8×8 block).
- LUMA_
VISIBILITY_ THRESHOLDS - Luminance visibility thresholds per DCT frequency (8×8 block, row-major).
Functions§
- scale_
thresholds - Scale the standard visibility threshold table by a quality factor.