[speex-dev] Speex wishlist

Jean-Marc Valin jean-marc.valin at hermes.usherb.ca
Fri Dec 13 10:30:43 PST 2002

> 	I was wondering if you could add a check to ensure that memory is actually
> allocated during the nb_encoder_init and sb_encoder_init functions.  We have
> been looking at using Speex on a DSP and noticed that if we didn't allocate
> a large enough heap space memory segment that the DSP would crash.  I would
> recommend something like:
> if (!st->stack) fprintf(stderr,"ERROR could not allocate memory for stack");

I guess I should do that on all other malloc'ed variables too. 

> 	Also, is it necessary to allocate 20000 floats for stack space.  Have you
> ever profiled the amount of stack space consumed?  We tried a few values for
> the stack size and checked for stability.  This isn't the most rigorous
> check...  However, we did reduce the stack size down to 5000 in both nb and
> sb_encoder_init functions and we were able to successfully encode at quality
> 6, wideband, complexity 3.  On a DSP memory can be scarce, so we may need to
> cut this down some more if possible.

I noticed that, in CVS the stack size for the encoder is now down to
4000 (2000 for the decoder). This size works for any quality/complexity
setting. For lower complexity settings though it might be possible to
set a lower value, but I haven't found any good way to handle that so
the size is set to the maximum size possible (because complexity can be
changed dynamically). I'd be happy to receive ideas on better ways of
handling that...


Jean-Marc Valin, M.Sc.A.
LABORIUS (http://www.gel.usherb.ca/laborius)
Université de Sherbrooke, Québec, Canada

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 242 bytes
Desc: signature.asc
Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20021213/98a0f3a1/signature-0001.pgp

More information about the Speex-dev mailing list