Interface Codec
- All Known Implementing Classes:
Codec.Binary, Codec.Gamma, Codec.Huffman, Codec.Unary, Codec.ZeroCodec
public interface Codec
A class representing a specific instantaneous code for compressed functions.
The logic of this code is quite tightly coupled with such functions, and it is unlikely to be resusable elsewhere easily.
- Author:
- Sebastiano Vigna, Marco Genuzio
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA binary fixed-width codec.static interfaceA coder: provides methods to turn symbols into codewords.static interfaceA decoder: provides a method to turn sequences of bits into symbols.static classA codec based on Elias's γ code (starting at zero).static classA Huffman codec with length-limiting capabilities and a fast canonical decoder.static classA unary codec (starting at zero).static classA degenerate stateless codec (always returns zero). -
Method Summary
Modifier and TypeMethodDescriptiongetCoder(it.unimi.dsi.fastutil.longs.Long2LongMap frequencies) Returns a coder for a specific map from symbols to frequencies.
-
Method Details
-
getCoder
Returns a coder for a specific map from symbols to frequencies.Note that even instantaneous codes (such as
Codec.Unary) need to know the set of symbols, as the returned coder needs to known the maximum codeword length.- Parameters:
frequencies- a map from symbols (longs) to frequencies (longs).- Returns:
- a coder for the given map.
-