QUOTE (SebastianG @ Aug 20 2005, 08:27 PM)
QUOTE (viktor09 @ Aug 20 2005, 05:33 PM)
frame 1: mdb = 0, adl = 64
frame 2: mdb = 64, adl = 112
frame 3: mdb = 176, adl = 114
frame 4: mdb = 290, adl = 114
frame 5: mdb = 290, adl = 0
frame 6: mdb = 100, adl = 0
So this means frame 2 - 4 have a main_data_begin != 0 but don't use the bitreservoir, as all pointers up to frame 5 point to the same byte in the reservoir.
how do you compute "adl" ?
what's the size of each side info block ?
what are the frames' sizes ?
what do your numbers tell us ? (bits or bytes?)
maybe you could upload/post a link to a file containing the first couple frames of your file.
I compute adl size with the following formula (all values in bits):
adl = size_of_frame - size_of_header - size_of_crc - size_of_side_info - size_of_audio_data
size_of_header = 32
size_of_crc = 16 or 0
size_of_side_info = 136 for 1 channel or 256
size_of_audio_data = sum of part2_3_length values in side_info
The value I gave in my posting is in bytes (adl / 8) because main_data_begin is in bytes (right?).
QUOTE (SebastianG @ Aug 20 2005, 08:27 PM)
QUOTE (viktor09 @ Aug 20 2005, 05:33 PM)
2 questions here: First is this possible or is my parser not working correct? If it is correct, why not set the mdb to 0 for frames 2 - 4?
I can't answer that one. You didn't give us all necessary informations.
Is it possible to upload files here? Meanwhile here is a more elaborate info about the first frames. All size values are in bytes. Frame 0 contains no audio data but an info tag.
CODE
0 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 0, fr size = 626, audio length = 0, anc length = 590
1 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 0, fr size = 626, audio length = 525, anc length = 64
2 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 64, fr size = 627, audio length = 478, anc length = 112
3 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 176, fr size = 627, audio length = 476, anc length = 114
4 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 290, fr size = 627, audio length = 477, anc length = 114
5 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 404, fr size = 627, audio length = 496, anc length = 94
6 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 498, fr size = 627, audio length = 588, anc length = 2
7 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 500, fr size = 627, audio length = 589, anc length = 1
8 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 501, fr size = 627, audio length = 593, anc length = 0
9 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 498, fr size = 627, audio length = 588, anc length = 2
10 a MPAHeader (vers 3, layer 1, frq=44100, chn=stereo, t=0.02612244897959184)
mdb = 500, fr size = 627, audio length = 592, anc length = 0
So taking your last answer into accout, the audio data length in frame 8 contains 3 ( = 501 - 498) bytes from the reservoir which leaves 590 bytes in the frame itself. Given that header and sideinfo cosumes 36 bytes it would just fill the whole frame.
But I still don't understand why frames 1 - 7 have mdb != 0. Why not set it to 0?
QUOTE (SebastianG @ Aug 20 2005, 08:27 PM)
QUOTE (viktor09 @ Aug 20 2005, 05:33 PM)
Another thing I observed was that the length of the audio data as caluclated by summing up the part2_3_length values can exceed the size of the frame. Again 2 questions: Is this correct or is my parse not working? If it is correct, does it mean that the calculated length includes the bits from the reservoir?
1.) Yes, it's possible that the sum exeeds the frame size
2.) Bingo
I suspect you don't fully understand what the reservoir thing is about and/or what main_data_begin actually says.
That's possible. But I'm trying.
Martin