annotate pcmu2efr/stdefr-diff.c @ 50:0db059f4632d

efr-sid OS#6538: more sensible 2-bit errors
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 12 Aug 2024 02:49:28 +0000
parents 39b3c24256ae
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,
17
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
3 * and then does a diff among them, seeking to verify that they are all
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
4 * distinct.
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];
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 main(argc, argv)
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 char **argv;
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 {
17
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
18 unsigned m, n;
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 generate_linear_inputs();
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 generate_std_efr();
17
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
22 for (m = 0; m < 159; m++) {
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
23 for (n = m + 1; n < 160; n++) {
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
24 if (!memcmp(standard_efr[m], standard_efr[n], 31))
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
25 printf("Bad: sequences #%u and #%u are equal\n",
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
26 m, n);
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
27 }
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 }
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 exit(0);
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 }