(State s, int treeType, int numBlockTypes)
| 849 | } |
| 850 | |
| 851 | private static int readMetablockPartition(State s, int treeType, int numBlockTypes) { |
| 852 | int offset = s.blockTrees[2 * treeType]; |
| 853 | if (numBlockTypes <= 1) { |
| 854 | s.blockTrees[2 * treeType + 1] = offset; |
| 855 | s.blockTrees[2 * treeType + 2] = offset; |
| 856 | return 1 << 28; |
| 857 | } |
| 858 | |
| 859 | final int blockTypeAlphabetSize = numBlockTypes + 2; |
| 860 | int result = readHuffmanCode( |
| 861 | blockTypeAlphabetSize, blockTypeAlphabetSize, s.blockTrees, 2 * treeType, s); |
| 862 | if (result < BROTLI_OK) { |
| 863 | return result; |
| 864 | } |
| 865 | offset += result; |
| 866 | s.blockTrees[2 * treeType + 1] = offset; |
| 867 | |
| 868 | final int blockLengthAlphabetSize = NUM_BLOCK_LENGTH_CODES; |
| 869 | result = readHuffmanCode( |
| 870 | blockLengthAlphabetSize, blockLengthAlphabetSize, s.blockTrees, 2 * treeType + 1, s); |
| 871 | if (result < BROTLI_OK) { |
| 872 | return result; |
| 873 | } |
| 874 | offset += result; |
| 875 | s.blockTrees[2 * treeType + 2] = offset; |
| 876 | |
| 877 | return readBlockLength(s.blockTrees, 2 * treeType + 1, s); |
| 878 | } |
| 879 | |
| 880 | private static void calculateDistanceLut(State s, int alphabetSizeLimit) { |
| 881 | final byte[] distExtraBits = s.distExtraBits; |
no test coverage detected