| 2178 | } |
| 2179 | |
| 2180 | stbi_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? |
no test coverage detected