comparison pcma2efr/pcma-input.c @ 31:dd9a9368009e

pcma2efr: emit full input sequence
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 13 May 2024 05:56:13 +0000
parents pcmu2efr/pcmu-input.c@1794bf0fbcf7
children
comparison
equal deleted inserted replaced
30:760bbae44c1f 31:dd9a9368009e
1 /*
2 * This program emits the full sequence (3 EHFs and 2 copies of seqsynca)
3 * that needs to be fed to TRAU DL input from G.711 PCMA side to perform
4 * the test of reversing the EFR variant used and finding frame sync.
5 */
6
7 #include <stdio.h>
8 #include <stdint.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include <strings.h>
12
13 extern const uint8_t seqsynca_last_frame[160];
14
15 main(argc, argv)
16 char **argv;
17 {
18 FILE *outf;
19 uint8_t ehf[160];
20
21 if (argc != 2) {
22 fprintf(stderr, "usage: %s pcma-out-file\n", argv[0]);
23 exit(1);
24 }
25 outf = fopen(argv[1], "w");
26 if (!outf) {
27 perror(argv[1]);
28 exit(1);
29 }
30 memset(ehf, 0xD5, 160);
31 fwrite(ehf, 1, 160, outf);
32 fwrite(ehf, 1, 160, outf);
33 fwrite(ehf, 1, 160, outf);
34 fwrite(seqsynca_last_frame, 1, 160, outf);
35 fwrite(seqsynca_last_frame, 1, 160, outf);
36 fclose(outf);
37 exit(0);
38 }