IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
MP3 main data pointer:, main data pointer points between 36 bytes of header and side info
Ravi
post Jun 10 2009, 19:37
Post #1





Group: Members
Posts: 20
Joined: 15-November 07
Member No.: 48770



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-
Go to the top of the page
+Quote Post
Ravi
post Jun 10 2009, 19:41
Post #2





Group: Members
Posts: 20
Joined: 15-November 07
Member No.: 48770



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-
Go to the top of the page
+Quote Post
SebastianG
post Jun 16 2009, 19:18
Post #3





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (Ravi @ Jun 10 2009, 19:41) *
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
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th April 2014 - 21:54