In order to determine the optimum heap size requirements for my embedded C55xx design, I have used the following to get the encoder and decoder memory requirements: size = opus_encoder_get_size(config.channels); enc = malloc(size); error = opus_encoder_init(enc, config.Fs, config.channels, config.application); size = opus_decoder_get_size(config.channels); dec = malloc(size); error = opus_decoder_init(dec, config.Fs, config.channels); Both the encode decoder init function return no error. However, opus_encode crashes somewhere deep in the bowels of the function (I cannot determine where since I have compiler optimizations enabled). Do I need more heap than what is returned by the above get_size functions? Thx, MikeH -------------- next part -------------- An HTML attachment was scrubbed... URL: lists.xiph.org/pipermail/opus/attachments/20120831/7f1ebda1/attachment.htm
On Fri, Aug 31, 2012 at 1:10 PM, Mike Hooper <mihooper at bellsouth.net> wrote:> In order to determine the optimum heap size requirements for my embedded > C55xx design, I have used the following to get the encoder and decoder > memory requirements:[snip]> Both the encode decoder init function return no error. However, opus_encode > crashes somewhere deep in the bowels of the function (I cannot determine > where since I have compiler optimizations enabled). Do I need more heap than > what is returned by the above get_size functions?In a normal compile there are _no_ heap allocations done except in the _create calls, which you can avoid using as you've described. If you have compiled with NONTHREADSAFE_PSEUDOSTACK in order to reduce the stack usage then there are heap allocations via opus_alloc_scratch() to allocate stack for the pesudostack.