pub struct SliceDec<'a> {Show 24 fields
pub sps: &'a Sps,
pub pps: &'a Pps,
pub hdr: &'a SliceHeader,
pub slice_num: u32,
pub pic: &'a mut CurPic,
pub dpb: &'a [RefPic],
pub refs: &'a [Vec<RefEntry>; 2],
pub frefs: &'a [[Vec<RefEntry>; 2]; 2],
pub tables: &'a CavlcTables,
pub mb_x: usize,
pub mb_y: usize,
pub addr: usize,
pub mbaff: bool,
pub mb_field: bool,
pub vmb_y: usize,
pub geo: Geo,
pub qp: i32,
pub prev_qp_nz: bool,
pub ctx: Vec<Ctx>,
pub bd_y: u32,
pub bd_c: u32,
pub chroma: bool,
pub c422: bool,
pub syn: MbSyn,
/* private fields */
}decode only.Fields§
§sps: &'a Sps§pps: &'a Pps§hdr: &'a SliceHeader§slice_num: u32§pic: &'a mut CurPic§dpb: &'a [RefPic]§refs: &'a [Vec<RefEntry>; 2]§frefs: &'a [[Vec<RefEntry>; 2]; 2]MBAFF: the field lists, [parity][list] (see Decoder::field_lists).
tables: &'a CavlcTables§mb_x: usize§mb_y: usizeMacroblock row in the picture (MBAFF: 2 * pair row + bottom).
addr: usizeRaster index of the macroblock in pic.mbs.
mbaff: boolMbaffFrameFlag.
mb_field: boolThe current macroblock is a field macroblock of an MBAFF frame.
vmb_y: usizeMacroblock row in the current macroblock’s own sample view: mb_y,
or the pair row for an MBAFF field macroblock.
geo: GeoHow that view’s rows map onto picture rows.
qp: i32QPY of the previous macroblock in decoding order.
prev_qp_nz: boolWhether the previous macroblock had a non-zero mb_qp_delta.
ctx: Vec<Ctx>§bd_y: u32§bd_c: u32§chroma: bool§c422: bool4:2:2: chroma macroblocks are 8×16.
syn: MbSynImplementations§
Source§impl SliceDec<'_>
impl SliceDec<'_>
Sourcepub fn cabac_field_flag(&mut self, c: &mut Cabac<'_>) -> bool
pub fn cabac_field_flag(&mut self, c: &mut Cabac<'_>) -> bool
mb_field_decoding_flag (ctxIdx 70-72), read at a pair’s top
macroblock. The left term is the flag the pair inherited, as ffmpeg
has it (the left pair’s, within a slice).
pub fn cabac_skip_flag(&mut self, c: &mut Cabac<'_>) -> bool
pub fn parse_mb_cabac(&mut self, c: &mut Cabac<'_>) -> Result<()>
Source§impl SliceDec<'_>
impl SliceDec<'_>
Source§impl<'a> SliceDec<'a>
impl<'a> SliceDec<'a>
pub fn new( sps: &'a Sps, pps: &'a Pps, hdr: &'a SliceHeader, slice_num: u32, pic: &'a mut CurPic, dpb: &'a [RefPic], refs: &'a [Vec<RefEntry>; 2], frefs: &'a [[Vec<RefEntry>; 2]; 2], tables: &'a CavlcTables, ) -> Self
Sourcepub fn set_field(&mut self, field: bool)
pub fn set_field(&mut self, field: bool)
Set the current macroblock’s mb_field_decoding_flag (MBAFF).
Sourcepub fn rl(&self, l: usize) -> &'a [RefEntry]
pub fn rl(&self, l: usize) -> &'a [RefEntry]
Reference list l as the current macroblock indexes it: an MBAFF
field macroblock’s is the field list of its parity.
Sourcepub fn num_ref(&self, l: usize) -> u32
pub fn num_ref(&self, l: usize) -> u32
num_ref_idx_lX_active for the current macroblock (doubled for an
MBAFF field macroblock).
Sourcepub fn field_coded(&self) -> bool
pub fn field_coded(&self) -> bool
Field scans and CABAC field contexts: a field picture or an MBAFF field macroblock.
Sourcepub fn mb_nb(&self, dx: isize, dy: isize) -> Option<usize>
pub fn mb_nb(&self, dx: isize, dy: isize) -> Option<usize>
Address of the macroblock at offset (dx, dy), if it is available:
inside the picture, already decoded, and in this slice. In an MBAFF
frame, the macroblock covering luma location (-1, 0), (0, -1),
(16, -1) or (-1, -1) (§6.4.11.1).
Sourcepub fn loc_nb(
&self,
xn: isize,
yn: isize,
maxw: isize,
maxh: isize,
) -> Option<(usize, usize, usize)>
pub fn loc_nb( &self, xn: isize, yn: isize, maxw: isize, maxh: isize, ) -> Option<(usize, usize, usize)>
MBAFF neighbouring location (§6.4.12.2): the available macroblock
covering location (xn, yn) of the current macroblock’s view, in a
component whose macroblocks are maxw × maxh, and the location within
it. A location maps onto the picture row it shows (every other row in
a field macroblock), and from there into whichever macroblock of the
pair holds that row: this is Table 6-4, and ffmpeg’s
left_block_options / top_xy / topleft_xy adjustments.
Sourcepub fn blk_nb(&self, x: isize, y: isize) -> Option<(usize, usize)>
pub fn blk_nb(&self, x: isize, y: isize) -> Option<(usize, usize)>
The 4×4 block at (x, y) (4-sample units relative to the current
macroblock, x in -1..=4, y in -1..=3): (mb address, raster index). The current macroblock is returned too; callers that care
whether its block is decoded yet check that themselves.
Sourcepub fn blk_nb_row(
&self,
x: isize,
y: isize,
last_row: bool,
) -> Option<(usize, usize)>
pub fn blk_nb_row( &self, x: isize, y: isize, last_row: bool, ) -> Option<(usize, usize)>
Self::blk_nb, locating the block by its last sample row instead
of its first: neighbour D of a partition is luma location
(x - 1, y - 1), the bottom row of the block above-left. Only an
MBAFF left pair of the other kind tells the two apart.
Sourcepub fn cblk_nb(&self, x: isize, y: isize) -> Option<(usize, usize)>
pub fn cblk_nb(&self, x: isize, y: isize) -> Option<(usize, usize)>
The chroma 4×4 block at (x, y) (x in -1..2, y in -1..rows):
(mb address, index into nnz_c).
pub fn decode_skip(&mut self) -> Result<()>
pub fn decode_mb(&mut self) -> Result<()>
Auto Trait Implementations§
impl<'a> !UnwindSafe for SliceDec<'a>
impl<'a> Forget for SliceDec<'a>
impl<'a> Freeze for SliceDec<'a>
impl<'a> Move for SliceDec<'a>
impl<'a> RefUnwindSafe for SliceDec<'a>
impl<'a> Send for SliceDec<'a>
impl<'a> Sync for SliceDec<'a>
impl<'a> Unpin for SliceDec<'a>
impl<'a> UnsafeUnpin for SliceDec<'a>
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