[Speex-dev] NB encoder with multiple channels

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Mon Feb 13 21:26:43 PST 2006


On Mon, 2006-02-13 at 23:01 -0600, Jerry Trantow wrote: 
> I am trying to implement a relatively high number of encoders (24/32) on a
> single DSP and would like to minimize the memory requirements.  Has anyone
> optimized the persistent EncState memory allocation for multiple channels.
> The default C64x fixed point implementation allocates 5280 bytes of
> persistent memory per encoder.

First thing I suggest if not already done is to use define VAR_ARRAY so
all the temporary stuff gets allocated from the the stack instead of
being malloc()ed for each encoder (unless you're already using a scratch
space?). 
  
> I'm willing to restrict my settings to complexity 1, quality 3.
> It looks like I can share the st->window, lagWindow, 

Those are constant for all encoders, so it's fine.

> bw_lpc1, bw_lpc2,

You can't share those, but they can be allocated as temporary (stack or
scratch space).

> variables which would save 562 bytes per encoder.  Are there more variables
> that can be shared or eliminated if I stick to narrow band?

You can also use temp allocation for lpc, autocorr, interp_lpc,
interp_qlpc (encoder only), interp_lsp and interp_qlsp. You can probably
completely remove all the vbr, abr, vad and dtx stuff.

> The biggest variables are the inBuf, excBuf, swBuf, innov and I think these
> have to stay.  

A lot of those could be converted to 16-bit, but of course that requires
more work. inBuf is partially redundant with the input, but again it
would require a bit of code rewriting to take advantage of that.

	Jean-Marc


More information about the Speex-dev mailing list