17 #ifndef _TS2_BIT_UTILS_H_ 18 #define _TS2_BIT_UTILS_H_ 30 #define TS2_WORD_BITS 32 31 #define TS2_WORD_BYTES 4 93 ATX_UInt32 bit_count);
99 #define TS2_BitWriter_IsByteAligned(writer) ((writer)->bit_count%8 == 0) 101 #define TS2_BitWriter_ByteCount(writer) ((ATX_UInt32)((writer)->bit_count / 8)) ATX_Result TS2_BitWriter_Write(TS2_BitWriter *writer, ATX_UInt32 bits, ATX_UInt32 bit_count)
ATX_Result TS2_BitStream_SetData(TS2_BitStream *bits, const ATX_Byte *data, ATX_Size data_size)
ATX_Result TS2_BitStream_ReadTimecode(TS2_BitStream *bits, ATX_UInt64 *timecode)
ATX_UInt64 TS2_BitStream_Read64(TS2_BitStream *bits, ATX_UInt32 n)
ATX_UInt64 bit_count
Definition: Ts2BitUtils.h:47
ATX_UInt32 TS2_BitStream_PeekBits(const TS2_BitStream *bits, ATX_UInt32 n)
ATX_UInt32 TS2_BitStream_PeekBit(const TS2_BitStream *bits)
ATX_Result TS2_BitWriter_WriteAlignedBytes(TS2_BitWriter *writer, ATX_Byte *data, ATX_Size data_size)
void TS2_BitStream_SkipBit(TS2_BitStream *bits)
ATX_Size data_size
Definition: Ts2BitUtils.h:38
const ATX_Byte * data
Definition: Ts2BitUtils.h:37
ATX_Result TS2_BitStream_Reset(TS2_BitStream *bits)
ATX_UInt32 TS2_BitStream_ReadBits(TS2_BitStream *bits, ATX_UInt32 n)
ATX_Byte * data
Definition: Ts2BitUtils.h:45
ATX_Size TS2_BitStream_GetBitsLeft(TS2_BitStream *bits)
void TS2_BitStream_SkipBits(TS2_BitStream *bits, ATX_UInt32 n)
ATX_Size data_size
Definition: Ts2BitUtils.h:46
Definition: Ts2BitUtils.h:44
ATX_UInt8 bits_cached
Definition: Ts2BitUtils.h:41
Definition: Ts2BitUtils.h:36
TS2_BitsWord cache
Definition: Ts2BitUtils.h:40
ATX_UInt32 pos
Definition: Ts2BitUtils.h:39
ATX_Result TS2_BitWriter_SetData(TS2_BitWriter *writer, ATX_Byte *data, ATX_Size data_size)
doesn't take ownership of data, just write into the buffer
ATX_UInt32 TS2_BitsWord
Definition: Ts2BitUtils.h:29
ATX_Result TS2_BitStream_Rewind(TS2_BitStream *bits, ATX_UInt32 n)
ATX_UInt32 TS2_BitStream_ReadBit(TS2_BitStream *bits)