Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: The MP3 Bit Reservoir (Read 2829 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

The MP3 Bit Reservoir

Can someone point me to some information on how to collect data from the bit reservoir before a split in an MP3 so it can be pre-pended to the beginning of the second piece after the split? (so there is no lost data at the beginning of the second piece)

There is SO much information about MP3 on the internet that I cannot even find the darn ISO MP3 spec.

Any help/links/info you can offer me would be greatly appreciated.

Thanks
Back off, or I'll flick a booger on your windshield!


The MP3 Bit Reservoir

Reply #2
First, thanks for responding - I was starting to wonder if anyone could spare me the time to help.

Well, I pretty much understand the major bits of MP3 frame format like layer, bitrate, frequency, and so forth, but in all the Googling and reading I've done, I haven't been able to find out how and where this "bit reservoir" is stored. In fact, I didn't even know of its existence until I started reading more in-depth info here on HA.

One of the clearer sources I found was The Private Life of MP3 Frames, which aparently explained most of what I wanted to know about the formatting data at the beginning of a frame, but did not go into the "audio data" area of the frame. Once I started to look for info on the bit reservoir and/or the fomat of the audio data area, about all I could find was philosophical discussions about encoding, or deeply technical information about algorhythms and bitrate, and the guts of MP3 like FFT and polyphase filters, none of which seems relevant to what I was looking for.

So... Basically what I need is some kind of byte-block diagram (like the one from the ID3.org link I pasted above) that explains where the bytes are that indicate the size and position of the bit reservoir in the file, or if it's not that simple, perhaps the math needed to calculate that position (assuming its something simple like bitrate*thisbyte*thatbyte-framesize or somethign like that).

At this point, my understanding - which may be incorrect - is that the bit reservoir is an unused area at the end of the frame that gets filled with overflow information from previous frames. And in order to get that info, you need to know which "pointer bytes" to look at in the audio data to get the numbers to calculate where it is.

Perhaps this is more complicated than I am imagining. I am starting to think that the bit reservoir is not a fixed and defined area at the end of a frame, but instead is some kind of "sideband" (like in radio) that is entwined with the main data stream, and is only reconstructed as a cumulative byproduct of the compression and decompression processes...  Did that sentence make sense? :-) If this is the case, my road stops here - I just dont have the knowhow to do this.

Also, here are a few new thoughts I've while typing this:
- is this crossing into the patented and copyrighted parts of MP3?
- is the bit reservoir data the same format as the main audio data?
- if so, is it really just a matter of collecting it all from previous frames, appending it together, and putting into one or more newly constructed frames at the beginning of the new file?
- also what if the bit reservoir contains information about more than one upcoming frame? how do i sort out the data for upcoming frame #1, from upcoming frame #2, and so on...

Well if anyone got his far into my babbling, I think that is a good sign, yes? Hopefully one of you might be able to pass a few usefule bit of knowledge to me. Thanks.
Back off, or I'll flick a booger on your windshield!

 

The MP3 Bit Reservoir

Reply #3
spinjector: mp3-tech.org