Skip to main content

Module svtav1

Module svtav1 

Source
Expand description

Software AV1 through SVT-AV1. Software AV1 through SVT-AV1 at preset 11 in its real-time mode (PRESET), one frame in and one packet out (two frames deep before 2.3), with rate control either constant-rate at the session’s bitrate and VBV or a constant quantizer. A new bitrate reaches the running encoder with the next picture where the release takes one (HAS_EVENTS); a quality, frame-rate, or VBV change re-opens it, as a bitrate change does on an earlier release.

A capped constant quantizer (RateSettings::capped) holds its peak beside the library (PeakOffset), as x264 does: the library’s own capped CRF (max_bit_rate) needs its temporal dependency model, which the low-delay structure a real-time session codes in leaves off, so the library drops the cap there (4.3.0: “Maximum bit rate only supported with tpl on”), and its constant rate cannot be switched to live. The session opens with per-picture quantizers (use_qp_file) and names none while its peak does not bind, which the patched library codes at the sequence’s quantizer (patches/svtav1, svtav1_sequence_qp), so a session the peak never binds codes as an uncapped one; while it binds, a picture is forced at the quality raised by the peak’s offset, and from then until the encoder next opens a change of quality is forced on the pictures it applies to rather than re-opening on a key frame (SvtAv1Encoder::forced_level). A library without the patch runs the constant quantizer uncapped.

A constant-rate session on such a release names its references: it predicts every frame from the one before in a flat structure and has the library store anchors on the schedule of ReferenceSlots, its GOLDEN and ALTREF, so a frame a client lost is predicted past from an anchor older than it, at ANCHOR_PRESET. Any other session leaves the references to the library, and a frame a client lost costs the key frame the caller codes on the refusal, which SVT-AV1 before 2.0 codes only from a re-open as well.

The blocks the ledger marks still and clean reach the library as the picture’s constant-block map (constant_blocks, EbBufferHeaderType.constant_blocks; the patches under patches/svtav1): it copies only the other blocks, and those changed since its pooled buffer last held the picture, into the buffers it codes from, bit for bit the stream of a whole copy (the copy of a still 1080p frame took 0.011 ms on the calling thread where it took 0.22, and at 2560x1600 0.025 where it took 0.52), and at a constant quantizer codes a 64x64 superblock of them as a zero-motion skip with no motion search, partition pass, candidate search, or transform (a still 1080p frame took 1.08 ms on six logical processors where it took 1.70, and at 2560x1600 1.88 where it took 2.86). A constant rate takes the copy alone: its refresh of a still picture at a finer quantizer runs through the blocks a map would hold, and holding them let its quantizer fall until a frame coded whole came out at many times the budget. An SVT-AV1 a distribution packages copies every picture whole and analyses every superblock.

The session refines no blocks (FrameEncoder::refines): the library’s region map sets a segment’s quantizer under a constant quantizer alone, its constant rate never setting up segmentation, and the mode decision keeps the frame’s lambda for every segment, so a still block skips whatever its segment’s quantizer. Half a still 720p picture mapped 150 quantizer index steps finer than its qp 50 key frame came out at the map’s 17 bytes a frame more, at presets 4 to 11 (SVT-AV1 2.3).

Structs§

SvtAv1Encoder
One SVT-AV1 session for one capture.

Constants§

ANCHOR_PRESET 🔒
The preset a frame predicting from an anchor alone is coded at. At preset 11 the library keeps some blocks the picture changed since the anchor as they stand in the anchor, a stale copy every client shows (test_slow_page’s bar, 14 frames back, left where it was in a 64-pixel block); preset 10 codes them. A session naming its references opens at it, since the library takes a preset change only toward a faster one, and codes every other frame at PRESET.
FEED_BEFORE_RELEASE 🔒
SVT-AV1 before 1.5 drains an encoder on release even when it took no frame, and waits for a packet that never comes; a session released before its first frame feeds it one.
FORCED_MIN_LEVEL 🔒
The lowest quantizer level a forced picture finer than the session’s quality codes at (SvtAv1Encoder::forced_level): the library’s own floor, below which it faults.
KEYFRAME_BY_REOPEN 🔒
SVT-AV1 before 2.0 codes a key frame asked for mid-stream only in its random-access quality mode; a session on one re-opens the encoder for it, and the first frame answers.
KEY_PRESET 🔒
The preset a constant-rate session opens at and codes a still screen’s held key frame at: the slowest at which the real-time mode keeps a frame’s references to two, which the anchors the session stores (MANAGED_REFS) need; the library refuses them below it. The real-time mode turns the screen-content tools (palette, intra block copy) off from this preset on. The session’s first key frame and every other frame keep their own presets: the library takes a picture’s preset change within the open one’s and faster.
MANAGED_REFS 🔒
The anchors a session that names its references has the library hold: GOLDEN and ALTREF, and the ones they replaced until a picture releases them.
MAX_BITRATE_BPS 🔒
The highest constant-rate target the library takes, at open and live alike.
PRESET 🔒
The preset frames are coded at: in the real-time mode, a quarter less encode time than preset 10 for more bytes at a fixed quantizer, which the quantizer table absorbs; the presets above it are no faster.
RTC_MIN_LEVEL 🔒
The lowest quantizer level the real-time mode runs at. Below three the library faults, and below ten it codes every other frame of a scrolling text desktop with the lower third of the picture wrong, at three times the bytes of level ten.

Statics§

LIFECYCLE 🔒
The handles alive, held while one is created or released and while the probe forks: before 4.0 the library rebuilds a process-wide processor table in every handle it creates and frees it in every one it releases, and from 4.1 handle setup takes process-wide locks that a child forked meanwhile inherits held. The probe forks only while no handle is alive, since a live session’s worker threads hold that state as well.
RELEASED 🔒
Notified at each handle released, for a probe waiting for none to be alive.

Functions§

anchor_id 🔒
The id an anchor is stored under: its timestamp, off the zero the library reserves.
error 🔒