* Initialize the PutBitContext s. * * @param buffer the buffer where to put bits * @param buffer_size the size in bytes of buffer */
| 60 | * @param buffer_size the size in bytes of buffer |
| 61 | */ |
| 62 | static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, |
| 63 | int buffer_size) |
| 64 | { |
| 65 | if (buffer_size < 0) { |
| 66 | buffer_size = 0; |
| 67 | buffer = NULL; |
| 68 | } |
| 69 | |
| 70 | s->buf = buffer; |
| 71 | s->buf_end = s->buf + buffer_size; |
| 72 | s->buf_ptr = s->buf; |
| 73 | s->bit_left = BUF_BITS; |
| 74 | s->bit_buf = 0; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Inform the compiler that a PutBitContext is flushed (i.e. if it has just |
no outgoing calls