Struct vpk0::LzssSettings[][src]

pub struct LzssSettings {
    pub offset_bits: usize,
    pub length_bits: usize,
    pub max_uncoded: usize,
}

Configure the LZSS encoding that underlies vpk0 compression

You can set the three key LZSS parameters: dictionary size, maximum match size, and minimum match size. When using new or struct literals, you are setting the total number of bits for the dictionary or max match, but the minimum match size is in bytes. If you’d prefer to set everything in terms of bytes, you can use byte_sized. Note that any non-power-of-two byte sizes will be rounded up for the dictionary and max match.

By default:

ParameterFieldBit SizeBytes
Dictionaryoffset_bits1665536
Max Matchlength_bits8256
Min Matchmax_uncoded2

These settings were used by Nintendo when compressing the files in Super Smash Bros. 64.

Fields

offset_bits: usize

number of bits for move back (window size)

length_bits: usize

number of bits for copying (max match encoded)

max_uncoded: usize

max number of bytes not encoded

Implementations

impl LzssSettings[src]

pub const fn new(
    offset_bits: usize,
    size_bits: usize,
    max_uncoded: usize
) -> Self
[src]

pub const fn byte_sized(
    dictionary: usize,
    max_match: usize,
    min_match: usize
) -> Self
[src]

Trait Implementations

impl Clone for LzssSettings[src]

impl Copy for LzssSettings[src]

impl Debug for LzssSettings[src]

impl Default for LzssSettings[src]

impl Eq for LzssSettings[src]

impl PartialEq<LzssSettings> for LzssSettings[src]

impl StructuralEq for LzssSettings[src]

impl StructuralPartialEq for LzssSettings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.