pub struct Rans64EncSymbol {
pub x_max_hi: u32,
pub freq_rcp_shift: u32,
pub freq_rcp: u64,
pub freq_cmpl: u32,
pub bias: u32,
}Expand description
Re-export the core rANS primitives. Prepared encoder symbol.
Fields§
§x_max_hi: u32§freq_rcp_shift: u32§freq_rcp: u64§freq_cmpl: u32§bias: u32Implementations§
Source§impl Rans64EncSymbol
impl Rans64EncSymbol
Sourcepub fn new(start: u32, freq: u32, scale_bits: u32) -> Rans64EncSymbol
pub fn new(start: u32, freq: u32, scale_bits: u32) -> Rans64EncSymbol
Create a new prepared encoder symbol.
Sourcepub fn try_new(
start: u32,
freq: u32,
scale_bits: u32,
) -> Result<Rans64EncSymbol, RawRansError>
pub fn try_new( start: u32, freq: u32, scale_bits: u32, ) -> Result<Rans64EncSymbol, RawRansError>
Create a new prepared encoder symbol with bounds checking.
Returns Err(RawRansError::InvalidScaleBits) if scale_bits is outside
the safe range [2, min($max_scale_bits, 31)]. The value 32 is rejected
because 1u32 << 32 overflows (a defined Rust panic and C++ UB).
Trait Implementations§
Source§impl Clone for Rans64EncSymbol
impl Clone for Rans64EncSymbol
Source§fn clone(&self) -> Rans64EncSymbol
fn clone(&self) -> Rans64EncSymbol
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Rans64EncSymbol
Auto Trait Implementations§
impl Freeze for Rans64EncSymbol
impl RefUnwindSafe for Rans64EncSymbol
impl Send for Rans64EncSymbol
impl Sync for Rans64EncSymbol
impl Unpin for Rans64EncSymbol
impl UnsafeUnpin for Rans64EncSymbol
impl UnwindSafe for Rans64EncSymbol
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