[−][src]Trait compress::entropy::ari::Model
An abstract model to produce probability ranges Can be a table, a mix of tables, or just a smart function.
Required methods
fn get_range(&self, value: V) -> (Border, Border)
Get the probability range of a value
fn find_value(&self, offset: Border) -> (V, Border, Border)
Find the value by a given probability offset, return with the range
fn get_denominator(&self) -> Border
Get the sum of all probabilities
Provided methods
fn encode(&self, value: V, re: &mut RangeEncoder, out: &mut [Symbol]) -> usize
Encode a value using a range encoder return the number of symbols written
fn decode(&self, code: Border, re: &mut RangeEncoder) -> (V, usize)
Decode a value using given 'code' on the range encoder return a (value, num_symbols_to_shift) pair