pub struct BlockLedger {Show 17 fields
width: i32,
height: i32,
cols: usize,
rows: usize,
still: Vec<u16>,
clean: Vec<bool>,
refined: Vec<bool>,
coarse: Vec<bool>,
coarse_key: Vec<bool>,
coarse_count: usize,
owed: Vec<bool>,
owed_count: usize,
fresh: Vec<bool>,
fresh_count: usize,
next_refresh: usize,
next: usize,
unreported: bool,
}Expand description
Per-block stillness and cleanliness of one region (module docblock).
Fields§
§width: i32§height: i32§cols: usize§rows: usize§still: Vec<u16>Frames each block has held still, saturating.
clean: Vec<bool>Whether each block’s last coding was at the paint-over quality or finer.
refined: Vec<bool>Whether each block was refined (refined) since it last changed: coded at the target a
key-frame cleanup reaches, which a refresh at the paint-over quality does not.
coarse: Vec<bool>Whether each block was last coded under a capped constant quality’s binding peak,
coarser than the rate factor would have chosen (coded), and not refreshed since, and
whether that was in a key frame.
coarse_key: Vec<bool>§coarse_count: usizeHow many blocks are coarse, so a session no peak ever bound reads none at no cost.
owed: Vec<bool>Whether each block is owed its paint-over: a cleanup that fell due on it was left to the
refresh, or coded short of its target under a binding peak (spent), and the block not
coded at it since. An owed block is coarse too, and the refresh codes it at the
paint-over quality (refresh_owed).
owed_count: usize§fresh: Vec<bool>Whether each block was refreshed at the session’s own quality since it changed: a
cleanup coded over it as over the picture an uncapped session holds leaves it coarser
than that session’s paint-over, the quality it starts from being finer (fresh).
fresh_count: usize§next_refresh: usizeThe block the next refresh starts its turn from.
next: usizeThe block the next plan starts its turn from.
unreported: boolWhether the region’s source was last seen to leave a change unreported
(frame_reported).
Implementations§
Source§impl BlockLedger
impl BlockLedger
Sourcepub fn new(width: i32, height: i32) -> Self
pub fn new(width: i32, height: i32) -> Self
A ledger of a width x height region, every block changed and unclean.
Sourcepub fn fit(&mut self, width: i32, height: i32)
pub fn fit(&mut self, width: i32, height: i32)
Follow the region to width x height, starting over where that changed it: a resize,
a scale change, or a rebuilt encoder leaves nothing of the old picture’s quality.
Sourcepub fn frame<'a>(
&mut self,
rects: impl IntoIterator<Item = &'a Rectangle<i32, Physical>>,
)
pub fn frame<'a>( &mut self, rects: impl IntoIterator<Item = &'a Rectangle<i32, Physical>>, )
One frame of the region: the blocks rects cover changed and are unclean, and every
other block held still one more frame. Damage across frames the capture skipped is the
caller’s to union into rects.
Sourcepub fn frame_reported(
&mut self,
rects: &[Rectangle<i32, Physical>],
dirty: bool,
observed: bool,
)
pub fn frame_reported( &mut self, rects: &[Rectangle<i32, Physical>], dirty: bool, observed: bool, )
One frame of a region whose source reports where it changed (rects) and whose content
hash says whether it did (dirty): the blocks rects cover changed, and where none does
the whole region did, while the source was last seen to leave a change unreported. A
frame the hash checked and found changed (observed) says which: without a rectangle
the source missed it, as the X server’s DAMAGE misses directly rendered GL. A hash that
keeps a region dirty for a run of frames after it moved checks only the run’s last, so
read as a change, the frames after a video stopped beside clean text dropped every block
the ledger had refined.
Sourcepub fn frame_all(&mut self)
pub fn frame_all(&mut self)
The whole region changed this frame (a source that cannot say where).
Sourcepub fn coarsened(&mut self)
pub fn coarsened(&mut self)
The frame just coded the whole region at the rate control’s quality where it was clean (a key frame a consumer asked for): every block is unclean again.
Sourcepub fn cleaned(&mut self)
pub fn cleaned(&mut self)
The frame just coded the whole region at the paint-over quality or finer: every block that did not change in it is clean, and no longer coarse nor owed its paint-over.
Sourcepub fn spent(&mut self) -> bool
pub fn spent(&mut self) -> bool
A cleanup that fell due on the region is left to the refresh, or was coded short of its
target under a binding peak: every block that did not change this frame is owed its
paint-over, for the refresh once the peak lets go (refresh_owed). Whether that owed
any block it did not owe.
Sourcepub fn settled(&self) -> bool
pub fn settled(&self) -> bool
Whether every block that held still is clean: nothing for a cleanup to do.
Sourcepub fn plan(
&mut self,
trigger: u32,
max: usize,
runs: usize,
) -> Option<BlockPlan>
pub fn plan( &mut self, trigger: u32, max: usize, runs: usize, ) -> Option<BlockPlan>
The blocks to refine this frame: those still for trigger frames or more and not
clean, at most max in at most runs runs along a row, in turn from where the last
plan stopped; None where there are none.
Sourcepub fn refinement_coded(&mut self, refinement: &Refinement, coded: i32)
pub fn refinement_coded(&mut self, refinement: &Refinement, coded: i32)
A frame that carried refinement came out with the rate control at quality index
coded: its blocks are clean where that put them at the target or finer. A rate control
codes the rows a refinement overspends coarser, and a block it left short is refined again
on its next turn, from the index it now codes at.
Sourcepub fn refined(&mut self, plan: &BlockPlan)
pub fn refined(&mut self, plan: &BlockPlan)
The blocks plan refined were coded at the paint-over quality: they are clean.
The share of the region’s blocks not refined since they last changed: what a key-frame
cleanup has left to do (pipeline::cleanup_due), the whole region on a session that does
not refine.
Sourcepub fn unchanged(&self) -> impl Iterator<Item = bool> + '_
pub fn unchanged(&self) -> impl Iterator<Item = bool> + '_
Whether each block, in raster order, held still this frame: what the source reported unchanged since the frame before.
Sourcepub fn constant(&self) -> impl Iterator<Item = bool> + '_
pub fn constant(&self) -> impl Iterator<Item = bool> + '_
Whether each block, in raster order, held still this frame and is clean: coded at the
cleanup’s quality since it last changed, so a frame of the rate control’s may code it as
a skip without analysis (FrameEncoder::constant_blocks). A still block not yet clean is
left to the encoder, whose rate control refines it as it codes the frame; a skip there
would hold it at the quality it was coded at while moving.
Sourcepub fn coded(&mut self, capped: bool, whole: bool)
pub fn coded(&mut self, capped: bool, whole: bool)
The frame just coded the blocks that changed in it, or the whole region where it was a
key frame (whole), under a capped constant quality’s binding peak (capped): coarser
than the rate factor would have chosen, so coarse and unclean, or at the session’s own
quality, so no longer coarse. Either way they are owed no paint-over: one falls due on
them again once they hold still.
Sourcepub fn refresh(&mut self, max: usize) -> Option<(BlockPlan, BlockPlan)>
pub fn refresh(&mut self, max: usize) -> Option<(BlockPlan, BlockPlan)>
The coarse blocks (coded) that held still this frame, split into the ones it codes
again at the session’s own quality, at most max in turn from where the last refresh
stopped, and the rest, which wait as skips; None where none is coarse.
Sourcepub fn refresh_keyed(
&mut self,
max: usize,
) -> Option<(BlockPlan, BlockPlan, BlockPlan)>
pub fn refresh_keyed( &mut self, max: usize, ) -> Option<(BlockPlan, BlockPlan, BlockPlan)>
refresh, with the blocks it codes now that a capped key frame left coarse apart
(REFRESH_KEY_FINER), among them. A block owed its paint-over waits for
refresh_owed.
Sourcepub fn refresh_owed(&mut self, max: usize) -> Option<(BlockPlan, BlockPlan)>
pub fn refresh_owed(&mut self, max: usize) -> Option<(BlockPlan, BlockPlan)>
The coarse blocks owed their paint-over (spent) that held still this frame, split into
the ones it codes again at the paint-over quality, at most max in turn from where the
last refresh stopped, and every other coarse block that held still, which waits as a
skip; None where none is owed. A refresh takes these before the rest (refresh).
Sourcepub fn refreshed(&mut self, plan: &BlockPlan)
pub fn refreshed(&mut self, plan: &BlockPlan)
The blocks plan refreshed were coded at the session’s own quality, or at the
paint-over quality where they were owed it (refresh_owed), which leaves them clean: no
longer coarse.
Trait Implementations§
Source§impl Clone for BlockLedger
impl Clone for BlockLedger
Source§fn clone(&self) -> BlockLedger
fn clone(&self) -> BlockLedger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlockLedger
impl Debug for BlockLedger
Source§impl Default for BlockLedger
impl Default for BlockLedger
Source§fn default() -> BlockLedger
fn default() -> BlockLedger
Auto Trait Implementations§
impl Freeze for BlockLedger
impl RefUnwindSafe for BlockLedger
impl Send for BlockLedger
impl Sync for BlockLedger
impl Unpin for BlockLedger
impl UnsafeUnpin for BlockLedger
impl UnwindSafe for BlockLedger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().