diff options
author | Dave Chapman <dave@dchapman.com> | 2007-07-04 20:27:26 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2007-07-04 20:27:26 +0000 |
commit | ba3f4ed565ed9fdfb696f44193958e68d6acc19f (patch) | |
tree | c032043a2e55adbf03d6298bb9f3115d3f1dea84 /apps/codecs | |
parent | e7cdd6cbc6040c3c6225580ba155edfdfd35efb1 (diff) | |
download | rockbox-ba3f4ed565ed9fdfb696f44193958e68d6acc19f.tar.gz rockbox-ba3f4ed565ed9fdfb696f44193958e68d6acc19f.zip |
Remove some unused code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13788 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/libwma/bswap.h | 127 | ||||
-rw-r--r-- | apps/codecs/libwma/wmadeci.c | 22 |
2 files changed, 0 insertions, 149 deletions
diff --git a/apps/codecs/libwma/bswap.h b/apps/codecs/libwma/bswap.h deleted file mode 100644 index cacaac488d..0000000000 --- a/apps/codecs/libwma/bswap.h +++ /dev/null | |||
@@ -1,127 +0,0 @@ | |||
1 | /** | ||
2 | * @file bswap.h | ||
3 | * byte swap. | ||
4 | */ | ||
5 | |||
6 | #ifndef __BSWAP_H__ | ||
7 | #define __BSWAP_H__ | ||
8 | |||
9 | #include <config.h> | ||
10 | |||
11 | #ifdef ARCH_X86 | ||
12 | static inline unsigned short ByteSwap16(unsigned short x) | ||
13 | { | ||
14 | __asm("xchgb %b0,%h0" : | ||
15 | "=q" (x) : | ||
16 | "0" (x)); | ||
17 | return x; | ||
18 | } | ||
19 | #define bswap_16(x) ByteSwap16(x) | ||
20 | |||
21 | static inline unsigned int ByteSwap32(unsigned int x) | ||
22 | { | ||
23 | #if __CPU__ > 386 | ||
24 | __asm("bswap %0": | ||
25 | "=r" (x) : | ||
26 | #else | ||
27 | __asm("xchgb %b0,%h0\n" | ||
28 | " rorl $16,%0\n" | ||
29 | " xchgb %b0,%h0": | ||
30 | "=q" (x) : | ||
31 | #endif | ||
32 | "0" (x)); | ||
33 | return x; | ||
34 | } | ||
35 | #define bswap_32(x) ByteSwap32(x) | ||
36 | |||
37 | static inline unsigned long long int ByteSwap64(unsigned long long int x) | ||
38 | { | ||
39 | register union { __extension__ uint64_t __ll; | ||
40 | uint32_t __l[2]; } __x; | ||
41 | asm("xchgl %0,%1": | ||
42 | "=r"(__x.__l[0]),"=r"(__x.__l[1]): | ||
43 | "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32)))); | ||
44 | return __x.__ll; | ||
45 | } | ||
46 | #define bswap_64(x) ByteSwap64(x) | ||
47 | |||
48 | #elif defined(ARCH_SH4) | ||
49 | |||
50 | static inline uint16_t ByteSwap16(uint16_t x) { | ||
51 | __asm__("swap.b %0,%0":"=r"(x):"0"(x)); | ||
52 | return x; | ||
53 | } | ||
54 | |||
55 | static inline uint32_t ByteSwap32(uint32_t x) { | ||
56 | __asm__( | ||
57 | "swap.b %0,%0\n" | ||
58 | "swap.w %0,%0\n" | ||
59 | "swap.b %0,%0\n" | ||
60 | :"=r"(x):"0"(x)); | ||
61 | return x; | ||
62 | } | ||
63 | |||
64 | #define bswap_16(x) ByteSwap16(x) | ||
65 | #define bswap_32(x) ByteSwap32(x) | ||
66 | |||
67 | static inline uint64_t ByteSwap64(uint64_t x) | ||
68 | { | ||
69 | union { | ||
70 | uint64_t ll; | ||
71 | struct { | ||
72 | uint32_t l,h; | ||
73 | } l; | ||
74 | } r; | ||
75 | r.l.l = bswap_32 (x); | ||
76 | r.l.h = bswap_32 (x>>32); | ||
77 | return r.ll; | ||
78 | } | ||
79 | #define bswap_64(x) ByteSwap64(x) | ||
80 | |||
81 | #else | ||
82 | |||
83 | #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8) | ||
84 | |||
85 | |||
86 | // code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc. | ||
87 | #define bswap_32(x) \ | ||
88 | ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ | ||
89 | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) | ||
90 | |||
91 | static inline uint64_t ByteSwap64(uint64_t x) | ||
92 | { | ||
93 | union { | ||
94 | uint64_t ll; | ||
95 | uint32_t l[2]; | ||
96 | } w, r; | ||
97 | w.ll = x; | ||
98 | r.l[0] = bswap_32 (w.l[1]); | ||
99 | r.l[1] = bswap_32 (w.l[0]); | ||
100 | return r.ll; | ||
101 | } | ||
102 | #define bswap_64(x) ByteSwap64(x) | ||
103 | |||
104 | #endif /* !ARCH_X86 */ | ||
105 | |||
106 | #endif /* !HAVE_BYTESWAP_H */ | ||
107 | |||
108 | // be2me ... BigEndian to MachineEndian | ||
109 | // le2me ... LittleEndian to MachineEndian | ||
110 | |||
111 | #ifdef ROCKBOX_BIG_ENDIAN | ||
112 | #define be2me_16(x) (x) | ||
113 | #define be2me_32(x) (x) | ||
114 | #define be2me_64(x) (x) | ||
115 | #define le2me_16(x) bswap_16(x) | ||
116 | #define le2me_32(x) bswap_32(x) | ||
117 | #define le2me_64(x) bswap_64(x) | ||
118 | #else | ||
119 | #define be2me_16(x) bswap_16(x) | ||
120 | #define be2me_32(x) bswap_32(x) | ||
121 | #define be2me_64(x) bswap_64(x) | ||
122 | #define le2me_16(x) (x) | ||
123 | #define le2me_32(x) (x) | ||
124 | #define le2me_64(x) (x) | ||
125 | #endif | ||
126 | |||
127 | #endif /* __BSWAP_H__ */ | ||
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c index 29651382e2..e48720c043 100644 --- a/apps/codecs/libwma/wmadeci.c +++ b/apps/codecs/libwma/wmadeci.c | |||
@@ -28,28 +28,6 @@ | |||
28 | #include "wmadec.h" | 28 | #include "wmadec.h" |
29 | #include "wmafixed.c" | 29 | #include "wmafixed.c" |
30 | 30 | ||
31 | |||
32 | |||
33 | #define ALT_BITSTREAM_READER | ||
34 | |||
35 | #define unaligned32(a) (*(uint32_t*)(a)) | ||
36 | |||
37 | uint16_t bswap_16(uint16_t x) | ||
38 | { | ||
39 | uint16_t hi = x & 0xff00; | ||
40 | uint16_t lo = x & 0x00ff; | ||
41 | return (hi >> 8) | (lo << 8); | ||
42 | } | ||
43 | |||
44 | uint32_t bswap_32(uint32_t x) | ||
45 | { | ||
46 | uint32_t b1 = x & 0xff000000; | ||
47 | uint32_t b2 = x & 0x00ff0000; | ||
48 | uint32_t b3 = x & 0x0000ff00; | ||
49 | uint32_t b4 = x & 0x000000ff; | ||
50 | return (b1 >> 24) | (b2 >> 8) | (b3 << 8) | (b4 << 24); | ||
51 | } | ||
52 | |||
53 | #ifdef CPU_ARM | 31 | #ifdef CPU_ARM |
54 | static inline | 32 | static inline |
55 | void CMUL(fixed32 *x, fixed32 *y, | 33 | void CMUL(fixed32 *x, fixed32 *y, |