MCPcopy Index your code
hub / github.com/google/brotli / decodeBlockTypeAndLength

Method decodeBlockTypeAndLength

java/org/brotli/dec/Decode.java:732–752  ·  view source on GitHub ↗
(State s, int treeType, int numBlockTypes)

Source from the content-addressed store, hash-verified

730 }
731
732 private static int decodeBlockTypeAndLength(State s, int treeType, int numBlockTypes) {
733 final int[] ringBuffers = s.rings;
734 final int offset = 4 + treeType * 2;
735 BitReader.fillBitWindow(s);
736 int blockType = readSymbol(s.blockTrees, 2 * treeType, s);
737 final int result = readBlockLength(s.blockTrees, 2 * treeType + 1, s);
738
739 if (blockType == 1) {
740 blockType = ringBuffers[offset + 1] + 1;
741 } else if (blockType == 0) {
742 blockType = ringBuffers[offset];
743 } else {
744 blockType -= 2;
745 }
746 if (blockType >= numBlockTypes) {
747 blockType -= numBlockTypes;
748 }
749 ringBuffers[offset] = ringBuffers[offset + 1];
750 ringBuffers[offset + 1] = blockType;
751 return result;
752 }
753
754 private static void decodeLiteralBlockSwitch(State s) {
755 s.literalBlockLength = decodeBlockTypeAndLength(s, 0, s.numLiteralBlockTypes);

Callers 3

Calls 3

fillBitWindowMethod · 0.95
readSymbolMethod · 0.95
readBlockLengthMethod · 0.95

Tested by

no test coverage detected