pub struct RansByteEncSymbol {
pub x_max_hi: u32,
pub freq_rcp_shift: u32,
pub freq_rcp: u32,
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: u32§freq_cmpl: u32§bias: u32Implementations§
Source§impl RansByteEncSymbol
impl RansByteEncSymbol
Sourcepub fn new(start: u32, freq: u32, scale_bits: u32) -> RansByteEncSymbol
pub fn new(start: u32, freq: u32, scale_bits: u32) -> RansByteEncSymbol
Create a new prepared encoder symbol.
Sourcepub fn try_new(
start: u32,
freq: u32,
scale_bits: u32,
) -> Result<RansByteEncSymbol, RawRansError>
pub fn try_new( start: u32, freq: u32, scale_bits: u32, ) -> Result<RansByteEncSymbol, 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 RansByteEncSymbol
impl Clone for RansByteEncSymbol
Source§fn clone(&self) -> RansByteEncSymbol
fn clone(&self) -> RansByteEncSymbol
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 RansByteEncSymbol
Auto Trait Implementations§
impl Freeze for RansByteEncSymbol
impl RefUnwindSafe for RansByteEncSymbol
impl Send for RansByteEncSymbol
impl Sync for RansByteEncSymbol
impl Unpin for RansByteEncSymbol
impl UnsafeUnpin for RansByteEncSymbol
impl UnwindSafe for RansByteEncSymbol
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