comparison amrconv/param_dump.c @ 211:78d1a6513393

amrconv: new program amr-cod-parse
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 20 Apr 2023 01:30:46 +0000
parents
children
comparison
equal deleted inserted replaced
210:7e490a8efe8a 211:78d1a6513393
1 /*
2 * This C module is common between amr-cod-parse and amr-ietf-parse
3 * utilities. It contains the function that takes an array of
4 * extracted codec parameters and prints them out as appropriate
5 * for each mode.
6 */
7
8 #include <stdio.h>
9 #include <stdint.h>
10 #include "amr_defs.h"
11
12 void
13 dump_amr_params(params, mode)
14 uint16_t *params;
15 unsigned mode;
16 {
17 int i, j, n;
18
19 switch (mode) {
20 case MR475:
21 printf(" %u %u %u\n", params[0], params[1], params[2]);
22 printf(" %u %u %u %u\n", params[3], params[4], params[5],
23 params[6]);
24 printf(" %u %u %u\n", params[7], params[8], params[9]);
25 printf(" %u %u %u %u\n", params[10], params[11], params[12],
26 params[13]);
27 printf(" %u %u %u\n", params[14], params[15], params[16]);
28 return;
29 case MR515:
30 case MR59:
31 case MR67:
32 case MR74:
33 printf(" %u %u %u\n", params[0], params[1], params[2]);
34 n = 3;
35 for (i = 0; i < 4; i++) {
36 putchar(' ');
37 for (j = 0; j < 4; j++)
38 printf(" %u", params[n++]);
39 putchar('\n');
40 }
41 return;
42 case MR795:
43 printf(" %u %u %u\n", params[0], params[1], params[2]);
44 n = 3;
45 for (i = 0; i < 4; i++) {
46 putchar(' ');
47 for (j = 0; j < 5; j++)
48 printf(" %u", params[n++]);
49 putchar('\n');
50 }
51 return;
52 case MR102:
53 printf(" %u %u %u\n", params[0], params[1], params[2]);
54 n = 3;
55 for (i = 0; i < 4; i++) {
56 putchar(' ');
57 for (j = 0; j < 9; j++)
58 printf(" %u", params[n++]);
59 putchar('\n');
60 }
61 return;
62 case MR122:
63 printf(" %u %u %u %u %u\n", params[0], params[1], params[2],
64 params[3], params[4]);
65 n = 5;
66 for (i = 0; i < 4; i++) {
67 putchar(' ');
68 for (j = 0; j < 13; j++)
69 printf(" %u", params[n++]);
70 putchar('\n');
71 }
72 return;
73 case MRDTX:
74 printf(" %u %u %u %u %u\n", params[0], params[1], params[2],
75 params[3], params[4]);
76 return;
77 }
78 }