[xiph-commits] r12899 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Sat Apr 28 06:33:51 PDT 2007
Author: jm
Date: 2007-04-28 06:33:51 -0700 (Sat, 28 Apr 2007)
New Revision: 12899
Modified:
trunk/speex/libspeex/misc.c
trunk/speex/libspeex/misc.h
Log:
le_int now inline and returns a signed value. be_int is gone (no use)
Modified: trunk/speex/libspeex/misc.c
===================================================================
--- trunk/speex/libspeex/misc.c 2007-04-28 13:30:22 UTC (rev 12898)
+++ trunk/speex/libspeex/misc.c 2007-04-28 13:33:51 UTC (rev 12899)
@@ -63,30 +63,6 @@
#endif
-spx_uint32_t be_int(spx_uint32_t i)
-{
- spx_uint32_t ret=i;
-#ifndef WORDS_BIGENDIAN
- ret = i>>24;
- ret += (i>>8)&0x0000ff00;
- ret += (i<<8)&0x00ff0000;
- ret += (i<<24);
-#endif
- return ret;
-}
-
-spx_uint32_t le_int(spx_uint32_t i)
-{
- spx_uint32_t ret=i;
-#ifdef WORDS_BIGENDIAN
- ret = i>>24;
- ret += (i>>8)&0x0000ff00;
- ret += (i<<8)&0x00ff0000;
- ret += (i<<24);
-#endif
- return ret;
-}
-
#ifndef OVERRIDE_SPEEX_ALLOC
void *speex_alloc (int size)
{
Modified: trunk/speex/libspeex/misc.h
===================================================================
--- trunk/speex/libspeex/misc.h 2007-04-28 13:30:22 UTC (rev 12898)
+++ trunk/speex/libspeex/misc.h 2007-04-28 13:33:51 UTC (rev 12899)
@@ -75,10 +75,21 @@
void print_vec(float *vec, int len, char *name);
#endif
-/** Convert big endian */
-spx_uint32_t be_int(spx_uint32_t i);
/** Convert little endian */
-spx_uint32_t le_int(spx_uint32_t i);
+static inline spx_int32_t le_int(spx_int32_t i)
+{
+#ifdef WORDS_BIGENDIAN
+ 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
+}
/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free */
void *speex_alloc (int size);
More information about the commits
mailing list