summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libtremor')
-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){
153static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){ 153static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
154 int i; 154 int i;
155 long b_size[2]; 155 long b_size[2];
156 LOOKUP_TNC *iramposw;
157 156
158 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; 157 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
159 private_state *b=NULL; 158 private_state *b=NULL;
@@ -183,17 +182,20 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
183 b_size[1]=ci->blocksizes[1]/2; 182 b_size[1]=ci->blocksizes[1]/2;
184 b->window[0]=_vorbis_window(0,b_size[0]); 183 b->window[0]=_vorbis_window(0,b_size[0]);
185 b->window[1]=_vorbis_window(0,b_size[1]); 184 b->window[1]=_vorbis_window(0,b_size[1]);
186 185
186#ifdef TREMOR_USE_IRAM
187 /* allocate IRAM buffer for window tables too, if sufficient iram available */ 187 /* allocate IRAM buffer for window tables too, if sufficient iram available */
188 /* give preference to the larger window over the smaller window 188 /* give preference to the larger window over the smaller window
189 (on the assumption that both windows are equally likely used) */ 189 (on the assumption that both windows are equally likely used) */
190 LOOKUP_TNC *iramposw;
190 for(i=1; i>=0; i--){ 191 for(i=1; i>=0; i--){
191 iramposw=(LOOKUP_TNC *)iram_malloc(b_size[i]*sizeof(LOOKUP_TNC)); 192 iramposw=iram_malloc(b_size[i]*sizeof(LOOKUP_TNC));
192 if(iramposw!=NULL) { 193 if(iramposw!=NULL) {
193 memcpy(iramposw, b->window[i], b_size[i]*sizeof(LOOKUP_TNC)); 194 memcpy(iramposw, b->window[i], b_size[i]*sizeof(LOOKUP_TNC));
194 b->window[i]=iramposw; 195 b->window[i]=iramposw;
195 } 196 }
196 } 197 }
198#endif
197 199
198 /* finish the codebooks */ 200 /* finish the codebooks */
199 if(!ci->fullbooks){ 201 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 @@
23#define ICODE_ATTR_TREMOR_NOT_MDCT ICODE_ATTR 23#define ICODE_ATTR_TREMOR_NOT_MDCT ICODE_ATTR
24#endif 24#endif
25 25
26#ifdef USE_IRAM
27#define TREMOR_USE_IRAM
28#endif
29
26/* Define CPU of large IRAM (PP5022/5024, MCF5250) */ 30/* Define CPU of large IRAM (PP5022/5024, MCF5250) */
27#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || defined(CPU_S5L870X) || (CONFIG_CPU == MCF5250) 31#if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || defined(CPU_S5L870X) || (CONFIG_CPU == MCF5250)
28/* PCM_BUFFER : 32768 byte (4096*2*4 or 2048*4*4) * 32/* PCM_BUFFER : 32768 byte (4096*2*4 or 2048*4*4) *