diff options
Diffstat (limited to 'apps/codecs/libspeex/misc.h')
-rw-r--r-- | apps/codecs/libspeex/misc.h | 133 |
1 files changed, 2 insertions, 131 deletions
diff --git a/apps/codecs/libspeex/misc.h b/apps/codecs/libspeex/misc.h index 8702919b7b..7dcc4f25f9 100644 --- a/apps/codecs/libspeex/misc.h +++ b/apps/codecs/libspeex/misc.h @@ -40,9 +40,9 @@ #ifndef SPEEX_VERSION #define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */ #define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */ -#define SPEEX_MICRO_VERSION 14 /**< Micro Speex version. */ +#define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */ #define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */ -#define SPEEX_VERSION "speex-1.2beta2" /**< Speex version string. */ +#define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */ #endif /* A couple test to catch stupid option combinations */ @@ -71,7 +71,6 @@ #endif #include "arch.h" -#include "rockbox.h" /** Convert little endian */ static inline spx_int32_t le_int(spx_int32_t i) @@ -91,138 +90,10 @@ static inline spx_int32_t le_int(spx_int32_t i) #endif } -#define speex_fatal(str) _speex_fatal(str, __FILE__, __LINE__); -#define speex_assert(cond) {if (!(cond)) {speex_fatal("assertion failed: " #cond);}} - -#ifndef RELEASE -static void print_vec(float *vec, int len, char *name) -{ - int i; - printf ("%s ", name); - for (i=0;i<len;i++) - printf (" %f", vec[i]); - printf ("\n"); -} -#endif #ifdef FIXED_DEBUG long long spx_mips=0; #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 */ -#ifndef OVERRIDE_SPEEX_ALLOC -static inline void *speex_alloc (int size) -{ - return calloc(size,1); -} -#endif - -/** Same as speex_alloc, except that the area is only needed inside a Speex call (might cause problem with wideband though) */ -#ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH -static inline void *speex_alloc_scratch (int size) -{ - return calloc(size,1); -} -#endif - -/** Speex wrapper for realloc. To do your own dynamic allocation, all you need to do is replace this function, speex_alloc and speex_free */ -#ifndef OVERRIDE_SPEEX_REALLOC -static inline void *speex_realloc (void *ptr, int size) -{ - return realloc(ptr, size); -} -#endif - -/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_alloc */ -#ifndef OVERRIDE_SPEEX_FREE -static inline void speex_free (void *ptr) -{ - free(ptr); -} -#endif - -/** Same as speex_free, except that the area is only needed inside a Speex call (might cause problem with wideband though) */ -#ifndef OVERRIDE_SPEEX_FREE_SCRATCH -static inline void speex_free_scratch (void *ptr) -{ - free(ptr); -} -#endif - -/** Print warning message with integer argument to stderr */ -#ifndef OVERRIDE_SPEEX_MOVE -static inline void *speex_move (void *dest, void *src, int n) -{ - return memmove(dest,src,n); -} -#endif - -#ifndef OVERRIDE_SPEEX_FATAL -static inline void _speex_fatal(const char *str, const char *file, int line) -{ - fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); - exit(1); -} -#endif - -#ifndef OVERRIDE_SPEEX_WARNING -static inline void speex_warning(const char *str) -{ -#ifndef DISABLE_WARNINGS - fprintf (stderr, "warning: %s\n", str); -#endif -} -#endif - -#ifndef OVERRIDE_SPEEX_WARNING_INT -static inline void speex_warning_int(const char *str, int val) -{ -#ifndef DISABLE_WARNINGS - fprintf (stderr, "warning: %s %d\n", str, val); -#endif -} -#endif - -#ifndef OVERRIDE_SPEEX_NOTIFY -static inline void speex_notify(const char *str) -{ -#ifndef DISABLE_NOTIFICATIONS - fprintf (stderr, "notification: %s\n", str); -#endif -} -#endif - -#ifdef FIXED_POINT -/** Generate a pseudo-random number */ -static inline spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed) -{ - spx_word32_t res; - *seed = 1664525 * *seed + 1013904223; - res = MULT16_16(EXTRACT16(SHR32(*seed,16)),std); - return EXTRACT16(PSHR32(SUB32(res, SHR32(res, 3)),14)); -} -#else -/** Generate a pseudo-random number */ -static inline spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed) -{ - const unsigned int jflone = 0x3f800000; - const unsigned int jflmsk = 0x007fffff; - union {int i; float f;} ran; - *seed = 1664525 * *seed + 1013904223; - ran.i = jflone | (jflmsk & *seed); - ran.f -= 1.5; - return 3.4642*std*ran.f; -} -#endif - -#ifndef OVERRIDE_SPEEX_PUTC -/** Speex wrapper for putc */ -static inline void _speex_putc(int ch, void *file) -{ - FILE *f = (FILE *)file; - fprintf(f, "%c", ch); -} -#endif - #endif |