Trait redux::model::Model [] [src]

pub trait Model {
    fn parameters<'a>(&'a self) -> &'a Parameters;
    fn total_frequency(&self) -> u64;
    fn get_frequency(&mut self, symbol: usize) -> Result<(u64, u64)>;
    fn get_symbol(&mut self, value: u64) -> Result<(usize, u64, u64)>;
    fn get_freq_table(&self) -> Vec<(u64, u64)>;
}

Trait for the probability models behind arithmetic coding. Possible implementations may include static models with fixed probabilities or and adaptive model that continuously updates cumulative frequencies.

Required Methods

Returns the arithmetic compression parameters.

Returns the maximum cumulative frequency.

Returns the cumulative frequency range for the given input symbol.

Returns the symbol that corresponds to the given cumulative frequency.

Returns the cumulative frequency table for debugging purposes.

Implementors