Class MMRDecompressor

java.lang.Object
org.apache.pdfbox.jbig2.decoder.mmr.MMRDecompressor

public class MMRDecompressor extends Object
A decompressor for MMR compression.
  • Field Details

  • Constructor Details

    • MMRDecompressor

      public MMRDecompressor(int width, int height, ImageInputStream stream)
  • Method Details

    • initTables

      private static final void initTables()
    • uncompress2D

      private final int uncompress2D(MMRDecompressor.RunData runData, int[] referenceOffsets, int refRunLength, int[] runOffsets, int width)
    • uncompress

      public Bitmap uncompress()
    • detectAndSkipEOL

      private void detectAndSkipEOL()
    • fillBitmap

      private void fillBitmap(Bitmap result, int line, int[] currentOffsets, int count)
    • uncompress1D

      private final int uncompress1D(MMRDecompressor.RunData runData, int[] runOffsets, int width)
    • createLittleEndianTable

      private static MMRDecompressor.Code[] createLittleEndianTable(int[][] codes)
      For little endian, the tables are structured like this:
        v--------v length = FIRST_LEVEL_TABLE_LENGTH
                      v-----v length = SECOND_LEVEL_TABLE_LENGTH
       
        A code word which fits into the first level table (length=3)
        [Cccvvvvv]
       
        A code word which needs the second level table also (length=10)
        [Cccccccc] -> [ccvvv]
       
        "C" denotes the first code word bit
        "c" denotes a code word bit
        "v" denotes a variant bit