diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-10-16 22:55:40 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-10-16 22:55:40 +0000 |
commit | fc43b9df823af80dd1c9cf7dc1b5de6703944043 (patch) | |
tree | bb17b985d00d13bc6fce61823acbe50ed1e003b0 /apps/plugins/mpegplayer/idct.c | |
parent | 84f5c5c3e3590cb993f4cf2a7eba5979e3bc825b (diff) | |
download | rockbox-fc43b9df823af80dd1c9cf7dc1b5de6703944043.tar.gz rockbox-fc43b9df823af80dd1c9cf7dc1b5de6703944043.zip |
Mpegplayer: Assembler optimised IDCT for coldfire, based on FS #5995 by Karim Boucher. Put the IDCT block buffer in IRAM for better performance. The whole libmpeg2 decoder struct doesn't fit without throwing some libmad buffers out of IRAM, but then doesn't change performance significantly. Mpegplayer is quite usable now on X5; H300 is sort-of usable for widescreen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15156 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/idct.c')
-rw-r--r-- | apps/plugins/mpegplayer/idct.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/plugins/mpegplayer/idct.c b/apps/plugins/mpegplayer/idct.c index bf705c6a2f..bf7097401e 100644 --- a/apps/plugins/mpegplayer/idct.c +++ b/apps/plugins/mpegplayer/idct.c | |||
@@ -76,6 +76,14 @@ uint8_t mpeg2_clip[3840 * 2 + 256] IBSS_ATTR; | |||
76 | #define CLIP(i) ((mpeg2_clip + 3840)[i]) | 76 | #define CLIP(i) ((mpeg2_clip + 3840)[i]) |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifdef CPU_COLDFIRE | ||
80 | /* assembler functions */ | ||
81 | extern void mpeg2_idct_copy_coldfire(int16_t * block, uint8_t * dest, | ||
82 | const int stride); | ||
83 | extern void mpeg2_idct_add_coldfire(const int last, int16_t * block, | ||
84 | uint8_t * dest, const int stride); | ||
85 | #else /* !CPU_COLDFIE */ | ||
86 | |||
79 | #if 0 | 87 | #if 0 |
80 | #define BUTTERFLY(t0,t1,W0,W1,d0,d1) \ | 88 | #define BUTTERFLY(t0,t1,W0,W1,d0,d1) \ |
81 | do { \ | 89 | do { \ |
@@ -258,6 +266,8 @@ static void mpeg2_idct_add_c (const int last, int16_t * block, | |||
258 | } | 266 | } |
259 | } | 267 | } |
260 | 268 | ||
269 | #endif /* !CPU_COLDFIRE */ | ||
270 | |||
261 | void mpeg2_idct_init (void) | 271 | void mpeg2_idct_init (void) |
262 | { | 272 | { |
263 | extern uint8_t default_mpeg2_scan_norm[64]; | 273 | extern uint8_t default_mpeg2_scan_norm[64]; |
@@ -266,8 +276,13 @@ void mpeg2_idct_init (void) | |||
266 | extern uint8_t mpeg2_scan_alt[64]; | 276 | extern uint8_t mpeg2_scan_alt[64]; |
267 | int i, j; | 277 | int i, j; |
268 | 278 | ||
279 | #ifdef CPU_COLDFIRE | ||
280 | mpeg2_idct_copy = mpeg2_idct_copy_coldfire; | ||
281 | mpeg2_idct_add = mpeg2_idct_add_coldfire; | ||
282 | #else | ||
269 | mpeg2_idct_copy = mpeg2_idct_copy_c; | 283 | mpeg2_idct_copy = mpeg2_idct_copy_c; |
270 | mpeg2_idct_add = mpeg2_idct_add_c; | 284 | mpeg2_idct_add = mpeg2_idct_add_c; |
285 | #endif | ||
271 | 286 | ||
272 | #if !defined(CPU_COLDFIRE) && !defined(CPU_ARM) | 287 | #if !defined(CPU_COLDFIRE) && !defined(CPU_ARM) |
273 | for (i = -3840; i < 3840 + 256; i++) | 288 | for (i = -3840; i < 3840 + 256; i++) |