FreeCalypso > hg > vband-misc
comparison dhf/efr-dhf-hexout.c @ 32:baf74dff5368
dhf: generate hex forms of EFR DHF
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 13 May 2024 06:26:22 +0000 |
parents | |
children | 307fe06fabec |
comparison
equal
deleted
inserted
replaced
31:dd9a9368009e | 32:baf74dff5368 |
---|---|
1 /* | |
2 * This little program takes EFR and MR122 DHFs provided in array-of-params | |
3 * form by libtwamr, turns them into EFR RTP format using libgsmefr function, | |
4 * and emits those two RTP-encoded EFR frames in hex, for inclusion in other | |
5 * C sources. | |
6 */ | |
7 | |
8 #include <stdio.h> | |
9 #include <stdint.h> | |
10 #include <stdlib.h> | |
11 #include <gsm_efr.h> | |
12 #include <tw_amr.h> | |
13 | |
14 static void | |
15 emit_one_frame(params, name) | |
16 const int16_t *params; | |
17 char *name; | |
18 { | |
19 uint8_t efr_rtp[EFR_RTP_FRAME_LEN]; | |
20 unsigned n; | |
21 | |
22 EFR_params2frame(params, efr_rtp); | |
23 printf("%s:\n\n", name); | |
24 for (n = 0; n < EFR_RTP_FRAME_LEN; n++) { | |
25 printf("0x%02X,", efr_rtp[n]); | |
26 if (n == 15 || n == 30) | |
27 putchar('\n'); | |
28 } | |
29 putchar('\n'); | |
30 } | |
31 | |
32 main(argc, argv) | |
33 char **argv; | |
34 { | |
35 emit_one_frame(amr_dhf_gsmefr, "EFR DHF"); | |
36 emit_one_frame(amr_dhf_mr122, "MR122 DHF"); | |
37 exit(0); | |
38 } |