summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-09-18 14:11:29 +0000
committerBenny Prijono <bennylp@teluu.com>2008-09-18 14:11:29 +0000
commite7130aeee4d10c1da69568d32a78784f412adc3f (patch)
tree0ba5307eec60dfaf3c6db5e2e4fa07c35d350608 /pjmedia
parent079dfbcbbe8e1d401a106c097845fd777c809011 (diff)
More ticket #619: changed default Cordic loop from 8 to 10 to gain more accuracy, and updated tonegen.c with the results from ARM9 tests
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2294 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/include/pjmedia/config.h8
-rw-r--r--pjmedia/src/pjmedia/tonegen.c12
2 files changed, 17 insertions, 3 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index 86a408e9..2f008dad 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -577,7 +577,9 @@
/**
- * Specify the tone generator algorithm to be used.
+ * Specify the tone generator algorithm to be used. Please see
+ * http://trac.pjsip.org/repos/wiki/Tone_Generator for the performance
+ * analysis results of the various tone generator algorithms.
*
* Default value:
* - PJMEDIA_TONEGEN_FLOATING_POINT when PJ_HAS_FLOATING_POINT is set
@@ -600,10 +602,10 @@
*
* Valid values are 1 to 28.
*
- * Default value: 7
+ * Default value: 10
*/
#ifndef PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP
-# define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP 7
+# define PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP 10
#endif
diff --git a/pjmedia/src/pjmedia/tonegen.c b/pjmedia/src/pjmedia/tonegen.c
index 3f2cbe37..152ff913 100644
--- a/pjmedia/src/pjmedia/tonegen.c
+++ b/pjmedia/src/pjmedia/tonegen.c
@@ -40,6 +40,8 @@
* This is the good old tone generator using sin().
* Speed = 1347 usec to generate 1 second, 8KHz dual-tones (2.66GHz P4).
* approx. 10.91 MIPS
+ *
+ * 506,535 usec/100.29 MIPS on ARM926EJ-S.
*/
struct gen
{
@@ -65,6 +67,8 @@
* the normal sin() generator.
* Speed = 350 usec to generate 1 second, 8KHz dual-tones (2.66GHz P4).
* approx. 2.84 MIPS
+ *
+ * 18,037 usec/3.57 MIPS on ARM926EJ-S.
*/
struct gen
{
@@ -84,6 +88,12 @@
* Speed = 742 usec to generate 1 second, 8KHz dual-tones (2.66GHz P4).
* (PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP=7)
* approx. 6.01 MIPS
+ *
+ * ARM926EJ-S results:
+ * loop=7: 8,943 usec/1.77 MIPS
+ * loop=8: 9,872 usec/1.95 MIPS
+ * loop=10: 11,662 usec/2.31 MIPS
+ * loop=12: 13,561 usec/2.69 MIPS
*/
#define CORDIC_1K 0x026DD3B6
#define CORDIC_HALF_PI 0x06487ED5
@@ -184,6 +194,8 @@
* Quality wise not so good, but it's blazing fast!
* Speed = 117 usec to generate 1 second, 8KHz dual-tones (2.66GHz P4).
* approx. 0.95 MIPS
+ *
+ * 1,449 usec/0.29 MIPS on ARM926EJ-S.
*/
PJ_INLINE(int) approximate_sin3(unsigned x)
{