(State s, int treeType, int numBlockTypes)
| 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); |
no test coverage detected