pub struct BitReader<'a> {
data: &'a [u8],
byte_pos: usize,
bit_pos: u8,
}Expand description
MSB-first のビットリーダ。H.264 の RBSP を読むための最小実装。
Fields§
§data: &'a [u8]§byte_pos: usize§bit_pos: u8Implementations§
Source§impl<'a> BitReader<'a>
impl<'a> BitReader<'a>
pub fn new(data: &'a [u8]) -> Self
Sourcepub fn more_rbsp_data(&self) -> bool
pub fn more_rbsp_data(&self) -> bool
more_rbsp_data()(7.2): 末尾の rbsp_stop_one_bit より前に未読のビットが残っているか。
停止ビットは「最後の 0 でないバイトの最下位の 1」(後ろの 0 バイトは cabac_zero_word 等)。
複数スライスのフレームで、スライスの終わりを知るのに使う(2026-10-17)。
Sourcepub fn bit_position(&self) -> usize
pub fn bit_position(&self) -> usize
先頭からのビット位置(CABAC の slice_data の開始位置を渡すのに使う)。
Sourcepub fn byte_align(&mut self)
pub fn byte_align(&mut self)
バイト境界まで進める(I_PCM の pcm_alignment_zero_bits 用)。
Trait Implementations§
Source§impl MbSyntax for BitReader<'_>
impl MbSyntax for BitReader<'_>
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>
CAVLC の 8x8 は 4x4 の residual_block を 4 回読み、係数を交互に並べる(7.3.5.3.2: level8x8[4 * k + i] = level4x4_i[k])。nC は 4x4 ごとで、同じ 8x8 の先に読んだ 4x4 の total_coeff も使う。
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 BitReader<'a>
impl<'a> RefUnwindSafe for BitReader<'a>
impl<'a> Send for BitReader<'a>
impl<'a> Sync for BitReader<'a>
impl<'a> Unpin for BitReader<'a>
impl<'a> UnsafeUnpin for BitReader<'a>
impl<'a> UnwindSafe for BitReader<'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