[Speex-dev] How to create a compact Speex library
ndno72-speex at yahoo.com
ndno72-speex at yahoo.com
Mon Apr 17 17:53:30 PDT 2006
--- Jim Crichton <jim.crichton at comcast.net> wrote:
> >> > Sorry if this a repost but I want to create the
> >> > smallest Speex library possible to be put in
> >> > TMS320 DSP. I'm only interested in one
> >> configuration:
> >> > 5.97 Kbps narrowband. What part of source code
> >> can I
> >> > remove? Currently, when I compiled the version
> >> 1.1.12
> >> > libspeex.a library with the TI TMS320 and
> >> > Fixed-Integer options, I get around 522Kb.
> >> You mean kilo-bit or kilo-byte? The former is
> >> I'd expect, so if
> >> you're getting the latter, something's already
> >> wrong.
> >> > I would
> >> > like to reduce it to as small as possible given
> >> > above 5.97 Kbps operating constraints (I don't
> >> need
> >> > all the other extra features from Speex: jitter
> >> > buffer, echo cancellation, etc).
> >> First, try --disable-wideband (or define
> >> DISABLE_WIDEBAND). Then you can
> >> start removing other stuff you don't need. To get
> >> rid of the echo
> >> canceller, simply remove mdf.c. Then you can get
> >> of jitter.c,
> >> preprocess.c, pcm_wrapper.c, smallft.c, ...
> >> Basically, if you remove the
> >> file and it still works, then it wasn't needed.
> >> addition to all the
> >> files you can remove without the need to touch
> >> anything else, the
> >> following can be disabled as long as you disable
> >> bit of code:
> >> - VBR (vbr.c and references to VBR in nb_celp.c)
> >> - codebooks for other bit-rates:
> >> * all exc_*.c files except exc_10_16_table.c
> >> * gain_table.c
> >> There might be a few bits more that can be
> >> but I think this
> >> summarizes it well.
> >> Jean-Marc
> > Thanks, that help a lot. I was able to reduced
> > library from 522Kb to 296Kb per your suggestions.
> > want to reduce it more but don't know what other
> > to remove; you wrote "..., smallft.c, etc.", would
> > mind specifying the "etc" files; I know I'm too
> > to figure it out myself and since you are the
> > I will trush you more. Thanks.
> Take a look at the TI subdirectory in the Speex
> tree, which has builds for
> some TI DSPs. Those builds are 8kbps narrowband,
> with no extra features.
> Change a couple of lines and you have 5.97
> narrowband builds. There is also
> some instrumentation for measuring data memory
> usage. Clearly, though, if
> you are worried about data space then you should
> take a look at Jean-Marc's
> new code (I have not had a chance yet, myself).
> What families of TI DSPs are you looking at? Most
> everything TI makes
> starts with TMS320, but that is over 100 different
> parts in several
> different familys. If you say a little more about
> what you are trying to
> do, you may find that others here have already tried
> it. But you are not
> going to get much help saying "I know I'm too lazy
> to figure it out myself".
> Having said that, here is the contents of my speex
> library for TI C55x DSP
> (from the .pjt file):
> I have not removed any files which require code
> changes, but I will have to
> look at Jean-Marc's tips about vbr.c, exc_*.c, and
> gain_table.c (thanks for
> By the way, do you really care about the size of the
> .a file? My library is
> 467kbytes, but that is meaningless, because the
> library was built with
> symbol information. Looking at the map file, Speex
> (including my interface
> routines) takes about 41kbytes in .text and 16kbytes
> in .const. That does
> not include data memory, which is what Jean-Marc is
> working on now.
> Jim Crichton
Thanks for your help. And sorry to Jean-Marc for
implying that I don't want to do any work and just
"free-load" off everyone else's efforts. I just
wanted some hints/pointers as to what I should remove
given my operating Speex parameters (5.95 kilo bits
/sec). Jim, you are correct, the .a has nothing to do
with the final resources being used; the .a has other
headers/data that don't show up when I linked with my
application. By the way, I'm using a TMS320VC5510
DSP. Thanks to Jean-Marc for his help: I was able to
remove vbr.c, all exc_*.c except exc_10_16_table.c,
and gain_table.c (for references to those tables, I
just replaced them with "0", is that OK?).
More information about the Speex-dev