MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__zhuffman_decode

Function stbi__zhuffman_decode

lite/example/cpp_example/mge/cv/stb_image.h:4574–4590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4572}
4573
4574stbi_inline static int stbi__zhuffman_decode(stbi__zbuf* a, stbi__zhuffman* z) {
4575 int b, s;
4576 if (a->num_bits < 16) {
4577 if (stbi__zeof(a)) {
4578 return -1; /* report error for unexpected end of data. */
4579 }
4580 stbi__fill_bits(a);
4581 }
4582 b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
4583 if (b) {
4584 s = b >> 9;
4585 a->code_buffer >>= s;
4586 a->num_bits -= s;
4587 return b & 511;
4588 }
4589 return stbi__zhuffman_decode_slowpath(a, z);
4590}
4591
4592static int stbi__zexpand(
4593 stbi__zbuf* z, char* zout, int n) // need to make room for n bytes

Callers 2

Calls 3

stbi__zeofFunction · 0.85
stbi__fill_bitsFunction · 0.85

Tested by

no test coverage detected