summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libspeex/speex_header.c
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-14 02:15:56 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-14 02:15:56 +0000
commit85b325fdb991a0602a2f16a55fc1df2c303aded1 (patch)
tree6eba0129ce3cc84831b37e2ed64c473d053317ac /apps/codecs/libspeex/speex_header.c
parent91f618f1ba1e507a9aa1cf7ee87eaf0370272b17 (diff)
downloadrockbox-85b325fdb991a0602a2f16a55fc1df2c303aded1.tar.gz
rockbox-85b325fdb991a0602a2f16a55fc1df2c303aded1.zip
Sync Speex to SVN. Disable stereo compatibility hack since we don't needed it and it produced warnings. Remove unneeded math.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15613 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/speex_header.c')
-rw-r--r--apps/codecs/libspeex/speex_header.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/codecs/libspeex/speex_header.c b/apps/codecs/libspeex/speex_header.c
index 6d1e010828..eb4c199d46 100644
--- a/apps/codecs/libspeex/speex_header.c
+++ b/apps/codecs/libspeex/speex_header.c
@@ -35,7 +35,7 @@
#include "config-speex.h"
#endif
-#include "misc.h"
+#include "arch.h"
#include <speex/speex_header.h>
#include <speex/speex.h>
#include "os_support.h"
@@ -44,6 +44,24 @@
#define NULL 0
#endif
+/** Convert little endian */
+static inline spx_int32_t le_int(spx_int32_t i)
+{
+#if 1
+ return letoh32(i);
+#elif !defined(__LITTLE_ENDIAN__) && ( defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__) )
+ spx_uint32_t ui, ret;
+ ui = i;
+ ret = ui>>24;
+ ret |= (ui>>8)&0x0000ff00;
+ ret |= (ui<<8)&0x00ff0000;
+ ret |= (ui<<24);
+ return ret;
+#else
+ return i;
+#endif
+}
+
#define ENDIAN_SWITCH(x) {x=le_int(x);}