# HG changeset patch # User Mychaela Falconia # Date 1715578856 0 # Node ID 760bbae44c1f8d9ea74e2a70f94de1dcda675b90 # Parent fc4544e3687b0e78aad00f88aed44f3aec4047ba pcma2efr: emit the set of computed frames diff -r fc4544e3687b -r 760bbae44c1f .hgignore --- a/.hgignore Mon May 13 02:49:26 2024 +0000 +++ b/.hgignore Mon May 13 05:40:56 2024 +0000 @@ -9,7 +9,9 @@ ^dmw/gen-dmw-bin$ ^dmw/dmw-[au]law\. +^pcma2efr/all-outputs\. ^pcma2efr/comb-diff$ +^pcma2efr/comb-out$ ^pcma2efr/dhf-check$ ^pcmu2efr/all-outputs\. diff -r fc4544e3687b -r 760bbae44c1f Makefile --- a/Makefile Mon May 13 02:49:26 2024 +0000 +++ b/Makefile Mon May 13 05:40:56 2024 +0000 @@ -2,6 +2,7 @@ all: ${SUBDIR} +pcma2efr: utils pcmu2efr: utils ringing: utils diff -r fc4544e3687b -r 760bbae44c1f pcma2efr/Makefile --- a/pcma2efr/Makefile Mon May 13 02:49:26 2024 +0000 +++ b/pcma2efr/Makefile Mon May 13 05:40:56 2024 +0000 @@ -1,19 +1,33 @@ CC= gcc CFLAGS= -O2 -PROGS= comb-diff dhf-check +PROGS= comb-diff comb-out dhf-check +FILES= all-outputs.gsmx all-outputs.inc COMB_DIFF_OBJS= alaw-expand.o comb-diff.o gen-amr-2fr.o gen-efr.o gen160.o \ seqsynca.o +COMB_OUT_OBJS= alaw-expand.o comb-out.o gen-amr-2fr.o gen-efr.o gen160.o \ + seqsynca.o DHF_CHECK_OBJS= alaw-expand.o dhf-check.o gen-amr-2fr.o gen-efr.o gen160.o \ seqsynca.o -all: ${PROGS} +all: ${PROGS} ${FILES} comb-diff: ${COMB_DIFF_OBJS} ${CC} ${CFLAGS} -o $@ ${COMB_DIFF_OBJS} -lgsmefr -ltwamr +comb-out: ${COMB_OUT_OBJS} + ${CC} ${CFLAGS} -o $@ ${COMB_OUT_OBJS} -lgsmefr -ltwamr + dhf-check: ${DHF_CHECK_OBJS} ${CC} ${CFLAGS} -o $@ ${DHF_CHECK_OBJS} -lgsmefr -ltwamr +# data outputs + +all-outputs.gsmx: comb-out + ./comb-out $@ + +all-outputs.inc: all-outputs.gsmx + ../utils/gen-hex-c all-outputs.gsmx $@ + clean: rm -f *.o ${PROGS} *.bin *.gsmx *.inc diff -r fc4544e3687b -r 760bbae44c1f pcma2efr/comb-out.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pcma2efr/comb-out.c Mon May 13 05:40:56 2024 +0000 @@ -0,0 +1,37 @@ +/* + * This program computes 160 possible EFR encoder outputs using standard EFR, + * then 160 possible outputs in AMR-EFR, then writes out all 320 frames + * to a gsmx output file. + */ + +#include +#include +#include +#include +#include + +extern uint8_t standard_efr[160][31]; +extern uint8_t amr_efr[160][31]; + +main(argc, argv) + char **argv; +{ + FILE *outf; + + if (argc != 2) { + fprintf(stderr, "usage: %s gsmx-out-file\n", argv[0]); + exit(1); + } + generate_linear_inputs(); + generate_std_efr(); + generate_amr_efr(); + outf = fopen(argv[1], "w"); + if (!outf) { + perror(argv[1]); + exit(1); + } + fwrite(standard_efr, 31, 160, outf); + fwrite(amr_efr, 31, 160, outf); + fclose(outf); + exit(0); +}