struct CabacReader<'a> {}Expand description
CABAC の MB 層の読み手(9.3.2 二値化・9.3.3.1.1 文脈選択)。近傍の情報は同じスライスの
MB だけを見る(可用性は DecState::avail_px)。スライスごとに作り直す。
Fields§
§e: CabacEngine<'a>§blk_w: usize§mb_w: usize§cur_mb: usize§cur_intra: bool§mb_flags: Vec<u8>MB ごと: MBF_* フラグ・coded_block_pattern・DC の coded_block_flag(bit0 輝度, bit1 Cb, bit2 Cr)・ intra_chroma_pred_mode。
mb_cbp: Vec<u8>§mb_dc: Vec<u8>§mb_cpm: Vec<u8>§prev_dqp: i32§cur_dqp: i32§mvd: [Vec<[u8; 2]>; 2]4x4 ごと: |mvd|(成分ごと、70 で頭打ち)・refIdx > 0 か・ダイレクト予測か。
ref_gt0: [Vec<bool>; 2]§direct: Vec<bool>Implementations§
Source§impl<'a> CabacReader<'a>
impl<'a> CabacReader<'a>
fn new(e: CabacEngine<'a>, st: &DecState) -> Self
Sourcefn nb_mbs(
&self,
st: &DecState,
mb_x: u32,
mb_y: u32,
) -> (Option<usize>, Option<usize>)
fn nb_mbs( &self, st: &DecState, mb_x: u32, mb_y: u32, ) -> (Option<usize>, Option<usize>)
左(A)・上(B)の MB 番号(同じスライスで可用なときだけ)。
Sourcefn mb_skip(
&mut self,
st: &DecState,
mb_x: u32,
mb_y: u32,
kind: SliceKind,
) -> bool
fn mb_skip( &mut self, st: &DecState, mb_x: u32, mb_y: u32, kind: SliceKind, ) -> bool
mb_skip_flag(P: ctxIdx 11..13、B: 24..26)。真なら P_Skip / B_Skip として記録する。
Sourcefn intra_mb_type(&mut self, base: usize, intra_slice: bool, inc: usize) -> u32
fn intra_mb_type(&mut self, base: usize, intra_slice: bool, inc: usize) -> u32
イントラの mb_type(表 9-36)。base は I スライスで 3、P で 17、B で 32。
Trait Implementations§
Source§impl MbSyntax for CabacReader<'_>
impl MbSyntax for CabacReader<'_>
Source§fn residual8x8(
&mut self,
_st: &DecState,
_bx4: usize,
_by4: usize,
) -> Result<([i32; 64], [u8; 4]), &'static str>
fn residual8x8( &mut self, _st: &DecState, _bx4: usize, _by4: usize, ) -> Result<([i32; 64], [u8; 4]), &'static str>
輝度 8x8(cat 5)。4:2:0 では coded_block_flag は無く常に 1(7.4.5.3.3)。
fn mb_type( &mut self, st: &DecState, mb_x: u32, mb_y: u32, kind: SliceKind, ) -> Result<u32, &'static str>
fn sub_mb_type(&mut self, kind: SliceKind) -> Result<u32, &'static str>
Source§fn intra4x4_rem(&mut self) -> Option<i32>
fn intra4x4_rem(&mut self) -> Option<i32>
prev_intra4x4_pred_mode_flag が 1 なら None、0 なら rem_intra4x4_pred_mode。
fn intra_chroma_mode( &mut self, st: &DecState, mb_x: u32, mb_y: u32, ) -> Result<u8, &'static str>
fn cbp( &mut self, st: &DecState, mb_x: u32, mb_y: u32, _intra: bool, ) -> Result<u32, &'static str>
fn qp_delta(&mut self) -> Result<i32, &'static str>
Source§fn ref_idx(
&mut self,
st: &DecState,
list: usize,
px: usize,
py: usize,
pw: usize,
ph: usize,
num_ref: u32,
) -> Result<i8, &'static str>
fn ref_idx( &mut self, st: &DecState, list: usize, px: usize, py: usize, pw: usize, ph: usize, num_ref: u32, ) -> Result<i8, &'static str>
パーティション (px, py, pw, ph) の ref_idx_lX。
Source§fn mvd(
&mut self,
st: &DecState,
list: usize,
px: usize,
py: usize,
pw: usize,
ph: usize,
) -> Result<[i16; 2], &'static str>
fn mvd( &mut self, st: &DecState, list: usize, px: usize, py: usize, pw: usize, ph: usize, ) -> Result<[i16; 2], &'static str>
パーティション (px, py, pw, ph) の mvd_lX。
Source§fn residual(
&mut self,
st: &DecState,
blk: ResBlock,
) -> Result<([i32; 16], u8), &'static str>
fn residual( &mut self, st: &DecState, blk: ResBlock, ) -> Result<([i32; 16], u8), &'static str>
残差 1 ブロック(走査順の係数, 非ゼロ係数の数)。
Auto Trait Implementations§
impl<'a> Freeze for CabacReader<'a>
impl<'a> RefUnwindSafe for CabacReader<'a>
impl<'a> Send for CabacReader<'a>
impl<'a> Sync for CabacReader<'a>
impl<'a> Unpin for CabacReader<'a>
impl<'a> UnsafeUnpin for CabacReader<'a>
impl<'a> UnwindSafe for CabacReader<'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
Mutably borrows from an owned value. Read more