annotate pcmu2efr/comb-out.c @ 24:c52fb8080faf

pcmu2efr: emit all 320 computed frames
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 12 May 2024 04:28:49 +0000
parents pcmu2efr/comb-diff.c@2628a34fe75b
children 1f58ba0d79a4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This program computes 160 possible EFR encoder outputs using standard EFR,
24
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
3 * then 160 possible outputs in AMR-EFR, then writes out all 320 frames
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
4 * to a gsmx output file.
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 */
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <stdio.h>
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <stdint.h>
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <stdlib.h>
17
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
10 #include <string.h>
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
11 #include <strings.h>
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 extern uint8_t standard_efr[160][31];
21
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
14 extern uint8_t amr_efr[160][31];
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 main(argc, argv)
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 char **argv;
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 {
24
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
19 FILE *outf;
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
24
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
21 if (argc != 2) {
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
22 fprintf(stderr, "usage: %s gsmx-out-file\n", argv[0]);
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
23 exit(1);
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
24 }
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 generate_linear_inputs();
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 generate_std_efr();
21
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
27 generate_amr_efr();
24
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
28 fwrite(standard_efr, 31, 160, outf);
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
29 fwrite(amr_efr, 31, 160, outf);
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
30 fclose(outf);
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 exit(0);
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 }