The Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder) with perceptual enhancements for psychovisually optimal AV1 encoding
The Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder) with perceptual enhancements for psychovisually optimal AV1 encoding
Since the original SVT-AV1-PSY project was sunset, I decided to build svt-av1-psyex: a way for all of us to develop the best open AV1 video encoder in novel ways to attain the best visual fidelity at all quality levels when compressing videos.
As such, SVT-AV1-PSYEX is the Scalable Video Technology Psychovisually Extended with advanced perceptual improvements, additions and tuning for psychovisually optimal media encoding. The goal is to create the best encoding implementation for perceptual quality with AV1. We may or may not implement bleeding edge features, optimizations and even extend mainline features beyond their intended purpose.
Compared to previous SVT-AV1-PSYEX versions, svt-av1-psyex 3.0.2-B has superior default settings. The main change relates to the visual tune: tune 0 has been made default in place of tune 1. This has been done to improve visual quality on the side of fidelity. However, just changing the default from tune 1 to tune 0 would have increased encoding artifacts considerably.
For this reason, I set --noise-adaptive-filtering 0 by default, which disables noise-adaptive CDEF and restoration filters. This restores original CDEF and restoration filter applications similar to tune 1/tune 2.
Normally in tune 0/3, noise-adaptive CDEF and restoration filters are enabled: if noise levels are high enough, CDEF and restoration filtering get completely disabled. This has the effect of increasing sharpness levels quite a bit in some scenarios.
However, at lower bitrates and for lots of 2D animated content, completely disabling those filters when there's just a bit of noise, can wreck image stability and/or quality around lines. In the past with previous svt-av1 and svt-av1-psy, this tradeoff was worth it since there weren't other ways to boost image quality; today is a completely different story with much more powerful psychovisual options.
This allowed us to set --tune 0 --noise-adaptive-filtering 0 and still get higher visual quality than the previously set --tune 1 in svt-av1-psyex 3.0.2-A in almost all encoding scenarios as well!
If you want previous tune 0 behavior, you can set --noise-adaptive-filters 1. Do note that 1 enables both noise-adaptive CDEF and restoration filtering at all times, for all presets. --noise-adaptive-filtering 1 can be forced to all tunes, which can be useful if you want to make --tune 2 behave more closely to --tune 3.
For reference, here is Fidelity Simplicity is key If you're doing general encoding or are at the beginning of your encoding journey, I'd just recommend staying with the well tuned defaults and only change things like speed presets (recommended are P2 to P6), CRF and maybe higher psy-rd if everything else fails.
Note: higher fidelity = sharper with more chances of artifacts, higher appeal = fewer artifacts with more potential for blurriness.
For sharper, more consistent visuals (with a chance of more artifacts) without slowing the encoder down:
--psy-rd strength.--qm-min 8--noise-adaptive-filtering 1This will make the encode more consistent and increase visual sharpness, but might introduce more artifacts at the same bitrate; this is usually worth it.
For more challenging content, a further quality increase can be achieved with:
--noise-norm-strength 3 (Default is 1)For more consistent quality at the expense of compression efficiency:
--qp-scale-compress-strength 2 (the default is 1; higher values offer diminishing returns).For a significant visual quality increase at the cost of more encoding time:
--complex-hvs 1 to the above settings. This enables much higher quality mode decisions, which can greatly increase visual quality in all scenarios when psy-rd is active, particularly at higher strengths.--hbd-mds 1 to get static 10-bit mode decision, increasing visual quality and efficiency at all times.--enable-dlf 2 to increase deblocking filter quality.To preserve smooth, clean high quality lines in anime without excessive bitrate:
--noise-adaptive-filtering 4.Only for content with overwhelming natural or artificial grain (e.g., old films, Breaking Bad or massive artifical grain dumps). Not recommended for clean, modern sources. Expect large file sizes and slow encodes, particularly if you have natural content from most modern cameras that is relatively clean and doesn't deserve bloat.
You have been warned: don't expect great efficiency with these settings at CRF50 1080p60 natural content. It is also rather slow.
--preset X --complex-hvs 1 --crf XX --enable-cdef 0 --enable-restoration 0 --enable-tf 0 --spy-rd 1 --noise-norm-strength 3 --qm-min 10 --tune 0 --qp-scale-compress-strength 3 --scm 0 --psy-rd 4.0 --hbd-mds 1
If you want much more detailed information, you can just visit the x266 wiki on the subject and expect some future articles on there for a truely profound... deep dive. Sorry for the word play :)
--variance-boost-strength 1 to 4 (Merged to Mainline)Provides control over our augmented AQ Modes 0 and 2 which can utilize variance information in each frame for more consistent quality under high/low contrast scenes. Four curve strength options are provided, and the default is strength 2; 1: mild, 2: gentle, 3: medium, 4: aggressive
--variance-octile 1 to 8 (Merged to Mainline)Controls how "selective" the algorithm is when boosting superblocks, based on their low/high 8x8 variance ratio. A value of 1 is the least selective, and will readily boost a superblock if only 1/8th of the superblock is low variance. Conversely, a value of 8 will only boost if the entire superblock is low variance. Lower values increase bitrate. The default value is 6.
--variance-boost-curve 0 to 2 (Merged to Mainline)Enable an alternative variance boost curve, with different bit allocation and visual characteristics. The default is 0.
A 3rd curve --variance-boost-curve 3 will be added in the next release for HDR content.
Presets -2 & -3Terrifically slow encoding modes for research purposes, as well as extremely low filesize challenges.
Enhanced Tune 0Using the knowledge gained from the Tune 3 implementation, we greatly enhanced tune 0 to the point that it's become the favored tune for high fidelity video encoding, including demanding anime content. Further updates on related options will be added to push tune 0 into a different direction for less demanding animu content, since many have asked for less... aggressive tuning.
Tune 3A new tune based on Tune 2 (SSIM) called SSIM with Subjective Quality Tuning. Generally harms metric performance in exchange for better visual fidelity with the SSIM+SSIM-RD tuning.
Tune 4 (Ported to libaom)Another new tune based on Tune 2 (SSIM) called Still Picture. Optimized for still images based on SSIMULACRA2 performance on the CID22 Validation test set. Not recommended for use outside of all-intra (image) encoding
--sharpness 0 to 7 (Merged to Mainline)A parameter for modifying loopfilter deblock sharpness and rate distortion to improve visual fidelity. The default is 1 (mild sharpness bias).
--dolby-vision-rpu path to fileSet the path to a Dolby Vision RPU for encoding Dolby Vision video. SVT-AV1-PSY needs to be built with the enable-libdovi flag enabled in build.sh (see ./Build/linux/build.sh --help for more info) (Thank you @quietvoid !)
Progress 3A new progress mode that provides more detailed information about the encoding process.
--fgs-table path to file (Merged to Mainline)Argument for providing a film grain table for synthetic film grain (similar to aomenc's '--film-grain-table=' argument).
Extended CRF (for now, only quarter step CRF has been merged to mainline)Provides a more versatile and granular way to set CRF. Range has been expanded to 70 (from 63) to help with ultra-low bitrate encodes, and can now be set in quarter-step (0.25) increments.
--qp-scale-compress-strength 0.0 to 8.0 (Merged to Mainline)Increases video quality temporal consistency, especially with clips that contain film grain and/or contain fast-moving objects. The default is 1, a conservative setting for most content.
--enable-dlf 2 (Merged to Mainline)Enables a more accurate loop filter that prevents blocking, for a modest increase in compute time (most noticeable at presets 7 to 9). This stops being useful at Preset 3.
The default is 1, which is based on the preset.
Higher-quality presets for 8K and 16KLowers the minimum available preset from 8 to 2 for higher-quality 8K and 16K encoding (64 GB of RAM recommended per encoding instance).
--luminance-qp-bias 0 to 100 (Merged to Mainline)It was known before as --frame-luma-bias
Enables frame-level luma bias to improve quality in dark scenes by adjusting frame-level QP based on average luminance across each frame.
The default is 0.
--max-32-tx-size 0 and 1 (Merged to Mainline)Restricts available transform sizes to a maximum of 32x32 pixels. Can help slightly improve detail retention at high fidelity CRFs. The default is 0.
--adaptive-film-grain 0 and 1 (Merged to Mainline)Adaptively varies the film grain blocksize based on the resolution of the input video. Often greatly improves the consistency of film grain in the output video, reducing grain patterns. The default is 1, and is the recommended setting.
--hdr10plus-json path to fileSet the path to an HDR10+ JSON file for encoding HDR10+ video. SVT-AV1-PSY needs to be built with the enable-hdr10plus flag enabled in build.sh (see ./Build/linux/build.sh --help for more info) (Thank you @quietvoid !)
--tf-strength 0 to 4 (Merged to Mainline)Manually adjust temporal filtering strength to adjust the trade-off between fewer artifacts in motion and fine detail retention. Each increment is a 2x increase in temporal filtering strength; the default value of 1 is 4x weaker than mainline SVT-AV1's default temporal filter (which would be equivalent to 3 here).
--chroma-qm-min & --chroma-qm-max 0 to 15 (**[Merged to Mainline](https://gitlab.com/AOMediaCodec/SVT-AV1/-/commit/4f0794415e707daa3ceNo open issues yet, or sync has not completed.