diff options
Diffstat (limited to 'apps/codecs/libspeex/misc.c')
-rw-r--r-- | apps/codecs/libspeex/misc.c | 121 |
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 | ||
51 | void 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 | ||
62 | long long spx_mips=0; | ||
63 | #endif | ||
64 | |||
65 | |||
66 | #ifndef OVERRIDE_SPEEX_ALLOC | ||
67 | void *speex_alloc (int size) | ||
68 | { | ||
69 | return calloc(size,1); | ||
70 | } | ||
71 | #endif | ||
72 | |||
73 | #ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH | ||
74 | void *speex_alloc_scratch (int size) | ||
75 | { | ||
76 | return calloc(size,1); | ||
77 | } | ||
78 | #endif | ||
79 | |||
80 | #ifndef OVERRIDE_SPEEX_REALLOC | ||
81 | void *speex_realloc (void *ptr, int size) | ||
82 | { | ||
83 | return realloc(ptr, size); | ||
84 | } | ||
85 | #endif | ||
86 | |||
87 | #ifndef OVERRIDE_SPEEX_FREE | ||
88 | void speex_free (void *ptr) | ||
89 | { | ||
90 | free(ptr); | ||
91 | } | ||
92 | #endif | ||
93 | |||
94 | #ifndef OVERRIDE_SPEEX_FREE_SCRATCH | ||
95 | void speex_free_scratch (void *ptr) | ||
96 | { | ||
97 | free(ptr); | ||
98 | } | ||
99 | #endif | ||
100 | |||
101 | #ifndef OVERRIDE_SPEEX_MOVE | ||
102 | void *speex_move (void *dest, void *src, int n) | ||
103 | { | ||
104 | return memmove(dest,src,n); | ||
105 | } | ||
106 | #endif | ||
107 | |||
108 | #ifndef OVERRIDE_SPEEX_ERROR | ||
109 | void 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 | ||
117 | void 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 | ||
126 | void 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 | ||
135 | void 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 | ||
144 | spx_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 | ||
152 | spx_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 | ||
165 | void _speex_putc(int ch, void *file) | ||
166 | { | ||
167 | FILE *f = (FILE *)file; | ||
168 | fprintf(f, "%c", ch); | ||
169 | } | ||
170 | #endif | ||