diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-05-16 21:31:59 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-05-16 21:31:59 +0000 |
commit | 22c9b6ef8e1e1f4354ff0fc445990512175a1649 (patch) | |
tree | 5389bf2dc5ca9cb3b440f9c58854020accb4ac98 | |
parent | e8c79d65e18be1eb1ddc8a0e32a04c17dbc73459 (diff) | |
download | rockbox-22c9b6ef8e1e1f4354ff0fc445990512175a1649.tar.gz rockbox-22c9b6ef8e1e1f4354ff0fc445990512175a1649.zip |
Use more IRAM for mpc on S5L870x. Speed up decoding by ~2%.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29891 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libmusepack/internal.h | 2 | ||||
-rw-r--r-- | apps/codecs/libmusepack/mpc_decoder.c | 3 | ||||
-rw-r--r-- | apps/codecs/libmusepack/mpc_demux.c | 2 | ||||
-rw-r--r-- | apps/codecs/libmusepack/mpcdec.h | 21 | ||||
-rw-r--r-- | apps/codecs/libmusepack/synth_filter.c | 6 |
5 files changed, 29 insertions, 5 deletions
diff --git a/apps/codecs/libmusepack/internal.h b/apps/codecs/libmusepack/internal.h index 760f50b02d..0f29060a7d 100644 --- a/apps/codecs/libmusepack/internal.h +++ b/apps/codecs/libmusepack/internal.h | |||
@@ -58,7 +58,7 @@ typedef struct mpc_block_t { | |||
58 | } mpc_block; | 58 | } mpc_block; |
59 | 59 | ||
60 | #define MAX_FRAME_SIZE 4352 | 60 | #define MAX_FRAME_SIZE 4352 |
61 | #define DEMUX_BUFFER_SIZE (65536 - MAX_FRAME_SIZE) // need some space as sand box | 61 | #define DEMUX_BUFFER_SIZE (32768 - MAX_FRAME_SIZE) // need some space as sand box |
62 | 62 | ||
63 | struct mpc_demux_t { | 63 | struct mpc_demux_t { |
64 | mpc_reader * r; | 64 | mpc_reader * r; |
diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c index face3d1f81..eb0638524f 100644 --- a/apps/codecs/libmusepack/mpc_decoder.c +++ b/apps/codecs/libmusepack/mpc_decoder.c | |||
@@ -123,7 +123,8 @@ void mpc_decoder_requantisierung (mpc_decoder *d) | |||
123 | void mpc_decoder_read_bitstream_sv7(mpc_decoder * d, mpc_bits_reader * r) | 123 | void mpc_decoder_read_bitstream_sv7(mpc_decoder * d, mpc_bits_reader * r) |
124 | ICODE_ATTR_MPC_LARGE_IRAM; | 124 | ICODE_ATTR_MPC_LARGE_IRAM; |
125 | void mpc_decoder_read_bitstream_sv8(mpc_decoder * d, mpc_bits_reader * r, | 125 | void mpc_decoder_read_bitstream_sv8(mpc_decoder * d, mpc_bits_reader * r, |
126 | mpc_bool_t is_key_frame); | 126 | mpc_bool_t is_key_frame) |
127 | ICODE_ATTR_MPC_SV8_BS_DEC; | ||
127 | 128 | ||
128 | //------------------------------------------------------------------------------ | 129 | //------------------------------------------------------------------------------ |
129 | // macros | 130 | // macros |
diff --git a/apps/codecs/libmusepack/mpc_demux.c b/apps/codecs/libmusepack/mpc_demux.c index e4ae0f89d3..499170c135 100644 --- a/apps/codecs/libmusepack/mpc_demux.c +++ b/apps/codecs/libmusepack/mpc_demux.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #define MAX_BUFFER_SIZE (DEMUX_BUFFER_SIZE + MAX_FRAME_SIZE) | 51 | #define MAX_BUFFER_SIZE (DEMUX_BUFFER_SIZE + MAX_FRAME_SIZE) |
52 | 52 | ||
53 | // globals | 53 | // globals |
54 | static mpc_uint8_t g_buffer[MAX_BUFFER_SIZE]; | 54 | static mpc_uint8_t g_buffer[MAX_BUFFER_SIZE] IBSS_ATTR_MPC_BITBUFFER; |
55 | static mpc_seek_t g_seek_table[MAX_SEEK_TABLE_SIZE]; | 55 | static mpc_seek_t g_seek_table[MAX_SEEK_TABLE_SIZE]; |
56 | static mpc_demux g_mpc_demux IBSS_ATTR; | 56 | static mpc_demux g_mpc_demux IBSS_ATTR; |
57 | 57 | ||
diff --git a/apps/codecs/libmusepack/mpcdec.h b/apps/codecs/libmusepack/mpcdec.h index d4c3bd22fc..68754dcbd2 100644 --- a/apps/codecs/libmusepack/mpcdec.h +++ b/apps/codecs/libmusepack/mpcdec.h | |||
@@ -52,23 +52,42 @@ extern "C" { | |||
52 | #define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR | 52 | #define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR |
53 | #define ICODE_ATTR_MPC_LARGE_IRAM | 53 | #define ICODE_ATTR_MPC_LARGE_IRAM |
54 | #define ICONST_ATTR_MPC_LARGE_IRAM ICONST_ATTR | 54 | #define ICONST_ATTR_MPC_LARGE_IRAM ICONST_ATTR |
55 | /* Does not fit into IRAM. */ | ||
56 | #define IBSS_ATTR_MPC_BITBUFFER | ||
57 | #define ICODE_ATTR_MPC_SV8_BS_DEC | ||
55 | /* Keep the data arrays of bitsreadr.c in IRAM. */ | 58 | /* Keep the data arrays of bitsreadr.c in IRAM. */ |
56 | #define ICONST_ATTR_MPC_BITSREADER ICONST_ATTR | 59 | #define ICONST_ATTR_MPC_BITSREADER ICONST_ATTR |
57 | 60 | ||
58 | #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || defined(CPU_S5L870X) | 61 | #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) |
59 | /* Enough IRAM to move additional data and code to it. */ | 62 | /* Enough IRAM to move additional data and code to it. */ |
60 | #define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR | 63 | #define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR |
61 | #define ICODE_ATTR_MPC_LARGE_IRAM ICODE_ATTR | 64 | #define ICODE_ATTR_MPC_LARGE_IRAM ICODE_ATTR |
62 | #define ICONST_ATTR_MPC_LARGE_IRAM ICONST_ATTR | 65 | #define ICONST_ATTR_MPC_LARGE_IRAM ICONST_ATTR |
66 | /* Does not fit into IRAM. */ | ||
67 | #define IBSS_ATTR_MPC_BITBUFFER | ||
68 | #define ICODE_ATTR_MPC_SV8_BS_DEC | ||
63 | /* Not putting the data arrays of bitsreader.c to IRAM allows to move the | 69 | /* Not putting the data arrays of bitsreader.c to IRAM allows to move the |
64 | * sv7/sv8 bitstream demuxing into IRAM. This config is faster. */ | 70 | * sv7/sv8 bitstream demuxing into IRAM. This config is faster. */ |
65 | #define ICONST_ATTR_MPC_BITSREADER | 71 | #define ICONST_ATTR_MPC_BITSREADER |
66 | 72 | ||
73 | #elif defined(CPU_S5L870X) | ||
74 | /* Enough IRAM to move additional data and code to it. */ | ||
75 | #define IBSS_ATTR_MPC_LARGE_IRAM IBSS_ATTR | ||
76 | #define ICODE_ATTR_MPC_LARGE_IRAM ICODE_ATTR | ||
77 | #define ICONST_ATTR_MPC_LARGE_IRAM ICONST_ATTR | ||
78 | /* Faster when moved to IRAM. */ | ||
79 | #define IBSS_ATTR_MPC_BITBUFFER IBSS_ATTR | ||
80 | #define ICODE_ATTR_MPC_SV8_BS_DEC ICODE_ATTR | ||
81 | /* Not faster when moved to IRAM. */ | ||
82 | #define ICONST_ATTR_MPC_BITSREADER | ||
83 | |||
67 | #else | 84 | #else |
68 | /* Not enough IRAM available. */ | 85 | /* Not enough IRAM available. */ |
69 | #define IBSS_ATTR_MPC_LARGE_IRAM | 86 | #define IBSS_ATTR_MPC_LARGE_IRAM |
70 | #define ICODE_ATTR_MPC_LARGE_IRAM | 87 | #define ICODE_ATTR_MPC_LARGE_IRAM |
71 | #define ICONST_ATTR_MPC_LARGE_IRAM | 88 | #define ICONST_ATTR_MPC_LARGE_IRAM |
89 | #define IBSS_ATTR_MPC_BITBUFFER | ||
90 | #define ICODE_ATTR_MPC_SV8_BS_DEC | ||
72 | #define ICONST_ATTR_MPC_BITSREADER | 91 | #define ICONST_ATTR_MPC_BITSREADER |
73 | #endif | 92 | #endif |
74 | 93 | ||
diff --git a/apps/codecs/libmusepack/synth_filter.c b/apps/codecs/libmusepack/synth_filter.c index 602edff6c6..3ad2b236a0 100644 --- a/apps/codecs/libmusepack/synth_filter.c +++ b/apps/codecs/libmusepack/synth_filter.c | |||
@@ -510,7 +510,11 @@ mpc_decoder_windowing_D(MPC_SAMPLE_FORMAT * Data, | |||
510 | #endif /* CPU_ARM || CPU_COLDFIRE */ | 510 | #endif /* CPU_ARM || CPU_COLDFIRE */ |
511 | 511 | ||
512 | static void | 512 | static void |
513 | mpc_full_synthesis_filter(MPC_SAMPLE_FORMAT *OutData, MPC_SAMPLE_FORMAT *V, const MPC_SAMPLE_FORMAT *Y) | 513 | mpc_full_synthesis_filter(MPC_SAMPLE_FORMAT *OutData, MPC_SAMPLE_FORMAT *V, |
514 | const MPC_SAMPLE_FORMAT *Y) ICODE_ATTR_MPC_LARGE_IRAM; | ||
515 | static void | ||
516 | mpc_full_synthesis_filter(MPC_SAMPLE_FORMAT *OutData, MPC_SAMPLE_FORMAT *V, | ||
517 | const MPC_SAMPLE_FORMAT *Y) | ||
514 | { | 518 | { |
515 | mpc_uint32_t n; | 519 | mpc_uint32_t n; |
516 | 520 | ||