[opus] Memory Size?

Gregory Maxwell gmaxwell at gmail.com
Fri Aug 31 11:33:54 PDT 2012

On Fri, Aug 31, 2012 at 2:25 PM, Mike Hooper <mihooper at bellsouth.net> wrote:
> Greg,
> Thanks for the quick reply.
> Let me make sure I understand what you are saying.
> I have compiled with NONTHREADSAFE_PSEUDOSTACK since the TI compiler does
> not support alloca. As I understand it, ALLOC_STACK, using
> opus_alloc_scratch(), creates a heap of size= GLOBAL_STACK_SIZE, which is
> 100k bytes as defined in arch.h by
> "#define GLOBAL_STACK_SIZE 100000" for FIXED_POINT systems.
> After the heap is created, both the encoder and decoder are created in this
> heap by:
>         enc = malloc(size);
>         dec = malloc(size);
> Therefore, if I have determined (by using get_size) that both the encoder
> and decoder require no more 50kbytes, I can safely reduce the
> GLOBAL_STACK_SIZE to 50kbytes?

No. get_size returns the size required to create the decoder/encoder
structs, which is all the heap used by a non-pseudostack build. There
is no function which returns the stack usage or the heap required by a
pseudostack build.

More information about the opus mailing list