diff options
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/libwma/Makefile | 2 | ||||
-rw-r--r-- | apps/codecs/libwma/bitstream.h | 2 | ||||
-rw-r--r-- | apps/codecs/libwma/bswap.h | 25 | ||||
-rw-r--r-- | apps/codecs/libwma/ffmpeg_config.h | 11 |
4 files changed, 34 insertions, 6 deletions
diff --git a/apps/codecs/libwma/Makefile b/apps/codecs/libwma/Makefile index 0d7f966737..91ea49b1fb 100644 --- a/apps/codecs/libwma/Makefile +++ b/apps/codecs/libwma/Makefile | |||
@@ -14,7 +14,7 @@ ifdef APPEXTRA | |||
14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | 14 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) |
15 | endif | 15 | endif |
16 | 16 | ||
17 | WMAOPTS = -O2 | 17 | WMAOPTS = -O2 -DROCKBOX |
18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WMAOPTS) $(TARGET) \ | 18 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WMAOPTS) $(TARGET) \ |
19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1 | 19 | $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1 |
20 | 20 | ||
diff --git a/apps/codecs/libwma/bitstream.h b/apps/codecs/libwma/bitstream.h index c02845e09b..77ccff695e 100644 --- a/apps/codecs/libwma/bitstream.h +++ b/apps/codecs/libwma/bitstream.h | |||
@@ -203,7 +203,7 @@ typedef struct RL_VLC_ELEM { | |||
203 | #endif | 203 | #endif |
204 | 204 | ||
205 | /* used to avoid missaligned exceptions on some archs (alpha, ...) */ | 205 | /* used to avoid missaligned exceptions on some archs (alpha, ...) */ |
206 | #if defined(ARCH_X86) | 206 | #if defined(ARCH_X86) || defined(CPU_COLDFIRE) |
207 | # define unaligned16(a) (*(const uint16_t*)(a)) | 207 | # define unaligned16(a) (*(const uint16_t*)(a)) |
208 | # define unaligned32(a) (*(const uint32_t*)(a)) | 208 | # define unaligned32(a) (*(const uint32_t*)(a)) |
209 | # define unaligned64(a) (*(const uint64_t*)(a)) | 209 | # define unaligned64(a) (*(const uint64_t*)(a)) |
diff --git a/apps/codecs/libwma/bswap.h b/apps/codecs/libwma/bswap.h index 460f7abd40..33377cfcba 100644 --- a/apps/codecs/libwma/bswap.h +++ b/apps/codecs/libwma/bswap.h | |||
@@ -10,7 +10,28 @@ | |||
10 | #include <byteswap.h> | 10 | #include <byteswap.h> |
11 | #else | 11 | #else |
12 | 12 | ||
13 | #ifdef ARCH_X86 | 13 | #ifdef ROCKBOX |
14 | #include "codecs.h" | ||
15 | |||
16 | /* rockbox' optimised inline functions */ | ||
17 | #define bswap_16(x) swap16(x) | ||
18 | #define bswap_32(x) swap32(x) | ||
19 | |||
20 | static inline uint64_t ByteSwap64(uint64_t x) | ||
21 | { | ||
22 | union { | ||
23 | uint64_t ll; | ||
24 | struct { | ||
25 | uint32_t l,h; | ||
26 | } l; | ||
27 | } r; | ||
28 | r.l.l = bswap_32 (x); | ||
29 | r.l.h = bswap_32 (x>>32); | ||
30 | return r.ll; | ||
31 | } | ||
32 | #define bswap_64(x) ByteSwap64(x) | ||
33 | |||
34 | #elif defined(ARCH_X86) | ||
14 | static inline unsigned short ByteSwap16(unsigned short x) | 35 | static inline unsigned short ByteSwap16(unsigned short x) |
15 | { | 36 | { |
16 | __asm("xchgb %b0,%h0" : | 37 | __asm("xchgb %b0,%h0" : |
@@ -83,7 +104,7 @@ static inline uint64_t ByteSwap64(uint64_t x) | |||
83 | #else | 104 | #else |
84 | 105 | ||
85 | #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8) | 106 | #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8) |
86 | 107 | ||
87 | 108 | ||
88 | // code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc. | 109 | // code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc. |
89 | #define bswap_32(x) \ | 110 | #define bswap_32(x) \ |
diff --git a/apps/codecs/libwma/ffmpeg_config.h b/apps/codecs/libwma/ffmpeg_config.h index 40815cb54b..12b0666e42 100644 --- a/apps/codecs/libwma/ffmpeg_config.h +++ b/apps/codecs/libwma/ffmpeg_config.h | |||
@@ -1,7 +1,14 @@ | |||
1 | /* Automatically generated by configure - do not modify */ | 1 | /* Automatically generated by configure - do not modify */ |
2 | #ifndef _CONFIG_H | 2 | #ifndef _FFMPEG_CONFIG_H |
3 | #define _CONFIG_H | 3 | #define _FFMPEG_CONFIG_H |
4 | #include "codecs.h" | ||
4 | 5 | ||
6 | #ifdef CPU_ARM | ||
5 | #define CONFIG_ALIGN 1 | 7 | #define CONFIG_ALIGN 1 |
8 | #endif | ||
9 | |||
10 | #ifdef ROCKBOX_BIG_ENDIAN | ||
11 | #define WORDS_BIGENDIAN | ||
12 | #endif | ||
6 | 13 | ||
7 | #endif | 14 | #endif |