pub struct BitEncoder { /* private fields */ }Expand description
A single binary probability model.
Implementations§
Source§impl BitEncoder
impl BitEncoder
Sourcepub const NUM_BIT_MODEL_TOTAL_BITS: i32 = 11
pub const NUM_BIT_MODEL_TOTAL_BITS: i32 = 11
The number of bits used to represent a probability.
Sourcepub const BIT_MODEL_TOTAL: u32
pub const BIT_MODEL_TOTAL: u32
The total number of probability units.
Sourcepub const NUM_MOVE_BITS: i32 = 5
pub const NUM_MOVE_BITS: i32 = 5
The number of bits the probability is shifted by on every update.
Sourcepub const NUM_MOVE_REDUCING_BITS: i32 = 2
pub const NUM_MOVE_REDUCING_BITS: i32 = 2
The number of bits the probability is reduced by when pricing.
Sourcepub const NUM_BIT_PRICE_SHIFT_BITS: i32 = 6
pub const NUM_BIT_PRICE_SHIFT_BITS: i32 = 6
The shift applied to the price of a bit.
Sourcepub fn update_model(&mut self, symbol: u32)
pub fn update_model(&mut self, symbol: u32)
Updates the probability for the given symbol.
Sourcepub fn encode(&mut self, encoder: &mut Encoder, symbol: u32)
pub fn encode(&mut self, encoder: &mut Encoder, symbol: u32)
Encodes one bit with this model and updates it.
Sourcepub fn get_price0(&self) -> u32
pub fn get_price0(&self) -> u32
The price of encoding a zero bit.
Sourcepub fn get_price1(&self) -> u32
pub fn get_price1(&self) -> u32
The price of encoding a one bit.
Trait Implementations§
Source§impl Clone for BitEncoder
impl Clone for BitEncoder
impl Copy for BitEncoder
Source§impl Debug for BitEncoder
impl Debug for BitEncoder
Source§impl Default for BitEncoder
impl Default for BitEncoder
impl Eq for BitEncoder
Source§impl PartialEq for BitEncoder
impl PartialEq for BitEncoder
impl StructuralPartialEq for BitEncoder
Auto Trait Implementations§
impl Freeze for BitEncoder
impl RefUnwindSafe for BitEncoder
impl Send for BitEncoder
impl Sync for BitEncoder
impl Unpin for BitEncoder
impl UnsafeUnpin for BitEncoder
impl UnwindSafe for BitEncoder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.