[Ffmpeg-devel] Re: [Patch] aligned av_realloc

Luca Barbato lu_zero
Sun Aug 13 00:17:15 CEST 2006

Michael Niedermayer wrote:
> Hi
> On Sat, Aug 05, 2006 at 08:37:34PM +0200, Herv? W. wrote:
>> On 21/07/06, Herv? W. <H.O.W.aka.V+ffmpeg at gmail.com> wrote:
>>> Hi,
>> again :-)
>>> On 30/06/06, Herv? W. wrote:
>>>> The changes:
>>>> for the case memalign-hack:
>>>> *changed the type of 'diff' from int to long. In this patch diff gets
>>>> used in exactly the same way as in av_malloc and per r4911: "long is
>>>> better than int for pointer differences"
>>>> *ptr is reallocated. If the data isn't aligned, it gets moved in the
>>>> allocated space, and diff is updated.
>>>> with memalign:
>>>> *memalign is called, the original data is copied and the old ptr is
>>>> av_free'd.
>>> [...]
>>>> without hack or memalign:
>>>> *as regular realloc. The memalign hack isn't needed (or wanted), nor
>>>> is memalign, therefore malloc is aligned on 16 (or does not need to
>>>> be?) and, presumably, the same applies to realloc.
>>> The previous patch had some mistakes.
>> Less comments in this patch.
>> Any comment whatsoever on the patch would be appreciated.
> does this patch fix any bug?

Inconsistency between av_realloc and av_malloc

> does this patch improve speed?

SIMD code for audio could avoid some unaligned store.

> does this patch reduce memory usage?

I think it isn't

lu - bitten by this issue.


Luca Barbato

Gentoo/linux Gentoo/PPC

More information about the ffmpeg-devel mailing list