diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pcma2efr/pcma-input.c	Mon May 13 05:56:13 2024 +0000
@@ -0,0 +1,38 @@
+/*
+ * This program emits the full sequence (3 EHFs and 2 copies of seqsynca)
+ * that needs to be fed to TRAU DL input from G.711 PCMA side to perform
+ * the test of reversing the EFR variant used and finding frame sync.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+
+extern const uint8_t seqsynca_last_frame[160];
+
+main(argc, argv)
+	char **argv;
+{
+	FILE *outf;
+	uint8_t ehf[160];
+
+	if (argc != 2) {
+		fprintf(stderr, "usage: %s pcma-out-file\n", argv[0]);
+		exit(1);
+	}
+	outf = fopen(argv[1], "w");
+	if (!outf) {
+		perror(argv[1]);
+		exit(1);
+	}
+	memset(ehf, 0xD5, 160);
+	fwrite(ehf, 1, 160, outf);
+	fwrite(ehf, 1, 160, outf);
+	fwrite(ehf, 1, 160, outf);
+	fwrite(seqsynca_last_frame, 1, 160, outf);
+	fwrite(seqsynca_last_frame, 1, 160, outf);
+	fclose(outf);
+	exit(0);
+}