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

Justin Ruggles justin.ruggles
Wed Dec 15 21:22:41 CET 2010


On 12/15/2010 01:01 PM, Michael Chinen wrote:

> On Sun, Dec 12, 2010 at 4:53 AM, Justin Ruggles
> <justin.ruggles at gmail.com> wrote:
>> [...]
>> Well, it would catch up after several frames...  Maybe an LPC function
>> to predict frame size would do better... it is FLAC after all.  ;)
>>
>> Anyway, anything that's even remotely predictive is better than a fixed
>> value.  8192 bytes is very certainly a big overestimate for silent frames.
> 
> Okay, how about using 8192 bytes initially and make it the largest
> average found so far?
> This should handle the silent and small sections.


Well, it doesn't solve the buffering of lots of silent frames when you
only need 10, but it does improve efficiency when the input buffer is
large enough and you want to avoid having to buffer multiple times to
get the next frame.  It's at least an improvement over the current
situation.

Also, if you're going for trying to always buffer enough and not worry
about small frames, you might as well use the largest actual validated
frame size up to that point rather than the largest average of what has
been in the buffer.

And starting at 8192 sounds fine since there is no reference for
prediction at that point.

-Justin




More information about the ffmpeg-devel mailing list