To init the alaw to slinear conversion stuff, this needs to be run.
153{
154 int i;
155
156
157
158#ifndef G711_NEW_ALGORITHM
159 for (i = 0; i < 256; i++) {
161 }
162
163 for (i = -32768; i < 32768; i++) {
165 }
166#else
167 for (i = 0; i < 256; i++) {
169 }
170
173 }
174#endif
175
176#ifdef TEST_CODING_TABLES
177 for (i = -32768; i < 32768; ++i) {
178#ifndef G711_NEW_ALGORITHM
180#else
182#endif
187
188 if (e1 != e2 || d1 != d3 || d2 != d3) {
189 ast_log(
LOG_WARNING,
"a-Law coding tables test failed on %d: e1=%u, e2=%u, d1=%d, d2=%d\n",
190 i, (unsigned)e1, (unsigned)e2, (int)d1, (int)d2);
191 }
192 }
194#endif
195
196#ifdef TEST_TANDEM_TRANSCODING
197
198 for (i = -32768; i < 32768; ++i) {
205
206 if (e1 != e2 || e2 != e3 || d1 != d2 || d2 != d3) {
207 ast_log(
LOG_WARNING,
"a-Law tandem transcoding test failed on %d: e1=%u, e2=%u, d1=%d, d2=%d, d3=%d\n",
208 i, (unsigned)e1, (unsigned)e2, (int)d1, (int)d2, (int)d3);
209 }
210 }
212#endif
213
214}
static unsigned char linear2alaw(short int linear)
unsigned char __ast_lin2a[8192]
converts signed linear to alaw
static short int alaw2linear(unsigned char alaw)