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 
    A binary fixed-width codec.
    static interface 
    A coder: provides methods to turn symbols into codewords.
    static interface 
    A decoder: provides a method to turn sequences of bits into symbols.
    static class 
    A codec based on Elias's γ code (starting at zero).
    static class 
    A Huffman codec with length-limiting capabilities and a fast canonical decoder.
    static class 
    A unary codec (starting at zero).
    static class 
    A degenerate stateless codec (always returns zero).
  • Method Summary

    Modifier and Type
    Method
    Description
    getCoder(Long2LongMap frequencies)
    Returns a coder for a specific map from symbols to frequencies.
  • Method Details

    • getCoder

      Codec.Coder getCoder(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.