MCPcopy
hub / github.com/google/brotli / readHuffmanCode

Method readHuffmanCode

java/org/brotli/dec/Decode.java:650–664  ·  view source on GitHub ↗

Decodes Huffman table from bit-stream. @return number of slots used by resulting Huffman table

(int alphabetSizeMax, int alphabetSizeLimit,
      int[] tableGroup, int tableIdx, State s)

Source from the content-addressed store, hash-verified

648 * @return number of slots used by resulting Huffman table
649 */
650 private static int readHuffmanCode(int alphabetSizeMax, int alphabetSizeLimit,
651 int[] tableGroup, int tableIdx, State s) {
652 if (s.halfOffset > BitReader.HALF_WATERLINE) {
653 final int result = BitReader.readMoreInput(s);
654 if (result < BROTLI_OK) {
655 return result;
656 }
657 }
658 BitReader.fillBitWindow(s);
659 final int simpleCodeOrSkip = BitReader.readFewBits(s, 2);
660 if (simpleCodeOrSkip == 1) {
661 return readSimpleHuffmanCode(alphabetSizeMax, alphabetSizeLimit, tableGroup, tableIdx, s);
662 }
663 return readComplexHuffmanCode(alphabetSizeLimit, simpleCodeOrSkip, tableGroup, tableIdx, s);
664 }
665
666 private static int decodeContextMap(int contextMapSize, byte[] contextMap, State s) {
667 int result;

Callers 3

decodeContextMapMethod · 0.95

Calls 5

readMoreInputMethod · 0.95
fillBitWindowMethod · 0.95
readFewBitsMethod · 0.95
readSimpleHuffmanCodeMethod · 0.95

Tested by

no test coverage detected