FreeCalypso > hg > gsm-net-reveng
annotate trau-decode/parse-efr.c @ 53:c93ecd225b7f
d144: generate d144-ul-input.bin
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 25 Sep 2024 03:50:11 +0000 |
parents | bf5c9fb431b8 |
children |
rev | line source |
---|---|
4
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module implements the EFR decoding part of trau-parse. |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <stdio.h> |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdint.h> |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdlib.h> |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <string.h> |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <strings.h> |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <gsm_efr.h> |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include "osmo_bits.h" |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 /* |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 * EFR TRAU parity |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 * |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 * g(x) = x^3 + x^1 + 1 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 */ |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 static const struct osmo_crc8gen_code gsm0860_efr_crc3 = { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 .bits = 3, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 .poly = 0x3, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 .init = 0x0, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 .remainder = 0x7, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 }; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 /* re-combine EFR parity bits */ |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 static inline void efr_parity_bits_1(ubit_t *check_bits, const ubit_t *d_bits) |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 memcpy(check_bits + 0 , d_bits + 0, 22); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 memcpy(check_bits + 22 , d_bits + 24, 3); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 check_bits[25] = d_bits[28]; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 } |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 static inline void efr_parity_bits_2(ubit_t *check_bits, const ubit_t *d_bits) |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 memcpy(check_bits + 0 , d_bits + 42, 10); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 memcpy(check_bits + 10 , d_bits + 90, 2); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 } |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 static inline void efr_parity_bits_3(ubit_t *check_bits, const ubit_t *d_bits) |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 memcpy(check_bits + 0 , d_bits + 98, 5); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 check_bits[5] = d_bits[104]; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 memcpy(check_bits + 6 , d_bits + 143, 2); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 } |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 static inline void efr_parity_bits_4(ubit_t *check_bits, const ubit_t *d_bits) |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 memcpy(check_bits + 0 , d_bits + 151, 10); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 memcpy(check_bits + 10 , d_bits + 199, 2); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 } |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 static inline void efr_parity_bits_5(ubit_t *check_bits, const ubit_t *d_bits) |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 memcpy(check_bits + 0 , d_bits + 207, 5); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 check_bits[5] = d_bits[213]; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 memcpy(check_bits + 6 , d_bits + 252, 2); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 } |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 void |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 check_efr_crc(d_bits) |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 ubit_t *d_bits; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 { |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 ubit_t check_bits[26]; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 int rc1, rc2, rc3, rc4, rc5; |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 efr_parity_bits_1(check_bits, d_bits); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 rc1 = osmo_crc8gen_check_bits(&gsm0860_efr_crc3, check_bits, 26, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 d_bits + 39); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 efr_parity_bits_2(check_bits, d_bits); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 rc2 = osmo_crc8gen_check_bits(&gsm0860_efr_crc3, check_bits, 12, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 d_bits + 95); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 efr_parity_bits_3(check_bits, d_bits); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 rc3 = osmo_crc8gen_check_bits(&gsm0860_efr_crc3, check_bits, 8, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 d_bits + 148); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 efr_parity_bits_4(check_bits, d_bits); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 rc4 = osmo_crc8gen_check_bits(&gsm0860_efr_crc3, check_bits, 12, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 d_bits + 204); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 efr_parity_bits_5(check_bits, d_bits); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 rc5 = osmo_crc8gen_check_bits(&gsm0860_efr_crc3, check_bits, 8, |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 d_bits + 257); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 printf(" D1=%u CRC: %s %s %s %s %s\n", d_bits[0], |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 rc1 ? "bad" : "good", rc2 ? "bad" : "good", |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 rc3 ? "bad" : "good", rc4 ? "bad" : "good", |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 rc5 ? "bad" : "good"); |
d9c095357c32
trau-parse: check and report EFR CRC
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 } |
5
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
86 |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
87 static void |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
88 dbits_to_frame(d_bits, frame) |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
89 ubit_t *d_bits; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
90 uint8_t *frame; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
91 { |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
92 ubit_t intermed[248], *ip; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
93 uint8_t *op, mask; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
94 unsigned nb; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
95 |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
96 intermed[0] = 1; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
97 intermed[1] = 1; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
98 intermed[2] = 0; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
99 intermed[3] = 0; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
100 bcopy(d_bits + 1, intermed + 4, 38); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
101 bcopy(d_bits + 42, intermed + 42, 53); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
102 bcopy(d_bits + 98, intermed + 95, 50); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
103 bcopy(d_bits + 151, intermed + 145, 53); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
104 bcopy(d_bits + 207, intermed + 198, 50); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
105 ip = intermed; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
106 op = frame; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
107 for (nb = 0; nb < EFR_RTP_FRAME_LEN; nb++) { |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
108 *op = 0; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
109 for (mask = 0x80; mask; mask >>= 1) { |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
110 if (*ip) |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
111 *op |= mask; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
112 ip++; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
113 } |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
114 op++; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
115 } |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
116 } |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
117 |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
118 void |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
119 print_efr_frame(d_bits) |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
120 ubit_t *d_bits; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
121 { |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
122 uint8_t frame[EFR_RTP_FRAME_LEN]; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
123 int16_t params[EFR_NUM_PARAMS]; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
124 int i, j, n, sid; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
125 |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
126 dbits_to_frame(d_bits, frame); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
127 EFR_frame2params(frame, params); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
128 fputs(" EFR frame:\n LPC", stdout); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
129 n = 0; |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
130 for (i = 0; i < 5; i++) |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
131 printf(" %d", params[n++]); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
132 putchar('\n'); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
133 for (i = 0; i < 4; i++) { |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
134 fputs(" ", stdout); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
135 for (j = 0; j < 13; j++) |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
136 printf(" %d", params[n++]); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
137 putchar('\n'); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
138 } |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
139 sid = EFR_sid_classify(frame); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
140 printf(" SID recompute: %d\n", sid); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
141 if (!bcmp(frame, EFR_decoder_homing_frame, EFR_RTP_FRAME_LEN)) |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
142 puts(" Matches DHF"); |
bf5c9fb431b8
trau-parse: implement EFR decoding
Mychaela Falconia <falcon@freecalypso.org>
parents:
4
diff
changeset
|
143 } |