diff options
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 fe736c8def..b4ca8f3f11 100644 --- a/apps/codecs/libtremor/block.c +++ b/apps/codecs/libtremor/block.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "window.h" | 25 | #include "window.h" |
26 | #include "registry.h" | 26 | #include "registry.h" |
27 | #include "misc.h" | 27 | #include "misc.h" |
28 | //#include <codecs/lib/codeclib.h> | ||
28 | 29 | ||
29 | static int ilog(unsigned int v){ | 30 | static int ilog(unsigned int v){ |
30 | int ret=0; | 31 | int ret=0; |
@@ -239,6 +240,7 @@ static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){ | |||
239 | b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i], | 240 | b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i], |
240 | ci->map_param[mapnum]); | 241 | ci->map_param[mapnum]); |
241 | } | 242 | } |
243 | |||
242 | return(0); | 244 | return(0); |
243 | } | 245 | } |
244 | 246 | ||
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 { | |||
60 | /* Vorbis supports only short and long blocks, but allows the | 60 | /* Vorbis supports only short and long blocks, but allows the |
61 | encoder to choose the sizes */ | 61 | encoder to choose the sizes */ |
62 | 62 | ||
63 | long blocksizes[2]; | 63 | int blocksizes_nbits[2]; |
64 | long blocksizes[2]; /* = 1<<nbits */ | ||
64 | 65 | ||
65 | /* modes are the primary means of supporting on-the-fly different | 66 | /* modes are the primary means of supporting on-the-fly different |
66 | blocksizes, different channel mappings (LR or M/A), | 67 | blocksizes, different channel mappings (LR or M/A), |
diff --git a/apps/codecs/libtremor/info.c b/apps/codecs/libtremor/info.c index 4273f97dc1..afa9497cf0 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){ | |||
120 | vi->bitrate_nominal=oggpack_read(opb,32); | 120 | vi->bitrate_nominal=oggpack_read(opb,32); |
121 | vi->bitrate_lower=oggpack_read(opb,32); | 121 | vi->bitrate_lower=oggpack_read(opb,32); |
122 | 122 | ||
123 | ci->blocksizes[0]=1<<oggpack_read(opb,4); | 123 | ci->blocksizes_nbits[0]=oggpack_read(opb,4); |
124 | ci->blocksizes[1]=1<<oggpack_read(opb,4); | 124 | ci->blocksizes_nbits[1]=oggpack_read(opb,4); |
125 | ci->blocksizes[0]=1<<(ci->blocksizes_nbits[0]); | ||
126 | ci->blocksizes[1]=1<<(ci->blocksizes_nbits[1]); | ||
125 | 127 | ||
126 | if(vi->rate<1)goto err_out; | 128 | if(vi->rate<1)goto err_out; |
127 | if(vi->channels<1)goto err_out; | 129 | 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" | |||
24 | #endif /* __cplusplus */ | 24 | #endif /* __cplusplus */ |
25 | 25 | ||
26 | #include "ogg.h" | 26 | #include "ogg.h" |
27 | //#include <codecs/lib/codeclib.h> | ||
27 | 28 | ||
28 | typedef struct vorbis_info{ | 29 | typedef struct vorbis_info{ |
29 | int version; | 30 | int version; |
@@ -105,7 +106,6 @@ typedef struct vorbis_block{ | |||
105 | long localalloc; | 106 | long localalloc; |
106 | long totaluse; | 107 | long totaluse; |
107 | struct alloc_chain *reap; | 108 | struct alloc_chain *reap; |
108 | |||
109 | } vorbis_block; | 109 | } vorbis_block; |
110 | 110 | ||
111 | /* vorbis_block is a single block of data to be processed as part of | 111 | /* 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 @@ | |||
27 | #include "window.h" | 27 | #include "window.h" |
28 | #include "registry.h" | 28 | #include "registry.h" |
29 | #include "misc.h" | 29 | #include "misc.h" |
30 | 30 | #include <codecs/lib/codeclib.h> | |
31 | |||
32 | 31 | ||
33 | /* simplistic, wasteful way of doing this (unique lookup for each | 32 | /* simplistic, wasteful way of doing this (unique lookup for each |
34 | mode/submapping); there should be a central repository for | 33 | mode/submapping); there should be a central repository for |
@@ -291,7 +290,10 @@ static int mapping0_inverse(vorbis_block *vb,vorbis_look_mapping *l){ | |||
291 | /* compute and apply spectral envelope */ | 290 | /* compute and apply spectral envelope */ |
292 | look->floor_func[submap]-> | 291 | look->floor_func[submap]-> |
293 | inverse2(vb,look->floor_look[submap],floormemo[i],pcm); | 292 | inverse2(vb,look->floor_look[submap],floormemo[i],pcm); |
294 | mdct_backward(n, (int32_t*) pcm, (int32_t*) pcm); | 293 | |
294 | ff_imdct_calc(ci->blocksizes_nbits[vb->W], | ||
295 | (int32_t*)pcm, | ||
296 | (int32_t*)pcm); | ||
295 | /* window the data */ | 297 | /* window the data */ |
296 | _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW); | 298 | _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW); |
297 | } | 299 | } |
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 @@ | |||
26 | 26 | ||
27 | 27 | ||
28 | static ogg_int32_t *ipcm_vect[CHANNELS] IBSS_ATTR; | 28 | static ogg_int32_t *ipcm_vect[CHANNELS] IBSS_ATTR; |
29 | int32_t staticbuffer[16384]; | ||
29 | 30 | ||
30 | int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep) | 31 | int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep) |
31 | ICODE_ATTR_TREMOR_NOT_MDCT; | 32 | ICODE_ATTR_TREMOR_NOT_MDCT; |
@@ -67,7 +68,8 @@ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){ | |||
67 | vb->sequence=op->packetno-3; /* first block is third packet */ | 68 | vb->sequence=op->packetno-3; /* first block is third packet */ |
68 | vb->eofflag=op->e_o_s; | 69 | vb->eofflag=op->e_o_s; |
69 | 70 | ||
70 | if(decodep && vi->channels<=CHANNELS){ | 71 | if(decodep && vi->channels<=CHANNELS) |
72 | { | ||
71 | vb->pcm = ipcm_vect; | 73 | vb->pcm = ipcm_vect; |
72 | 74 | ||
73 | /* set pcm end point */ | 75 | /* set pcm end point */ |
@@ -81,6 +83,7 @@ int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){ | |||
81 | by simply flipping pointers */ | 83 | by simply flipping pointers */ |
82 | for(i=0; i<vi->channels; i++) | 84 | for(i=0; i<vi->channels; i++) |
83 | vb->pcm[i] = &vd->first_pcm[i*ci->blocksizes[1]]; | 85 | vb->pcm[i] = &vd->first_pcm[i*ci->blocksizes[1]]; |
86 | |||
84 | } | 87 | } |
85 | vd->reset_pcmb = false; | 88 | vd->reset_pcmb = false; |
86 | 89 | ||