33 static const BITCOUNT bit_word_count = 32;
36 #define BIT_WORD_MAX 0xFFFFFFFF 39 #define MAX_SAMPLE_OFFSET_COUNT 8 CODEC_ERROR BitstreamCodecError(BITSTREAM *bitstream)
Convert a bitstream error code into a codec error code.
Definition: bitstream.c:245
No error.
Definition: bitstream.h:20
struct _bitstream BITSTREAM
Declaration of the bitstream data structure.
Declaration of the bitstream data structure.
Definition: bitstream.h:48
_bitstream_error
Bitstream error codes.
Definition: bitstream.h:18
struct _stream * stream
Stream for reading bytes into the buffer.
Definition: bitstream.h:51
Declaration of the data structure for a byte stream.
Definition: stream.h:69
uint32_t sample_offset_stack[MAX_SAMPLE_OFFSET_COUNT]
Definition: bitstream.h:67
CODEC_ERROR PutByteArray(BITSTREAM *bitstream, const uint8_t *block, size_t size)
Write a block of bytes into the bitstream.
Definition: bitstream.c:354
FILE * logfile
File for bitstream debugging output.
Definition: bitstream.h:73
enum _bitstream_error BITSTREAM_ERROR
Bitstream error codes.
uint32_t BITWORD
Data type of the internal bitstream buffer.
Definition: bitstream.h:29
CODEC_ERROR PutLong(BITSTREAM *stream, BITWORD longword)
Write a longword (32 bits) to the stream.
Definition: bitstream.c:194
CODEC_ERROR AlignBitsByte(BITSTREAM *bitstream)
Align the bitstream to a byte boundary.
Definition: bitstream.c:284
CODEC_ERROR AttachBitstream(struct _bitstream *bitstream, struct _stream *stream)
Attach a bitstream to a byte stream.
Definition: bitstream.c:71
uint_fast8_t sample_offset_count
Number of entries in the sample offset stack.
Definition: bitstream.h:70
CODEC_ERROR RewindBitstream(BITSTREAM *bitstream)
Reset the bitstream.
Definition: bitstream.c:208
uint_fast8_t BITCOUNT
Number of bits in the bitsteam buffer.
Definition: bitstream.h:30
No more bits can be written to the bitstream.
Definition: bitstream.h:22
CODEC_ERROR AlignBitsWord(BITSTREAM *bitstream)
Align the bitstream to the next word boundary.
Definition: bitstream.c:302
Unexpected tag found in the bitstream.
Definition: bitstream.h:23
size_t GetBitstreamPosition(BITSTREAM *stream)
Get the current position in the byte stream.
Definition: bitstream.c:266
CODEC_ERROR ReleaseBitstream(BITSTREAM *stream)
Detach a bitstream from a byte stream.
Definition: bitstream.c:86
CODEC_ERROR PutBits(BITSTREAM *stream, BITWORD bits, BITCOUNT count)
Write the specified number of bits to the bitstream.
Definition: bitstream.c:96
BITSTREAM_ERROR error
Error while processing the bitstream.
Definition: bitstream.h:50
BITCOUNT count
Number of bits remaining in the buffer.
Definition: bitstream.h:53
uint32_t PopSampleOffsetStack(BITSTREAM *bitstream)
Pop the top value from the sample offset stack.
Definition: bitstream.c:345
CODEC_ERROR InitBitstream(BITSTREAM *bitstream)
Initialize a bitstream data structure.
Definition: bitstream.c:41
enum _codec_error CODEC_ERROR
Codec error codes.
CODEC_ERROR PutBuffer(BITSTREAM *stream)
Write the internal bitstream buffer to a byte stream.
Definition: bitstream.c:169
No unread bits remaining in the bitstream.
Definition: bitstream.h:21
BITWORD buffer
Internal buffer holds remaining bits.
Definition: bitstream.h:52
bool putbits_flag
The putbits flags controls debug output during entropy coding.
Definition: bitstream.h:76
CODEC_ERROR FlushBitstream(BITSTREAM *bitstream)
Write any bits in the buffer to the byte stream.
Definition: bitstream.c:323