Package it.unimi.dsi.sux4j.mph.codec
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 Classes Modifier and Type Interface Description static class
Codec.Binary
A binary fixed-width codec.static interface
Codec.Coder
A coder: provides methods to turn symbols into codewords.static interface
Codec.Decoder
A decoder: provides a method to turn sequences of bits into symbols.static class
Codec.Gamma
A codec based on Elias's γ code (starting at zero).static class
Codec.Huffman
A Huffman codec with length-limiting capabilities and a fast canonical decoder.static class
Codec.Unary
A unary codec (starting at zero).static class
Codec.ZeroCodec
A degenerate stateless codec (always returns zero).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Codec.Coder
getCoder(it.unimi.dsi.fastutil.longs.Long2LongMap frequencies)
Returns a coder for a specific map from symbols to frequencies.
-
-
-
Method Detail
-
getCoder
Codec.Coder getCoder(it.unimi.dsi.fastutil.longs.Long2LongMap frequencies)
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.
-
-