IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
FLAC Frame size
filoe
post Apr 7 2012, 22:33
Post #1





Group: Members
Posts: 13
Joined: 7-April 12
Member No.: 98516



I am currently implementing a Flacdecoder into my project. Now i am having a huge Problem.
The SeekTable is not standart so I have to implement something i can seek on every flac stream. But how? I can't readout the framesize of the flacfile.
So what should i do now?

Does anyone know something?
Go to the top of the page
+Quote Post
Justin Ruggles
post Apr 7 2012, 23:06
Post #2





Group: Developer
Posts: 165
Joined: 3-June 06
From: Raleigh, NC
Member No.: 31393



You could do what is done in Libav/FFmpeg. FLAC frames do have a header identifier and 8-bit header CRC. This gives decent probability of the next frame start. Then taking it a step further, it checks for changing basic audio parameters to help identify false positives. And further to that, it checks the 16-bit CRC of full consecutive frames (up to 10 frames in a row). All of these combined works very well.

Edit: Note that just using the header identifier and header CRC will absolutely give false positives, so at least some continuity checking is needed.

This post has been edited by Justin Ruggles: Apr 7 2012, 23:11
Go to the top of the page
+Quote Post
filoe
post Apr 8 2012, 11:19
Post #3





Group: Members
Posts: 13
Joined: 7-April 12
Member No.: 98516



i don t want to use other libarys because i am writing my own currently in c#.
But if I am right you want to tell me that i can use the crc8 and crc16 to calculate the next framestart or that framelength.
Could you may explain me where i can read how i can calculate the next frame start out of this or may you explain me how this works.
Would be really really nice because i don t have absolutely no idea.
Go to the top of the page
+Quote Post
Justin Ruggles
post Apr 8 2012, 17:41
Post #4





Group: Developer
Posts: 165
Joined: 3-June 06
From: Raleigh, NC
Member No.: 31393



QUOTE (filoe @ Apr 8 2012, 06:19) *
i don t want to use other libarys because i am writing my own currently in c#.
But if I am right you want to tell me that i can use the crc8 and crc16 to calculate the next framestart or that framelength.
Could you may explain me where i can read how i can calculate the next frame start out of this or may you explain me how this works.
Would be really really nice because i don t have absolutely no idea.

First see http://flac.sourceforge.net/format.html if you haven't already.

One way is of course just to decode from the beginning for each seek. But if you want to avoid a full decode you can do some of the things I described in my previous reply.

Basically you want to start by searching for the next frame start code. Then you want to check to see if it might be a false positive. The further you go with the validation, the more likely you are that you indeed have the correct next frame start. How much you want to validate depends on how much complexity you're willing to have relative to how sure you want to be that you have the correct position.
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: 16th April 2014 - 23:07