summaryrefslogtreecommitdiff
path: root/apps/codecs/libspeex/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libspeex/misc.c')
-rw-r--r--apps/codecs/libspeex/misc.c121
1 files changed, 0 insertions, 121 deletions
diff --git a/apps/codecs/libspeex/misc.c b/apps/codecs/libspeex/misc.c
index ae6869781d..e33b910850 100644
--- a/apps/codecs/libspeex/misc.c
+++ b/apps/codecs/libspeex/misc.c
@@ -47,124 +47,3 @@
47#include "misc_bfin.h" 47#include "misc_bfin.h"
48#endif 48#endif
49 49
50#ifndef RELEASE
51void print_vec(float *vec, int len, char *name)
52{
53 int i;
54 printf ("%s ", name);
55 for (i=0;i<len;i++)
56 printf (" %f", vec[i]);
57 printf ("\n");
58}
59#endif
60
61#ifdef FIXED_DEBUG
62long long spx_mips=0;
63#endif
64
65
66#ifndef OVERRIDE_SPEEX_ALLOC
67void *speex_alloc (int size)
68{
69 return calloc(size,1);
70}
71#endif
72
73#ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH
74void *speex_alloc_scratch (int size)
75{
76 return calloc(size,1);
77}
78#endif
79
80#ifndef OVERRIDE_SPEEX_REALLOC
81void *speex_realloc (void *ptr, int size)
82{
83 return realloc(ptr, size);
84}
85#endif
86
87#ifndef OVERRIDE_SPEEX_FREE
88void speex_free (void *ptr)
89{
90 free(ptr);
91}
92#endif
93
94#ifndef OVERRIDE_SPEEX_FREE_SCRATCH
95void speex_free_scratch (void *ptr)
96{
97 free(ptr);
98}
99#endif
100
101#ifndef OVERRIDE_SPEEX_MOVE
102void *speex_move (void *dest, void *src, int n)
103{
104 return memmove(dest,src,n);
105}
106#endif
107
108#ifndef OVERRIDE_SPEEX_ERROR
109void speex_error(const char *str)
110{
111 fprintf (stderr, "Fatal (internal) error: %s\n", str);
112 exit(1);
113}
114#endif
115
116#ifndef OVERRIDE_SPEEX_WARNING
117void speex_warning(const char *str)
118{
119#ifndef DISABLE_WARNINGS
120 fprintf (stderr, "warning: %s\n", str);
121#endif
122}
123#endif
124
125#ifndef OVERRIDE_SPEEX_WARNING_INT
126void speex_warning_int(const char *str, int val)
127{
128#ifndef DISABLE_WARNINGS
129 fprintf (stderr, "warning: %s %d\n", str, val);
130#endif
131}
132#endif
133
134#ifndef OVERRIDE_SPEEX_NOTIFY
135void speex_notify(const char *str)
136{
137#ifndef DISABLE_NOTIFICATIONS
138 fprintf (stderr, "notification: %s\n", str);
139#endif
140}
141#endif
142
143#ifdef FIXED_POINT
144spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed)
145{
146 spx_word32_t res;
147 *seed = 1664525 * *seed + 1013904223;
148 res = MULT16_16(EXTRACT16(SHR32(*seed,16)),std);
149 return EXTRACT16(PSHR32(SUB32(res, SHR32(res, 3)),14));
150}
151#else
152spx_word16_t speex_rand(spx_word16_t std, spx_int32_t *seed)
153{
154 const unsigned int jflone = 0x3f800000;
155 const unsigned int jflmsk = 0x007fffff;
156 union {int i; float f;} ran;
157 *seed = 1664525 * *seed + 1013904223;
158 ran.i = jflone | (jflmsk & *seed);
159 ran.f -= 1.5;
160 return 3.4642*std*ran.f;
161}
162#endif
163
164#ifndef OVERRIDE_SPEEX_PUTC
165void _speex_putc(int ch, void *file)
166{
167 FILE *f = (FILE *)file;
168 fprintf(f, "%c", ch);
169}
170#endif