[FFmpeg-devel] [PATCH] FLAC parser

Michael Chinen mchinen
Wed Jul 21 23:00:47 CEST 2010


On Wed, Jul 21, 2010 at 10:44 PM, Justin Ruggles
<justin.ruggles at gmail.com> wrote:
> Michael Niedermayer wrote:
>
>> On Mon, Jul 19, 2010 at 12:55:05AM +0200, Michael Chinen wrote:
>>> Hi,
>>>
>>> This FLAC parser takes the suggestions from a thread from another FLAC
>>> parser patch submitted by Jason Ruggles in March 2009[1].
>>> Currently it stores 20 headers (8 bit crc verified) and finds all
>>> possible (16 bit footer) crc-verified sequences within a neighbor
>>> distance of 4.
>>> It penalizes sequences that have changes in sample rate, bit depth,
>>> and channel arrangement.
>>> The settings probably need some twiddling.
>>
>> you should check the frame number too (unless encoders dont set it like
>> ours does)
>> without the frame number there can be ambigous cases with finite probability
>> even as the number of frames considered goes to infinity
>
> Good thought. ?Each frame header has either the frame number or sample
> number (depending on whether it has variable or fixed block size). ?But
> either one could be tracked and checked.
Okay, I'll assume it is monotonic and increasing, that the frame
number should be one bigger?
For sample number I think its safe to check that it is equal to the
last sample number plus the current block_size?
It may also be okay to check current_block size against max.  I also
see that we can check min and max blocksize against blocksize.

I'm thinking to make the penalty slightly (but not proportionately)
smaller (from -7 to -5 with a base score of 10) since we have more
checks.  This actually needs sorting out (e.g. certain changes have
more penalty,) but its hard to test because the files I've been doing
don't have fake frames.
Michael



More information about the ffmpeg-devel mailing list