pub struct VorbisCodebook {
pub entries: Vec<CodebookEntry>,
pub num_entries: usize,
pub dimensions: u16,
pub lookup_type: u8,
}Expand description
Vorbis codebook: Huffman tree built from codeword lengths
Fields§
§entries: Vec<CodebookEntry>Codebook entries sorted by codeword
num_entries: usizeNumber of valid entries
dimensions: u16Codebook dimensions (for VQ lookup)
lookup_type: u8Lookup table type (0 = no lookup, 1 = implicitly defined, 2 = explicitly defined)
Implementations§
Source§impl VorbisCodebook
impl VorbisCodebook
Sourcepub fn from_lengths(lengths: &[u8], dimensions: u16) -> CodecResult<Self>
pub fn from_lengths(lengths: &[u8], dimensions: u16) -> CodecResult<Self>
Build a codebook from codeword lengths (Vorbis spec section 3.2.1).
Sourcepub fn decode(&self, reader: &mut BitstreamReader<'_>) -> CodecResult<u16>
pub fn decode(&self, reader: &mut BitstreamReader<'_>) -> CodecResult<u16>
Decode a single symbol from a bitstream reader via canonical Huffman.
Trait Implementations§
Source§impl Clone for VorbisCodebook
impl Clone for VorbisCodebook
Source§fn clone(&self) -> VorbisCodebook
fn clone(&self) -> VorbisCodebook
Returns a duplicate of the value. Read more
1.0.0§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 VorbisCodebook
impl RefUnwindSafe for VorbisCodebook
impl Send for VorbisCodebook
impl Sync for VorbisCodebook
impl Unpin for VorbisCodebook
impl UnwindSafe for VorbisCodebook
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)