Skip to main content

Module psycho_visual

Module psycho_visual 

Source
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§

BlockMaskStats
Per-block statistics gathered during analysis (before encoding).
PsychoVisualConfig
Configuration for the psycho-visual masking model.
PsychoVisualModel
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.