annotate pcma2efr/comb-out.c @ 40:e38e8d0fba70

ae-dec-dhf: complete generation
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 14 May 2024 08:18:17 +0000
parents 760bbae44c1f
children
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();
25
1f58ba0d79a4 pcmu2efr: brown paper bag
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
28 outf = fopen(argv[1], "w");
1f58ba0d79a4 pcmu2efr: brown paper bag
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
29 if (!outf) {
1f58ba0d79a4 pcmu2efr: brown paper bag
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
30 perror(argv[1]);
1f58ba0d79a4 pcmu2efr: brown paper bag
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
31 exit(1);
1f58ba0d79a4 pcmu2efr: brown paper bag
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
32 }
24
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
33 fwrite(standard_efr, 31, 160, outf);
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
34 fwrite(amr_efr, 31, 160, outf);
c52fb8080faf pcmu2efr: emit all 320 computed frames
Mychaela Falconia <falcon@freecalypso.org>
parents: 23
diff changeset
35 fclose(outf);
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 exit(0);
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 }