FreeCalypso > hg > gsm-codec-lib
comparison dev/gsmfr-dhf.c @ 277:37dc5c84bbe9
dev: generate RTP-packed GSM-FR DHF
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Apr 2024 04:00:02 +0000 |
parents | dev/gsm0611-silence-fr.c@e4ca04586118 |
children |
comparison
equal
deleted
inserted
replaced
276:e4ca04586118 | 277:37dc5c84bbe9 |
---|---|
1 /* | |
2 * This program is meant to be run only once by the developer - it | |
3 * generates RTP-packed form of the decoder homing frame for GSM-FR, | |
4 * as specified in more recent versions of GSM 06.10 spec. | |
5 */ | |
6 | |
7 #include <stdio.h> | |
8 #include <stdint.h> | |
9 #include <stdlib.h> | |
10 #include <string.h> | |
11 #include <strings.h> | |
12 | |
13 extern void gsmfr_pack_to_rtp(const int16_t *params, uint8_t *frame); | |
14 | |
15 static const int16_t larc[8] = {9, 23, 15, 8, 7, 3, 3, 2}; | |
16 | |
17 main(argc, argv) | |
18 char **argv; | |
19 { | |
20 int16_t params[76], *pp; | |
21 uint8_t frame[33]; | |
22 unsigned m, n; | |
23 | |
24 /* gather params */ | |
25 bcopy(larc, params, sizeof(int16_t) * 8); | |
26 pp = params + 8; | |
27 for (m = 0; m < 4; m++) { | |
28 *pp++ = 40; | |
29 *pp++ = 0; | |
30 *pp++ = 0; | |
31 *pp++ = 0; | |
32 for (n = 0; n < 13; n++) { | |
33 if (m == 3 && n == 4) | |
34 *pp++ = 3; | |
35 else | |
36 *pp++ = 4; | |
37 } | |
38 } | |
39 /* generate frame */ | |
40 gsmfr_pack_to_rtp(params, frame); | |
41 /* print the frame */ | |
42 for (n = 0; n < 33; n++) { | |
43 printf("0x%02X,", frame[n]); | |
44 if (n == 4 || n == 11 || n == 18 || n == 25 || n == 32) | |
45 putchar('\n'); | |
46 else | |
47 putchar(' '); | |
48 } | |
49 exit(0); | |
50 } |