 |
libxcoder
5.2.0
|
Go to the documentation of this file.
48 #define LIB_API_BITSTREAM __declspec(dllexport)
50 #define LIB_API_BITSTREAM __declspec(dllimport)
53 #define LIB_API_BITSTREAM
55 #elif __linux__ || __APPLE__
56 #define LIB_API_BITSTREAM
60 #define NI_DATA_CHUNK_SIZE 4096
LIB_API_BITSTREAM int ni_bs_reader_bits_count(ni_bitstream_reader_t *br)
return the number of bits already parsed in stream
void ni_bs_writer_put_ue(ni_bitstream_writer_t *stream, uint32_t data)
write unsigned Exp-Golomb bit string to bitstream, 2^32-2 at most.
LIB_API_BITSTREAM void ni_bitstream_reader_init(ni_bitstream_reader_t *br, const uint8_t *data, int bit_size)
init a bitstream reader Note: bitstream_reader takes reading ownership of the data
void ni_bs_writer_clear(ni_bitstream_writer_t *stream)
clear and reset bitstream
struct ni_data_chunk_t ni_data_chunk_t
uint8_t data[NI_DATA_CHUNK_SIZE]
LIB_API_BITSTREAM uint32_t ni_bs_reader_get_bits(ni_bitstream_reader_t *br, int n)
read bits (up to 32) from the bitstream reader, after reader init
void ni_bs_writer_put(ni_bitstream_writer_t *stream, uint32_t data, uint8_t bits)
write a specified number (<= 32) of bits to bitstream, buffer individual bits until a full byte is ma...
struct _ni_bitstream_writer_t ni_bitstream_writer_t
uint64_t ni_bs_writer_tell(const ni_bitstream_writer_t *const stream)
return the number of bits written to bitstream so far
LIB_API_BITSTREAM int ni_bs_reader_get_bits_left(ni_bitstream_reader_t *br)
return the number of bits left to parse in stream
LIB_API_BITSTREAM int32_t ni_bs_reader_get_se(ni_bitstream_reader_t *br)
read a signed Exp-Golomb code se(v)
#define NI_DATA_CHUNK_SIZE
void ni_bitstream_writer_init(ni_bitstream_writer_t *stream)
init a bitstream writer
void ni_bs_writer_align_zero(ni_bitstream_writer_t *stream)
align the bitstream with zero
struct ni_data_chunk_t * next
void ni_bs_writer_put_se(ni_bitstream_writer_t *stream, int32_t data)
write signed Exp-Golomb bit string to bitstream
LIB_API_BITSTREAM void ni_bs_reader_skip_bits(ni_bitstream_reader_t *br, int n)
skip a number of bits ahead in the bitstream reader
void ni_bs_writer_copy(uint8_t *dst, const ni_bitstream_writer_t *stream)
copy bitstream data to dst Note: caller must ensure sufficient space in dst
LIB_API_BITSTREAM uint32_t ni_bs_reader_get_ue(ni_bitstream_reader_t *br)
read an unsigned Exp-Golomb code ue(v)
struct _ni_bitstream_reader_t ni_bitstream_reader_t