comparison dev/efr-bit-packing.c @ 32:9639a44ae2e7

dev: efr-bit-packing helper program
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 24 Nov 2022 01:41:49 +0000
parents
children
comparison
equal deleted inserted replaced
31:19a90fa1f608 32:9639a44ae2e7
1 /*
2 * We would like to generate our EFR RTP frame packing and unpacking code
3 * using bitter and sweet utilities from libgsm, so we'll end up packing
4 * and unpacking EFR just like good old FR. However, because of our
5 * slightly different approach, entering the spec file for bitter and sweet
6 * manually would be tedious and error-prone, hence we are going to
7 * generate it with this program.
8 */
9
10 #include <stdio.h>
11 #include <stdlib.h>
12
13 #define PRM_NO 57
14
15 /* table from ETSI EFR code */
16 static const unsigned bitno[PRM_NO] =
17 {
18 7, 8, 9, 8, 6, /* LSP VQ */
19 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* first subframe */
20 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* second subframe */
21 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* third subframe */
22 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5 /* fourth subframe */
23 };
24
25 main(argc, argv)
26 char **argv;
27 {
28 unsigned n;
29
30 printf("EFR_MAGIC\t4\n");
31 for (n = 0; n < PRM_NO; n++)
32 printf("params[%u]\t%u\n", n, bitno[n]);
33 exit(0);
34 }