MP3 main data pointer:, main data pointer points between 36 bytes of header and side info |
![]() ![]() |
MP3 main data pointer:, main data pointer points between 36 bytes of header and side info |
Jun 10 2009, 19:37
Post
#1
|
|
|
Group: Members Posts: 18 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- |
|
|
|
Jun 10 2009, 19:41
Post
#2
|
|
|
Group: Members Posts: 18 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- |
|
|
|
Jun 16 2009, 19:18
Post
#3
|
|
![]() Group: Members Posts: 1219 Joined: 20-March 04 From: Göttingen (DE) Member No.: 12875 |
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 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 03:52 |