diff options
Diffstat (limited to 'apps/codecs/demac/libdemac')
-rw-r--r-- | apps/codecs/demac/libdemac/decoder.c | 10 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/entropy.c | 12 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/entropy.h | 12 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/filter.c | 6 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/filter.h | 15 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/predictor.c | 18 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/predictor.h | 6 |
7 files changed, 38 insertions, 41 deletions
diff --git a/apps/codecs/demac/libdemac/decoder.c b/apps/codecs/demac/libdemac/decoder.c index 31bcb28b72..30ab2bd359 100644 --- a/apps/codecs/demac/libdemac/decoder.c +++ b/apps/codecs/demac/libdemac/decoder.c | |||
@@ -82,7 +82,6 @@ int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx, | |||
82 | int32_t* decoded0, int32_t* decoded1, | 82 | int32_t* decoded0, int32_t* decoded1, |
83 | int count) | 83 | int count) |
84 | { | 84 | { |
85 | int res; | ||
86 | int32_t left, right; | 85 | int32_t left, right; |
87 | #ifdef ROCKBOX | 86 | #ifdef ROCKBOX |
88 | int scale = (APE_OUTPUT_DEPTH - ape_ctx->bps); | 87 | int scale = (APE_OUTPUT_DEPTH - ape_ctx->bps); |
@@ -93,11 +92,11 @@ int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx, | |||
93 | 92 | ||
94 | if ((ape_ctx->channels==1) || (ape_ctx->frameflags & APE_FRAMECODE_PSEUDO_STEREO)) { | 93 | if ((ape_ctx->channels==1) || (ape_ctx->frameflags & APE_FRAMECODE_PSEUDO_STEREO)) { |
95 | if (ape_ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) { | 94 | if (ape_ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) { |
96 | res = entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, decoded1, count); | 95 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, decoded1, count); |
97 | /* We are pure silence, so we're done. */ | 96 | /* We are pure silence, so we're done. */ |
98 | return 0; | 97 | return 0; |
99 | } else { | 98 | } else { |
100 | res = entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, NULL, count); | 99 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, NULL, count); |
101 | } | 100 | } |
102 | 101 | ||
103 | switch (ape_ctx->compressiontype) | 102 | switch (ape_ctx->compressiontype) |
@@ -143,7 +142,7 @@ int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx, | |||
143 | return 0; | 142 | return 0; |
144 | } | 143 | } |
145 | 144 | ||
146 | res = entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, decoded1, count); | 145 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, decoded1, count); |
147 | 146 | ||
148 | /* Apply filters - compression type 1000 doesn't have any */ | 147 | /* Apply filters - compression type 1000 doesn't have any */ |
149 | switch (ape_ctx->compressiontype) | 148 | switch (ape_ctx->compressiontype) |
@@ -184,6 +183,5 @@ int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx, | |||
184 | } | 183 | } |
185 | } | 184 | } |
186 | } | 185 | } |
187 | 186 | return 0; | |
188 | return res; | ||
189 | } | 187 | } |
diff --git a/apps/codecs/demac/libdemac/entropy.c b/apps/codecs/demac/libdemac/entropy.c index e8561122a7..54b5cc57b6 100644 --- a/apps/codecs/demac/libdemac/entropy.c +++ b/apps/codecs/demac/libdemac/entropy.c | |||
@@ -419,11 +419,11 @@ void init_entropy_decoder(struct ape_ctx_t* ape_ctx, | |||
419 | *firstbyte = bytebufferoffset; | 419 | *firstbyte = bytebufferoffset; |
420 | } | 420 | } |
421 | 421 | ||
422 | int ICODE_ATTR_DEMAC entropy_decode(struct ape_ctx_t* ape_ctx, | 422 | void ICODE_ATTR_DEMAC entropy_decode(struct ape_ctx_t* ape_ctx, |
423 | unsigned char* inbuffer, int* firstbyte, | 423 | unsigned char* inbuffer, int* firstbyte, |
424 | int* bytesconsumed, | 424 | int* bytesconsumed, |
425 | int32_t* decoded0, int32_t* decoded1, | 425 | int32_t* decoded0, int32_t* decoded1, |
426 | int blockstodecode) | 426 | int blockstodecode) |
427 | { | 427 | { |
428 | bytebuffer = inbuffer; | 428 | bytebuffer = inbuffer; |
429 | bytebufferoffset = *firstbyte; | 429 | bytebufferoffset = *firstbyte; |
@@ -458,6 +458,4 @@ int ICODE_ATTR_DEMAC entropy_decode(struct ape_ctx_t* ape_ctx, | |||
458 | /* Return the new state of the buffer */ | 458 | /* Return the new state of the buffer */ |
459 | *bytesconsumed = bytebuffer - inbuffer; | 459 | *bytesconsumed = bytebuffer - inbuffer; |
460 | *firstbyte = bytebufferoffset; | 460 | *firstbyte = bytebufferoffset; |
461 | |||
462 | return(0); | ||
463 | } | 461 | } |
diff --git a/apps/codecs/demac/libdemac/entropy.h b/apps/codecs/demac/libdemac/entropy.h index dd6736cb15..fac2a44d99 100644 --- a/apps/codecs/demac/libdemac/entropy.h +++ b/apps/codecs/demac/libdemac/entropy.h | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | libdemac - A Monkey's Audio decoder | 3 | libdemac - A Monkey's Audio decoder |
4 | 4 | ||
5 | $Id:$ | 5 | $Id$ |
6 | 6 | ||
7 | Copyright (C) Dave Chapman 2007 | 7 | Copyright (C) Dave Chapman 2007 |
8 | 8 | ||
@@ -31,10 +31,10 @@ void init_entropy_decoder(struct ape_ctx_t* ape_ctx, | |||
31 | unsigned char* inbuffer, int* firstbyte, | 31 | unsigned char* inbuffer, int* firstbyte, |
32 | int* bytesconsumed); | 32 | int* bytesconsumed); |
33 | 33 | ||
34 | int entropy_decode(struct ape_ctx_t* ape_ctx, | 34 | void entropy_decode(struct ape_ctx_t* ape_ctx, |
35 | unsigned char* inbuffer, int* firstbyte, | 35 | unsigned char* inbuffer, int* firstbyte, |
36 | int* bytesconsumed, | 36 | int* bytesconsumed, |
37 | int32_t* decoded0, int32_t* decoded1, | 37 | int32_t* decoded0, int32_t* decoded1, |
38 | int blockstodecode); | 38 | int blockstodecode); |
39 | 39 | ||
40 | #endif | 40 | #endif |
diff --git a/apps/codecs/demac/libdemac/filter.c b/apps/codecs/demac/libdemac/filter.c index d66bdc69b0..4a3eb74744 100644 --- a/apps/codecs/demac/libdemac/filter.c +++ b/apps/codecs/demac/libdemac/filter.c | |||
@@ -237,8 +237,8 @@ void INIT_FILTER(filter_int* buf) | |||
237 | do_init_filter(&filter1, buf + ORDER*3 + FILTER_HISTORY_SIZE); | 237 | do_init_filter(&filter1, buf + ORDER*3 + FILTER_HISTORY_SIZE); |
238 | } | 238 | } |
239 | 239 | ||
240 | int ICODE_ATTR_DEMAC APPLY_FILTER(int fileversion, int32_t* data0, | 240 | void ICODE_ATTR_DEMAC APPLY_FILTER(int fileversion, int32_t* data0, |
241 | int32_t* data1, int count) | 241 | int32_t* data1, int count) |
242 | { | 242 | { |
243 | if (fileversion >= 3980) { | 243 | if (fileversion >= 3980) { |
244 | do_apply_filter_3980(&filter0, data0, count); | 244 | do_apply_filter_3980(&filter0, data0, count); |
@@ -249,6 +249,4 @@ int ICODE_ATTR_DEMAC APPLY_FILTER(int fileversion, int32_t* data0, | |||
249 | if (data1 != NULL) | 249 | if (data1 != NULL) |
250 | do_apply_filter_3970(&filter1, data1, count); | 250 | do_apply_filter_3970(&filter1, data1, count); |
251 | } | 251 | } |
252 | |||
253 | return 0; | ||
254 | } | 252 | } |
diff --git a/apps/codecs/demac/libdemac/filter.h b/apps/codecs/demac/libdemac/filter.h index bbe51d4572..bfd0c552a6 100644 --- a/apps/codecs/demac/libdemac/filter.h +++ b/apps/codecs/demac/libdemac/filter.h | |||
@@ -28,18 +28,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | |||
28 | #include "demac_config.h" | 28 | #include "demac_config.h" |
29 | 29 | ||
30 | void init_filter_16_11(filter_int* buf); | 30 | void init_filter_16_11(filter_int* buf); |
31 | int apply_filter_16_11(int fileversion, int32_t* decoded0, int32_t* decoded1, int count); | 31 | void apply_filter_16_11(int fileversion, int32_t* decoded0, |
32 | int32_t* decoded1, int count); | ||
32 | 33 | ||
33 | void init_filter_64_11(filter_int* buf); | 34 | void init_filter_64_11(filter_int* buf); |
34 | int apply_filter_64_11(int fileversion, int32_t* decoded0, int32_t* decoded1, int count); | 35 | void apply_filter_64_11(int fileversion, int32_t* decoded0, |
36 | int32_t* decoded1, int count); | ||
35 | 37 | ||
36 | void init_filter_32_10(filter_int* buf); | 38 | void init_filter_32_10(filter_int* buf); |
37 | int apply_filter_32_10(int fileversion, int32_t* decoded0, int32_t* decoded1, int count); | 39 | void apply_filter_32_10(int fileversion, int32_t* decoded0, |
40 | int32_t* decoded1, int count); | ||
38 | 41 | ||
39 | void init_filter_256_13(filter_int* buf); | 42 | void init_filter_256_13(filter_int* buf); |
40 | int apply_filter_256_13(int fileversion, int32_t* decoded0, int32_t* decoded1, int count); | 43 | void apply_filter_256_13(int fileversion, int32_t* decoded0, |
44 | int32_t* decoded1, int count); | ||
41 | 45 | ||
42 | void init_filter_1280_15(filter_int* buf); | 46 | void init_filter_1280_15(filter_int* buf); |
43 | int apply_filter_1280_15(int fileversion, int32_t* decoded0, int32_t* decoded1, int count); | 47 | void apply_filter_1280_15(int fileversion, int32_t* decoded0, |
48 | int32_t* decoded1, int count); | ||
44 | 49 | ||
45 | #endif | 50 | #endif |
diff --git a/apps/codecs/demac/libdemac/predictor.c b/apps/codecs/demac/libdemac/predictor.c index 67a17f4b5d..d4f886fb8c 100644 --- a/apps/codecs/demac/libdemac/predictor.c +++ b/apps/codecs/demac/libdemac/predictor.c | |||
@@ -68,10 +68,10 @@ void init_predictor_decoder(struct predictor_t* p) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | #if !defined(CPU_ARM) && !defined(CPU_COLDFIRE) | 70 | #if !defined(CPU_ARM) && !defined(CPU_COLDFIRE) |
71 | int ICODE_ATTR_DEMAC predictor_decode_stereo(struct predictor_t* p, | 71 | void ICODE_ATTR_DEMAC predictor_decode_stereo(struct predictor_t* p, |
72 | int32_t* decoded0, | 72 | int32_t* decoded0, |
73 | int32_t* decoded1, | 73 | int32_t* decoded1, |
74 | int count) | 74 | int count) |
75 | { | 75 | { |
76 | int32_t predictionA, predictionB; | 76 | int32_t predictionA, predictionB; |
77 | 77 | ||
@@ -208,14 +208,12 @@ int ICODE_ATTR_DEMAC predictor_decode_stereo(struct predictor_t* p, | |||
208 | p->buf = p->historybuffer; | 208 | p->buf = p->historybuffer; |
209 | } | 209 | } |
210 | } | 210 | } |
211 | |||
212 | return 0; | ||
213 | } | 211 | } |
214 | #endif | 212 | #endif |
215 | 213 | ||
216 | int ICODE_ATTR_DEMAC predictor_decode_mono(struct predictor_t* p, | 214 | void ICODE_ATTR_DEMAC predictor_decode_mono(struct predictor_t* p, |
217 | int32_t* decoded0, | 215 | int32_t* decoded0, |
218 | int count) | 216 | int count) |
219 | { | 217 | { |
220 | int32_t predictionA, currentA, A; | 218 | int32_t predictionA, currentA, A; |
221 | 219 | ||
@@ -270,6 +268,4 @@ int ICODE_ATTR_DEMAC predictor_decode_mono(struct predictor_t* p, | |||
270 | } | 268 | } |
271 | 269 | ||
272 | p->YlastA = currentA; | 270 | p->YlastA = currentA; |
273 | |||
274 | return 0; | ||
275 | } | 271 | } |
diff --git a/apps/codecs/demac/libdemac/predictor.h b/apps/codecs/demac/libdemac/predictor.h index df2ba629e6..6a0a81983b 100644 --- a/apps/codecs/demac/libdemac/predictor.h +++ b/apps/codecs/demac/libdemac/predictor.h | |||
@@ -30,7 +30,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | |||
30 | #include "filter.h" | 30 | #include "filter.h" |
31 | 31 | ||
32 | void init_predictor_decoder(struct predictor_t* p); | 32 | void init_predictor_decoder(struct predictor_t* p); |
33 | int predictor_decode_stereo(struct predictor_t* p, int32_t* decoded0, int32_t* decoded1, int count); | 33 | void predictor_decode_stereo(struct predictor_t* p, int32_t* decoded0, |
34 | int predictor_decode_mono(struct predictor_t* p, int32_t* decoded0, int count); | 34 | int32_t* decoded1, int count); |
35 | void predictor_decode_mono(struct predictor_t* p, int32_t* decoded0, | ||
36 | int count); | ||
35 | 37 | ||
36 | #endif | 38 | #endif |