26 #ifndef AVCODEC_PUT_BITS_H
27 #define AVCODEC_PUT_BITS_H
33 #include "libavutil/bswap.h"
34 #include "libavutil/common.h"
35 #include "libavutil/intreadwrite.h"
36 #include "libavutil/log.h"
37 #include "libavutil/avassert.h"
57 if (buffer_size < 0) {
91 #ifndef BITSTREAM_WRITER_LE
97 #ifdef BITSTREAM_WRITER_LE
110 #ifdef BITSTREAM_WRITER_LE
111 #define avpriv_align_put_bits align_put_bits_unsupported_here
112 #define avpriv_put_string ff_put_string_unsupported_here
113 #define avpriv_copy_bits avpriv_copy_bits_unsupported_here
126 int terminate_string);
142 unsigned int bit_buf;
151 #ifdef BITSTREAM_WRITER_LE
152 bit_buf |= value << (32 - bit_left);
157 bit_buf = (bit_left == 32) ? 0 : value >> bit_left;
163 bit_buf = (bit_buf <<
n) | value;
166 bit_buf <<= bit_left;
167 bit_buf |= value >> (n - bit_left);
184 put_bits(pb, n, value & ((1 << n) - 1));
192 int lo = value & 0xffff;
193 int hi = value >> 16;
194 #ifdef BITSTREAM_WRITER_LE
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
Write exactly 32 bits into a bitstream.
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static void skip_put_bits(PutBitContext *s, int n)
Skip the given number of bits.
void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
Copy the content of src to the bitstream.
void avpriv_align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
static uint8_t * put_bits_ptr(PutBitContext *s)
Return the pointer to the byte where the bitstream writer will put the next bit.
static int put_bits_left(PutBitContext *s)
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
#define av_unused
Disable warnings about deprecated features This is useful for sections of code kept for backward comp...
static int put_bits_count(PutBitContext *s)
static void skip_put_bytes(PutBitContext *s, int n)
Skip the given number of bytes.
static void set_put_bits_buffer_size(PutBitContext *s, int size)
Change the end of the buffer.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
void avpriv_put_string(PutBitContext *pb, const char *string, int terminate_string)
Put the string string in the bitstream.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.