Enable Variance-Based AQ in SVT-AV1
This article provides a straightforward guide on how to enable
variance-based adaptive quantization (AQ) when encoding video using the
SVT-AV1 encoder. It covers the specific command-line parameters required
for both the native SVT-AV1 standalone encoder
(SvtAv1EncApp) and the FFmpeg integration, allowing you to
improve visual quality by distributing bits more efficiently across
different frame textures.
Understanding the Parameter
Adaptive Quantization (AQ) adjusts the quantization parameter (QP) locally within a frame based on the complexity of the image. In SVT-AV1, variance-based AQ analyzes the spatial variance of a block to determine whether it contains flat, low-contrast textures or highly detailed, high-contrast textures. This helps prevent blockiness and banding in smooth areas like skies or flat walls.
To enable variance-based adaptive quantization, you must set the AQ mode parameter to 1.
Enabling AQ in the Native SVT-AV1 Encoder
When using the standalone SvtAv1EncApp executable, you
enable variance-based AQ by passing the --aq-mode flag
followed by the value 1.
Below is an example of the command-line usage:
SvtAv1EncApp -i input.yuv -w 1920 -h 1080 --preset 4 --crf 26 --aq-mode 1 -b output.ivfEnabling AQ in FFmpeg
If you are invoking libsvtav1 through FFmpeg, you must
pass the parameter using the -svtav1-params option.
Multiple parameters inside -svtav1-params are separated by
colons.
Below is an example of the FFmpeg command-line usage:
ffmpeg -i input.mp4 -c:v libsvtav1 -crf 26 -preset 4 -svtav1-params aq-mode=1 output.mkvVerifying the Settings
- aq-mode 0: Disables adaptive quantization entirely.
- aq-mode 1: Enables variance-based adaptive quantization (recommended for most standard content to improve subjective visual quality).
- aq-mode 2: Enables delta-q adaptive quantization (an alternative method that utilizes delta-QP to optimize rate-distortion performance).