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

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.