2 #ifndef ASTERISK_MSGSM_H 3 #define ASTERISK_MSGSM_H 13 #define readGSM_33(c1) { \ 14 gsm_byte *__c = (c1); \ 15 LARc[0] = (*__c++ & 0xF) << 2; \ 16 LARc[0] |= (*__c >> 6) & 0x3; \ 17 LARc[1] = *__c++ & 0x3F; \ 18 LARc[2] = (*__c >> 3) & 0x1F; \ 19 LARc[3] = (*__c++ & 0x7) << 2; \ 20 LARc[3] |= (*__c >> 6) & 0x3; \ 21 LARc[4] = (*__c >> 2) & 0xF; \ 22 LARc[5] = (*__c++ & 0x3) << 2; \ 23 LARc[5] |= (*__c >> 6) & 0x3; \ 24 LARc[6] = (*__c >> 3) & 0x7; \ 25 LARc[7] = *__c++ & 0x7; \ 26 Nc[0] = (*__c >> 1) & 0x7F; \ 27 bc[0] = (*__c++ & 0x1) << 1; \ 28 bc[0] |= (*__c >> 7) & 0x1; \ 29 Mc[0] = (*__c >> 5) & 0x3; \ 30 xmaxc[0] = (*__c++ & 0x1F) << 1; \ 31 xmaxc[0] |= (*__c >> 7) & 0x1; \ 32 xmc[0] = (*__c >> 4) & 0x7; \ 33 xmc[1] = (*__c >> 1) & 0x7; \ 34 xmc[2] = (*__c++ & 0x1) << 2; \ 35 xmc[2] |= (*__c >> 6) & 0x3; \ 36 xmc[3] = (*__c >> 3) & 0x7; \ 37 xmc[4] = *__c++ & 0x7; \ 38 xmc[5] = (*__c >> 5) & 0x7; \ 39 xmc[6] = (*__c >> 2) & 0x7; \ 40 xmc[7] = (*__c++ & 0x3) << 1; \ 41 xmc[7] |= (*__c >> 7) & 0x1; \ 42 xmc[8] = (*__c >> 4) & 0x7; \ 43 xmc[9] = (*__c >> 1) & 0x7; \ 44 xmc[10] = (*__c++ & 0x1) << 2; \ 45 xmc[10] |= (*__c >> 6) & 0x3; \ 46 xmc[11] = (*__c >> 3) & 0x7; \ 47 xmc[12] = *__c++ & 0x7; \ 48 Nc[1] = (*__c >> 1) & 0x7F; \ 49 bc[1] = (*__c++ & 0x1) << 1; \ 50 bc[1] |= (*__c >> 7) & 0x1; \ 51 Mc[1] = (*__c >> 5) & 0x3; \ 52 xmaxc[1] = (*__c++ & 0x1F) << 1; \ 53 xmaxc[1] |= (*__c >> 7) & 0x1; \ 54 xmc[13] = (*__c >> 4) & 0x7; \ 55 xmc[14] = (*__c >> 1) & 0x7; \ 56 xmc[15] = (*__c++ & 0x1) << 2; \ 57 xmc[15] |= (*__c >> 6) & 0x3; \ 58 xmc[16] = (*__c >> 3) & 0x7; \ 59 xmc[17] = *__c++ & 0x7; \ 60 xmc[18] = (*__c >> 5) & 0x7; \ 61 xmc[19] = (*__c >> 2) & 0x7; \ 62 xmc[20] = (*__c++ & 0x3) << 1; \ 63 xmc[20] |= (*__c >> 7) & 0x1; \ 64 xmc[21] = (*__c >> 4) & 0x7; \ 65 xmc[22] = (*__c >> 1) & 0x7; \ 66 xmc[23] = (*__c++ & 0x1) << 2; \ 67 xmc[23] |= (*__c >> 6) & 0x3; \ 68 xmc[24] = (*__c >> 3) & 0x7; \ 69 xmc[25] = *__c++ & 0x7; \ 70 Nc[2] = (*__c >> 1) & 0x7F; \ 71 bc[2] = (*__c++ & 0x1) << 1; \ 72 bc[2] |= (*__c >> 7) & 0x1; \ 73 Mc[2] = (*__c >> 5) & 0x3; \ 74 xmaxc[2] = (*__c++ & 0x1F) << 1; \ 75 xmaxc[2] |= (*__c >> 7) & 0x1; \ 76 xmc[26] = (*__c >> 4) & 0x7; \ 77 xmc[27] = (*__c >> 1) & 0x7; \ 78 xmc[28] = (*__c++ & 0x1) << 2; \ 79 xmc[28] |= (*__c >> 6) & 0x3; \ 80 xmc[29] = (*__c >> 3) & 0x7; \ 81 xmc[30] = *__c++ & 0x7; \ 82 xmc[31] = (*__c >> 5) & 0x7; \ 83 xmc[32] = (*__c >> 2) & 0x7; \ 84 xmc[33] = (*__c++ & 0x3) << 1; \ 85 xmc[33] |= (*__c >> 7) & 0x1; \ 86 xmc[34] = (*__c >> 4) & 0x7; \ 87 xmc[35] = (*__c >> 1) & 0x7; \ 88 xmc[36] = (*__c++ & 0x1) << 2; \ 89 xmc[36] |= (*__c >> 6) & 0x3; \ 90 xmc[37] = (*__c >> 3) & 0x7; \ 91 xmc[38] = *__c++ & 0x7; \ 92 Nc[3] = (*__c >> 1) & 0x7F; \ 93 bc[3] = (*__c++ & 0x1) << 1; \ 94 bc[3] |= (*__c >> 7) & 0x1; \ 95 Mc[3] = (*__c >> 5) & 0x3; \ 96 xmaxc[3] = (*__c++ & 0x1F) << 1; \ 97 xmaxc[3] |= (*__c >> 7) & 0x1; \ 98 xmc[39] = (*__c >> 4) & 0x7; \ 99 xmc[40] = (*__c >> 1) & 0x7; \ 100 xmc[41] = (*__c++ & 0x1) << 2; \ 101 xmc[41] |= (*__c >> 6) & 0x3; \ 102 xmc[42] = (*__c >> 3) & 0x7; \ 103 xmc[43] = *__c++ & 0x7; \ 104 xmc[44] = (*__c >> 5) & 0x7; \ 105 xmc[45] = (*__c >> 2) & 0x7; \ 106 xmc[46] = (*__c++ & 0x3) << 1; \ 107 xmc[46] |= (*__c >> 7) & 0x1; \ 108 xmc[47] = (*__c >> 4) & 0x7; \ 109 xmc[48] = (*__c >> 1) & 0x7; \ 110 xmc[49] = (*__c++ & 0x1) << 2; \ 111 xmc[49] |= (*__c >> 6) & 0x3; \ 112 xmc[50] = (*__c >> 3) & 0x7; \ 113 xmc[51] = *__c & 0x7; \ 123 sr = (sr >> 6) | (LARc[0] << 10);
124 sr = (sr >> 6) | (LARc[1] << 10);
126 sr = (sr >> 5) | (LARc[2] << 11);
128 sr = (sr >> 5) | (LARc[3] << 11);
129 sr = (sr >> 4) | (LARc[4] << 12);
131 sr = (sr >> 4) | (LARc[5] << 12);
132 sr = (sr >> 3) | (LARc[6] << 13);
134 sr = (sr >> 3) | (LARc[7] << 13);
135 sr = (sr >> 7) | (Nc[0] << 9);
137 sr = (sr >> 2) | (bc[0] << 14);
138 sr = (sr >> 2) | (Mc[0] << 14);
139 sr = (sr >> 6) | (xmaxc[0] << 10);
141 sr = (sr >> 3 )|( xmc[0] << 13);
143 sr = (sr >> 3 )|( xmc[1] << 13);
144 sr = (sr >> 3 )|( xmc[2] << 13);
145 sr = (sr >> 3 )|( xmc[3] << 13);
147 sr = (sr >> 3 )|( xmc[4] << 13);
148 sr = (sr >> 3 )|( xmc[5] << 13);
149 sr = (sr >> 3 )|( xmc[6] << 13);
151 sr = (sr >> 3 )|( xmc[7] << 13);
152 sr = (sr >> 3 )|( xmc[8] << 13);
154 sr = (sr >> 3 )|( xmc[9] << 13);
155 sr = (sr >> 3 )|( xmc[10] << 13);
156 sr = (sr >> 3 )|( xmc[11] << 13);
158 sr = (sr >> 3 )|( xmc[12] << 13);
159 sr = (sr >> 7 )|( Nc[1] << 9);
161 sr = (sr >> 2 )|( bc[1] << 14);
162 sr = (sr >> 2 )|( Mc[1] << 14);
163 sr = (sr >> 6 )|( xmaxc[1] << 10);
165 sr = (sr >> 3 )|( xmc[13] << 13);
167 sr = (sr >> 3 )|( xmc[14] << 13);
168 sr = (sr >> 3 )|( xmc[15] << 13);
169 sr = (sr >> 3 )|( xmc[16] << 13);
171 sr = (sr >> 3 )|( xmc[17] << 13);
172 sr = (sr >> 3 )|( xmc[18] << 13);
173 sr = (sr >> 3 )|( xmc[19] << 13);
175 sr = (sr >> 3 )|( xmc[20] << 13);
176 sr = (sr >> 3 )|( xmc[21] << 13);
178 sr = (sr >> 3 )|( xmc[22] << 13);
179 sr = (sr >> 3 )|( xmc[23] << 13);
180 sr = (sr >> 3 )|( xmc[24] << 13);
182 sr = (sr >> 3 )|( xmc[25] << 13);
183 sr = (sr >> 7 )|( Nc[2] << 9);
185 sr = (sr >> 2 )|( bc[2] << 14);
186 sr = (sr >> 2 )|( Mc[2] << 14);
187 sr = (sr >> 6 )|( xmaxc[2] << 10);
189 sr = (sr >> 3 )|( xmc[26] << 13);
191 sr = (sr >> 3 )|( xmc[27] << 13);
192 sr = (sr >> 3 )|( xmc[28] << 13);
193 sr = (sr >> 3 )|( xmc[29] << 13);
195 sr = (sr >> 3 )|( xmc[30] << 13);
196 sr = (sr >> 3 )|( xmc[31] << 13);
197 sr = (sr >> 3 )|( xmc[32] << 13);
199 sr = (sr >> 3 )|( xmc[33] << 13);
200 sr = (sr >> 3 )|( xmc[34] << 13);
202 sr = (sr >> 3 )|( xmc[35] << 13);
203 sr = (sr >> 3 )|( xmc[36] << 13);
204 sr = (sr >> 3 )|( xmc[37] << 13);
206 sr = (sr >> 3 )|( xmc[38] << 13);
207 sr = (sr >> 7 )|( Nc[3] << 9);
209 sr = (sr >> 2 )|( bc[3] << 14);
210 sr = (sr >> 2 )|( Mc[3] << 14);
211 sr = (sr >> 6 )|( xmaxc[3] << 10);
213 sr = (sr >> 3 )|( xmc[39] << 13);
215 sr = (sr >> 3 )|( xmc[40] << 13);
216 sr = (sr >> 3 )|( xmc[41] << 13);
217 sr = (sr >> 3 )|( xmc[42] << 13);
219 sr = (sr >> 3 )|( xmc[43] << 13);
220 sr = (sr >> 3 )|( xmc[44] << 13);
221 sr = (sr >> 3 )|( xmc[45] << 13);
223 sr = (sr >> 3 )|( xmc[46] << 13);
224 sr = (sr >> 3 )|( xmc[47] << 13);
226 sr = (sr >> 3 )|( xmc[48] << 13);
227 sr = (sr >> 3 )|( xmc[49] << 13);
228 sr = (sr >> 3 )|( xmc[50] << 13);
230 sr = (sr >> 3 )|( xmc[51] << 13);
239 sr = (sr >> 4 )|( frame_chain << 12);
241 sr = (sr >> 6 )|( LARc[0] << 10);
243 sr = (sr >> 6 )|( LARc[1] << 10);
245 sr = (sr >> 5 )|( LARc[2] << 11);
246 sr = (sr >> 5 )|( LARc[3] << 11);
248 sr = (sr >> 4 )|( LARc[4] << 12);
249 sr = (sr >> 4 )|( LARc[5] << 12);
251 sr = (sr >> 3 )|( LARc[6] << 13);
252 sr = (sr >> 3 )|( LARc[7] << 13);
254 sr = (sr >> 7 )|( Nc[0] << 9);
255 sr = (sr >> 2 )|( bc[0] << 14);
257 sr = (sr >> 2 )|( Mc[0] << 14);
258 sr = (sr >> 6 )|( xmaxc[0] << 10);
260 sr = (sr >> 3 )|( xmc[0] << 13);
261 sr = (sr >> 3 )|( xmc[1] << 13);
262 sr = (sr >> 3 )|( xmc[2] << 13);
264 sr = (sr >> 3 )|( xmc[3] << 13);
265 sr = (sr >> 3 )|( xmc[4] << 13);
267 sr = (sr >> 3 )|( xmc[5] << 13);
268 sr = (sr >> 3 )|( xmc[6] << 13);
269 sr = (sr >> 3 )|( xmc[7] << 13);
271 sr = (sr >> 3 )|( xmc[8] << 13);
272 sr = (sr >> 3 )|( xmc[9] << 13);
273 sr = (sr >> 3 )|( xmc[10] << 13);
275 sr = (sr >> 3 )|( xmc[11] << 13);
276 sr = (sr >> 3 )|( xmc[12] << 13);
278 sr = (sr >> 7 )|( Nc[1] << 9);
279 sr = (sr >> 2 )|( bc[1] << 14);
281 sr = (sr >> 2 )|( Mc[1] << 14);
282 sr = (sr >> 6 )|( xmaxc[1] << 10);
284 sr = (sr >> 3 )|( xmc[13] << 13);
285 sr = (sr >> 3 )|( xmc[14] << 13);
286 sr = (sr >> 3 )|( xmc[15] << 13);
288 sr = (sr >> 3 )|( xmc[16] << 13);
289 sr = (sr >> 3 )|( xmc[17] << 13);
291 sr = (sr >> 3 )|( xmc[18] << 13);
292 sr = (sr >> 3 )|( xmc[19] << 13);
293 sr = (sr >> 3 )|( xmc[20] << 13);
295 sr = (sr >> 3 )|( xmc[21] << 13);
296 sr = (sr >> 3 )|( xmc[22] << 13);
297 sr = (sr >> 3 )|( xmc[23] << 13);
299 sr = (sr >> 3 )|( xmc[24] << 13);
300 sr = (sr >> 3 )|( xmc[25] << 13);
302 sr = (sr >> 7 )|( Nc[2] << 9);
303 sr = (sr >> 2 )|( bc[2] << 14);
305 sr = (sr >> 2 )|( Mc[2] << 14);
306 sr = (sr >> 6 )|( xmaxc[2] << 10);
308 sr = (sr >> 3 )|( xmc[26] << 13);
309 sr = (sr >> 3 )|( xmc[27] << 13);
310 sr = (sr >> 3 )|( xmc[28] << 13);
312 sr = (sr >> 3 )|( xmc[29] << 13);
313 sr = (sr >> 3 )|( xmc[30] << 13);
315 sr = (sr >> 3 )|( xmc[31] << 13);
316 sr = (sr >> 3 )|( xmc[32] << 13);
317 sr = (sr >> 3 )|( xmc[33] << 13);
319 sr = (sr >> 3 )|( xmc[34] << 13);
320 sr = (sr >> 3 )|( xmc[35] << 13);
321 sr = (sr >> 3 )|( xmc[36] << 13);
323 sr = (sr >> 3 )|( xmc[37] << 13);
324 sr = (sr >> 3 )|( xmc[38] << 13);
326 sr = (sr >> 7 )|( Nc[3] << 9);
327 sr = (sr >> 2 )|( bc[3] << 14);
329 sr = (sr >> 2 )|( Mc[3] << 14);
330 sr = (sr >> 6 )|( xmaxc[3] << 10);
332 sr = (sr >> 3 )|( xmc[39] << 13);
333 sr = (sr >> 3 )|( xmc[40] << 13);
334 sr = (sr >> 3 )|( xmc[41] << 13);
336 sr = (sr >> 3 )|( xmc[42] << 13);
337 sr = (sr >> 3 )|( xmc[43] << 13);
339 sr = (sr >> 3 )|( xmc[44] << 13);
340 sr = (sr >> 3 )|( xmc[45] << 13);
341 sr = (sr >> 3 )|( xmc[46] << 13);
343 sr = (sr >> 3 )|( xmc[47] << 13);
344 sr = (sr >> 3 )|( xmc[48] << 13);
345 sr = (sr >> 3 )|( xmc[49] << 13);
347 sr = (sr >> 3 )|( xmc[50] << 13);
348 sr = (sr >> 3 )|( xmc[51] << 13);
353 #define writeGSM_33(c1) { \ 354 gsm_byte *__c = (c1); \ 355 *__c++ = ((GSM_MAGIC & 0xF) << 4) \ 356 | ((LARc[0] >> 2) & 0xF); \ 357 *__c++ = ((LARc[0] & 0x3) << 6) \ 358 | (LARc[1] & 0x3F); \ 359 *__c++ = ((LARc[2] & 0x1F) << 3) \ 360 | ((LARc[3] >> 2) & 0x7); \ 361 *__c++ = ((LARc[3] & 0x3) << 6) \ 362 | ((LARc[4] & 0xF) << 2) \ 363 | ((LARc[5] >> 2) & 0x3); \ 364 *__c++ = ((LARc[5] & 0x3) << 6) \ 365 | ((LARc[6] & 0x7) << 3) \ 367 *__c++ = ((Nc[0] & 0x7F) << 1) \ 368 | ((bc[0] >> 1) & 0x1); \ 369 *__c++ = ((bc[0] & 0x1) << 7) \ 370 | ((Mc[0] & 0x3) << 5) \ 371 | ((xmaxc[0] >> 1) & 0x1F); \ 372 *__c++ = ((xmaxc[0] & 0x1) << 7) \ 373 | ((xmc[0] & 0x7) << 4) \ 374 | ((xmc[1] & 0x7) << 1) \ 375 | ((xmc[2] >> 2) & 0x1); \ 376 *__c++ = ((xmc[2] & 0x3) << 6) \ 377 | ((xmc[3] & 0x7) << 3) \ 379 *__c++ = ((xmc[5] & 0x7) << 5) \ 380 | ((xmc[6] & 0x7) << 2) \ 381 | ((xmc[7] >> 1) & 0x3); \ 382 *__c++ = ((xmc[7] & 0x1) << 7) \ 383 | ((xmc[8] & 0x7) << 4) \ 384 | ((xmc[9] & 0x7) << 1) \ 385 | ((xmc[10] >> 2) & 0x1); \ 386 *__c++ = ((xmc[10] & 0x3) << 6) \ 387 | ((xmc[11] & 0x7) << 3) \ 389 *__c++ = ((Nc[1] & 0x7F) << 1) \ 390 | ((bc[1] >> 1) & 0x1); \ 391 *__c++ = ((bc[1] & 0x1) << 7) \ 392 | ((Mc[1] & 0x3) << 5) \ 393 | ((xmaxc[1] >> 1) & 0x1F); \ 394 *__c++ = ((xmaxc[1] & 0x1) << 7) \ 395 | ((xmc[13] & 0x7) << 4) \ 396 | ((xmc[14] & 0x7) << 1) \ 397 | ((xmc[15] >> 2) & 0x1); \ 398 *__c++ = ((xmc[15] & 0x3) << 6) \ 399 | ((xmc[16] & 0x7) << 3) \ 401 *__c++ = ((xmc[18] & 0x7) << 5) \ 402 | ((xmc[19] & 0x7) << 2) \ 403 | ((xmc[20] >> 1) & 0x3); \ 404 *__c++ = ((xmc[20] & 0x1) << 7) \ 405 | ((xmc[21] & 0x7) << 4) \ 406 | ((xmc[22] & 0x7) << 1) \ 407 | ((xmc[23] >> 2) & 0x1); \ 408 *__c++ = ((xmc[23] & 0x3) << 6) \ 409 | ((xmc[24] & 0x7) << 3) \ 411 *__c++ = ((Nc[2] & 0x7F) << 1) \ 412 | ((bc[2] >> 1) & 0x1); \ 413 *__c++ = ((bc[2] & 0x1) << 7) \ 414 | ((Mc[2] & 0x3) << 5) \ 415 | ((xmaxc[2] >> 1) & 0x1F); \ 416 *__c++ = ((xmaxc[2] & 0x1) << 7) \ 417 | ((xmc[26] & 0x7) << 4) \ 418 | ((xmc[27] & 0x7) << 1) \ 419 | ((xmc[28] >> 2) & 0x1); \ 420 *__c++ = ((xmc[28] & 0x3) << 6) \ 421 | ((xmc[29] & 0x7) << 3) \ 423 *__c++ = ((xmc[31] & 0x7) << 5) \ 424 | ((xmc[32] & 0x7) << 2) \ 425 | ((xmc[33] >> 1) & 0x3); \ 426 *__c++ = ((xmc[33] & 0x1) << 7) \ 427 | ((xmc[34] & 0x7) << 4) \ 428 | ((xmc[35] & 0x7) << 1) \ 429 | ((xmc[36] >> 2) & 0x1); \ 430 *__c++ = ((xmc[36] & 0x3) << 6) \ 431 | ((xmc[37] & 0x7) << 3) \ 433 *__c++ = ((Nc[3] & 0x7F) << 1) \ 434 | ((bc[3] >> 1) & 0x1); \ 435 *__c++ = ((bc[3] & 0x1) << 7) \ 436 | ((Mc[3] & 0x3) << 5) \ 437 | ((xmaxc[3] >> 1) & 0x1F); \ 438 *__c++ = ((xmaxc[3] & 0x1) << 7) \ 439 | ((xmc[39] & 0x7) << 4) \ 440 | ((xmc[40] & 0x7) << 1) \ 441 | ((xmc[41] >> 2) & 0x1); \ 442 *__c++ = ((xmc[41] & 0x3) << 6) \ 443 | ((xmc[42] & 0x7) << 3) \ 445 *__c++ = ((xmc[44] & 0x7) << 5) \ 446 | ((xmc[45] & 0x7) << 2) \ 447 | ((xmc[46] >> 1) & 0x3); \ 448 *__c++ = ((xmc[46] & 0x1) << 7) \ 449 | ((xmc[47] & 0x7) << 4) \ 450 | ((xmc[48] & 0x7) << 1) \ 451 | ((xmc[49] >> 2) & 0x1); \ 452 *__c++ = ((xmc[49] & 0x3) << 6) \ 453 | ((xmc[50] & 0x7) << 3) \ 460 unsigned int frame_chain;
463 unsigned int xmc[13*4] = { 0, };
466 LARc[0] = sr & 0x3f; sr >>= 6;
467 sr |= (
uword)*c++ << 2;
468 LARc[1] = sr & 0x3f; sr >>= 6;
469 sr |= (
uword)*c++ << 4;
470 LARc[2] = sr & 0x1f; sr >>= 5;
471 LARc[3] = sr & 0x1f; sr >>= 5;
472 sr |= (
uword)*c++ << 2;
473 LARc[4] = sr & 0xf; sr >>= 4;
474 LARc[5] = sr & 0xf; sr >>= 4;
475 sr |= (
uword)*c++ << 2;
476 LARc[6] = sr & 0x7; sr >>= 3;
477 LARc[7] = sr & 0x7; sr >>= 3;
478 sr |= (
uword)*c++ << 4;
479 Nc[0] = sr & 0x7f; sr >>= 7;
480 bc[0] = sr & 0x3; sr >>= 2;
481 Mc[0] = sr & 0x3; sr >>= 2;
482 sr |= (
uword)*c++ << 1;
483 xmaxc[0] = sr & 0x3f; sr >>= 6;
484 xmc[0] = sr & 0x7; sr >>= 3;
486 xmc[1] = sr & 0x7; sr >>= 3;
487 xmc[2] = sr & 0x7; sr >>= 3;
488 sr |= (
uword)*c++ << 2;
489 xmc[3] = sr & 0x7; sr >>= 3;
490 xmc[4] = sr & 0x7; sr >>= 3;
491 xmc[5] = sr & 0x7; sr >>= 3;
492 sr |= (
uword)*c++ << 1;
493 xmc[6] = sr & 0x7; sr >>= 3;
494 xmc[7] = sr & 0x7; sr >>= 3;
495 xmc[8] = sr & 0x7; sr >>= 3;
497 xmc[9] = sr & 0x7; sr >>= 3;
498 xmc[10] = sr & 0x7; sr >>= 3;
499 sr |= (
uword)*c++ << 2;
500 xmc[11] = sr & 0x7; sr >>= 3;
501 xmc[12] = sr & 0x7; sr >>= 3;
502 sr |= (
uword)*c++ << 4;
503 Nc[1] = sr & 0x7f; sr >>= 7;
504 bc[1] = sr & 0x3; sr >>= 2;
505 Mc[1] = sr & 0x3; sr >>= 2;
506 sr |= (
uword)*c++ << 1;
507 xmaxc[1] = sr & 0x3f; sr >>= 6;
508 xmc[13] = sr & 0x7; sr >>= 3;
510 xmc[14] = sr & 0x7; sr >>= 3;
511 xmc[15] = sr & 0x7; sr >>= 3;
512 sr |= (
uword)*c++ << 2;
513 xmc[16] = sr & 0x7; sr >>= 3;
514 xmc[17] = sr & 0x7; sr >>= 3;
515 xmc[18] = sr & 0x7; sr >>= 3;
516 sr |= (
uword)*c++ << 1;
517 xmc[19] = sr & 0x7; sr >>= 3;
518 xmc[20] = sr & 0x7; sr >>= 3;
519 xmc[21] = sr & 0x7; sr >>= 3;
521 xmc[22] = sr & 0x7; sr >>= 3;
522 xmc[23] = sr & 0x7; sr >>= 3;
523 sr |= (
uword)*c++ << 2;
524 xmc[24] = sr & 0x7; sr >>= 3;
525 xmc[25] = sr & 0x7; sr >>= 3;
526 sr |= (
uword)*c++ << 4;
527 Nc[2] = sr & 0x7f; sr >>= 7;
528 bc[2] = sr & 0x3; sr >>= 2;
529 Mc[2] = sr & 0x3; sr >>= 2;
530 sr |= (
uword)*c++ << 1;
531 xmaxc[2] = sr & 0x3f; sr >>= 6;
532 xmc[26] = sr & 0x7; sr >>= 3;
534 xmc[27] = sr & 0x7; sr >>= 3;
535 xmc[28] = sr & 0x7; sr >>= 3;
536 sr |= (
uword)*c++ << 2;
537 xmc[29] = sr & 0x7; sr >>= 3;
538 xmc[30] = sr & 0x7; sr >>= 3;
539 xmc[31] = sr & 0x7; sr >>= 3;
540 sr |= (
uword)*c++ << 1;
541 xmc[32] = sr & 0x7; sr >>= 3;
542 xmc[33] = sr & 0x7; sr >>= 3;
543 xmc[34] = sr & 0x7; sr >>= 3;
545 xmc[35] = sr & 0x7; sr >>= 3;
546 xmc[36] = sr & 0x7; sr >>= 3;
547 sr |= (
uword)*c++ << 2;
548 xmc[37] = sr & 0x7; sr >>= 3;
549 xmc[38] = sr & 0x7; sr >>= 3;
550 sr |= (
uword)*c++ << 4;
551 Nc[3] = sr & 0x7f; sr >>= 7;
552 bc[3] = sr & 0x3; sr >>= 2;
553 Mc[3] = sr & 0x3; sr >>= 2;
554 sr |= (
uword)*c++ << 1;
555 xmaxc[3] = sr & 0x3f; sr >>= 6;
556 xmc[39] = sr & 0x7; sr >>= 3;
558 xmc[40] = sr & 0x7; sr >>= 3;
559 xmc[41] = sr & 0x7; sr >>= 3;
560 sr |= (
uword)*c++ << 2;
561 xmc[42] = sr & 0x7; sr >>= 3;
562 xmc[43] = sr & 0x7; sr >>= 3;
563 xmc[44] = sr & 0x7; sr >>= 3;
564 sr |= (
uword)*c++ << 1;
565 xmc[45] = sr & 0x7; sr >>= 3;
566 xmc[46] = sr & 0x7; sr >>= 3;
567 xmc[47] = sr & 0x7; sr >>= 3;
569 xmc[49] = sr & 0x7; sr >>= 3;
570 sr |= (
uword)*c++ << 2;
571 xmc[50] = sr & 0x7; sr >>= 3;
572 xmc[51] = sr & 0x7; sr >>= 3;
574 frame_chain = sr & 0xf;
581 sr |= (
uword)*c++ << 4;
582 LARc[0] = sr & 0x3f; sr >>= 6;
583 LARc[1] = sr & 0x3f; sr >>= 6;
585 LARc[2] = sr & 0x1f; sr >>= 5;
586 sr |= (
uword)*c++ << 3;
587 LARc[3] = sr & 0x1f; sr >>= 5;
588 LARc[4] = sr & 0xf; sr >>= 4;
589 sr |= (
uword)*c++ << 2;
590 LARc[5] = sr & 0xf; sr >>= 4;
591 LARc[6] = sr & 0x7; sr >>= 3;
592 LARc[7] = sr & 0x7; sr >>= 3;
594 Nc[0] = sr & 0x7f; sr >>= 7;
595 sr |= (
uword)*c++ << 1;
596 bc[0] = sr & 0x3; sr >>= 2;
597 Mc[0] = sr & 0x3; sr >>= 2;
598 sr |= (
uword)*c++ << 5;
599 xmaxc[0] = sr & 0x3f; sr >>= 6;
600 xmc[0] = sr & 0x7; sr >>= 3;
601 xmc[1] = sr & 0x7; sr >>= 3;
602 sr |= (
uword)*c++ << 1;
603 xmc[2] = sr & 0x7; sr >>= 3;
604 xmc[3] = sr & 0x7; sr >>= 3;
605 xmc[4] = sr & 0x7; sr >>= 3;
607 xmc[5] = sr & 0x7; sr >>= 3;
608 xmc[6] = sr & 0x7; sr >>= 3;
609 sr |= (
uword)*c++ << 2;
610 xmc[7] = sr & 0x7; sr >>= 3;
611 xmc[8] = sr & 0x7; sr >>= 3;
612 xmc[9] = sr & 0x7; sr >>= 3;
613 sr |= (
uword)*c++ << 1;
614 xmc[10] = sr & 0x7; sr >>= 3;
615 xmc[11] = sr & 0x7; sr >>= 3;
616 xmc[12] = sr & 0x7; sr >>= 3;
618 Nc[1] = sr & 0x7f; sr >>= 7;
619 sr |= (
uword)*c++ << 1;
620 bc[1] = sr & 0x3; sr >>= 2;
621 Mc[1] = sr & 0x3; sr >>= 2;
622 sr |= (
uword)*c++ << 5;
623 xmaxc[1] = sr & 0x3f; sr >>= 6;
624 xmc[13] = sr & 0x7; sr >>= 3;
625 xmc[14] = sr & 0x7; sr >>= 3;
626 sr |= (
uword)*c++ << 1;
627 xmc[15] = sr & 0x7; sr >>= 3;
628 xmc[16] = sr & 0x7; sr >>= 3;
629 xmc[17] = sr & 0x7; sr >>= 3;
631 xmc[18] = sr & 0x7; sr >>= 3;
632 xmc[19] = sr & 0x7; sr >>= 3;
633 sr |= (
uword)*c++ << 2;
634 xmc[20] = sr & 0x7; sr >>= 3;
635 xmc[21] = sr & 0x7; sr >>= 3;
636 xmc[22] = sr & 0x7; sr >>= 3;
637 sr |= (
uword)*c++ << 1;
638 xmc[23] = sr & 0x7; sr >>= 3;
639 xmc[24] = sr & 0x7; sr >>= 3;
640 xmc[25] = sr & 0x7; sr >>= 3;
642 Nc[2] = sr & 0x7f; sr >>= 7;
643 sr |= (
uword)*c++ << 1;
644 bc[2] = sr & 0x3; sr >>= 2;
645 Mc[2] = sr & 0x3; sr >>= 2;
646 sr |= (
uword)*c++ << 5;
647 xmaxc[2] = sr & 0x3f; sr >>= 6;
648 xmc[26] = sr & 0x7; sr >>= 3;
649 xmc[27] = sr & 0x7; sr >>= 3;
650 sr |= (
uword)*c++ << 1;
651 xmc[28] = sr & 0x7; sr >>= 3;
652 xmc[29] = sr & 0x7; sr >>= 3;
653 xmc[30] = sr & 0x7; sr >>= 3;
655 xmc[31] = sr & 0x7; sr >>= 3;
656 xmc[32] = sr & 0x7; sr >>= 3;
657 sr |= (
uword)*c++ << 2;
658 xmc[33] = sr & 0x7; sr >>= 3;
659 xmc[34] = sr & 0x7; sr >>= 3;
660 xmc[35] = sr & 0x7; sr >>= 3;
661 sr |= (
uword)*c++ << 1;
662 xmc[36] = sr & 0x7; sr >>= 3;
663 xmc[37] = sr & 0x7; sr >>= 3;
664 xmc[38] = sr & 0x7; sr >>= 3;
666 Nc[3] = sr & 0x7f; sr >>= 7;
667 sr |= (
uword)*c++ << 1;
668 bc[3] = sr & 0x3; sr >>= 2;
669 Mc[3] = sr & 0x3; sr >>= 2;
670 sr |= (
uword)*c++ << 5;
671 xmaxc[3] = sr & 0x3f; sr >>= 6;
672 xmc[39] = sr & 0x7; sr >>= 3;
673 xmc[40] = sr & 0x7; sr >>= 3;
674 sr |= (
uword)*c++ << 1;
675 xmc[41] = sr & 0x7; sr >>= 3;
676 xmc[42] = sr & 0x7; sr >>= 3;
677 xmc[43] = sr & 0x7; sr >>= 3;
679 xmc[44] = sr & 0x7; sr >>= 3;
680 xmc[45] = sr & 0x7; sr >>= 3;
681 sr |= (
uword)*c++ << 2;
682 xmc[46] = sr & 0x7; sr >>= 3;
683 xmc[47] = sr & 0x7; sr >>= 3;
684 xmc[48] = sr & 0x7; sr >>= 3;
685 sr |= (
uword)*c++ << 1;
686 xmc[49] = sr & 0x7; sr >>= 3;
687 xmc[50] = sr & 0x7; sr >>= 3;
688 xmc[51] = sr & 0x7; sr >>= 3;
static void conv65(wav_byte *c, gsm_byte *d)
static void conv66(gsm_byte *d, wav_byte *c)