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

Method log2floor

java/org/brotli/dec/Decode.java:161–175  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

159 }
160
161 private static int log2floor(int i) {
162 // REQUIRED: i > 0
163 int result = -1;
164 int step = 16;
165 int v = i;
166 while (step > 0) {
167 int next = v >> step;
168 if (next != 0) {
169 result += step;
170 v = next;
171 }
172 step = step >> 1;
173 }
174 return result + v;
175 }
176
177 private static int calculateDistanceAlphabetSize(int npostfix, int ndirect, int maxndistbits) {
178 return NUM_DISTANCE_SHORT_CODES + ndirect + 2 * (maxndistbits << npostfix);

Callers 2

readSimpleHuffmanCodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected