[Speex-dev] Speex on ARM7

Eliso eliso at planeta.inf.br
Fri Aug 24 11:18:00 PDT 2007


Hello

 

I'm testing SPEEX on embedded board using ARM7 (Atmel). ARM7 don't have
floating point so I'm using FIXED_POINT. Unfortunately the encoding speed is
about 5 times slower then necessary for real time. 

ARM7 is slow for 16/8 bits operations. 

The  sequence:

 

static inline spx_word32_t compute_pitch_error(spx_word16_t *C, spx_word16_t
*g, spx_word16_t pitch_control)

{

   spx_word32_t sum = 0;

   sum = ADD32(sum,MULT16_16(MULT16_16_16(g[0],pitch_control),C[0]));

   sum = ADD32(sum,MULT16_16(MULT16_16_16(g[1],pitch_control),C[1]));

   sum = ADD32(sum,MULT16_16(MULT16_16_16(g[2],pitch_control),C[2]));

   sum = SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[1]),C[3]));

   sum = SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[1]),C[4]));

   sum = SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[0]),C[5]));

   sum = SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[0]),C[6]));

   sum = SUB32(sum,MULT16_16(MULT16_16_16(g[1],g[1]),C[7]));

   sum = SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[2]),C[8]));

   return sum;

}

 

is about 30 times slower than similar operation using 32 bits (int)  below.

 

static inline long compute_pitch_errorL(int *C, int *g, int pitch_control)

{

   spx_word32_t sum=0;

   sum+=g[0] * pitch_control * C[0]; //
ADD32(sum,MULT16_16(MULT16_16_16(g[0],pitch_control),C[0]));

   sum+=g[1] * pitch_control * C[1]; //
ADD32(sum,MULT16_16(MULT16_16_16(g[1],pitch_control),C[1]));

   sum+=g[2] * pitch_control * C[2]; //
ADD32(sum,MULT16_16(MULT16_16_16(g[2],pitch_control),C[2]));

   sum-=g[0] * g[1] * C[3];
//SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[1]),C[3]));

   sum-=g[2] * g[1] * C[4];
//SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[1]),C[4]));

   sum-=g[2] * g[0] * C[5]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[0]),C[5]));

   sum-=g[0] * g[0] * C[6]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[0]),C[6]));

   sum-=g[1] * g[1] * C[7]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[1],g[1]),C[7]));

   sum-=g[2] * g[2] * C[8]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[2]),C[8]));

   return sum;

}

Not use 16 bits seem to be a possible solution. I'd like to know if there is
an option to execute this way or if the algorithm relay on 16 bit operation
and cannot easily converted to 32 bits.

 

Best regards

 

Eliso Cavalli

 

 

 

 

Planeta Informatica Ltda.Rua Roxo Moreira, 1178, 

Campinas/SP/BRASIL. 

CEP 13083-591.

phone: +55 19 32897755

fax: +55 19 32491717

 <mailto:eliso at planeta.inf.br>  

 
<file:///C:\Documents%20and%20Settings\Administrador.PLANETA\Dados%20de%20ap
licativos\Microsoft\Signatures\www.planeta.inf.br>  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20070824/eda03686/attachment.htm


More information about the Speex-dev mailing list