pub struct RefFrameList { /* private fields */ }Expand description
A list of reference frames maintained in the decoded picture buffer.
Limits itself to max_size entries; oldest short-term frames are evicted
when capacity is exceeded.
Implementations§
Source§impl RefFrameList
impl RefFrameList
Sourcepub fn new(max_size: usize) -> Self
pub fn new(max_size: usize) -> Self
Creates a new empty reference frame list with the given capacity.
Sourcepub fn add(&mut self, frame: RefFrame) -> bool
pub fn add(&mut self, frame: RefFrame) -> bool
Adds a reference frame to the list.
If the list is full, the oldest short-term reference is removed first.
Returns false if no space could be made (all frames are long-term).
Sourcepub fn remove_oldest(&mut self) -> bool
pub fn remove_oldest(&mut self) -> bool
Removes the oldest short-term reference frame (lowest frame_num).
Returns true if a frame was removed.
Sourcepub fn find_closest_poc(&self, target_poc: i32) -> Option<&RefFrame>
pub fn find_closest_poc(&self, target_poc: i32) -> Option<&RefFrame>
Finds the reference frame whose POC is closest to target_poc.
Returns None if the list is empty.
Sourcepub fn iter(&self) -> impl Iterator<Item = &RefFrame>
pub fn iter(&self) -> impl Iterator<Item = &RefFrame>
Returns an iterator over all active reference frames.
Sourcepub fn long_term_count(&self) -> usize
pub fn long_term_count(&self) -> usize
Returns the number of long-term reference frames.
Sourcepub fn short_term_count(&self) -> usize
pub fn short_term_count(&self) -> usize
Returns the number of short-term reference frames.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RefFrameList
impl RefUnwindSafe for RefFrameList
impl Send for RefFrameList
impl Sync for RefFrameList
impl Unpin for RefFrameList
impl UnsafeUnpin for RefFrameList
impl UnwindSafe for RefFrameList
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
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