Help - Search - Members - Calendar
Full Version: Detecting bitrate of left / right channel
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
Sebastian Mares
Hello!

As far as I know, Stereo encoding will not assign 50% of the bitrate to the left channel and 50% of the bitrate to the right channel, but determine how much bits each channel needs. Otherwise, it would be Dual Channel (some tools also call it Dual Mono).

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)?

Thank you in advance,
Sebastian Mares
smack
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! wink.gif
Sebastian Mares
Thank you for the information!
Dologan
How about when Mid/Side stereo is used? Does it even make sense to talk about how much bits were asigned to each channel in this case? In case it does, wouldn't it be more logical to talk then about bitrate assigned to left/central/right "channel"?
smack
QUOTE (Dologan @ Jan 5 2004, 08:02 PM)
How about when Mid/Side stereo is used? Does it even make sense to talk about how much bits were asigned to each channel in this case? In case it does, wouldn't it be more logical to talk then about bitrate assigned to left/central/right "channel"?

Hm yes, what I wrote above was not precise enough. wink.gif You are right that when joint-stereo coding is used, the bit numbers in the side info apply to the "mid" and "side" channels instead of "left" and "right".
Anyway, the original question by Sebastian was about stereo and dual channel encoding, so I think we have no problem here. tongue.gif
Sebastian Mares
If the same approach applies to Mid/Side Stereo encoding it is even better. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.