(State s, int maxDistance, int npostfix, int ndirect)
| 181 | // TODO(eustas): add a correctness test for this function when |
| 182 | // large-window and dictionary are implemented. |
| 183 | private static int calculateDistanceAlphabetLimit(State s, int maxDistance, int npostfix, int ndirect) { |
| 184 | if (maxDistance < ndirect + (2 << npostfix)) { |
| 185 | return Utils.makeError(s, BROTLI_PANIC_MAX_DISTANCE_TOO_SMALL); |
| 186 | } |
| 187 | final int offset = ((maxDistance - ndirect) >> npostfix) + 4; |
| 188 | final int ndistbits = log2floor(offset) - 1; |
| 189 | final int group = ((ndistbits - 1) << 1) | ((offset >> ndistbits) & 1); |
| 190 | return ((group - 1) << npostfix) + (1 << npostfix) + ndirect + NUM_DISTANCE_SHORT_CODES; |
| 191 | } |
| 192 | |
| 193 | private static void unpackCommandLookupTable(short[] cmdLookup) { |
| 194 | final int[] insertLengthOffsets = new int[24]; |
no test coverage detected