summaryrefslogtreecommitdiff
path: root/apps/codecs/demac/libdemac/decoder.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-10-03 21:40:32 +0000
committerJens Arnold <amiconn@rockbox.org>2008-10-03 21:40:32 +0000
commitd1b19be423ab5fc62a7d16b26813b9624bf57709 (patch)
tree01ad3fe534efbb614b82712ecf419f99edfc349b /apps/codecs/demac/libdemac/decoder.c
parent66fe9a462c5093003a0b65239b54b44f6395b342 (diff)
downloadrockbox-d1b19be423ab5fc62a7d16b26813b9624bf57709.tar.gz
rockbox-d1b19be423ab5fc62a7d16b26813b9624bf57709.zip
Various speedups: (1) Put actual decoding functions into IRAM on PP5002. (2) Put the insane filter buffer into IRAM on coldfire and PP502x (just for completeness, as long as there's no better use). (3) Use the ARMv6 'ssat' instruction for saturation on Gigabeat S.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18701 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/demac/libdemac/decoder.c')
-rw-r--r--apps/codecs/demac/libdemac/decoder.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/codecs/demac/libdemac/decoder.c b/apps/codecs/demac/libdemac/decoder.c
index 326e893ec4..f6c2451c0c 100644
--- a/apps/codecs/demac/libdemac/decoder.c
+++ b/apps/codecs/demac/libdemac/decoder.c
@@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
29#include "predictor.h" 29#include "predictor.h"
30#include "entropy.h" 30#include "entropy.h"
31#include "filter.h" 31#include "filter.h"
32#include "demac_iram.h"
32 33
33/* Statically allocate the filter buffers */ 34/* Statically allocate the filter buffers */
34 35
@@ -40,7 +41,7 @@ static int16_t filterbuf256[(256*3 + HISTORY_SIZE) * 2] /* 5120 bytes */
40/* This is only needed for "insane" files, and no Rockbox targets can 41/* This is only needed for "insane" files, and no Rockbox targets can
41 hope to decode them in realtime anyway. */ 42 hope to decode them in realtime anyway. */
42static int16_t filterbuf1280[(1280*3 + HISTORY_SIZE) * 2] /* 17408 bytes */ 43static int16_t filterbuf1280[(1280*3 + HISTORY_SIZE) * 2] /* 17408 bytes */
43 __attribute__((aligned(16))); 44 IBSS_ATTR_DEMAC_INSANEBUF __attribute__((aligned(16)));
44 45
45void init_frame_decoder(struct ape_ctx_t* ape_ctx, 46void init_frame_decoder(struct ape_ctx_t* ape_ctx,
46 unsigned char* inbuffer, int* firstbyte, 47 unsigned char* inbuffer, int* firstbyte,
@@ -74,11 +75,11 @@ void init_frame_decoder(struct ape_ctx_t* ape_ctx,
74 } 75 }
75} 76}
76 77
77int decode_chunk(struct ape_ctx_t* ape_ctx, 78int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx,
78 unsigned char* inbuffer, int* firstbyte, 79 unsigned char* inbuffer, int* firstbyte,
79 int* bytesconsumed, 80 int* bytesconsumed,
80 int32_t* decoded0, int32_t* decoded1, 81 int32_t* decoded0, int32_t* decoded1,
81 int count) 82 int count)
82{ 83{
83 int res; 84 int res;
84 int32_t left, right; 85 int32_t left, right;