code: function send_bits(value, length) {
  		// If not enough room in bi_buf, use (valid) bits from bi_buf and
  		// (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
  		// unused bits in value.
  		if (bi_valid > Buf_size - length) {
  			bi_buf |= (value << bi_valid);
  			put_short(bi_buf);
  			bi_buf = (value >> (Buf_size - bi_valid));
  			bi_valid += length - Buf_size;
  		} else {
  			bi_buf |= value << bi_valid;
  			bi_valid += length;
  		}
  	}
docs: bit size of bi_buf