Class HuffmanTable

java.lang.Object
com.pixelmed.scpecg.HuffmanTable
Direct Known Subclasses:
DefaultHuffmanTable

public class HuffmanTable extends Object

A class to store Huffman Tables, either as read from an SCP-ECG file or the default as specified in the SCP-ECG standard.

See Also:
  • Field Details

    • numberOfCodeStructuresInTable

      protected int numberOfCodeStructuresInTable
    • numberOfBitsInPrefix

      protected int[] numberOfBitsInPrefix
    • numberOfBitsInEntireCode

      protected int[] numberOfBitsInEntireCode
    • tableModeSwitch

      protected int[] tableModeSwitch
    • baseValueRepresentedByBaseCode

      protected int[] baseValueRepresentedByBaseCode
    • baseCode

      protected long[] baseCode
  • Constructor Details

    • HuffmanTable

      protected HuffmanTable()
    • HuffmanTable

      public HuffmanTable(int numberOfCodeStructuresInTable, int[] numberOfBitsInPrefix, int[] numberOfBitsInEntireCode, int[] tableModeSwitch, int[] baseValueRepresentedByBaseCode, long[] baseCode)

      Construct a Huffman Table from the supplied data as read from an SCP-ECG file.

      Parameters:
      numberOfCodeStructuresInTable - the number of codes (i.e. the size of all the array parameters)
      numberOfBitsInPrefix - for each code, the number of prefix bits for each code (i.e. the Huffman code)
      numberOfBitsInEntireCode - for each code, if > numberOfBitsInPrefix, used to find the number of original bits encoded
      tableModeSwitch - for each code, a flag to indicate to switch to another table (1 indicates no switch)
      baseValueRepresentedByBaseCode - for each code, the value that the code represents
      baseCode - the codes (with the order of bits reversed)
  • Method Details

    • getNumberOfCodeStructuresInTable

      public int getNumberOfCodeStructuresInTable()
    • getNumberOfBitsInPrefix

      public int[] getNumberOfBitsInPrefix()
    • getNumberOfBitsInEntireCode

      public int[] getNumberOfBitsInEntireCode()
    • getTableModeSwitch

      public int[] getTableModeSwitch()
    • getBaseValueRepresentedByBaseCode

      public int[] getBaseValueRepresentedByBaseCode()
    • getBaseCode

      public long[] getBaseCode()
    • toString

      public String toString()

      Dump the tables as a String.

      Overrides:
      toString in class Object
      Returns:
      the tables as a String