summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-06-05 20:18:31 +0000
committerNils Wallménius <nils@rockbox.org>2011-06-05 20:18:31 +0000
commit684b74147f203662fb6767f65b4ca8fc9b8eeeac (patch)
tree9ef604a3f98f8cd46d3fa396d96d42de81599492
parent965113ed5051d3e9e4b563b8da1f5523c5470a76 (diff)
downloadrockbox-684b74147f203662fb6767f65b4ca8fc9b8eeeac.tar.gz
rockbox-684b74147f203662fb6767f65b4ca8fc9b8eeeac.tar.bz2
rockbox-684b74147f203662fb6767f65b4ca8fc9b8eeeac.zip
Safe part of FS#11268, saving some codec buffer space for targets that don't use separate iram.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29975 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libtremor/block.c8
-rw-r--r--apps/codecs/libtremor/config-tremor.h4
2 files changed, 9 insertions, 3 deletions
diff --git a/apps/codecs/libtremor/block.c b/apps/codecs/libtremor/block.c
index 0eaf7bc820..b88896dd15 100644
--- a/apps/codecs/libtremor/block.c
+++ b/apps/codecs/libtremor/block.c
@@ -153,7 +153,6 @@ int vorbis_block_clear(vorbis_block *vb){
static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
int i;
long b_size[2];
- LOOKUP_TNC *iramposw;
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
private_state *b=NULL;
@@ -183,17 +182,20 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
b_size[1]=ci->blocksizes[1]/2;
b->window[0]=_vorbis_window(0,b_size[0]);
b->window[1]=_vorbis_window(0,b_size[1]);
-
+
+#ifdef TREMOR_USE_IRAM
/* allocate IRAM buffer for window tables too, if sufficient iram available */
/* give preference to the larger window over the smaller window
(on the assumption that both windows are equally likely used) */
+ LOOKUP_TNC *iramposw;
for(i=1; i>=0; i--){
- iramposw=(LOOKUP_TNC *)iram_malloc(b_size[i]*sizeof(LOOKUP_TNC));
+ iramposw=iram_malloc(b_size[i]*sizeof(LOOKUP_TNC));
if(iramposw!=NULL) {
memcpy(iramposw, b->window[i], b_size[i]*sizeof(LOOKUP_TNC));
b->window[i]=iramposw;
}
}
+#endif
/* finish the codebooks */
if(!ci->fullbooks){
diff --git a/apps/codecs/libtremor/config-tremor.h b/apps/codecs/libtremor/config-tremor.h
index 7afb2c6ad0..2f93072d63 100644
--- a/apps/codecs/libtremor/config-tremor.h
+++ b/apps/codecs/libtremor/config-tremor.h
@@ -23,6 +23,10 @@
#define ICODE_ATTR_TREMOR_NOT_MDCT ICODE_ATTR
#endif
+#ifdef USE_IRAM
+#define TREMOR_USE_IRAM
+#endif
+
/* Define CPU of large IRAM (PP5022/5024, MCF5250) */
#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || defined(CPU_S5L870X) || (CONFIG_CPU == MCF5250)
/* PCM_BUFFER : 32768 byte (4096*2*4 or 2048*4*4) *