[FFmpeg-devel] [PATCH] vda: use fast reallocation.

Sebastien Zwickert dilaroga at gmail.com
Fri Nov 11 19:06:52 CET 2011


On Nov 11, 2011, at 6:55 PM, Reimar Döffinger wrote:

> On Fri, Nov 11, 2011 at 06:43:24PM +0100, Reimar Döffinger wrote:
>> On Fri, Nov 11, 2011 at 06:40:00PM +0100, Sebastien Zwickert wrote:
>>> 
>>> On Nov 11, 2011, at 5:55 PM, Reimar Döffinger wrote:
>>> 
>>>> On Fri, Nov 11, 2011 at 04:21:37PM +0100, Sebastien Zwickert wrote:
>>>>> Hi,
>>>>> 
>>>>> The patch in attachment reuses the buffer in order to take benefits of av_fast_realloc().
>>>> 
>>>> Why av_fast_realloc and not av_fast_malloc? I can't see the need to
>>>> preserve previous contents.
>>> 
>>> reusing buffer isn't faster ?
>> 
>> Both reuse buffers.
>> However by using av_fast_realloc instead of av_fast_malloc you have to
>> do more effort to handle allocation failures and you force it to copy
>> the old contents over to the new buffer if the buffer can't be reused.
> 
> I missed that you indeed have to preserve the previous contents since
> you concatenate the slices into the buffer.
> I had misread that.

Right.
I badly understood what was in this case the previous contents.
So forget my previous mail :)

Best regards,
Sebastien



More information about the ffmpeg-devel mailing list