# HG changeset patch # User Mychaela Falconia # Date 1715489316 0 # Node ID 1794bf0fbcf745796d29e8d099d8ed9a71309ad4 # Parent 1f58ba0d79a4bfed73e313dbb4c120e698a625c2 pcmu2efr: emit full PCMU input diff -r 1f58ba0d79a4 -r 1794bf0fbcf7 .hgignore --- a/.hgignore Sun May 12 04:34:15 2024 +0000 +++ b/.hgignore Sun May 12 04:48:36 2024 +0000 @@ -13,6 +13,7 @@ ^pcmu2efr/comb-diff$ ^pcmu2efr/comb-out$ ^pcmu2efr/dhf-check$ +^pcmu2efr/pcmu-input$ ^pcmu2efr/stdefr-diff$ ^pcmu2efr/stdefr-out$ diff -r 1f58ba0d79a4 -r 1794bf0fbcf7 pcmu2efr/Makefile --- a/pcmu2efr/Makefile Sun May 12 04:34:15 2024 +0000 +++ b/pcmu2efr/Makefile Sun May 12 04:48:36 2024 +0000 @@ -1,6 +1,7 @@ CC= gcc CFLAGS= -O2 -PROGS= amrefr-out comb-diff comb-out dhf-check stdefr-diff stdefr-out +PROGS= amrefr-out comb-diff comb-out dhf-check pcmu-input stdefr-diff \ + stdefr-out AMREFR_OBJS= amrefr-out.o gen-amrefr.o gen160.o seqsyncu.o ulaw-expand.o COMB_DIFF_OBJS= comb-diff.o gen-amr-2fr.o gen-efr.o gen160.o seqsyncu.o \ @@ -9,6 +10,7 @@ ulaw-expand.o DHF_CHECK_OBJS= dhf-check.o gen-amr-2fr.o gen-efr.o gen160.o seqsyncu.o \ ulaw-expand.o +PCMU_IN_OBJS= pcmu-input.o seqsyncu.o STDEFR_OBJS= gen-efr.o gen160.o seqsyncu.o stdefr-out.o ulaw-expand.o STDEFRD_OBJS= gen-efr.o gen160.o seqsyncu.o stdefr-diff.o ulaw-expand.o @@ -26,6 +28,9 @@ dhf-check: ${DHF_CHECK_OBJS} ${CC} ${CFLAGS} -o $@ ${DHF_CHECK_OBJS} -lgsmefr -ltwamr +pcmu-input: ${PCMU_IN_OBJS} + ${CC} ${CFLAGS} -o $@ ${PCMU_IN_OBJS} + stdefr-diff: ${STDEFRD_OBJS} ${CC} ${CFLAGS} -o $@ ${STDEFRD_OBJS} -lgsmefr diff -r 1f58ba0d79a4 -r 1794bf0fbcf7 pcmu2efr/pcmu-input.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcmu2efr/pcmu-input.c Sun May 12 04:48:36 2024 +0000 @@ -0,0 +1,38 @@ +/* + * This program emits the full sequence (3 EHFs and 2 copies of seqsyncu) + * that needs to be fed to TRAU DL input from G.711 PCMU side to perform + * the test of reversing the EFR variant used and finding frame sync. + */ + +#include +#include +#include +#include +#include + +extern const uint8_t seqsyncu_last_frame[160]; + +main(argc, argv) + char **argv; +{ + FILE *outf; + uint8_t ehf[160]; + + if (argc != 2) { + fprintf(stderr, "usage: %s pcmu-out-file\n", argv[0]); + exit(1); + } + outf = fopen(argv[1], "w"); + if (!outf) { + perror(argv[1]); + exit(1); + } + memset(ehf, 0xFE, 160); + fwrite(ehf, 1, 160, outf); + fwrite(ehf, 1, 160, outf); + fwrite(ehf, 1, 160, outf); + fwrite(seqsyncu_last_frame, 1, 160, outf); + fwrite(seqsyncu_last_frame, 1, 160, outf); + fclose(outf); + exit(0); +}