[FFmpeg-devel] PATCH: COOK audio decode infastructure to support fixpoint optimization
Marc Hoffman
mmh
Sun Jul 15 23:45:30 CEST 2007
Benjamin Larsson writes:
> 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.
pre allocate joint_decode/decode_buffer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c2.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070715/9d70679c/attachment.bin>
More information about the ffmpeg-devel
mailing list