diff options
| author | Dave Hooper <dave@beermex.com> | 2010-02-17 00:49:53 +0000 |
|---|---|---|
| committer | Dave Hooper <dave@beermex.com> | 2010-02-17 00:49:53 +0000 |
| commit | 42774d3128b91d5a37344cb40d56d3c4d147e5f2 (patch) | |
| tree | bf336b407992ec9a5e454556f3351e3f8a0d10de /apps/codecs/libtremor | |
| parent | 62257ebc38bc0a3095b25dd0f58c4c8215edf602 (diff) | |
| download | rockbox-42774d3128b91d5a37344cb40d56d3c4d147e5f2.zip rockbox-42774d3128b91d5a37344cb40d56d3c4d147e5f2.tar.gz rockbox-42774d3128b91d5a37344cb40d56d3c4d147e5f2.tar.bz2 rockbox-42774d3128b91d5a37344cb40d56d3c4d147e5f2.tar.xz | |
Merge from branches/mdctexp - faster ifft+imdct in codec lib
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24712 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libtremor')
| -rw-r--r-- | apps/codecs/libtremor/block.c | 2 | ||||
| -rw-r--r-- | apps/codecs/libtremor/codec_internal.h | 3 | ||||
| -rw-r--r-- | apps/codecs/libtremor/info.c | 6 | ||||
| -rw-r--r-- | apps/codecs/libtremor/ivorbiscodec.h | 2 | ||||
| -rw-r--r-- | apps/codecs/libtremor/mapping0.c | 8 | ||||
| -rw-r--r-- | apps/codecs/libtremor/synthesis.c | 5 |
6 files changed, 18 insertions, 8 deletions
diff --git a/apps/codecs/libtremor/block.c b/apps/codecs/libtremor/block.c index fe736c8..b4ca8f3 100644 --- a/apps/codecs/libtremor/block.c +++ b/apps/codecs/libtremor/block.c @@ -25,6 +25,7 @@ #include "window.h" #include "registry.h" #include "misc.h" +//#include <codecs/lib/codeclib.h> static int ilog(unsigned int v){ int ret=0; @@ -239,6 +240,7 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){ b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i], ci->map_param[mapnum]); } + return(0); } diff --git a/apps/codecs/libtremor/codec_internal.h b/apps/codecs/libtremor/codec_internal.h index 3ca7f54..3cbd7cd 100644 --- a/apps/codecs/libtremor/codec_internal.h +++ b/apps/codecs/libtremor/codec_internal.h @@ -60,7 +60,8 @@ typedef struct codec_setup_info { /* Vorbis supports only short and long blocks, but allows the encoder to choose the sizes */ - long blocksizes[2]; + int blocksizes_nbits[2]; + long blocksizes[2]; /* = 1<<nbits */ /* modes are the primary means of supporting on-the-fly different blocksizes, different channel mappings (LR or M/A), diff --git a/apps/codecs/libtremor/info.c b/apps/codecs/libtremor/info.c index 4273f97..afa9497 100644 --- a/apps/codecs/libtremor/info.c +++ b/apps/codecs/libtremor/info.c @@ -120,8 +120,10 @@ static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ vi->bitrate_nominal=oggpack_read(opb,32); vi->bitrate_lower=oggpack_read(opb,32); - ci->blocksizes[0]=1<<oggpack_read(opb,4); - ci->blocksizes[1]=1<<oggpack_read(opb,4); + ci->blocksizes_nbits[0]=oggpack_read(opb,4); + ci->blocksizes_nbits[1]=oggpack_read(opb,4); + ci->blocksizes[0]=1<<(ci->blocksizes_nbits[0]); + ci->blocksizes[1]=1<<(ci->blocksizes_nbits[1]); if(vi->rate<1)goto err_out; if(vi->channels<1)goto err_out; diff --git a/apps/codecs/libtremor/ivorbiscodec.h b/apps/codecs/libtremor/ivorbiscodec.h index c2836ad..f17c57a 100644 --- a/apps/codecs/libtremor/ivorbiscodec.h +++ b/apps/codecs/libtremor/ivorbiscodec.h @@ -24,6 +24,7 @@ extern "C" #endif /* __cplusplus */ #include "ogg.h" +//#include <codecs/lib/codeclib.h> typedef struct vorbis_info{ int version; @@ -105,7 +106,6 @@ typedef struct vorbis_block{ long localalloc; long totaluse; struct alloc_chain *reap; - } vorbis_block; /* vorbis_block is a single block of data to be processed as part of diff --git a/apps/codecs/libtremor/mapping0.c b/apps/codecs/libtremor/mapping0.c index ecee6db..bd0e032 100644 --- a/apps/codecs/libtremor/mapping0.c +++ b/apps/codecs/libtremor/mapping0.c @@ -27,8 +27,7 @@ #include "window.h" #include "registry.h" #include "misc.h" - - +#include <codecs/lib/codeclib.h> /* simplistic, wasteful way of doing this (unique lookup for each mode/submapping); there should be a central repository for @@ -291,7 +290,10 @@ static int mapping0_inverse(vorbis_block *vb,vorbis_look_mapping *l){ /* compute and apply spectral envelope */ look->floor_func[submap]-> inverse2(vb,look->floor_look[submap],floormemo[i],pcm); - mdct_backward(n, (int32_t*) pcm, (int32_t*) pcm); + + ff_imdct_calc(ci->blocksizes_nbits[vb->W], + (int32_t*)pcm, + (int32_t*)pcm); /* window the data */ _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW); } diff --git a/apps/codecs/libtremor/synthesis.c b/apps/codecs/libtremor/synthesis.c index a882a6d..464c777 100644 --- a/apps/codecs/libtremor/synthesis.c +++ b/apps/codecs/libtremor/synthesis.c @@ -26,6 +26,7 @@ static ogg_int32_t *ipcm_vect[CHANNELS] IBSS_ATTR; +int32_t staticbuffer[16384]; int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep) ICODE_ATTR_TREMOR_NOT_MDCT; @@ -67,7 +68,8 @@ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){ vb->sequence=op->packetno-3; /* first block is third packet */ vb->eofflag=op->e_o_s; - if(decodep && vi->channels<=CHANNELS){ + if(decodep && vi->channels<=CHANNELS) + { vb->pcm = ipcm_vect; /* set pcm end point */ @@ -81,6 +83,7 @@ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){ by simply flipping pointers */ for(i=0; i<vi->channels; i++) vb->pcm[i] = &vd->first_pcm[i*ci->blocksizes[1]]; + } vd->reset_pcmb = false; |