[FFmpeg-devel] PATCH: COOK audio decode infastructure to support fixpoint optimization

Benjamin Larsson banan
Sun Jul 15 23:26:04 CEST 2007


Marc Hoffman wrote:
> On 7/15/07, Benjamin Larsson <banan at ludd.ltu.se> wrote:
>> Marc Hoffman wrote:
>>
>>> +
>>> +static void joint_decode(COOKContext *q, vec_t* mlt_buffer1,
>>> +                         vec_t* mlt_buffer2) {
>>> +    int decouple_tab[SUBBAND_SIZE];
>>> +    vec_t *decode_buffer;
>>> +
>>> +    decode_buffer = av_malloc (1060*q->f_sample_size);
>> Don't allocate memory with malloc during decode. Use a fixed max size.
> 
> 
> why? your just allocating a really big buffer on the stack which causes
> actually problems for a machine with out a address translation.  Would it be
> acceptable to put that extra memory into COOKContext instead?
> 
> Marc

Sure, either preallocate the needed memory or keep it on the stack. The
malloc here could take long time or even fail to allocate the needed memory.

MvH
Benjamin Larsson




More information about the ffmpeg-devel mailing list