Expand description
What the full-frame software sessions share: planar input, quantizer, rate settings. What the full-frame software sessions share: the planar picture a packed host frame is converted into, at 8 or 10 bits, the constant quantizer that follows the session quality index, the rate-control settings a live change is compared against, and the frames an encoder has been handed but not yet answered.
Structs§
- Peak
Bucket - A leaky bucket of a capped constant quality’s peak (
RateSettings::capped), its buffer the session’s VBV, for an encoder whose constant quality takes no cap of its own: the session codes as an uncapped one while the bucket holds what it codes, binds to the peak through its constant rate, never finer than its quality, from the frame that overflows the bucket, and lets go onceRELEASE_FRAMESframes in a row come out at that quality with the bucket back within its buffer, which says the content fits under the peak again: a rate control that takes the peak with its buffer full codes at the quality for a while whatever the content. The frame that overflows has already gone out: the cap holds the frames after it. - Peak
Offset - The peak of a capped constant quality held beside an encoder that codes its constant quality
per frame and has no rate control to bind to it (x264, SVT-AV1), where
PeakBucketswitches one that does. A leaky bucket of the peak, its buffer the session’s VBV, takes each frame: from a frame that overflows it the quality index standsoffsetsteps above the session’s, aimed after each frame at bringing the bucket back to half full inDRAIN_FRAMESframes (a size halving every six steps) and lowered at mostRELEASE_STEPa frame, so a session that never overflows it codes as an uncapped one. - Pending
- The frames handed to an encoder and not yet answered, by the timestamp each was submitted with, so a packet names the frame it encodes rather than the one submitted alongside it. An encoder that pipelines answers a frame several later, and one that drops a frame never answers it at all, so taking a timestamp discards every submission it passed over.
- Planes
- A planar picture, 4:2:0 or 4:4:4, with tightly packed rows: 8-bit samples in
y,u, andv, or 10-bit ones iny16,u16, andv16, the planes of the other depth staying empty. - Quality
- The constant quantizer of a session, moved toward the one the quality index selects: a
decrease sharpens the picture and applies at once, an increase waits out
QP_HYSTERESIS_LIMITconsecutive requests so transient motion does not make quality blink. The domain is the codec’s own (Codec::quantizer). - Rate
Settings - The rate-control and frame-rate settings a session was configured with, so a live change re-programs the encoder only when a value it reads actually moved.
Functions§
- check_
host_ frame - Whether
pixelsholds awidthxheightpacked picture atstridebytes per row. - convert_
into - Convert a packed host frame into planes a library owns, at
strides(luma, chroma) bytes per row, asPlanes::convertdoes into its own. - encode_
threads - The encode threads a full-frame H.265, VP8, VP9, or AV1 software session spreads across
(
threads_up_toeight): x265’s and kvazaar’s wavefront, libvpx’s token partitions and rows, and SVT-AV1’s logical processors. - h264_
fullframe_ threads - The encode threads a full-frame H.264 software session spreads across (
threads_up_tofour): x264’s sliced threads, and OpenH264’s threads over its four slices, more than which would buy nothing. - threads_
up_ 🔒to - The encode threads a software session spreads across, between one and
most: one less than the host’s cores, or one alone wherecpu_encode_threadingis off. The conversion ahead of the encoder runs on as many.