<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2093/">https://reviewboard.asterisk.org/r/2093/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Alec Davis.</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">the dmtf_detector had to recalc the address from the amp[] for each of 8 calls to goerztzel_sample()
Now use similar optimization as was already done in tone_detect().
If we're counting just lines of code executed, originally for each of the 160 samples was 80, now 53.
created code looked like this;
this code is repeated 8 times in dtmf_detect, at 8000 times a second.
677:dsp.c **** goertzel_sample(s->td.dtmf.row_out, amp[j]);
14299 .loc 1 677 0
14300 0d21 8B45E0 movl -32(%ebp),%eax
14301 0d24 01C0 addl %eax,%eax
14302 0d26 034510 addl 16(%ebp),%eax
14303 0d29 0FB700 movzwl (%eax),%eax
14304 0d2c 98 cwtl
14305 0d2d 8B550C movl 12(%ebp),%edx
14306 0d30 81C29402 addl $660,%edx
14306 0000
14307 0d36 89442404 movl %eax,4(%esp)
14308 0d3a 891424 movl %edx,(%esp)
14309 0d3d E8EEF2FF call goertzel_sample
=============================================================
Now this code is add once
675:dsp.c **** samp = amp[j];
14281 .loc 1 675 0
14282 0cf1 8B45DC movl -36(%ebp),%eax
14283 0cf4 01C0 addl %eax,%eax
14284 0cf6 034510 addl 16(%ebp),%eax
14285 0cf9 0FB700 movzwl (%eax),%eax
14286 0cfc 668945E6 movw %ax,-26(%ebp)
Now this code is repeated 8 times.
679:dsp.c **** goertzel_sample(s->td.dtmf.row_out, samp);
14298 .loc 1 679 0
14299 0d25 0FBF45E6 movswl -26(%ebp),%eax
14300 0d29 8B550C movl 12(%ebp),%edx
14301 0d2c 81C29402 addl $660,%edx
14301 0000
14302 0d32 89442404 movl %eax,4(%esp)
14303 0d36 891424 movl %edx,(%esp)
14304 0d39 E8F2F2FF call goertzel_sample
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes, DTMF anyway, still able for recognise digits dialled.
Verified with spandsp 0.0.6 if SPANDSP_USE_FIXED_POINT is chosen</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/main/dsp.c <span style="color: grey">(371689)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2093/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>