QUOTE(Sebastian Mares @ Jan 5 2004, 05:40 PM)
Now, my question is: Is it possible to detect how much bits each channel received without decoding the main data (extract information from the frame header / ancillary data)?
Yes, it is.
The so-called "side information" (SI) data that follows the frame header contains exactly the info you want. For each channel in each granule of the frame there is one SI group:
- granule 1 - left channel
- granule 1 - right channel (exists only in 2-channel frames)
- granule 2 - left channel (exists only in MPEG-1 frames)
- granule 2 - right channel (exists only in 2-channel MPEG-1 frames)
That's one to four SI groups in total, depending on the MPEG-Version (1 or 2) and the number of channels (1 or 2) which are both stored in the frame header.
The first 12 bits in a SI group hold the number of bits in the respective part of the main data.
I don't remember the exact layout of the MPEG frame structure right now. Please have a look at some freely available decoder sources and/or documents yourself for the complete details.
Have fun!