[Speex-dev] Re: Windows Mobile build, memory allocation

Jim Crichton jim.crichton at comcast.net
Wed Jun 28 10:04:20 PDT 2006

> On Wed, 2006-06-28 at 11:34 +0530, Ashhar Farhan wrote:
>> I have sent the visual studio project files that compile the speex
>> client to jean-marc directly (as an attachment), sometime this week, I
>> will also upload the binary builds of static library files to my site
>> www.phonestack.com.
> Actually, Zen (illi on IRC) is the one handling the Windows stuff. I
> can't do anything with that (I've never even compiled Speex on
> Windows).
>> I am porting our LTP (lightweight telephony protocol) to some embedded
>> systems. I require to run speex in an environment that doesn't support
>> memory allocations. How difficult is it to convert speex_encoder_init
>> and speex_decoder_init to use preallocated memory buffers (presumably
>> passed by the initilisatio functions themselves)?
> All you need to do is override some of the functions in misc.c. You
> should need to touch anything else.

Look at the TI subdirectory for an example of this.  You just need to define 
USER_MISC, and then add a file user_misc.h, which has the actual override 
code.  In the TI example, there two statically allocated blocks of memory 
which are accessed through global variables.  It is not elegant, but it does 
not break the API.

The memory requirements will depend upon what Speex modes you will be 
supporting.    In the TI example the scratch and persistent storage are 
allocated from separate blocks, which allows the encoder and decoder to 
share the same scratch space.

- Jim 

More information about the Speex-dev mailing list