
Temporal AQ adjusts the QP based on the temporal characteristics of the sequence. If no value is specified for the -spatial-aq-gain option, the default value is 50. To enable spatial AQ, set the -spatial-aq-gain to 1 and the -spatial-aq-gain to 50 on the FFmpeg command line. The range of this option is from 0 to 100 and indicates the strength of this algorithm as a percentage. The spatial AQ algorithm can be controlled using the -spatial-aq-gain option.

It is recommended to turn this feature off when performing PSNR/VMAF based evaluation. Although spatial AQ improves visual quality, it hurts objective metrics and causes a drop in PSNR and VMAF. This redistribution of bits to visually perceptible regions of the frame brings about visual improvement. Spatial AQ exploits this and provides more bits to the low texture and flat regions at the expense of high texture regions. The human eye is more sensitive to regions which are flat and have low texture than regions which have lots of detail and texture. Spatial AQ adjusts the QP within a frame based on the spatial characteristics. Both of these AQ modes are enabled by default, and -qp-mode is set to relative-load when -lookahead_depth >= 1. The Alveo U30 card supports two types of AQ: Spatial Adaptive Quantization and Temporal Adaptive Quantization. It exploits the fact that the human eye is more sensitive to certain regions of a frame and redistributes more bits to those regions.

The QP for each frame is determined by the rate control, and adaptive quantization (AQ) adjusts QP on top of that for different regions within a frame. This tool improves the visual quality by changing the quantization parameter (QP) within a frame.
