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

Method readMetablockPartition

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

Source from the content-addressed store, hash-verified

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;

Calls 2

readHuffmanCodeMethod · 0.95
readBlockLengthMethod · 0.95

Tested by

no test coverage detected