]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/put_bits.h
lavf/qsvvpp: bypass vpp if not needed.
[ffmpeg] / libavcodec / put_bits.h
index 6ea05929c80adaeb3b5a3248d263bb59ffed1190..17666fac4890d497ac927397ab96acecf2814fe8 100644 (file)
 #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;
@@ -74,6 +69,14 @@ static inline int put_bits_count(PutBitContext *s)
     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.
  */