summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-12-29 19:46:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-12-29 19:46:35 +0000
commita222f27c4a17ed8f9809cda7861fe5f23d4cc0c1 (patch)
treed393a23d83549f99772bb156e59ffb88725148b6 /firmware
parent1d0f6b90ff43776e55b4b9f062c9bea3f99aa768 (diff)
downloadrockbox-a222f27c4a17ed8f9809cda7861fe5f23d4cc0c1.tar.gz
rockbox-a222f27c4a17ed8f9809cda7861fe5f23d4cc0c1.zip
mpegplayer: Make playback engine fully seekable and frame-accurate and split into logical parts. Be sure to have all current features work. Actual UI for seeking will be added soon. Recommended GOP size is about 15-30 frames depending on target or seeking can be slow with really long GOPs (nature of MPEG video). More refined encoding recommendations for a particular player should be posted soon.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15977 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/system.h12
-rw-r--r--firmware/export/thread.h11
-rw-r--r--firmware/general.c3
3 files changed, 19 insertions, 7 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index cba4b81631..b973b57fd9 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -243,16 +243,18 @@ static inline uint32_t swap_odd_even32(uint32_t value)
243#define CACHEALIGN_DOWN(x) \ 243#define CACHEALIGN_DOWN(x) \
244 ((typeof (x))ALIGN_DOWN_P2((uintptr_t)(x), CACHEALIGN_BITS)) 244 ((typeof (x))ALIGN_DOWN_P2((uintptr_t)(x), CACHEALIGN_BITS))
245/* Aligns at least to the greater of size x or CACHEALIGN_SIZE */ 245/* Aligns at least to the greater of size x or CACHEALIGN_SIZE */
246#define CACHEALIGN_AT_LEAST_ATTR(x) __attribute__((aligned(CACHEALIGN_UP(x)))) 246#define CACHEALIGN_AT_LEAST_ATTR(x) \
247 __attribute__((aligned(CACHEALIGN_UP(x))))
247/* Aligns a buffer pointer and size to proper boundaries */ 248/* Aligns a buffer pointer and size to proper boundaries */
248#define CACHEALIGN_BUFFER(start, size) \ 249#define CACHEALIGN_BUFFER(start, size) \
249 ({ align_buffer((start), (size), CACHEALIGN_SIZE); }) 250 ({ align_buffer(PUN_PTR(void **, (start)), (size), CACHEALIGN_SIZE); })
250 251
251#else /* ndef PROC_NEEDS_CACHEALIGN */ 252#else /* ndef PROC_NEEDS_CACHEALIGN */
252 253
253/* Cache alignment attributes and sizes are not enabled */ 254/* Cache alignment attributes and sizes are not enabled */
254#define CACHEALIGN_ATTR 255#define CACHEALIGN_ATTR
255#define CACHEALIGN_AT_LEAST_ATTR(x) __attribute__((aligned(x))) 256#define CACHEALIGN_AT_LEAST_ATTR(x) \
257 __attribute__((aligned(x)))
256#define CACHEALIGN_UP(x) (x) 258#define CACHEALIGN_UP(x) (x)
257#define CACHEALIGN_DOWN(x) (x) 259#define CACHEALIGN_DOWN(x) (x)
258/* Make no adjustments */ 260/* Make no adjustments */
@@ -261,4 +263,8 @@ static inline uint32_t swap_odd_even32(uint32_t value)
261 263
262#endif /* PROC_NEEDS_CACHEALIGN */ 264#endif /* PROC_NEEDS_CACHEALIGN */
263 265
266/* Double-cast to avoid 'dereferencing type-punned pointer will
267 * break strict aliasing rules' B.S. */
268#define PUN_PTR(type, p) ((type)(intptr_t)(p))
269
264#endif /* __SYSTEM_H__ */ 270#endif /* __SYSTEM_H__ */
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index df18f7b095..0b1500cd99 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -42,11 +42,20 @@
42#define PRIORITY_SYSTEM 6 /* All other firmware threads */ 42#define PRIORITY_SYSTEM 6 /* All other firmware threads */
43#define PRIORITY_BACKGROUND 8 /* Normal application threads */ 43#define PRIORITY_BACKGROUND 8 /* Normal application threads */
44 44
45/* TODO: Only a minor tweak to create_thread would be needed to let
46 * thread slots be caller allocated - no essential threading functionality
47 * depends upon an array */
45#if CONFIG_CODEC == SWCODEC 48#if CONFIG_CODEC == SWCODEC
49
50#ifdef HAVE_RECORDING
51#define MAXTHREADS 18
52#else
46#define MAXTHREADS 17 53#define MAXTHREADS 17
54#endif
55
47#else 56#else
48#define MAXTHREADS 11 57#define MAXTHREADS 11
49#endif 58#endif /* CONFIG_CODE == * */
50 59
51#define DEFAULT_STACK_SIZE 0x400 /* Bytes */ 60#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
52 61
diff --git a/firmware/general.c b/firmware/general.c
index cc3710c8f3..117e6c3548 100644
--- a/firmware/general.c
+++ b/firmware/general.c
@@ -77,8 +77,6 @@ int make_list_from_caps32(unsigned long src_mask,
77 return count; 77 return count;
78} /* make_list_from_caps32 */ 78} /* make_list_from_caps32 */
79 79
80/* Only needed for cache aligning atm */
81#ifdef PROC_NEEDS_CACHEALIGN
82/* Align a buffer and size to a size boundary while remaining within 80/* Align a buffer and size to a size boundary while remaining within
83 * the original boundaries */ 81 * the original boundaries */
84size_t align_buffer(void **start, size_t size, size_t align) 82size_t align_buffer(void **start, size_t size, size_t align)
@@ -98,4 +96,3 @@ size_t align_buffer(void **start, size_t size, size_t align)
98 *start = newstart; 96 *start = newstart;
99 return newend - newstart; 97 return newend - newstart;
100} 98}
101#endif /* PROC_NEEDS_CACHEALIGN */