FreeCalypso > hg > gsm-net-reveng
changeset 105:699afc9ef063
TRAU-AMR-8k: implement MR74 speech decoding
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Thu, 20 Nov 2025 22:28:45 +0000 |
| parents | 9cc76853d291 |
| children | 028307356ba9 |
| files | trau-decode/amr8-common.c |
| diffstat | 1 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/trau-decode/amr8-common.c Thu Nov 20 22:09:43 2025 +0000 +++ b/trau-decode/amr8-common.c Thu Nov 20 22:28:45 2025 +0000 @@ -456,6 +456,7 @@ print_speech_params(d_bits + 58, params_67_sf24); print_speech_params(d_bits + 83, params_67_sf13); print_speech_params(d_bits + 112, params_67_sf24); + saved_mode_valid = 0; } @@ -463,7 +464,31 @@ handle_amr8_7k4(frame_bits) ubit_t *frame_bits; { - puts(" TRAU-AMR-8k MR74 format, decoding to be implemented"); + ubit_t *c_bits = frame_bits + 17; + ubit_t d_bits[151], crc_collect[37]; + int crc_stat; + + bcopy(frame_bits + 3, d_bits, 5); + bcopy(frame_bits + 9, d_bits + 5, 7); + bcopy(frame_bits + 20, d_bits + 12, 4); + bcopy(frame_bits + 25, d_bits + 16, 135); + + decode_6k7_7k4_common(c_bits, d_bits, "MR74", 5); + bcopy(c_bits, crc_collect, 3); + bcopy(d_bits, crc_collect + 3, 20); + bcopy(d_bits + 21, crc_collect + 23, 3); + bcopy(d_bits + 26, crc_collect + 26, 6); + bcopy(d_bits + 51, crc_collect + 32, 2); + bcopy(d_bits + 54, crc_collect + 34, 3); + crc_stat = osmo_crc8gen_check_bits(&gsm0860_amr_crc3, crc_collect, 37, + d_bits + 58); + printf(" CRC %s\n", crc_stat ? "bad" : "good"); + print_speech_params(d_bits, params_lsf_59_67_74); + print_speech_params(d_bits + 26, params_74_sf13); + print_speech_params(d_bits + 61, params_74_sf24); + print_speech_params(d_bits + 90, params_74_sf13); + print_speech_params(d_bits + 122, params_74_sf24); + saved_mode_valid = 0; }
