search for: getbigendianstreambits

Displaying 3 results from an estimated 3 matches for "getbigendianstreambits".

2010 Jun 23
1
FLAC StreamInfo Parsing
...he number of bits > requested. The accumulator will have to be (long long) because you > will sometimes request more than 32 bits. > > In other words, instead of: > > GetEndianBytes(streamArray, streamOffset, numBytes); > > ... you should implement: > > (long long)GetBigEndianStreamBits(streamHandle, (unsigned)numBits); > > The return value will have to be 64-bit to handle totalSamples. > The nice thing is that you won't need any indexing or bit shifting, > because GetBigEndianStreamBits() will directly return the value you > ask for, based upon the numbe...
2010 Jun 23
3
FLAC StreamInfo Parsing
Thank you very much! But how to deal with endianness in the case of bit stream? Some blocks (for example MinBlockSize) require 16bits (simply swap first and second), some block (e.g.MinFrameSize) require 3 byte-array to be reverted. Finally totalSamples is stored in 5 bytes ( only last 4 bits from first one byte are used). It was a real issue to make it little-endian (here is how I did it:
2010 Jun 23
0
FLAC StreamInfo Parsing
...y existing bits in your accumulator around to make room for the new bits. When pulling values out of the accumulator, you do that based upon the number of bits requested. In other words, instead of: GetEndianBytes(streamArray, streamOffset, numBytes); ... you should implement: (long long)GetBigEndianStreamBits(streamHandle, outputAddressPointer, (unsigned)numBits); The return value will have to be 64-bit to handle totalSamples. The nice thing is that you won't need any indexing or bit shifting, because GetBigEndianStreamBits() will directly return the value you ask for, based upon the numbe...