pub struct RangeCoder {
pub buf: Vec<u8>,
pub storage: u32,
pub end_offs: u32,
pub end_window: u32,
pub nend_bits: i32,
pub nbits_total: i32,
pub offs: u32,
pub rng: u32,
pub val: u32,
pub ext: u32,
pub rem: i32,
pub error: i32,
}Fields§
§buf: Vec<u8>§storage: u32§end_offs: u32§end_window: u32§nend_bits: i32§nbits_total: i32§offs: u32§rng: u32§val: u32§ext: u32§rem: i32§error: i32Implementations§
Source§impl RangeCoder
impl RangeCoder
pub fn new_encoder(size: u32) -> Self
pub fn reset_for_encode(&mut self, size: u32)
pub fn new_decoder(data: &[u8]) -> Self
pub fn enc_uint(&mut self, fl: u32, ft: u32)
pub fn dec_uint(&mut self, ft: u32) -> u32
pub fn enc_bits(&mut self, val: u32, bits: u32)
pub fn pad_to_bits(&mut self, target_bits: i32)
pub fn dec_bits(&mut self, bits: u32) -> u32
pub fn tell_frac(&self) -> i32
Sourcepub fn tell(&self) -> i32
pub fn tell(&self) -> i32
Integer bit count matching C’s ec_tell(): nbits_total - EC_ILOG(rng).
pub fn tell_fast(&self) -> i32
Sourcepub fn shrink(&mut self, new_size: u32)
pub fn shrink(&mut self, new_size: u32)
Shrink the range coder buffer, moving end-coded bytes to the new end.
Equivalent to C’s ec_enc_shrink.
pub fn encode(&mut self, fl: u32, fh: u32, ft: u32)
pub fn encode_bit_logp(&mut self, val: bool, logp: u32)
pub fn encode_icdf(&mut self, s: i32, icdf: &[u8], ftb: u32)
pub fn decode_bit_logp(&mut self, logp: u32) -> bool
pub fn decode_icdf(&mut self, icdf: &[u8], ftb: u32) -> i32
pub fn decode(&mut self, ft: u32) -> u32
pub fn update(&mut self, fl: u32, fh: u32, ft: u32)
pub fn laplace_encode(&mut self, value: &mut i32, fs: u32, decay: i32)
pub fn laplace_decode(&mut self, fs: u32, decay: i32) -> i32
pub fn patch_initial_bits(&mut self, val: u32, nbits: u32)
pub fn done(&mut self)
pub fn finish(&mut self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for RangeCoder
impl Clone for RangeCoder
Source§fn clone(&self) -> RangeCoder
fn clone(&self) -> RangeCoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RangeCoder
impl RefUnwindSafe for RangeCoder
impl Send for RangeCoder
impl Sync for RangeCoder
impl Unpin for RangeCoder
impl UnsafeUnpin for RangeCoder
impl UnwindSafe for RangeCoder
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