FreeCalypso > hg > gsm-net-reveng
comparison trau-decode/parse-amr.c @ 81:9eff2af191d5
trau-parse: AMR 10k2 CRC
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 08 Feb 2025 20:36:23 +0000 |
parents | 58dfdb2fc6df |
children | 31a8d34b71ed |
comparison
equal
deleted
inserted
replaced
80:58dfdb2fc6df | 81:9eff2af191d5 |
---|---|
89 | 89 |
90 static void | 90 static void |
91 decode_mode_6(c_bits, d_bits) | 91 decode_mode_6(c_bits, d_bits) |
92 ubit_t *c_bits, *d_bits; | 92 ubit_t *c_bits, *d_bits; |
93 { | 93 { |
94 ubit_t crc_collect[82]; | |
95 int crc1, crc2, crc3, crc4; | |
96 | |
97 bcopy(c_bits, crc_collect, 25); | |
98 bcopy(d_bits, crc_collect + 25, 45); | |
99 bcopy(d_bits + 46, crc_collect + 70, 8); | |
100 bcopy(d_bits + 85, crc_collect + 78, 2); | |
101 bcopy(d_bits + 88, crc_collect + 80, 2); | |
102 crc1 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 82, | |
103 d_bits + 92); | |
104 bcopy(d_bits + 95, crc_collect, 4); | |
105 bcopy(d_bits + 131, crc_collect + 4, 2); | |
106 bcopy(d_bits + 134, crc_collect + 6, 2); | |
107 crc2 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 8, | |
108 d_bits + 138); | |
109 bcopy(d_bits + 141, crc_collect, 8); | |
110 bcopy(d_bits + 180, crc_collect + 8, 2); | |
111 bcopy(d_bits + 183, crc_collect + 10, 2); | |
112 crc3 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 12, | |
113 d_bits + 187); | |
114 bcopy(d_bits + 190, crc_collect, 4); | |
115 bcopy(d_bits + 226, crc_collect + 4, 2); | |
116 bcopy(d_bits + 229, crc_collect + 6, 2); | |
117 bcopy(d_bits + 233, crc_collect + 8, 20); | |
118 crc4 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 28, | |
119 d_bits + 253); | |
120 printf(" CRC %s %s %s %s\n", | |
121 crc1 ? "bad" : "good", crc2 ? "bad" : "good", | |
122 crc3 ? "bad" : "good", crc4 ? "bad" : "good"); | |
94 } | 123 } |
95 | 124 |
96 static void | 125 static void |
97 decode_mode_7(c_bits, d_bits) | 126 decode_mode_7(c_bits, d_bits) |
98 ubit_t *c_bits, *d_bits; | 127 ubit_t *c_bits, *d_bits; |