(s)
| 10601 | * Flush the bit buffer, keeping at most 7 bits in it. |
| 10602 | */ |
| 10603 | function 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 | /* =========================================================================== |