62 #define MS_BIT (1 << (CHAR_BIT - 1))
66 #define BIT_IN_CHAR(bit) (1 << bit)
98 { dirac_byte_stats.
Clear(); }
152 inline void SetBits(
unsigned char& c,
unsigned char bits)
const { c |= bits; }
240 for(
int i=0; i < byte_size; ++i)
260 for(
int index=0; index < count; ++index)
295 mp_stream->seekg(std::max(cur_pos,0), std::ios_base::beg);
327 for(
int i=length-1; i >=0 ; --i)
329 unsigned char cp = (value>>(i*8))&0xff;
341 inline void SeekGet(
const int offset, std::ios_base::seekdir dir)
#define BIT_IN_CHAR(bit)
Definition byteio.h:66
Definition of class SequenceHeaderByteIO.
Definition accessunit_byteio.h:52
void WriteBit(const bool &bit)
Outputs a bit.
bool CanRead() const
Definition byteio.h:146
int m_bits_left
num bits left to read
Definition byteio.h:387
void RemoveRedundantBytes(const int count)
Removes portion of byte-stream no longer required.
int m_current_pos
Used to set individual bit within the current header byte.
Definition byteio.h:372
std::string InputUnString(const int count)
Reads a series of bytes from a stream.
Definition byteio.h:257
friend class ArithCodecBase
ArithCodec can see internals for getting/setting bits.
Definition byteio.h:357
void OutputCurrentByte()
Outputs current byte contents.
Definition byteio.h:301
void FlushInputB()
Flushes the bounde input.
unsigned int ReadUintB()
Reads an unsigned integer in interleaved exp Golomb format from bounded input.
bool m_new_stream
stream alloc flag
Definition byteio.h:382
unsigned char m_current_byte
Char used for temporary storage of op data bits.
Definition byteio.h:367
void ByteAlignInput()
Sync input for byte-alignment.
void WriteSint(int val)
Outputs an integer in Golomb signed integer format.
int ReadBit()
Reads next bit.
void WriteUint(unsigned int value)
Ouputs an unsigned integer in interleaved exp Golomb format.
unsigned int ReadNBits(int count)
Reads next 'count' bits.
void WriteUintLit(const unsigned int &value, const int &length)
Output unsigned int value in big endian format.
Definition byteio.h:325
bool GetBit(unsigned char &c, int pos) const
Definition byteio.h:148
void ByteAlignOutput()
Sync input for byte-alignment.
int ReadBitB()
Reads next bit - bounded i/o.
unsigned int ReadUintLit(const int byte_size)
Reads a fixed length unsigned integer from the stream in big endian.
Definition byteio.h:238
ByteIO(const ByteIO &stream_data)
Constructor.
void SeekGet(const int offset, std::ios_base::seekdir dir)
Definition byteio.h:341
virtual void CollateByteStats(DiracByteStats &dirac_byte_stats)
Gathers byte-stream statistics.
Definition byteio.h:97
void SetByteParams(const ByteIO &byte_io)
Copies stream source/destination info.
int m_num_bytes
Number of bytes processed.
Definition byteio.h:377
int ReadSint()
Reads a signed integer in interleaved exp-Golomb format return Signed integer read.
unsigned char InputUnByte()
Reads a byte from the stream.
Definition byteio.h:252
int ReadSintB()
Reads a signed integer in interleaved exp-Golomb format from bounded input return Signed integer read...
void SetBitsLeft(int left_bits)
Sets input size in bits.
Definition byteio.h:137
std::stringstream * mp_stream
Input/output steam.
Definition byteio.h:349
void SetBits(unsigned char &c, unsigned char bits) const
Definition byteio.h:152
virtual ~ByteIO()
Destructor.
virtual const std::string GetBytes()
Get bytes in Dirac-bytestream format.
bool ReadBool()
Reads boolean value.
int BitsLeft(void)
Sets input size in bits.
Definition byteio.h:142
int WriteNBits(unsigned int val)
Outputs an unsigned integer.
void WriteNBits(unsigned int val, int count)
Outputs an n bit integer.
int GetReadBytePosition() const
Get position of read stream pointer.
Definition byteio.h:108
void InputBytes(char *data, int count)
Reads from stream.
Definition byteio.h:192
void SetBit(unsigned char &c, int pos) const
Definition byteio.h:150
friend class ArithCodecToVLCAdapter
VLC entropy coder can see internals for getting/setting bits.
Definition byteio.h:362
bool ReadBoolB()
Reads boolean value - bounded i/o.
unsigned int ReadUint()
Reads an unsigned integer in interleaved exp Golomb format.
ByteIO(bool new_stream=true)
Default constructor.
void OutputBytes(const std::string &bytes)
Outputs a series of bytes.
Definition byteio.h:290
virtual int GetSize() const
Gets size (in bytes)
Class DiracByteStats - for collecting statistics on aspects of the Dirac byte-stream.
Definition dirac_byte_stats.h:71