27 LARc[0] = sr & 0x3f; sr >>= 6;
29 LARc[1] = sr & 0x3f; sr >>= 6;
31 LARc[2] = sr & 0x1f; sr >>= 5;
32 LARc[3] = sr & 0x1f; sr >>= 5;
34 LARc[4] = sr & 0xf; sr >>= 4;
35 LARc[5] = sr & 0xf; sr >>= 4;
37 LARc[6] = sr & 0x7; sr >>= 3;
38 LARc[7] = sr & 0x7; sr >>= 3;
40 Nc[0] = sr & 0x7f; sr >>= 7;
41 bc[0] = sr & 0x3; sr >>= 2;
42 Mc[0] = sr & 0x3; sr >>= 2;
44 xmaxc[0] = sr & 0x3f; sr >>= 6;
45 xmc[0] = sr & 0x7; sr >>= 3;
47 xmc[1] = sr & 0x7; sr >>= 3;
48 xmc[2] = sr & 0x7; sr >>= 3;
50 xmc[3] = sr & 0x7; sr >>= 3;
51 xmc[4] = sr & 0x7; sr >>= 3;
52 xmc[5] = sr & 0x7; sr >>= 3;
54 xmc[6] = sr & 0x7; sr >>= 3;
55 xmc[7] = sr & 0x7; sr >>= 3;
56 xmc[8] = sr & 0x7; sr >>= 3;
58 xmc[9] = sr & 0x7; sr >>= 3;
59 xmc[10] = sr & 0x7; sr >>= 3;
61 xmc[11] = sr & 0x7; sr >>= 3;
62 xmc[12] = sr & 0x7; sr >>= 3;
64 Nc[1] = sr & 0x7f; sr >>= 7;
65 bc[1] = sr & 0x3; sr >>= 2;
66 Mc[1] = sr & 0x3; sr >>= 2;
68 xmaxc[1] = sr & 0x3f; sr >>= 6;
69 xmc[13] = sr & 0x7; sr >>= 3;
71 xmc[14] = sr & 0x7; sr >>= 3;
72 xmc[15] = sr & 0x7; sr >>= 3;
74 xmc[16] = sr & 0x7; sr >>= 3;
75 xmc[17] = sr & 0x7; sr >>= 3;
76 xmc[18] = sr & 0x7; sr >>= 3;
78 xmc[19] = sr & 0x7; sr >>= 3;
79 xmc[20] = sr & 0x7; sr >>= 3;
80 xmc[21] = sr & 0x7; sr >>= 3;
82 xmc[22] = sr & 0x7; sr >>= 3;
83 xmc[23] = sr & 0x7; sr >>= 3;
85 xmc[24] = sr & 0x7; sr >>= 3;
86 xmc[25] = sr & 0x7; sr >>= 3;
88 Nc[2] = sr & 0x7f; sr >>= 7;
89 bc[2] = sr & 0x3; sr >>= 2;
90 Mc[2] = sr & 0x3; sr >>= 2;
92 xmaxc[2] = sr & 0x3f; sr >>= 6;
93 xmc[26] = sr & 0x7; sr >>= 3;
95 xmc[27] = sr & 0x7; sr >>= 3;
96 xmc[28] = sr & 0x7; sr >>= 3;
98 xmc[29] = sr & 0x7; sr >>= 3;
99 xmc[30] = sr & 0x7; sr >>= 3;
100 xmc[31] = sr & 0x7; sr >>= 3;
102 xmc[32] = sr & 0x7; sr >>= 3;
103 xmc[33] = sr & 0x7; sr >>= 3;
104 xmc[34] = sr & 0x7; sr >>= 3;
106 xmc[35] = sr & 0x7; sr >>= 3;
107 xmc[36] = sr & 0x7; sr >>= 3;
109 xmc[37] = sr & 0x7; sr >>= 3;
110 xmc[38] = sr & 0x7; sr >>= 3;
112 Nc[3] = sr & 0x7f; sr >>= 7;
113 bc[3] = sr & 0x3; sr >>= 2;
114 Mc[3] = sr & 0x3; sr >>= 2;
116 xmaxc[3] = sr & 0x3f; sr >>= 6;
117 xmc[39] = sr & 0x7; sr >>= 3;
119 xmc[40] = sr & 0x7; sr >>= 3;
120 xmc[41] = sr & 0x7; sr >>= 3;
122 xmc[42] = sr & 0x7; sr >>= 3;
123 xmc[43] = sr & 0x7; sr >>= 3;
124 xmc[44] = sr & 0x7; sr >>= 3;
126 xmc[45] = sr & 0x7; sr >>= 3;
127 xmc[46] = sr & 0x7; sr >>= 3;
128 xmc[47] = sr & 0x7; sr >>= 3;
130 xmc[48] = sr & 0x7; sr >>= 3;
131 xmc[49] = sr & 0x7; sr >>= 3;
133 xmc[50] = sr & 0x7; sr >>= 3;
134 xmc[51] = sr & 0x7; sr >>= 3;
141 LARc[0] = sr & 0x3f; sr >>= 6;
142 LARc[1] = sr & 0x3f; sr >>= 6;
144 LARc[2] = sr & 0x1f; sr >>= 5;
146 LARc[3] = sr & 0x1f; sr >>= 5;
147 LARc[4] = sr & 0xf; sr >>= 4;
149 LARc[5] = sr & 0xf; sr >>= 4;
150 LARc[6] = sr & 0x7; sr >>= 3;
151 LARc[7] = sr & 0x7; sr >>= 3;
153 Nc[0] = sr & 0x7f; sr >>= 7;
155 bc[0] = sr & 0x3; sr >>= 2;
156 Mc[0] = sr & 0x3; sr >>= 2;
158 xmaxc[0] = sr & 0x3f; sr >>= 6;
159 xmc[0] = sr & 0x7; sr >>= 3;
160 xmc[1] = sr & 0x7; sr >>= 3;
162 xmc[2] = sr & 0x7; sr >>= 3;
163 xmc[3] = sr & 0x7; sr >>= 3;
164 xmc[4] = sr & 0x7; sr >>= 3;
166 xmc[5] = sr & 0x7; sr >>= 3;
167 xmc[6] = sr & 0x7; sr >>= 3;
169 xmc[7] = sr & 0x7; sr >>= 3;
170 xmc[8] = sr & 0x7; sr >>= 3;
171 xmc[9] = sr & 0x7; sr >>= 3;
173 xmc[10] = sr & 0x7; sr >>= 3;
174 xmc[11] = sr & 0x7; sr >>= 3;
175 xmc[12] = sr & 0x7; sr >>= 3;
177 Nc[1] = sr & 0x7f; sr >>= 7;
179 bc[1] = sr & 0x3; sr >>= 2;
180 Mc[1] = sr & 0x3; sr >>= 2;
182 xmaxc[1] = sr & 0x3f; sr >>= 6;
183 xmc[13] = sr & 0x7; sr >>= 3;
184 xmc[14] = sr & 0x7; sr >>= 3;
186 xmc[15] = sr & 0x7; sr >>= 3;
187 xmc[16] = sr & 0x7; sr >>= 3;
188 xmc[17] = sr & 0x7; sr >>= 3;
190 xmc[18] = sr & 0x7; sr >>= 3;
191 xmc[19] = sr & 0x7; sr >>= 3;
193 xmc[20] = sr & 0x7; sr >>= 3;
194 xmc[21] = sr & 0x7; sr >>= 3;
195 xmc[22] = sr & 0x7; sr >>= 3;
197 xmc[23] = sr & 0x7; sr >>= 3;
198 xmc[24] = sr & 0x7; sr >>= 3;
199 xmc[25] = sr & 0x7; sr >>= 3;
201 Nc[2] = sr & 0x7f; sr >>= 7;
203 bc[2] = sr & 0x3; sr >>= 2;
204 Mc[2] = sr & 0x3; sr >>= 2;
206 xmaxc[2] = sr & 0x3f; sr >>= 6;
207 xmc[26] = sr & 0x7; sr >>= 3;
208 xmc[27] = sr & 0x7; sr >>= 3;
210 xmc[28] = sr & 0x7; sr >>= 3;
211 xmc[29] = sr & 0x7; sr >>= 3;
212 xmc[30] = sr & 0x7; sr >>= 3;
214 xmc[31] = sr & 0x7; sr >>= 3;
215 xmc[32] = sr & 0x7; sr >>= 3;
217 xmc[33] = sr & 0x7; sr >>= 3;
218 xmc[34] = sr & 0x7; sr >>= 3;
219 xmc[35] = sr & 0x7; sr >>= 3;
221 xmc[36] = sr & 0x7; sr >>= 3;
222 xmc[37] = sr & 0x7; sr >>= 3;
223 xmc[38] = sr & 0x7; sr >>= 3;
225 Nc[3] = sr & 0x7f; sr >>= 7;
227 bc[3] = sr & 0x3; sr >>= 2;
228 Mc[3] = sr & 0x3; sr >>= 2;
230 xmaxc[3] = sr & 0x3f; sr >>= 6;
231 xmc[39] = sr & 0x7; sr >>= 3;
232 xmc[40] = sr & 0x7; sr >>= 3;
234 xmc[41] = sr & 0x7; sr >>= 3;
235 xmc[42] = sr & 0x7; sr >>= 3;
236 xmc[43] = sr & 0x7; sr >>= 3;
238 xmc[44] = sr & 0x7; sr >>= 3;
239 xmc[45] = sr & 0x7; sr >>= 3;
241 xmc[46] = sr & 0x7; sr >>= 3;
242 xmc[47] = sr & 0x7; sr >>= 3;
243 xmc[48] = sr & 0x7; sr >>= 3;
245 xmc[49] = sr & 0x7; sr >>= 3;
246 xmc[50] = sr & 0x7; sr >>= 3;
247 xmc[51] = sr & 0x7; sr >>= 3;
255 if (((*
c >> 4) & 0x0F) !=
GSM_MAGIC)
return -1;
257 LARc[0] = (*
c++ & 0xF) << 2;
258 LARc[0] |= (*
c >> 6) & 0x3;
259 LARc[1] = *
c++ & 0x3F;
260 LARc[2] = (*
c >> 3) & 0x1F;
261 LARc[3] = (*
c++ & 0x7) << 2;
262 LARc[3] |= (*
c >> 6) & 0x3;
263 LARc[4] = (*
c >> 2) & 0xF;
264 LARc[5] = (*
c++ & 0x3) << 2;
265 LARc[5] |= (*
c >> 6) & 0x3;
266 LARc[6] = (*
c >> 3) & 0x7;
267 LARc[7] = *
c++ & 0x7;
268 Nc[0] = (*
c >> 1) & 0x7F;
269 bc[0] = (*
c++ & 0x1) << 1;
270 bc[0] |= (*
c >> 7) & 0x1;
271 Mc[0] = (*
c >> 5) & 0x3;
272 xmaxc[0] = (*
c++ & 0x1F) << 1;
273 xmaxc[0] |= (*
c >> 7) & 0x1;
274 xmc[0] = (*
c >> 4) & 0x7;
275 xmc[1] = (*
c >> 1) & 0x7;
276 xmc[2] = (*
c++ & 0x1) << 2;
277 xmc[2] |= (*
c >> 6) & 0x3;
278 xmc[3] = (*
c >> 3) & 0x7;
280 xmc[5] = (*
c >> 5) & 0x7;
281 xmc[6] = (*
c >> 2) & 0x7;
282 xmc[7] = (*
c++ & 0x3) << 1;
283 xmc[7] |= (*
c >> 7) & 0x1;
284 xmc[8] = (*
c >> 4) & 0x7;
285 xmc[9] = (*
c >> 1) & 0x7;
286 xmc[10] = (*
c++ & 0x1) << 2;
287 xmc[10] |= (*
c >> 6) & 0x3;
288 xmc[11] = (*
c >> 3) & 0x7;
289 xmc[12] = *
c++ & 0x7;
290 Nc[1] = (*
c >> 1) & 0x7F;
291 bc[1] = (*
c++ & 0x1) << 1;
292 bc[1] |= (*
c >> 7) & 0x1;
293 Mc[1] = (*
c >> 5) & 0x3;
294 xmaxc[1] = (*
c++ & 0x1F) << 1;
295 xmaxc[1] |= (*
c >> 7) & 0x1;
296 xmc[13] = (*
c >> 4) & 0x7;
297 xmc[14] = (*
c >> 1) & 0x7;
298 xmc[15] = (*
c++ & 0x1) << 2;
299 xmc[15] |= (*
c >> 6) & 0x3;
300 xmc[16] = (*
c >> 3) & 0x7;
301 xmc[17] = *
c++ & 0x7;
302 xmc[18] = (*
c >> 5) & 0x7;
303 xmc[19] = (*
c >> 2) & 0x7;
304 xmc[20] = (*
c++ & 0x3) << 1;
305 xmc[20] |= (*
c >> 7) & 0x1;
306 xmc[21] = (*
c >> 4) & 0x7;
307 xmc[22] = (*
c >> 1) & 0x7;
308 xmc[23] = (*
c++ & 0x1) << 2;
309 xmc[23] |= (*
c >> 6) & 0x3;
310 xmc[24] = (*
c >> 3) & 0x7;
311 xmc[25] = *
c++ & 0x7;
312 Nc[2] = (*
c >> 1) & 0x7F;
313 bc[2] = (*
c++ & 0x1) << 1;
314 bc[2] |= (*
c >> 7) & 0x1;
315 Mc[2] = (*
c >> 5) & 0x3;
316 xmaxc[2] = (*
c++ & 0x1F) << 1;
317 xmaxc[2] |= (*
c >> 7) & 0x1;
318 xmc[26] = (*
c >> 4) & 0x7;
319 xmc[27] = (*
c >> 1) & 0x7;
320 xmc[28] = (*
c++ & 0x1) << 2;
321 xmc[28] |= (*
c >> 6) & 0x3;
322 xmc[29] = (*
c >> 3) & 0x7;
323 xmc[30] = *
c++ & 0x7;
324 xmc[31] = (*
c >> 5) & 0x7;
325 xmc[32] = (*
c >> 2) & 0x7;
326 xmc[33] = (*
c++ & 0x3) << 1;
327 xmc[33] |= (*
c >> 7) & 0x1;
328 xmc[34] = (*
c >> 4) & 0x7;
329 xmc[35] = (*
c >> 1) & 0x7;
330 xmc[36] = (*
c++ & 0x1) << 2;
331 xmc[36] |= (*
c >> 6) & 0x3;
332 xmc[37] = (*
c >> 3) & 0x7;
333 xmc[38] = *
c++ & 0x7;
334 Nc[3] = (*
c >> 1) & 0x7F;
335 bc[3] = (*
c++ & 0x1) << 1;
336 bc[3] |= (*
c >> 7) & 0x1;
337 Mc[3] = (*
c >> 5) & 0x3;
338 xmaxc[3] = (*
c++ & 0x1F) << 1;
339 xmaxc[3] |= (*
c >> 7) & 0x1;
340 xmc[39] = (*
c >> 4) & 0x7;
341 xmc[40] = (*
c >> 1) & 0x7;
342 xmc[41] = (*
c++ & 0x1) << 2;
343 xmc[41] |= (*
c >> 6) & 0x3;
344 xmc[42] = (*
c >> 3) & 0x7;
345 xmc[43] = *
c++ & 0x7;
346 xmc[44] = (*
c >> 5) & 0x7;
347 xmc[45] = (*
c >> 2) & 0x7;
348 xmc[46] = (*
c++ & 0x3) << 1;
349 xmc[46] |= (*
c >> 7) & 0x1;
350 xmc[47] = (*
c >> 4) & 0x7;
351 xmc[48] = (*
c >> 1) & 0x7;
352 xmc[49] = (*
c++ & 0x1) << 2;
353 xmc[49] |= (*
c >> 6) & 0x3;
354 xmc[50] = (*
c >> 3) & 0x7;
358 Gsm_Decoder(s, LARc, Nc, bc, Mc, xmaxc, xmc, target);
unsigned char frame_index
unsigned char frame_chain