From 42774d3128b91d5a37344cb40d56d3c4d147e5f2 Mon Sep 17 00:00:00 2001 From: Dave Hooper Date: Wed, 17 Feb 2010 00:49:53 +0000 Subject: 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 --- apps/codecs/libtremor/block.c | 2 ++ apps/codecs/libtremor/codec_internal.h | 3 ++- apps/codecs/libtremor/info.c | 6 ++++-- apps/codecs/libtremor/ivorbiscodec.h | 2 +- apps/codecs/libtremor/mapping0.c | 8 +++++--- apps/codecs/libtremor/synthesis.c | 5 ++++- 6 files changed, 18 insertions(+), 8 deletions(-) (limited to 'apps/codecs/libtremor') diff --git a/apps/codecs/libtremor/block.c b/apps/codecs/libtremor/block.c index fe736c8def..b4ca8f3f11 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 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 3ca7f54724..3cbd7cde89 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<bitrate_nominal=oggpack_read(opb,32); vi->bitrate_lower=oggpack_read(opb,32); - ci->blocksizes[0]=1<blocksizes[1]=1<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 c2836ad8a9..f17c57a86d 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 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 ecee6db0c7..bd0e0322fe 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 /* 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 a882a6d07a..464c777605 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; ichannels; i++) vb->pcm[i] = &vd->first_pcm[i*ci->blocksizes[1]]; + } vd->reset_pcmb = false; -- cgit v1.2.3