pub struct Dpb<T: DecodedHandle> {
entries: Vec<DpbEntry<T>>,
max_num_pics: usize,
interlaced: bool,
}
Fields
entries: Vec<DpbEntry<T>>
List of PictureData
and backend handles to decoded pictures.
max_num_pics: usize
The maximum number of pictures that can be stored.
interlaced: bool
Whether we’re decoding in interlaced mode. Interlaced support is inspired by the GStreamer implementation, in which frames are split if interlaced=1. This makes reference marking easier. We also decode both fields to the same surface, and this surface with both fields is outputted only once.
Implementations
sourceimpl<T: DecodedHandle> Dpb<T>
impl<T: DecodedHandle> Dpb<T>
sourcepub fn pictures(&self) -> impl Iterator<Item = Ref<'_, PictureData>>
pub fn pictures(&self) -> impl Iterator<Item = Ref<'_, PictureData>>
Returns an iterator over the underlying H264 pictures stored in the DPB.
sourcepub fn pictures_mut(&mut self) -> impl Iterator<Item = RefMut<'_, PictureData>>
pub fn pictures_mut(&mut self) -> impl Iterator<Item = RefMut<'_, PictureData>>
Returns a mutable iterator over the underlying H264 pictures stored in the DPB.
sourcepub fn set_max_num_pics(&mut self, max_num_pics: usize)
pub fn set_max_num_pics(&mut self, max_num_pics: usize)
Set the dpb’s max num pics.
sourcepub fn max_num_pics(&self) -> usize
pub fn max_num_pics(&self) -> usize
Get a reference to the dpb’s max num pics.
pub fn num_ref_frames(&self) -> usize
sourcepub fn interlaced(&self) -> bool
pub fn interlaced(&self) -> bool
Get a reference to the dpb’s interlaced mode.
sourcepub fn set_interlaced(&mut self, interlaced: bool)
pub fn set_interlaced(&mut self, interlaced: bool)
Set the dpb’s interlaced mode.
sourcepub fn find_short_term_lowest_frame_num_wrap(
&self
) -> Option<Rc<RefCell<PictureData>>>
pub fn find_short_term_lowest_frame_num_wrap(
&self
) -> Option<Rc<RefCell<PictureData>>>
Find the short term reference picture with the lowest frame_num_wrap
value.
sourcepub fn mark_all_as_unused_for_ref(&mut self)
pub fn mark_all_as_unused_for_ref(&mut self)
Mark all pictures in the DPB as unused for reference.
sourcepub fn remove_unused(&mut self)
pub fn remove_unused(&mut self)
Remove unused pictures from the DPB. A picture is not going to be used anymore if it’s a) not a reference and b) not needed for output
sourcepub fn find_short_term_with_pic_num(&self, pic_num: i32) -> Option<DpbEntry<T>>
pub fn find_short_term_with_pic_num(&self, pic_num: i32) -> Option<DpbEntry<T>>
Find a short term reference picture with the given pic_num
value.
sourcepub fn find_long_term_with_long_term_pic_num(
&self,
long_term_pic_num: i32
) -> Option<DpbEntry<T>>
pub fn find_long_term_with_long_term_pic_num(
&self,
long_term_pic_num: i32
) -> Option<DpbEntry<T>>
Find a long term reference picture with the given long_term_pic_num
value.
sourcepub fn store_picture(
&mut self,
picture: Rc<RefCell<PictureData>>,
handle: Option<T>
) -> Result<()>
pub fn store_picture(
&mut self,
picture: Rc<RefCell<PictureData>>,
handle: Option<T>
) -> Result<()>
Store a picture and its backend handle in the DPB.
sourcepub fn has_empty_frame_buffer(&self) -> bool
pub fn has_empty_frame_buffer(&self) -> bool
Whether the DPB has an empty slot for a new picture.
sourcepub fn needs_bumping(&self, to_insert: &PictureData) -> bool
pub fn needs_bumping(&self, to_insert: &PictureData) -> bool
Whether the DPB needs bumping, as described by clauses 1, 4, 5, 6 of C.4.5.3 “Bumping” process.
sourcefn find_lowest_poc_for_bumping(&self) -> Option<DpbEntry<T>>
fn find_lowest_poc_for_bumping(&self) -> Option<DpbEntry<T>>
Find the lowest POC in the DPB that can be bumped.
sourcefn get_position(&self, needle: &Rc<RefCell<PictureData>>) -> Option<usize>
fn get_position(&self, needle: &Rc<RefCell<PictureData>>) -> Option<usize>
Gets the position of needle
in the DPB, if any.
sourcepub fn bump(&mut self, flush: bool) -> Option<DpbEntry<T>>
pub fn bump(&mut self, flush: bool) -> Option<DpbEntry<T>>
Bump the dpb, returning a picture as per the bumping process described in C.4.5.3. Note that this picture will still be referenced by its pair, if any.
sourcepub fn drain(&mut self) -> Vec<DpbEntry<T>>
pub fn drain(&mut self) -> Vec<DpbEntry<T>>
Drains the DPB by continuously invoking the bumping process.
sourcepub fn get_short_term_refs(&self, out: &mut Vec<DpbEntry<T>>)
pub fn get_short_term_refs(&self, out: &mut Vec<DpbEntry<T>>)
Gets a Vec<ContainedPicture>
of short term refs into out
sourcepub fn get_long_term_refs(&self, out: &mut Vec<DpbEntry<T>>)
pub fn get_long_term_refs(&self, out: &mut Vec<DpbEntry<T>>)
Gets a Vec<ContainedPicture>
of long term refs into out