#define AVCODEC_PUT_BITS_H
#include <stdint.h>
-#include <stdlib.h>
+#include <stddef.h>
#include <assert.h>
-#include "libavutil/bswap.h"
-#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/log.h"
-#include "mathops.h"
-#include "config.h"
typedef struct PutBitContext {
uint32_t bit_buf;
return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
}
+/**
+ * @return the number of bits available in the bitstream.
+ */
+static inline int put_bits_left(PutBitContext* s)
+{
+ return (s->buf_end - s->buf_ptr) * 8 - 32 + s->bit_left;
+}
+
/**
* Pad the end of the output stream with zeros.
*/