(s)
| 22583 | * Flush the bit buffer, keeping at most 7 bits in it. |
| 22584 | */ |
| 22585 | function bi_flush(s) { |
| 22586 | if (s.bi_valid === 16) { |
| 22587 | put_short(s, s.bi_buf); |
| 22588 | s.bi_buf = 0; |
| 22589 | s.bi_valid = 0; |
| 22590 | |
| 22591 | } else if (s.bi_valid >= 8) { |
| 22592 | s.pending_buf[s.pending++] = s.bi_buf & 0xff; |
| 22593 | s.bi_buf >>= 8; |
| 22594 | s.bi_valid -= 8; |
| 22595 | } |
| 22596 | } |
| 22597 | |
| 22598 | |
| 22599 | /* =========================================================================== |