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

Function writeBitsReversed

depends/lodepng/lodepng.cpp:445–451  ·  view source on GitHub ↗

This one is to use for adding huffman symbol, the value bits are written MSB first */

Source from the content-addressed store, hash-verified

443
444/* This one is to use for adding huffman symbol, the value bits are written MSB first */
445static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) {
446 size_t i;
447 for(i = 0; i != nbits; ++i) {
448 /* TODO: increase output size only once here rather than in each WRITEBIT */
449 WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u));
450 }
451}
452#endif /*LODEPNG_COMPILE_ENCODER*/
453
454#ifdef LODEPNG_COMPILE_DECODER

Callers 3

writeLZ77dataFunction · 0.85
deflateDynamicFunction · 0.85
deflateFixedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected