# HG changeset patch # User Mychaela Falconia # Date 1715579773 0 # Node ID dd9a9368009e441341c31395ffd9001d0860f6c0 # Parent 760bbae44c1f8d9ea74e2a70f94de1dcda675b90 pcma2efr: emit full input sequence diff -r 760bbae44c1f -r dd9a9368009e .hgignore --- a/.hgignore Mon May 13 05:40:56 2024 +0000 +++ b/.hgignore Mon May 13 05:56:13 2024 +0000 @@ -13,6 +13,8 @@ ^pcma2efr/comb-diff$ ^pcma2efr/comb-out$ ^pcma2efr/dhf-check$ +^pcma2efr/pcma-input$ +^pcma2efr/pcma-input\.bin$ ^pcmu2efr/all-outputs\. ^pcmu2efr/amrefr-out$ diff -r 760bbae44c1f -r dd9a9368009e pcma2efr/Makefile --- a/pcma2efr/Makefile Mon May 13 05:40:56 2024 +0000 +++ b/pcma2efr/Makefile Mon May 13 05:56:13 2024 +0000 @@ -1,7 +1,7 @@ CC= gcc CFLAGS= -O2 -PROGS= comb-diff comb-out dhf-check -FILES= all-outputs.gsmx all-outputs.inc +PROGS= comb-diff comb-out dhf-check pcma-input +FILES= all-outputs.gsmx all-outputs.inc pcma-input.bin COMB_DIFF_OBJS= alaw-expand.o comb-diff.o gen-amr-2fr.o gen-efr.o gen160.o \ seqsynca.o @@ -9,6 +9,7 @@ seqsynca.o DHF_CHECK_OBJS= alaw-expand.o dhf-check.o gen-amr-2fr.o gen-efr.o gen160.o \ seqsynca.o +PCMA_IN_OBJS= pcma-input.o seqsynca.o all: ${PROGS} ${FILES} @@ -21,6 +22,9 @@ dhf-check: ${DHF_CHECK_OBJS} ${CC} ${CFLAGS} -o $@ ${DHF_CHECK_OBJS} -lgsmefr -ltwamr +pcma-input: ${PCMA_IN_OBJS} + ${CC} ${CFLAGS} -o $@ ${PCMA_IN_OBJS} + # data outputs all-outputs.gsmx: comb-out @@ -29,5 +33,8 @@ all-outputs.inc: all-outputs.gsmx ../utils/gen-hex-c all-outputs.gsmx $@ +pcma-input.bin: pcma-input + ./pcma-input $@ + clean: rm -f *.o ${PROGS} *.bin *.gsmx *.inc diff -r 760bbae44c1f -r dd9a9368009e pcma2efr/pcma-input.c --- /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 +#include +#include +#include +#include + +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); +}