View Full Version : BitStreamReader / Writer API


hypercube
14th May 2003, 09:27
I made my own API to parse bitstream like MPEG or DTS, and may be
it could be interest some of yours ? It was in C++

BistreamReader can read 1 to 32 bits, the interesting thing is
that it can TEST next bits, this functionnality is required by
MPEG spec...
I use a buffer to read the file, so performance are very good.
an EOFBSException is raised when end of stream is reached.

the BitStreamWriter is also simple, it can write 1 to 32 bits.
I use also a buffer.

some examples:

if (m_bsr.TestNextBits("0000 0000 0000 0000 0000 0001 1011 1010"))
{
...
}

int pack_start_code = m_bsr.ReadBits(32);
int _01_ = m_bsr.ReadBits(2);
int system_clock_reference_base1 = m_bsr.ReadBits(3);
int marker_bit1 = m_bsr.ReadBits(1);
int system_clock_reference_base2 = m_bsr.ReadBits(15);
int marker_bit2 = m_bsr.ReadBits(1);

if (streamid == BitStreamReader::GetValue("1011 1110"))
return "padding stream";

CMatt
14th May 2003, 11:10
Looks very intersting :)
But.. can we also donwload this class, to test it, or was this only a post to move ur fingers :D :p :p
I also wrote a class like this, but only with a GetBits and PutBits mehtod (yes i'm lazy.. :p )

hypercube
14th May 2003, 11:45
was this only a post to move ur fingers
:D yes, I'm at the office for isntance, and my work is
so boring.... :(

no, this is not a joke. I will publish it tonight on my website...
I could be a usefull API for beginners this is why I talk about it.

hypercube
14th May 2003, 21:02
you can download my BitStream API on my website.
(in "development" section)

ChristianHJW
15th May 2003, 09:41
Interesting. You may have a look here :

http://uci.sourceforge.net

and here

http://www.matroska.org/transor

or more specifically here

http://matroska.sourceforge.net/transor/transor-API.html

http://matroska.sourceforge.net/transor/transor.h


We are desperately searching for somebody helping the UCI dev team to come up with a general codec API, because this is what the OSS video and audio community needs badly in the medium term .. something to raise your interest hypercube :) ???

hypercube
15th May 2003, 10:20
sorry but I don't have any time to work on this project.
In fact it is already difficult for me to found
free time for my own projects !

:D