62 #define MS_BIT (1 << (CHAR_BIT - 1)) 66 #define BIT_IN_CHAR(bit) (1 << bit) 80 ByteIO(
bool new_stream=
true);
98 { dirac_byte_stats.
Clear(); }
103 virtual const std::string
GetBytes();
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)
Definition of class SequenceHeaderByteIO.
Definition: accessunit_byteio.h:51
void RemoveRedundantBytes(const int count)
Removes portion of byte-stream no longer required
int BitsLeft(void)
Sets input size in bits.
Definition: byteio.h:142
void FlushInputB()
Flushes the bounde input.
std::string InputUnString(const int count)
Reads a series of bytes from a stream.
Definition: byteio.h:257
bool GetBit(unsigned char &c, int pos) const
Definition: byteio.h:148
void ByteAlignInput()
Sync input for byte-alignment.
unsigned char m_current_byte
Char used for temporary storage of op data bits.
Definition: byteio.h:367
void SetBit(unsigned char &c, int pos) const
Definition: byteio.h:150
bool CanRead() const
Definition: byteio.h:146
int ReadBit()
Reads next bit.
bool ReadBoolB()
Reads boolean value - bounded i/o.
std::stringstream * mp_stream
Input/output steam
Definition: byteio.h:349
void ByteAlignOutput()
Sync input for byte-alignment.
int ReadSint()
Reads a signed integer in interleaved exp-Golomb format return Signed integer read ...
void OutputBytes(const std::string &bytes)
Outputs a series of bytes.
Definition: byteio.h:290
int m_num_bytes
Number of bytes processed.
Definition: byteio.h:377
bool m_new_stream
stream alloc flag
Definition: byteio.h:382
Definition: band_vlc.h:55
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
virtual const std::string GetBytes()
Get bytes in Dirac-bytestream format.
int m_current_pos
Used to set individual bit within the current header byte.
Definition: byteio.h:372
Class DiracByteStats - for collecting statistics on aspects of the Dirac byte-stream.
Definition: dirac_byte_stats.h:70
unsigned int ReadUint()
Reads an unsigned integer in interleaved exp Golomb format
Class ByteIO - top-level class for reading/writing bytes to a stream
Definition: byteio.h:72
void InputBytes(char *data, int count)
Reads from stream
Definition: byteio.h:192
int ReadSintB()
Reads a signed integer in interleaved exp-Golomb format from bounded input return Signed integer re...
int WriteNBits(unsigned int val)
Outputs an unsigned integer
virtual ~ByteIO()
Destructor.
void SeekGet(const int offset, std::ios_base::seekdir dir)
Definition: byteio.h:341
bool ReadBool()
Reads boolean value.
int GetReadBytePosition() const
Get position of read stream pointer.
Definition: byteio.h:108
ByteIO(bool new_stream=true)
Default constructor
#define BIT_IN_CHAR(bit)
Definition: byteio.h:66
void WriteUint(unsigned int value)
Ouputs an unsigned integer in interleaved exp Golomb format
void OutputCurrentByte()
Outputs current byte contents
Definition: byteio.h:301
virtual void CollateByteStats(DiracByteStats &dirac_byte_stats)
Gathers byte-stream statistics
Definition: byteio.h:97
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
void SetBitsLeft(int left_bits)
Sets input size in bits.
Definition: byteio.h:137
unsigned char InputUnByte()
Reads a byte from the stream.
Definition: byteio.h:252
void WriteSint(int val)
Outputs an integer in Golomb signed integer format
void SetBits(unsigned char &c, unsigned char bits) const
Definition: byteio.h:152
unsigned int ReadUintB()
Reads an unsigned integer in interleaved exp Golomb format from bounded input
Definition: arith_codec.h:95
void WriteBit(const bool &bit)
Outputs a bit
virtual int GetSize() const
Gets size (in bytes)
void SetByteParams(const ByteIO &byte_io)
Copies stream source/destination info
int m_bits_left
num bits left to read
Definition: byteio.h:387