diff options
author | Dan Everton <dan@iocaine.org> | 2007-07-09 11:18:10 +0000 |
---|---|---|
committer | Dan Everton <dan@iocaine.org> | 2007-07-09 11:18:10 +0000 |
commit | 07fabd1cd1f2173d93cb1b3962da7d11ca80c569 (patch) | |
tree | 2a24deacde8e70f1da71aa1a53b8f0832fa3d6f3 | |
parent | 85aa3a8d381ac980b49699d49234e4df051813e5 (diff) |
ICONST_ATTR most constant tables in Speex. Results in a 10% improvement on Coldfire (200% to 220% realtime). Almost certainly not the best use of IRAM, but it works now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13831 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libspeex/exc_10_16_table.c | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/exc_10_32_table.c | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/exc_20_32_table.c | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/exc_5_256_table.c | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/exc_5_64_table.c | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/exc_8_128_table.c | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/filters.c | 11 | ||||
-rw-r--r-- | apps/codecs/libspeex/gain_table.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/gain_table_lbr.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/hexc_10_32_table.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/hexc_table.c | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/lsp_tables_nb.c | 12 | ||||
-rw-r--r-- | apps/codecs/libspeex/nb_celp.c | 10 | ||||
-rw-r--r-- | apps/codecs/libspeex/sb_celp.c | 6 | ||||
-rw-r--r-- | apps/codecs/libspeex/window.c | 2 |
15 files changed, 46 insertions, 29 deletions
diff --git a/apps/codecs/libspeex/exc_10_16_table.c b/apps/codecs/libspeex/exc_10_16_table.c index 98ae357d8c..2184e9c955 100644 --- a/apps/codecs/libspeex/exc_10_16_table.c +++ b/apps/codecs/libspeex/exc_10_16_table.c @@ -30,8 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config-speex.h" -const signed char exc_10_16_table[160] = { +const signed char exc_10_16_table[160] ICONST_ATTR = { 22,39,14,44,11,35,-2,23,-4,6, 46,-28,13,-27,-23,12,4,20,-5,9, 37,-18,-23,23,0,9,-6,-20,4,-1, diff --git a/apps/codecs/libspeex/exc_10_32_table.c b/apps/codecs/libspeex/exc_10_32_table.c index 1ee56a2595..ac8cda03c8 100644 --- a/apps/codecs/libspeex/exc_10_32_table.c +++ b/apps/codecs/libspeex/exc_10_32_table.c @@ -30,8 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config-speex.h" -const signed char exc_10_32_table[320] = { +const signed char exc_10_32_table[320] ICONST_ATTR = { 7,17,17,27,25,22,12,4,-3,0, 28,-36,39,-24,-15,3,-9,15,-5,10, 31,-28,11,31,-21,9,-11,-11,-2,-7, diff --git a/apps/codecs/libspeex/exc_20_32_table.c b/apps/codecs/libspeex/exc_20_32_table.c index e4098b8d1c..fff3bed944 100644 --- a/apps/codecs/libspeex/exc_20_32_table.c +++ b/apps/codecs/libspeex/exc_20_32_table.c @@ -30,8 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config-speex.h" -const signed char exc_20_32_table[640] = { +const signed char exc_20_32_table[640] ICONST_ATTR = { 12,32,25,46,36,33,9,14,-3,6,1,-8,0,-10,-5,-7,-7,-7,-5,-5, 31,-27,24,-32,-4,10,-11,21,-3,19,23,-9,22,24,-10,-1,-10,-13,-7,-11, 42,-33,31,19,-8,0,-10,-16,1,-21,-17,10,-8,14,8,4,11,-2,5,-2, diff --git a/apps/codecs/libspeex/exc_5_256_table.c b/apps/codecs/libspeex/exc_5_256_table.c index 4137996d4f..6af987fea4 100644 --- a/apps/codecs/libspeex/exc_5_256_table.c +++ b/apps/codecs/libspeex/exc_5_256_table.c @@ -30,8 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config-speex.h" -const signed char exc_5_256_table[1280] = { +const signed char exc_5_256_table[1280] ICONST_ATTR = { -8,-37,5,-43,5, 73,61,39,12,-3, -61,-32,2,42,30, diff --git a/apps/codecs/libspeex/exc_5_64_table.c b/apps/codecs/libspeex/exc_5_64_table.c index 2c66d5189e..cd03eb5a20 100644 --- a/apps/codecs/libspeex/exc_5_64_table.c +++ b/apps/codecs/libspeex/exc_5_64_table.c @@ -30,8 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config-speex.h" -const signed char exc_5_64_table[320]={ +const signed char exc_5_64_table[320] ICONST_ATTR = { 1,5,-15,49,-66, -48,-4,50,-44,7, 37,16,-18,25,-26, diff --git a/apps/codecs/libspeex/exc_8_128_table.c b/apps/codecs/libspeex/exc_8_128_table.c index 17ee64b926..3a910bee37 100644 --- a/apps/codecs/libspeex/exc_8_128_table.c +++ b/apps/codecs/libspeex/exc_8_128_table.c @@ -30,8 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config-speex.h" -const signed char exc_8_128_table[1024] = { +const signed char exc_8_128_table[1024] ICONST_ATTR = { -14,9,13,-32,2,-10,31,-10, -8,-8,6,-4,-1,10,-64,23, 6,20,13,6,8,-22,16,34, diff --git a/apps/codecs/libspeex/filters.c b/apps/codecs/libspeex/filters.c index 3d9d118cb6..fcb8ed4bac 100644 --- a/apps/codecs/libspeex/filters.c +++ b/apps/codecs/libspeex/filters.c @@ -80,16 +80,17 @@ void sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max } } -void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem) -{ - int i; #ifdef FIXED_POINT - const spx_word16_t Pcoef[5][3] = {{16384, -31313, 14991}, {16384, -31569, 15249}, {16384, -31677, 15328}, {16384, -32313, 15947}, {16384, -22446, 6537}}; - const spx_word16_t Zcoef[5][3] = {{15672, -31344, 15672}, {15802, -31601, 15802}, {15847, -31694, 15847}, {16162, -32322, 16162}, {14418, -28836, 14418}}; + const spx_word16_t Pcoef[5][3] ICONST_ATTR = {{16384, -31313, 14991}, {16384, -31569, 15249}, {16384, -31677, 15328}, {16384, -32313, 15947}, {16384, -22446, 6537}}; + const spx_word16_t Zcoef[5][3] ICONST_ATTR = {{15672, -31344, 15672}, {15802, -31601, 15802}, {15847, -31694, 15847}, {16162, -32322, 16162}, {14418, -28836, 14418}}; #else const spx_word16_t Pcoef[5][3] = {{1.00000f, -1.91120f, 0.91498f}, {1.00000f, -1.92683f, 0.93071f}, {1.00000f, -1.93338f, 0.93553f}, {1.00000f, -1.97226f, 0.97332f}, {1.00000f, -1.37000f, 0.39900f}}; const spx_word16_t Zcoef[5][3] = {{0.95654f, -1.91309f, 0.95654f}, {0.96446f, -1.92879f, 0.96446f}, {0.96723f, -1.93445f, 0.96723f}, {0.98645f, -1.97277f, 0.98645f}, {0.88000f, -1.76000f, 0.88000f}}; #endif + +void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem) +{ + int i; const spx_word16_t *den, *num; if (filtID>4) filtID=4; diff --git a/apps/codecs/libspeex/gain_table.c b/apps/codecs/libspeex/gain_table.c index 00b8244259..7d222450e1 100644 --- a/apps/codecs/libspeex/gain_table.c +++ b/apps/codecs/libspeex/gain_table.c @@ -29,7 +29,9 @@ POSSIBILITY OF SUCH DAMAGE. */ -const signed char gain_cdbk_nb[512] = { +#include "config-speex.h" + +const signed char gain_cdbk_nb[512] ICONST_ATTR = { -32, -32, -32, 0, -28, -67, -5, 33, -42, -6, -32, 18, diff --git a/apps/codecs/libspeex/gain_table_lbr.c b/apps/codecs/libspeex/gain_table_lbr.c index 3c1c3dba99..b97045b078 100644 --- a/apps/codecs/libspeex/gain_table_lbr.c +++ b/apps/codecs/libspeex/gain_table_lbr.c @@ -29,7 +29,9 @@ POSSIBILITY OF SUCH DAMAGE. */ -const signed char gain_cdbk_lbr[128] = { +#include "config-speex.h" + +const signed char gain_cdbk_lbr[128] ICONST_ATTR = { -32, -32, -32, 0, -31, -58, -16, 22, -41, -24, -43, 14, diff --git a/apps/codecs/libspeex/hexc_10_32_table.c b/apps/codecs/libspeex/hexc_10_32_table.c index 8dd408f2c3..f54f716db8 100644 --- a/apps/codecs/libspeex/hexc_10_32_table.c +++ b/apps/codecs/libspeex/hexc_10_32_table.c @@ -30,7 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -const signed char hexc_10_32_table[320] = { +#include "config-speex.h" + +const signed char hexc_10_32_table[320] ICONST_ATTR = { -3, -2, -1, 0, -4, 5, 35, -40, -9, 13, -44, 5, -27, -1, -7, 6, -11, 7, -8, 7, 19, -14, 15, -4, 9, -10, 10, -8, 10, -9, diff --git a/apps/codecs/libspeex/hexc_table.c b/apps/codecs/libspeex/hexc_table.c index 268408a8d4..98893f9a23 100644 --- a/apps/codecs/libspeex/hexc_table.c +++ b/apps/codecs/libspeex/hexc_table.c @@ -30,7 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -const signed char hexc_table[1024] = { +#include "config-speex.h" + +const signed char hexc_table[1024] ICONST_ATTR = { -24, 21, -20, 5, -5, -7, 14, -10, 2, -27, 16, -20, 0, -32, 26, 19, 8, -11, -41, 31, 28, -27, -32, 34, diff --git a/apps/codecs/libspeex/lsp_tables_nb.c b/apps/codecs/libspeex/lsp_tables_nb.c index 16f2e1b64f..e9fe9cebd5 100644 --- a/apps/codecs/libspeex/lsp_tables_nb.c +++ b/apps/codecs/libspeex/lsp_tables_nb.c @@ -29,7 +29,9 @@ POSSIBILITY OF SUCH DAMAGE. */ -const signed char cdbk_nb[640]={ +#include "config-speex.h" + +const signed char cdbk_nb[640] ICONST_ATTR = { 30,19,38,34,40,32,46,43,58,43, 5,-18,-25,-40,-33,-55,-52,20,34,28, -20,-63,-97,-92,61,53,47,49,53,75, @@ -95,7 +97,7 @@ const signed char cdbk_nb[640]={ -6,-41,-67,6,-2,-9,19,2,85,74, -22,-67,-84,-71,-50,3,11,-9,2,62}; -const signed char cdbk_nb_low1[320]={ +const signed char cdbk_nb_low1[320] ICONST_ATTR = { -34,-52,-15,45,2, 23,21,52,24,-33, -9,-1,9,-44,-41, @@ -161,7 +163,7 @@ const signed char cdbk_nb_low1[320]={ 13,20,20,-19,-22, -2,-8,2,51,-51}; -const signed char cdbk_nb_low2[320]={ +const signed char cdbk_nb_low2[320] ICONST_ATTR = { -6,53,-21,-24,4, 26,17,-4,-37,25, 17,-36,-13,31,3, @@ -227,7 +229,7 @@ const signed char cdbk_nb_low2[320]={ -23,-29,-16,1,-3, -8,-10,31,64,-65}; -const signed char cdbk_nb_high1[320]={ +const signed char cdbk_nb_high1[320] ICONST_ATTR = { -26,-8,29,21,4, 19,-39,33,-7,-36, 56,54,48,40,29, @@ -293,7 +295,7 @@ const signed char cdbk_nb_high1[320]={ 29,17,8,-29,-39, -69,18,15,-15,-5}; -const signed char cdbk_nb_high2[320]={ +const signed char cdbk_nb_high2[320] ICONST_ATTR = { 11,47,16,-9,-46, -32,26,-64,34,-5, 38,-7,47,20,2, diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c index e41ad6e703..a2da760156 100644 --- a/apps/codecs/libspeex/nb_celp.c +++ b/apps/codecs/libspeex/nb_celp.c @@ -75,11 +75,11 @@ #ifdef FIXED_POINT -const spx_word32_t ol_gain_table[32]={18900, 25150, 33468, 44536, 59265, 78865, 104946, 139653, 185838, 247297, 329081, 437913, 582736, 775454, 1031906, 1373169, 1827293, 2431601, 3235761, 4305867, 5729870, 7624808, 10146425, 13501971, 17967238, 23909222, 31816294, 42338330, 56340132, 74972501, 99766822, 132760927}; -const spx_word16_t exc_gain_quant_scal3_bound[7]={1841, 3883, 6051, 8062, 10444, 13580, 18560}; -const spx_word16_t exc_gain_quant_scal3[8]={1002, 2680, 5086, 7016, 9108, 11781, 15380, 21740}; -const spx_word16_t exc_gain_quant_scal1_bound[1]={14385}; -const spx_word16_t exc_gain_quant_scal1[2]={11546, 17224}; +const spx_word32_t ol_gain_table[32] ICONST_ATTR = {18900, 25150, 33468, 44536, 59265, 78865, 104946, 139653, 185838, 247297, 329081, 437913, 582736, 775454, 1031906, 1373169, 1827293, 2431601, 3235761, 4305867, 5729870, 7624808, 10146425, 13501971, 17967238, 23909222, 31816294, 42338330, 56340132, 74972501, 99766822, 132760927}; +const spx_word16_t exc_gain_quant_scal3_bound[7] ICONST_ATTR = {1841, 3883, 6051, 8062, 10444, 13580, 18560}; +const spx_word16_t exc_gain_quant_scal3[8] ICONST_ATTR = {1002, 2680, 5086, 7016, 9108, 11781, 15380, 21740}; +const spx_word16_t exc_gain_quant_scal1_bound[1] ICONST_ATTR = {14385}; +const spx_word16_t exc_gain_quant_scal1[2] ICONST_ATTR = {11546, 17224}; #define LSP_MARGIN 16 #define LSP_DELTA1 6553 diff --git a/apps/codecs/libspeex/sb_celp.c b/apps/codecs/libspeex/sb_celp.c index faabe24766..6066c8c51b 100644 --- a/apps/codecs/libspeex/sb_celp.c +++ b/apps/codecs/libspeex/sb_celp.c @@ -109,8 +109,8 @@ int sb_decoder_ctl(void *state, int request, void *ptr) #define SUBMODE(x) st->submodes[st->submodeID]->x #ifdef FIXED_POINT -static const spx_word16_t gc_quant_bound[16] = {125, 164, 215, 282, 370, 484, 635, 832, 1090, 1428, 1871, 2452, 3213, 4210, 5516, 7228}; -static const spx_word16_t fold_quant_bound[32] = { +static const spx_word16_t gc_quant_bound[16] ICONST_ATTR = {125, 164, 215, 282, 370, 484, 635, 832, 1090, 1428, 1871, 2452, 3213, 4210, 5516, 7228}; +static const spx_word16_t fold_quant_bound[32] ICONST_ATTR = { 39, 44, 50, 57, 64, 73, 83, 94, 106, 120, 136, 154, 175, 198, 225, 255, 288, 327, 370, 420, 476, 539, 611, 692, @@ -139,7 +139,7 @@ static const spx_word16_t fold_quant_bound[32] = { #define QMF_ORDER 64 #ifdef FIXED_POINT -static const spx_word16_t h0[64] = {2, -7, -7, 18, 15, -39, -25, 75, 35, -130, -41, 212, 38, -327, -17, 483, -32, -689, 124, 956, -283, -1307, 543, 1780, -973, -2467, 1733, 3633, -3339, -6409, 9059, 30153, 30153, 9059, -6409, -3339, 3633, 1733, -2467, -973, 1780, 543, -1307, -283, 956, 124, -689, -32, 483, -17, -327, 38, 212, -41, -130, 35, 75, -25, -39, 15, 18, -7, -7, 2}; +static const spx_word16_t h0[64] ICONST_ATTR = {2, -7, -7, 18, 15, -39, -25, 75, 35, -130, -41, 212, 38, -327, -17, 483, -32, -689, 124, 956, -283, -1307, 543, 1780, -973, -2467, 1733, 3633, -3339, -6409, 9059, 30153, 30153, 9059, -6409, -3339, 3633, 1733, -2467, -973, 1780, 543, -1307, -283, 956, 124, -689, -32, 483, -17, -327, 38, 212, -41, -130, 35, 75, -25, -39, 15, 18, -7, -7, 2}; #else static const float h0[64] = { diff --git a/apps/codecs/libspeex/window.c b/apps/codecs/libspeex/window.c index 55ceadf5b8..41757ff0d0 100644 --- a/apps/codecs/libspeex/window.c +++ b/apps/codecs/libspeex/window.c @@ -36,7 +36,7 @@ #include "misc.h" #ifdef FIXED_POINT -const spx_word16_t lpc_window[200] = { +const spx_word16_t lpc_window[200] ICONST_ATTR = { 1310, 1313, 1321, 1333, 1352, 1375, 1403, 1436, 1475, 1518, 1567, 1621, 1679, 1743, 1811, 1884, 1962, 2044, 2132, 2224, 2320, 2421, 2526, 2636, |