<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EstiloDeEmail17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=PT-BR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Hello<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>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. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>ARM7 is slow for 16/8 bits operations. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>The sequence:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>static inline spx_word32_t
compute_pitch_error(spx_word16_t *C, spx_word16_t *g, spx_word16_t
pitch_control)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> spx_word32_t sum = 0;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
ADD32(sum,MULT16_16(MULT16_16_16(g[0],pitch_control),C[0]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum = ADD32(sum,MULT16_16(MULT16_16_16(g[1],pitch_control),C[1]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
ADD32(sum,MULT16_16(MULT16_16_16(g[2],pitch_control),C[2]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[1]),C[3]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[1]),C[4]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[0]),C[5]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[0]),C[6]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
SUB32(sum,MULT16_16(MULT16_16_16(g[1],g[1]),C[7]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum =
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[2]),C[8]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> return sum;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>is about 30 times slower than similar operation using
32 bits (int) below.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>static inline long compute_pitch_errorL(int *C, int
*g, int pitch_control)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> spx_word32_t sum=0;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum+=g[0] * pitch_control * C[0];
// ADD32(sum,MULT16_16(MULT16_16_16(g[0],pitch_control),C[0]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum+=g[1] * pitch_control * C[1];
// ADD32(sum,MULT16_16(MULT16_16_16(g[1],pitch_control),C[1]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum+=g[2] * pitch_control * C[2]; //
ADD32(sum,MULT16_16(MULT16_16_16(g[2],pitch_control),C[2]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum-=g[0] * g[1] * C[3];
//SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[1]),C[3]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum-=g[2] * g[1] * C[4];
//SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[1]),C[4]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum-=g[2] * g[0] * C[5]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[0]),C[5]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum-=g[0] * g[0] * C[6]; // SUB32(sum,MULT16_16(MULT16_16_16(g[0],g[0]),C[6]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum-=g[1] * g[1] * C[7]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[1],g[1]),C[7]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> sum-=g[2] * g[2] * C[8]; //
SUB32(sum,MULT16_16(MULT16_16_16(g[2],g[2]),C[8]));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'> return sum;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>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.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Best regards<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Eliso Cavalli<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p><strong><b><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>Planeta
Informatica Ltda.Rua Roxo Moreira, 1178, </span></font></b></strong><font
size=2><span style='font-size:10.0pt'><o:p></o:p></span></font></p>
<p><strong><b><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>Campinas/SP/BRASIL.
</span></font></b></strong><font size=2><span style='font-size:10.0pt'><o:p></o:p></span></font></p>
<p><strong><b><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>CEP
13083-591.</span></font></b></strong><font size=2><span style='font-size:10.0pt'><o:p></o:p></span></font></p>
<p><strong><b><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>phone:
+55 19 32897755</span></font></b></strong><font size=2><span style='font-size:
10.0pt'><o:p></o:p></span></font></p>
<p><strong><b><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>fax:
+55 19 32491717</span></font></b></strong><font size=2><span style='font-size:
10.0pt'><o:p></o:p></span></font></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'><a
href="mailto:eliso@planeta.inf.br"></a> <o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><a
href="file:///C:\Documents%20and%20Settings\Administrador.PLANETA\Dados%20de%20aplicativos\Microsoft\Signatures\www.planeta.inf.br"></a> </span><o:p></o:p></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>