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

Function stbi__jpeg_get_bits

Source/Utils/stb_image.h:2168–2178  ·  view source on GitHub ↗

get some unsigned bits

Source from the content-addressed store, hash-verified

2166
2167// get some unsigned bits
2168stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
2169{
2170 unsigned int k;
2171 if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
2172 if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
2173 k = stbi_lrot(j->code_buffer, n);
2174 j->code_buffer = k & ~stbi__bmask[n];
2175 k &= stbi__bmask[n];
2176 j->code_bits -= n;
2177 return k;
2178}
2179
2180stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
2181{

Callers 1

Calls 1

stbi__grow_buffer_unsafeFunction · 0.85

Tested by

no test coverage detected