annotate pcmu2efr/comb-diff.c @ 21:3eb407b08b4c

pcmu2efr: confirm that we got 280 distinct outputs so far
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 12 May 2024 03:15:23 +0000
parents pcmu2efr/stdefr-diff.c@39b3c24256ae
children 2628a34fe75b
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,
21
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
3 * then 120 possible outputs using "simple" AMR-EFR, then does a diff
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
4 * among them, seeking to verify that they are all 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];
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 {
21
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
19 uint8_t combine[320][31];
17
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
20 unsigned m, n;
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 generate_linear_inputs();
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 generate_std_efr();
21
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
24 generate_amr_efr();
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
25 bcopy(standard_efr, combine, 160*31);
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
26 bcopy(amr_efr, combine + 160, 160*31);
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
27 for (m = 0; m < 279; m++) {
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
28 for (n = m + 1; n < 280; n++) {
3eb407b08b4c pcmu2efr: confirm that we got 280 distinct outputs so far
Mychaela Falconia <falcon@freecalypso.org>
parents: 17
diff changeset
29 if (!memcmp(combine[m], combine[n], 31))
17
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
30 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
31 m, n);
39b3c24256ae pcmu2efr: add stdefr-diff sanity check
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
32 }
15
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 }
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 exit(0);
528eef871e23 pcmu2efr project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 }