Expand description
Frame-processing policy shared by the X11 and Wayland backends. Frame-processing policy shared by the two capture backends. It lives in its own module for one reason: the Wayland path (dmabuf, compositor damage) and the X11 path (host-ARGB, stripe-hash damage) capture pixels in completely different ways, but a viewer must never be able to tell which one produced a frame — a paint-over refresh or a recovery keyframe has to behave identically either way. Keeping the decision logic here, source-agnostic, is what guarantees it.
Structs§
- Encoder
Quality - What an encoder says about the frames it codes, which the cleanup reads: the quality index
its rate control last coded a frame at, where it reports one (
FrameEncoder::last_quality), the bytes of that frame, where it reports them too (FrameEncoder::last_size), whether it holds a frame at a quantizer it is asked for (FrameEncoder::holds_quantizer), whether a change of its constant quality re-opens it on a key frame (FrameEncoder::reopens_on_quality), whether its constant-rate cleanup ends on a key frame (FrameEncoder::cleans_up_with_key), where it holds a band of a frame at that quantizer (FrameEncoder::band_size), the bytes of its last held frame, and, where it measures a frame’s reconstruction against its source when asked (FrameEncoder::measures), the last measurement. - HwFrame
Decision - Outcome of the full-frame send decision produced by
decide_hw_fullframe. - X11Pipeline
- Everything the X11 host-ARGB path has to remember between frames.
Enums§
- Cleanup
- What the cleanup policy decided for one region’s frame.
- Convergence
- Where a rate control that the cleanup runs through stands after its last frame, of
bytesat quality indexlast, against the paint-over quantizer andbudgetbytes a frame. - Damage
- How much of a frame changed since the frame before it, as far as its capture can tell.
Functions§
- cleanup_
due - The still-screen cleanup of one region (a whole frame, or a stripe): track how long and how
much it has been changing, and say when it is due a cleanup and of which kind.
keysfalse (JPEG, whose every stripe is a picture of its own, and a constant-rate session cleaned up through its rate control) never answersCleanup::Key. - cleanup_
pending - Whether
cleanup_duewould answer a cleanup for a frame that changed nothing, without moving the bookkeeping: what an idle frame has to know before it skips a region. - converge_
frames - Frames a constant-rate cleanup through the rate control flows at most (
CONVERGE_S). - convergence
- Where the rate control stands (
Convergence). - decide_
hw_ fullframe - The send / quality / keyframe policy every full-frame encoder obeys. A constant-quality
session takes
decide_constant_quality; what follows is the constant-rate one. - frame_
budget - Bytes a frame of the constant-rate target, at
kbpsandfps. - held_
refresh_ quality - The quality index a held refresh (a predicted frame) is coded at: the paint-over one, or,
where a constant rate last coded far coarser, as much finer than that as
HELD_KEY_BUDGET_Sof the target allows at six steps a doubling, since a refresh of a whole screen at the paint-over quantizer after heavy motion at a low rate would cost many frames of budget at once. - paint_
over_ improves - Whether a cleanup improves the picture at all: at a constant quality where the paint-over
quality is finer than the session’s (the cleanup then moves the session’s quality, see
decide_constant_quality); at a constant rate where it is finer than the quality index the rate control last coded at, or the encoder does not say. A rate control that has already refined a still screen past it (a constant rate refines every frame it sends) is left alone: holding the paint-over quantizer there would coarsen the picture. A constant-rate encoder that holds no quantizer is cleaned up by the rate control’s own frames, a refresh and its burst, which it refines; a key frame there would come out at the rate control’s quantizer, which a small buffer starves. - periodic_
idr_ due - Whether a scheduled keyframe is due this tick.