15{
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109# define LARc source
110# define Nc *((gsm_signal (*) [17])(source + 8))
111# define bc *((gsm_signal (*) [17])(source + 9))
112# define Mc *((gsm_signal (*) [17])(source + 10))
113# define xmaxc *((gsm_signal (*) [17])(source + 11))
114
115#ifdef WAV49
117
120
122 LARc[0] = sr & 0x3f; sr >>= 6;
124 LARc[1] = sr & 0x3f; sr >>= 6;
126 LARc[2] = sr & 0x1f; sr >>= 5;
127 LARc[3] = sr & 0x1f; sr >>= 5;
129 LARc[4] = sr & 0xf; sr >>= 4;
130 LARc[5] = sr & 0xf; sr >>= 4;
132 LARc[6] = sr & 0x7; sr >>= 3;
133 LARc[7] = sr & 0x7; sr >>= 3;
135 Nc[0] = sr & 0x7f; sr >>= 7;
136 bc[0] = sr & 0x3; sr >>= 2;
137 Mc[0] = sr & 0x3; sr >>= 2;
139 xmaxc[0] = sr & 0x3f; sr >>= 6;
140#undef xmc
141#define xmc (source + 12)
142 xmc[0] = sr & 0x7; sr >>= 3;
144 xmc[1] = sr & 0x7; sr >>= 3;
145 xmc[2] = sr & 0x7; sr >>= 3;
147 xmc[3] = sr & 0x7; sr >>= 3;
148 xmc[4] = sr & 0x7; sr >>= 3;
149 xmc[5] = sr & 0x7; sr >>= 3;
151 xmc[6] = sr & 0x7; sr >>= 3;
152 xmc[7] = sr & 0x7; sr >>= 3;
153 xmc[8] = sr & 0x7; sr >>= 3;
155 xmc[9] = sr & 0x7; sr >>= 3;
156 xmc[10] = sr & 0x7; sr >>= 3;
158 xmc[11] = sr & 0x7; sr >>= 3;
159 xmc[12] = sr & 0x7; sr >>= 3;
161 Nc[1] = sr & 0x7f; sr >>= 7;
162 bc[1] = sr & 0x3; sr >>= 2;
163 Mc[1] = sr & 0x3; sr >>= 2;
165 xmaxc[1] = sr & 0x3f; sr >>= 6;
166#undef xmc
167#define xmc (source + 29 - 13)
168 xmc[13] = sr & 0x7; sr >>= 3;
170 xmc[14] = sr & 0x7; sr >>= 3;
171 xmc[15] = sr & 0x7; sr >>= 3;
173 xmc[16] = sr & 0x7; sr >>= 3;
174 xmc[17] = sr & 0x7; sr >>= 3;
175 xmc[18] = sr & 0x7; sr >>= 3;
177 xmc[19] = sr & 0x7; sr >>= 3;
178 xmc[20] = sr & 0x7; sr >>= 3;
179 xmc[21] = sr & 0x7; sr >>= 3;
181 xmc[22] = sr & 0x7; sr >>= 3;
182 xmc[23] = sr & 0x7; sr >>= 3;
184 xmc[24] = sr & 0x7; sr >>= 3;
185 xmc[25] = sr & 0x7; sr >>= 3;
187 Nc[2] = sr & 0x7f; sr >>= 7;
188 bc[2] = sr & 0x3; sr >>= 2;
189 Mc[2] = sr & 0x3; sr >>= 2;
191 xmaxc[2] = sr & 0x3f; sr >>= 6;
192#undef xmc
193#define xmc (source + 46 - 26)
194 xmc[26] = sr & 0x7; sr >>= 3;
196 xmc[27] = sr & 0x7; sr >>= 3;
197 xmc[28] = sr & 0x7; sr >>= 3;
199 xmc[29] = sr & 0x7; sr >>= 3;
200 xmc[30] = sr & 0x7; sr >>= 3;
201 xmc[31] = sr & 0x7; sr >>= 3;
203 xmc[32] = sr & 0x7; sr >>= 3;
204 xmc[33] = sr & 0x7; sr >>= 3;
205 xmc[34] = sr & 0x7; sr >>= 3;
207 xmc[35] = sr & 0x7; sr >>= 3;
208 xmc[36] = sr & 0x7; sr >>= 3;
210 xmc[37] = sr & 0x7; sr >>= 3;
211 xmc[38] = sr & 0x7; sr >>= 3;
213 Nc[3] = sr & 0x7f; sr >>= 7;
214 bc[3] = sr & 0x3; sr >>= 2;
215 Mc[3] = sr & 0x3; sr >>= 2;
217 xmaxc[3] = sr & 0x3f; sr >>= 6;
218#undef xmc
219#define xmc (source + 63 - 39)
220
221 xmc[39] = sr & 0x7; sr >>= 3;
223 xmc[40] = sr & 0x7; sr >>= 3;
224 xmc[41] = sr & 0x7; sr >>= 3;
226 xmc[42] = sr & 0x7; sr >>= 3;
227 xmc[43] = sr & 0x7; sr >>= 3;
228 xmc[44] = sr & 0x7; sr >>= 3;
230 xmc[45] = sr & 0x7; sr >>= 3;
231 xmc[46] = sr & 0x7; sr >>= 3;
232 xmc[47] = sr & 0x7; sr >>= 3;
234 xmc[48] = sr & 0x7; sr >>= 3;
235 xmc[49] = sr & 0x7; sr >>= 3;
237 xmc[50] = sr & 0x7; sr >>= 3;
238 xmc[51] = sr & 0x7; sr >>= 3;
239
241 }
242 else {
245 LARc[0] = sr & 0x3f; sr >>= 6;
246 LARc[1] = sr & 0x3f; sr >>= 6;
248 LARc[2] = sr & 0x1f; sr >>= 5;
250 LARc[3] = sr & 0x1f; sr >>= 5;
251 LARc[4] = sr & 0xf; sr >>= 4;
253 LARc[5] = sr & 0xf; sr >>= 4;
254 LARc[6] = sr & 0x7; sr >>= 3;
255 LARc[7] = sr & 0x7; sr >>= 3;
257 Nc[0] = sr & 0x7f; sr >>= 7;
259 bc[0] = sr & 0x3; sr >>= 2;
260 Mc[0] = sr & 0x3; sr >>= 2;
262 xmaxc[0] = sr & 0x3f; sr >>= 6;
263#undef xmc
264#define xmc (source + 12)
265 xmc[0] = sr & 0x7; sr >>= 3;
266 xmc[1] = sr & 0x7; sr >>= 3;
268 xmc[2] = sr & 0x7; sr >>= 3;
269 xmc[3] = sr & 0x7; sr >>= 3;
270 xmc[4] = sr & 0x7; sr >>= 3;
272 xmc[5] = sr & 0x7; sr >>= 3;
273 xmc[6] = sr & 0x7; sr >>= 3;
275 xmc[7] = sr & 0x7; sr >>= 3;
276 xmc[8] = sr & 0x7; sr >>= 3;
277 xmc[9] = sr & 0x7; sr >>= 3;
279 xmc[10] = sr & 0x7; sr >>= 3;
280 xmc[11] = sr & 0x7; sr >>= 3;
281 xmc[12] = sr & 0x7; sr >>= 3;
283 Nc[1] = sr & 0x7f; sr >>= 7;
285 bc[1] = sr & 0x3; sr >>= 2;
286 Mc[1] = sr & 0x3; sr >>= 2;
288 xmaxc[1] = sr & 0x3f; sr >>= 6;
289#undef xmc
290#define xmc (source + 29 - 13)
291 xmc[13] = sr & 0x7; sr >>= 3;
292 xmc[14] = sr & 0x7; sr >>= 3;
294 xmc[15] = sr & 0x7; sr >>= 3;
295 xmc[16] = sr & 0x7; sr >>= 3;
296 xmc[17] = sr & 0x7; sr >>= 3;
298 xmc[18] = sr & 0x7; sr >>= 3;
299 xmc[19] = sr & 0x7; sr >>= 3;
301 xmc[20] = sr & 0x7; sr >>= 3;
302 xmc[21] = sr & 0x7; sr >>= 3;
303 xmc[22] = sr & 0x7; sr >>= 3;
305 xmc[23] = sr & 0x7; sr >>= 3;
306 xmc[24] = sr & 0x7; sr >>= 3;
307 xmc[25] = sr & 0x7; sr >>= 3;
309 Nc[2] = sr & 0x7f; sr >>= 7;
311 bc[2] = sr & 0x3; sr >>= 2;
312 Mc[2] = sr & 0x3; sr >>= 2;
314 xmaxc[2] = sr & 0x3f; sr >>= 6;
315#undef xmc
316#define xmc (source + 46 - 26)
317 xmc[26] = sr & 0x7; sr >>= 3;
318 xmc[27] = sr & 0x7; sr >>= 3;
320 xmc[28] = sr & 0x7; sr >>= 3;
321 xmc[29] = sr & 0x7; sr >>= 3;
322 xmc[30] = sr & 0x7; sr >>= 3;
324 xmc[31] = sr & 0x7; sr >>= 3;
325 xmc[32] = sr & 0x7; sr >>= 3;
327 xmc[33] = sr & 0x7; sr >>= 3;
328 xmc[34] = sr & 0x7; sr >>= 3;
329 xmc[35] = sr & 0x7; sr >>= 3;
331 xmc[36] = sr & 0x7; sr >>= 3;
332 xmc[37] = sr & 0x7; sr >>= 3;
333 xmc[38] = sr & 0x7; sr >>= 3;
335 Nc[3] = sr & 0x7f; sr >>= 7;
337 bc[3] = sr & 0x3; sr >>= 2;
338 Mc[3] = sr & 0x3; sr >>= 2;
340 xmaxc[3] = sr & 0x3f; sr >>= 6;
341#undef xmc
342#define xmc (source + 63 - 39)
343
344 xmc[39] = sr & 0x7; sr >>= 3;
345 xmc[40] = sr & 0x7; sr >>= 3;
347 xmc[41] = sr & 0x7; sr >>= 3;
348 xmc[42] = sr & 0x7; sr >>= 3;
349 xmc[43] = sr & 0x7; sr >>= 3;
351 xmc[44] = sr & 0x7; sr >>= 3;
352 xmc[45] = sr & 0x7; sr >>= 3;
354 xmc[46] = sr & 0x7; sr >>= 3;
355 xmc[47] = sr & 0x7; sr >>= 3;
356 xmc[48] = sr & 0x7; sr >>= 3;
358 xmc[49] = sr & 0x7; sr >>= 3;
359 xmc[50] = sr & 0x7; sr >>= 3;
360 xmc[51] = sr & 0x7; sr >>= 3;
361 }
362 }
363 else
364#endif
365 {
366
368 | ((
LARc[0] >> 2) & 0xF);
369 *
c++ = ((
LARc[0] & 0x3) << 6)
371 *
c++ = ((
LARc[2] & 0x1F) << 3)
372 | ((
LARc[3] >> 2) & 0x7);
373 *
c++ = ((
LARc[3] & 0x3) << 6)
374 | ((
LARc[4] & 0xF) << 2)
375 | ((
LARc[5] >> 2) & 0x3);
376 *
c++ = ((
LARc[5] & 0x3) << 6)
377 | ((
LARc[6] & 0x7) << 3)
379
380
381 *
c++ = ((
Nc[0] & 0x7F) << 1)
382
383
384 | ((
bc[0] >> 1) & 0x1);
385 *
c++ = ((
bc[0] & 0x1) << 7)
386
387
388 | ((
Mc[0] & 0x3) << 5)
389
390 | ((
xmaxc[0] >> 1) & 0x1F);
391 *
c++ = ((
xmaxc[0] & 0x1) << 7)
392
393#undef xmc
394#define xmc (source + 12)
395
396 | ((
xmc[0] & 0x7) << 4)
397 | ((
xmc[1] & 0x7) << 1)
398 | ((
xmc[2] >> 2) & 0x1);
399 *
c++ = ((
xmc[2] & 0x3) << 6)
400 | ((
xmc[3] & 0x7) << 3)
402 *
c++ = ((
xmc[5] & 0x7) << 5)
403 | ((
xmc[6] & 0x7) << 2)
404 | ((
xmc[7] >> 1) & 0x3);
405 *
c++ = ((
xmc[7] & 0x1) << 7)
406 | ((
xmc[8] & 0x7) << 4)
407 | ((
xmc[9] & 0x7) << 1)
408 | ((
xmc[10] >> 2) & 0x1);
409 *
c++ = ((
xmc[10] & 0x3) << 6)
410 | ((
xmc[11] & 0x7) << 3)
412
413
414 *
c++ = ((
Nc[1] & 0x7F) << 1)
415
416
417 | ((
bc[1] >> 1) & 0x1);
418 *
c++ = ((
bc[1] & 0x1) << 7)
419
420
421 | ((
Mc[1] & 0x3) << 5)
422
423
424 | ((
xmaxc[1] >> 1) & 0x1F);
425 *
c++ = ((
xmaxc[1] & 0x1) << 7)
426
427#undef xmc
428#define xmc (source + 29 - 13)
429
430 | ((
xmc[13] & 0x7) << 4)
431 | ((
xmc[14] & 0x7) << 1)
432 | ((
xmc[15] >> 2) & 0x1);
433 *
c++ = ((
xmc[15] & 0x3) << 6)
434 | ((
xmc[16] & 0x7) << 3)
436 *
c++ = ((
xmc[18] & 0x7) << 5)
437 | ((
xmc[19] & 0x7) << 2)
438 | ((
xmc[20] >> 1) & 0x3);
439 *
c++ = ((
xmc[20] & 0x1) << 7)
440 | ((
xmc[21] & 0x7) << 4)
441 | ((
xmc[22] & 0x7) << 1)
442 | ((
xmc[23] >> 2) & 0x1);
443 *
c++ = ((
xmc[23] & 0x3) << 6)
444 | ((
xmc[24] & 0x7) << 3)
446
447
448 *
c++ = ((
Nc[2] & 0x7F) << 1)
449
450
451 | ((
bc[2] >> 1) & 0x1);
452 *
c++ = ((
bc[2] & 0x1) << 7)
453
454
455 | ((
Mc[2] & 0x3) << 5)
456
457
458 | ((
xmaxc[2] >> 1) & 0x1F);
459 *
c++ = ((
xmaxc[2] & 0x1) << 7)
460
461#undef xmc
462#define xmc (source + 46 - 26)
463
464 | ((
xmc[26] & 0x7) << 4)
465 | ((
xmc[27] & 0x7) << 1)
466 | ((
xmc[28] >> 2) & 0x1);
467 *
c++ = ((
xmc[28] & 0x3) << 6)
468 | ((
xmc[29] & 0x7) << 3)
470 *
c++ = ((
xmc[31] & 0x7) << 5)
471 | ((
xmc[32] & 0x7) << 2)
472 | ((
xmc[33] >> 1) & 0x3);
473 *
c++ = ((
xmc[33] & 0x1) << 7)
474 | ((
xmc[34] & 0x7) << 4)
475 | ((
xmc[35] & 0x7) << 1)
476 | ((
xmc[36] >> 2) & 0x1);
477 *
c++ = ((
xmc[36] & 0x3) << 6)
478 | ((
xmc[37] & 0x7) << 3)
480
481
482 *
c++ = ((
Nc[3] & 0x7F) << 1)
483
484
485 | ((
bc[3] >> 1) & 0x1);
486 *
c++ = ((
bc[3] & 0x1) << 7)
487
488
489 | ((
Mc[3] & 0x3) << 5)
490
491
492 | ((
xmaxc[3] >> 1) & 0x1F);
493 *
c++ = ((
xmaxc[3] & 0x1) << 7)
494
495#undef xmc
496#define xmc (source + 63 - 39)
497
498 | ((
xmc[39] & 0x7) << 4)
499 | ((
xmc[40] & 0x7) << 1)
500 | ((
xmc[41] >> 2) & 0x1);
501 *
c++ = ((
xmc[41] & 0x3) << 6)
502 | ((
xmc[42] & 0x7) << 3)
504 *
c++ = ((
xmc[44] & 0x7) << 5)
505 | ((
xmc[45] & 0x7) << 2)
506 | ((
xmc[46] >> 1) & 0x3);
507 *
c++ = ((
xmc[46] & 0x1) << 7)
508 | ((
xmc[47] & 0x7) << 4)
509 | ((
xmc[48] & 0x7) << 1)
510 | ((
xmc[49] >> 2) & 0x1);
511 *
c++ = ((
xmc[49] & 0x3) << 6)
512 | ((
xmc[50] & 0x7) << 3)
514 }
515}
unsigned char frame_chain
unsigned char frame_index