MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi__jpeg_get_bit

Function stbi__jpeg_get_bit

Source/Utils/stb_image.h:2180–2189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178}
2179
2180stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
2181{
2182 unsigned int k;
2183 if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
2184 if (j->code_bits < 1) return 0; // ran out of bits from stream, return 0s intead of continuing
2185 k = j->code_buffer;
2186 j->code_buffer <<= 1;
2187 --j->code_bits;
2188 return k & 0x80000000;
2189}
2190
2191// given a value that's at position X in the zigzag stream,
2192// where does it appear in the 8x8 matrix coded as row-major?

Calls 1

stbi__grow_buffer_unsafeFunction · 0.85

Tested by

no test coverage detected