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

Function stbi__grow_buffer_unsafe

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

Source from the content-addressed store, hash-verified

2216}
2217
2218static void stbi__grow_buffer_unsafe(stbi__jpeg* j) {
2219 do {
2220 unsigned int b = j->nomore ? 0 : stbi__get8(j->s);
2221 if (b == 0xff) {
2222 int c = stbi__get8(j->s);
2223 while (c == 0xff)
2224 c = stbi__get8(j->s); // consume fill bytes
2225 if (c != 0) {
2226 j->marker = (unsigned char)c;
2227 j->nomore = 1;
2228 return;
2229 }
2230 }
2231 j->code_buffer |= b << (24 - j->code_bits);
2232 j->code_bits += 8;
2233 } while (j->code_bits <= 24);
2234}
2235
2236// (1 << n) - 1
2237static const stbi__uint32 stbi__bmask[17] = {0, 1, 3, 7, 15, 31,

Callers 8

stbi__jpeg_huff_decodeFunction · 0.85
stbi__extend_receiveFunction · 0.85
stbi__jpeg_get_bitsFunction · 0.85
stbi__jpeg_get_bitFunction · 0.85
stbi__jpeg_decode_blockFunction · 0.85

Calls 1

stbi__get8Function · 0.85

Tested by

no test coverage detected