summaryrefslogtreecommitdiff
path: root/apps/codecs/demac/libdemac/decoder.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-06-10 08:55:16 +0000
committerDave Chapman <dave@dchapman.com>2007-06-10 08:55:16 +0000
commit601ede7f9cc88cc40e074cc9d9cfdc2c0ba46d4c (patch)
treec0366c2ce8ff0932db0873e3e27ac00e91cc50a4 /apps/codecs/demac/libdemac/decoder.c
parent57440d52920f5ad76063089edd73c09f35951a87 (diff)
downloadrockbox-601ede7f9cc88cc40e074cc9d9cfdc2c0ba46d4c.tar.gz
rockbox-601ede7f9cc88cc40e074cc9d9cfdc2c0ba46d4c.zip
C optimisations to the predictor decoding - create a single function for decoding stereo streams, and reorganise to minimise the number of variables used. My -c1000 test track now decodes at 93% realtime on PortalPlayer (was 78%), 187% on Coldfire (was 170%) and 447% on Gigabeat (was 408%).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13608 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/demac/libdemac/decoder.c')
-rw-r--r--apps/codecs/demac/libdemac/decoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/codecs/demac/libdemac/decoder.c b/apps/codecs/demac/libdemac/decoder.c
index ba8c393a67..4f4a583d00 100644
--- a/apps/codecs/demac/libdemac/decoder.c
+++ b/apps/codecs/demac/libdemac/decoder.c
@@ -47,7 +47,7 @@ void init_frame_decoder(struct ape_ctx_t* ape_ctx,
47 //printf("CRC=0x%08x\n",ape_ctx->CRC); 47 //printf("CRC=0x%08x\n",ape_ctx->CRC);
48 //printf("Flags=0x%08x\n",ape_ctx->frameflags); 48 //printf("Flags=0x%08x\n",ape_ctx->frameflags);
49 49
50 init_predictor_decoder(ape_ctx); 50 init_predictor_decoder(&ape_ctx->predictor);
51 51
52 switch (ape_ctx->compressiontype) 52 switch (ape_ctx->compressiontype)
53 { 53 {
@@ -117,7 +117,7 @@ int decode_chunk(struct ape_ctx_t* ape_ctx,
117 } 117 }
118 118
119 /* Now apply the predictor decoding */ 119 /* Now apply the predictor decoding */
120 predictor_decode_mono(ape_ctx,decoded0,count); 120 predictor_decode_mono(&ape_ctx->predictor,decoded0,count);
121 121
122 if (ape_ctx->channels==2) { 122 if (ape_ctx->channels==2) {
123 /* Pseudo-stereo - just copy left channel to right channel */ 123 /* Pseudo-stereo - just copy left channel to right channel */
@@ -163,7 +163,7 @@ int decode_chunk(struct ape_ctx_t* ape_ctx,
163 } 163 }
164 164
165 /* Now apply the predictor decoding */ 165 /* Now apply the predictor decoding */
166 predictor_decode_stereo(ape_ctx,decoded0,decoded1,count); 166 predictor_decode_stereo(&ape_ctx->predictor,decoded0,decoded1,count);
167 167
168 if (ape_ctx->bps == 8) { 168 if (ape_ctx->bps == 8) {
169 /* TODO: Handle 8-bit streams */ 169 /* TODO: Handle 8-bit streams */