MCPcopy Create free account
hub / github.com/DFHack/dfhack / readBitFromReversedStream

Function readBitFromReversedStream

depends/lodepng/lodepng.cpp:2438–2442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2436so LodePNGBitWriter and LodePNGBitReader can't be used for those. */
2437
2438static unsigned char readBitFromReversedStream(size_t* bitpointer, const unsigned char* bitstream) {
2439 unsigned char result = (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1);
2440 ++(*bitpointer);
2441 return result;
2442}
2443
2444/* TODO: make this faster */
2445static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) {

Callers 5

Adam7_deinterlaceFunction · 0.85
removePaddingBitsFunction · 0.85
addPaddingBitsFunction · 0.85
Adam7_interlaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected