comparison trau-decode/parse-amr.c @ 87:9cd468f6872c

trau-parse: AMR 5k90 CRC
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 04 Mar 2025 23:41:52 +0000
parents 8b7ba6f4a85e
children cec24988550a
comparison
equal deleted inserted replaced
86:8b7ba6f4a85e 87:9cd468f6872c
65 65
66 static void 66 static void
67 decode_mode_2(c_bits, d_bits) 67 decode_mode_2(c_bits, d_bits)
68 ubit_t *c_bits, *d_bits; 68 ubit_t *c_bits, *d_bits;
69 { 69 {
70 ubit_t crc_collect[54];
71 int crc1, crc2, crc3, crc4;
72
73 bcopy(c_bits, crc_collect, 25);
74 bcopy(d_bits + 41, crc_collect + 25, 17);
75 bcopy(d_bits + 67, crc_collect + 42, 8);
76 bcopy(d_bits + 88, crc_collect + 50, 4);
77 crc1 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 54,
78 d_bits + 92);
79 bcopy(d_bits + 95, crc_collect, 3);
80 bcopy(d_bits + 112, crc_collect + 3, 4);
81 crc2 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 7,
82 d_bits + 116);
83 bcopy(d_bits + 119, crc_collect, 8);
84 bcopy(d_bits + 140, crc_collect + 8, 4);
85 crc3 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 12,
86 d_bits + 144);
87 bcopy(d_bits + 147, crc_collect, 3);
88 bcopy(d_bits + 164, crc_collect + 3, 4);
89 crc4 = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 7,
90 d_bits + 168);
91 printf(" CRC %s %s %s %s\n",
92 crc1 ? "bad" : "good", crc2 ? "bad" : "good",
93 crc3 ? "bad" : "good", crc4 ? "bad" : "good");
70 } 94 }
71 95
72 static void 96 static void
73 decode_mode_3(c_bits, d_bits) 97 decode_mode_3(c_bits, d_bits)
74 ubit_t *c_bits, *d_bits; 98 ubit_t *c_bits, *d_bits;