pub struct CtxModel {
pub state: u8,
pub mps: u8,
}Expand description
One CABAC context: an adaptive probability state (0..=63) and the current
most-probable-bin value (0/1).
Fields§
§state: u8pStateIdx — probability-state index into the range/transition tables.
mps: u8valMps — the value (0 or 1) currently treated as most probable.
Implementations§
Source§impl CtxModel
impl CtxModel
Sourcepub fn init(init_value: u8, slice_qp: i32) -> Self
pub fn init(init_value: u8, slice_qp: i32) -> Self
Initialize from an 8-bit init_value and the slice QP (H.265 §9.3.2.2).
The high/low nibbles of init_value give a slope/offset that map the QP
to a starting probability. This is how every context is seeded at the
start of a slice from the per-syntax-element init constants.
Sourcepub fn from_state(state: u8, mps: u8) -> Self
pub fn from_state(state: u8, mps: u8) -> Self
A context pinned to an explicit (state, mps) — for tests and for the
equiprobable-ish defaults some tools use before real init constants land.
Trait Implementations§
impl Copy for CtxModel
impl Eq for CtxModel
impl StructuralPartialEq for CtxModel
Auto Trait Implementations§
impl Forget for CtxModel
impl Freeze for CtxModel
impl Move for CtxModel
impl RefUnwindSafe for CtxModel
impl Send for CtxModel
impl Sync for CtxModel
impl Unpin for CtxModel
impl UnsafeUnpin for CtxModel
impl UnwindSafe for CtxModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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