MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / bi_flush

Function bi_flush

extern/zlib/src/trees.c:166–176  ·  view source on GitHub ↗

=========================================================================== * Flush the bit buffer, keeping at most 7 bits in it. */

Source from the content-addressed store, hash-verified

164 * Flush the bit buffer, keeping at most 7 bits in it.
165 */
166local void bi_flush(deflate_state *s) {
167 if (s->bi_valid == 16) {
168 put_short(s, s->bi_buf);
169 s->bi_buf = 0;
170 s->bi_valid = 0;
171 } else if (s->bi_valid >= 8) {
172 put_byte(s, (Byte)s->bi_buf);
173 s->bi_buf >>= 8;
174 s->bi_valid -= 8;
175 }
176}
177
178/* ===========================================================================
179 * Flush the bit buffer and align the output on a byte boundary

Callers 2

_tr_flush_bitsFunction · 0.85
_tr_alignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected