[][src]Function httlib_huffman::flatten::flatten

pub fn flatten(
    codings: &[(u8, u32)],
    speed: usize
) -> Vec<Vec<(Option<usize>, Option<usize>, usize)>>

Generates a translation matrix that can be used to decode a decoded content. The function expects the speed attribute which represents the number of bits that the decoder will read at a time when decoding an encoded sequence. The speed attribute can be between 1 bit and 5 bits. The higher number will have a positive effect on performance but a higher more footprint.

use httlib_huffman::encode::table::ENCODE_TABLE;
 
let speed = 4; // decoder will read 4 bits at a time
let table = flatten(&ENCODE_TABLE, speed);