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: MP3 main data pointer: (Read 4183 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MP3 main data pointer:

Hi All,

        I am facing a new problem while decoding the Mp3 frames. My main data pointer of few frames is pointing to back in between the "header+side info" of the previous frames. for example:

  Lets assume a frame starts at byte 4086 of Mp3 file.

    So the header of the frame will end at byte  (4086 + 4 =) 4090
  and if side info is 32 bytes the side info will end at (4090 + 32 =) 4122.
  So the header + side info for this frame lies between 4086 to 4122
 
  Assume that the length of the frame is 418 bytes. So the next frame will start from (4086 + 418 =) 4514
  Now in the new frame starting from 4514th byte the main data begin value indicated by first 9 bits of side info is 410.
  This means that the main data will start from the byte number 4514 - 410 = 4104th byte which is in between 4086 to 4122( the range of header + side info of previous frame)

Is there a possibility of such case? (I think answer of this question is yes as I am facing it in a file).
Another question is that if such case can happen then how to deal with it?

Thanks in Advance
  -R/\\/I-

MP3 main data pointer:

Reply #1
There is one calculation wrong above so I added this as a reply to correct it. All correction are marked by *.

I am facing a new problem while decoding the Mp3 frames. My main data pointer of few frames is pointing to back in between the "header+side info" of the previous frames. for example:

Lets assume a frame starts at byte 4086 of Mp3 file.

So the header of the frame will end at byte (4086 + 4 =) 4090
and if side info is 32 bytes the side info will end at (4090 + 32 =) 4122.
So the header + side info for this frame lies between 4086 to 4122

Assume that the length of the frame is 418 bytes. So the next frame will start from (4086 + 418 =) 4504*
Now in the new frame starting from 4504th byte the main data begin value indicated by first 9 bits of side info is 410.
This means that the main data will start from the byte number 4504* - 410 = 4094*th byte which is in between 4086 to 4122( the range of header + side info of previous frame)

Is there a possibility of such case? (I think answer of this question is yes as I am facing it in a file).
Another question is that if such case can happen then how to deal with it?

Thanks in Advance
-R/\\/I-

 

MP3 main data pointer:

Reply #2
I am facing a new problem while decoding the Mp3 frames. My main data pointer of few frames is pointing to back in between the "header+side info" of the previous frames.


You are supposed to buffer the main data bits separately from the header and the side info block. Create a FIFO of size 511+max_frame_size and fill it with main data bits only. Use that buffer for decoding the main data bits.

Cheers!
SG