Public Types | |
enum | { in, out } |
Public Member Functions | |
Bitstream (const char *filename, int mode) | |
Bitstream (const char **files, int mode) | |
void | Read (unsigned int *data, int numbits) |
void | Write (const unsigned int *data, int numbits) |
void | Seek (int numbits) |
int | Find (unsigned int pattern, int numbits) |
void | ReadBytes (char *bytes, int num) |
void | WriteBytes (const char *bytes, int num) |
void | WriteNullBytes (int num) |
EOF condition is reported via eof_final exception Input stream can work with list of files (reads them one by one, throws eof_partial at EOF condition, when there's at least one more file.
It's uses 32bit integers, but should be portable, it handles little/big endian issues. I can't test it, i have just x86 hardware. Could anyone send a Sparc workstation? :o)
Definition at line 24 of file bitstream.h.
|
Direction Definition at line 29 of file bitstream.h. |
|
Constructor for one file
Definition at line 17 of file bitstream.cpp. |
|
Constructor for list of files
Definition at line 28 of file bitstream.cpp. |
|
Reads from the stream until pattern is found Consecutive read will get bits immediately after the pattern
Definition at line 145 of file bitstream.cpp. References Read(), and ReadBytes(). |
|
Read bits from stream. Bits are stored in integer array, first bit in high-order bit of first integer in array.
Definition at line 40 of file bitstream.cpp. References ReadBytes(). Referenced by Bitarray< mp3_frame_header >::Bitarray(), and Find(). |
|
Direct read of bytes Skips bit-handling and reads bytes directly. Also used by Read().
Definition at line 170 of file bitstream.cpp. Referenced by AudioData::AudioData(), Find(), Read(), and Seek(). |
|
Seek forward by number of bits
Definition at line 118 of file bitstream.cpp. References ReadBytes(). |
|
Writes bits to stream. Bits are given in integer array, first bit in high-order bit of first integer in array.
Definition at line 89 of file bitstream.cpp. References WriteBytes(). Referenced by Bitarray< mp3_frame_header >::Write(). |
|
Direct write of bytes Skips bit-handling and writes bytes directly. Also used by Write().
Definition at line 201 of file bitstream.cpp. References out. Referenced by Write(), and AudioData::Write(). |
|
Write zero bytes to output
Definition at line 207 of file bitstream.cpp. References out. Referenced by MP3Stream::WriteData(), and MP3Frame::WriteData(). |