[FFmpeg-devel] [PATCH] make FLAC parser return frames when it has the required amount (without buffering)

Michael Chinen mchinen
Sat Dec 11 23:30:39 CET 2010


Hi,

On Sat, Dec 11, 2010 at 8:58 PM, Justin Ruggles
<justin.ruggles at gmail.com> wrote:
> On 12/11/2010 02:34 PM, Michael Chinen wrote:
>
>> On Sat, Dec 11, 2010 at 4:56 PM, Justin Ruggles
>> <justin.ruggles at gmail.com> wrote:
>>> On 12/10/2010 04:30 PM, Michael Chinen wrote:
>>>
>>>> The FLAC parser wasn't behaving well for large inputs.
>>>> For the problem, see discussion in thread "FLAC parser ineffeciency"
>>>>
>>>> I tested this patch with 16K, 32K, and 10MB input and it seems to work.
>>>> I should note that the parser buffers by copying the entire input so
>>>> for the 10MB case this is using a lot of space. ?Not an issue for
>>>> small buffer sizes, but if it is a real use case and should be
>>>> improved let me know and I can submit a separate patch that only takes
>>>> small chunks of the input buffer.
>>>
>>>
>>> If it's not too complicated, it might be better to have the parser guess
>>> how much data it needs to have enough frames to do the analysis and only
>>> read that much.
>>
>> Ok, this should do it.
>
>
> The first patch will tell you how many frames are already in the buffer,
> so instead of adding the full estimate for FLAC_MIN_HEADERS frames, it
> could estimate how much data is needed based on how many frames it
> already has.

Ok, here it is.
It uses (number of frames needed + 1) because I think an upper-bound is better.

Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-make-FLAC-parser-return-frames-when-it-has-the-requi.patch
Type: application/octet-stream
Size: 2922 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101211/eff2e210/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-flac_parser.c-only-buffer-the-estimated-amount-of-in.patch
Type: application/octet-stream
Size: 4701 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101211/eff2e210/attachment-0001.obj>



More information about the ffmpeg-devel mailing list