MCPcopy Create free account
hub / github.com/hoothin/UserScripts / bi_flush

Function bi_flush

Picviewer CE+/dist.user.js:10603–10614  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

10601 * Flush the bit buffer, keeping at most 7 bits in it.
10602 */
10603function bi_flush(s) {
10604 if (s.bi_valid === 16) {
10605 put_short(s, s.bi_buf);
10606 s.bi_buf = 0;
10607 s.bi_valid = 0;
10608
10609 } else if (s.bi_valid >= 8) {
10610 s.pending_buf[s.pending++] = s.bi_buf & 0xff;
10611 s.bi_buf >>= 8;
10612 s.bi_valid -= 8;
10613 }
10614}
10615
10616
10617/* ===========================================================================

Callers 1

_tr_alignFunction · 0.70

Calls 1

put_shortFunction · 0.70

Tested by

no test coverage detected