[Speex-dev] Speex optimization and 12 bits conversion for 12 bits ADC

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Jul 25 02:37:10 PDT 2007

> Yes, I have enabled the the current ARM4 assembly bits. I have tried
> to optimize these functions(filter_mem16(),iir_mem16() and
> fir_mem16()) in C code, but the effect is very small, and I am going
> to do assembly optimization for these functions. Do you have another C
> code about these functions for assembly optimisations? Can you give me
> some information and suggestions?

Basically, if either of these apply to your CPU:
1) A store is more costly than a load (e.g. you have write-through cache)
2) You have a MAC instruction where it's complicated to load the
accumulator every time
then you should consider implementing filter_mem16 similarly to the
commented version of filter_mem2() at the end of filters_bfin.h.

>> > Another question, my ADC and DAC are 12 bits, but Speex codec is
>> > 16bits, Did someone try to modify speex to 12 bits? I think if I
>> > modify speex to 12 bits, the computation power will be reduced, is it
>> > right?
>> Wrong. Speex would still need 16 bits internally. I also recommend you
>> only shift by 3 so that you're sure never to have clipping problems at
>> 16 bits.
> My ADC is 12 bits, and the data from 12 bits ADC just has 12-bit
> accuracy, means that I need fill the low 4 bit with zero to make the
> input data is 16 bit, I means that Some computation may be simplified
> so that to reduce computation power because the just 12 bit is useful.
> And the DAC is also 12 bit, it means that I just need the high 12 bit
> and discard the low 4 bit after decoer?

That's what I said. It's not going to work. It's not because your input
signal is 12-bit deep that suddenly the LPC and LSP coefs will accept
being quantised in 12 bits. Also, as I said in my previous email, I'd
recommend shifting your 12-bit data only by 3 (not by 4) when converting
to 16-bit. That'll give you a bit of headroom.



More information about the Speex-dev mailing list