diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2007-07-12 22:12:25 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2007-07-12 22:12:25 +0000 |
| commit | 42bd5b46f09556e04994981e83d8da397912a303 (patch) | |
| tree | 7f8d3bd685ff7719d257874459eac131724cd372 | |
| parent | d7dd23939a9b9130ca26f94f122efd08e10bcc33 (diff) | |
| download | rockbox-42bd5b46f09556e04994981e83d8da397912a303.zip rockbox-42bd5b46f09556e04994981e83d8da397912a303.tar.gz rockbox-42bd5b46f09556e04994981e83d8da397912a303.tar.bz2 rockbox-42bd5b46f09556e04994981e83d8da397912a303.tar.xz | |
WMA codec: Coldfire is capable of unaligned memory accesses, so lets make use of it. ~1.5% speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13865 a1c6a512-1295-4272-9138-f99709370657
| -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 0d7f966..91ea49b 100644 --- a/apps/codecs/libwma/Makefile +++ b/apps/codecs/libwma/Makefile @@ -14,7 +14,7 @@ ifdef APPEXTRA INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) endif -WMAOPTS = -O2 +WMAOPTS = -O2 -DROCKBOX CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WMAOPTS) $(TARGET) \ $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1 diff --git a/apps/codecs/libwma/bitstream.h b/apps/codecs/libwma/bitstream.h index c02845e..77ccff6 100644 --- a/apps/codecs/libwma/bitstream.h +++ b/apps/codecs/libwma/bitstream.h @@ -203,7 +203,7 @@ typedef struct RL_VLC_ELEM { #endif /* used to avoid missaligned exceptions on some archs (alpha, ...) */ -#if defined(ARCH_X86) +#if defined(ARCH_X86) || defined(CPU_COLDFIRE) # define unaligned16(a) (*(const uint16_t*)(a)) # define unaligned32(a) (*(const uint32_t*)(a)) # define unaligned64(a) (*(const uint64_t*)(a)) diff --git a/apps/codecs/libwma/bswap.h b/apps/codecs/libwma/bswap.h index 460f7ab..33377cf 100644 --- a/apps/codecs/libwma/bswap.h +++ b/apps/codecs/libwma/bswap.h @@ -10,7 +10,28 @@ #include <byteswap.h> #else -#ifdef ARCH_X86 +#ifdef ROCKBOX +#include "codecs.h" + +/* rockbox' optimised inline functions */ +#define bswap_16(x) swap16(x) +#define bswap_32(x) swap32(x) + +static inline uint64_t ByteSwap64(uint64_t x) +{ + union { + uint64_t ll; + struct { + uint32_t l,h; + } l; + } r; + r.l.l = bswap_32 (x); + r.l.h = bswap_32 (x>>32); + return r.ll; +} +#define bswap_64(x) ByteSwap64(x) + +#elif defined(ARCH_X86) static inline unsigned short ByteSwap16(unsigned short x) { __asm("xchgb %b0,%h0" : @@ -83,7 +104,7 @@ static inline uint64_t ByteSwap64(uint64_t x) #else #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8) - + // code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc. #define bswap_32(x) \ diff --git a/apps/codecs/libwma/ffmpeg_config.h b/apps/codecs/libwma/ffmpeg_config.h index 40815cb..12b0666 100644 --- a/apps/codecs/libwma/ffmpeg_config.h +++ b/apps/codecs/libwma/ffmpeg_config.h @@ -1,7 +1,14 @@ /* Automatically generated by configure - do not modify */ -#ifndef _CONFIG_H -#define _CONFIG_H +#ifndef _FFMPEG_CONFIG_H +#define _FFMPEG_CONFIG_H +#include "codecs.h" +#ifdef CPU_ARM #define CONFIG_ALIGN 1 +#endif + +#ifdef ROCKBOX_BIG_ENDIAN +#define WORDS_BIGENDIAN +#endif #endif |