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

Function reverseBits

depends/lodepng/lodepng.cpp:607–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605#endif /*LODEPNG_COMPILE_DECODER*/
606
607static unsigned reverseBits(unsigned bits, unsigned num) {
608 /*TODO: implement faster lookup table based version when needed*/
609 unsigned i, result = 0;
610 for(i = 0; i < num; i++) result |= ((bits >> (num - i - 1u)) & 1u) << i;
611 return result;
612}
613
614/* ////////////////////////////////////////////////////////////////////////// */
615/* / Deflate - Huffman / */

Callers 1

HuffmanTree_makeTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected