Dirac - A Video Codec
Created by the British Broadcasting Corporation.
Go to the documentation of this file.
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)
void WriteUintLit(const unsigned int &value, const int &length)
Output unsigned int value in big endian format.
Definition: byteio.h:325
int WriteNBits(unsigned int val)
Outputs an unsigned integer.
void FlushInputB()
Flushes the bounde input.
void SetBit(unsigned char &c, int pos) const
Definition: byteio.h:150
Definition of class SequenceHeaderByteIO.
Definition: accessunit_byteio.h:51
void OutputCurrentByte()
Outputs current byte contents.
Definition: byteio.h:301
void WriteBit(const bool &bit)
Outputs a bit.
unsigned int ReadNBits(int count)
Reads next 'count' bits.
void InputBytes(char *data, int count)
Reads from stream.
Definition: byteio.h:192
#define BIT_IN_CHAR(bit)
Definition: byteio.h:66
bool ReadBool()
Reads boolean value.
unsigned int ReadUint()
Reads an unsigned integer in interleaved exp Golomb format.
void SetBits(unsigned char &c, unsigned char bits) const
Definition: byteio.h:152
int BitsLeft(void)
Sets input size in bits.
Definition: byteio.h:142
void OutputBytes(const std::string &bytes)
Outputs a series of bytes.
Definition: byteio.h:290
std::string InputUnString(const int count)
Reads a series of bytes from a stream.
Definition: byteio.h:257
void WriteUint(unsigned int value)
Ouputs an unsigned integer in interleaved exp Golomb format.
void WriteSint(int val)
Outputs an integer in Golomb signed integer format.
int ReadSintB()
Reads a signed integer in interleaved exp-Golomb format from bounded input return Signed integer read...
int ReadBit()
Reads next bit.
bool CanRead() const
Definition: byteio.h:146
bool ReadBoolB()
Reads boolean value - bounded i/o.
virtual ~ByteIO()
Destructor.
void RemoveRedundantBytes(const int count)
Removes portion of byte-stream no longer required.
bool GetBit(unsigned char &c, int pos) const
Definition: byteio.h:148
std::stringstream * mp_stream
Input/output steam.
Definition: byteio.h:349
unsigned char m_current_byte
Char used for temporary storage of op data bits.
Definition: byteio.h:367
unsigned int ReadUintB()
Reads an unsigned integer in interleaved exp Golomb format from bounded input.
Class DiracByteStats - for collecting statistics on aspects of the Dirac byte-stream.
Definition: dirac_byte_stats.h:70
void SeekGet(const int offset, std::ios_base::seekdir dir)
Definition: byteio.h:341
Class ByteIO - top-level class for reading/writing bytes to a stream.
Definition: byteio.h:72
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
ByteIO(bool new_stream=true)
Default constructor.
Definition: band_vlc.h:55
int m_num_bytes
Number of bytes processed.
Definition: byteio.h:377
int m_bits_left
num bits left to read
Definition: byteio.h:387
void SetBitsLeft(int left_bits)
Sets input size in bits.
Definition: byteio.h:137
virtual const std::string GetBytes()
Get bytes in Dirac-bytestream format.
virtual int GetSize() const
Gets size (in bytes)
unsigned int ReadUintLit(const int byte_size)
Reads a fixed length unsigned integer from the stream in big endian.
Definition: byteio.h:238
virtual void CollateByteStats(DiracByteStats &dirac_byte_stats)
Gathers byte-stream statistics.
Definition: byteio.h:97
int GetReadBytePosition() const
Get position of read stream pointer.
Definition: byteio.h:108
int m_current_pos
Used to set individual bit within the current header byte.
Definition: byteio.h:372
void ByteAlignInput()
Sync input for byte-alignment.
void SetByteParams(const ByteIO &byte_io)
Copies stream source/destination info.
bool m_new_stream
stream alloc flag
Definition: byteio.h:382
void ByteAlignOutput()
Sync input for byte-alignment.
Definition: arith_codec.h:95
int ReadBitB()
Reads next bit - bounded i/o.
© 2004 British Broadcasting Corporation.
Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's
excellent Doxygen tool.