# HG changeset patch # User Mychaela Falconia # Date 1715674381 0 # Node ID ab7c80f6f02da5c7c625c2ee33ff727c63750913 # Parent e96e8d8973c066ef5d5b69da400f264404806685 ae-dec-dhf: initial generation diff -r e96e8d8973c0 -r ab7c80f6f02d .hgignore --- a/.hgignore Tue May 14 05:36:38 2024 +0000 +++ b/.hgignore Tue May 14 08:13:01 2024 +0000 @@ -1,18 +1,21 @@ syntax: regexp \.[oa]$ +\.bin$ \.inc$ +\.gsm$ +\.gsmx$ + +^ae-dec-dhf/gen-test-frames$ ^amrdiff/amrdiff$ ^amrdiff/readone-amr$ ^amrdiff/readone-efr$ -^dhf/efr-dhf\.gsmx$ ^dhf/efr-dhf-bytes\.c$ ^dhf/efr-dhf-hexout$ ^dhf/emit-dhfbin-0610$ ^dhf/emit-dhfbin-efr$ -^dhf/fr1-dhf\.gsm$ ^dhf/mr122-dhf-bytes\.c$ ^dmw/gen-dmw-bin$ @@ -23,7 +26,6 @@ ^pcma2efr/comb-out$ ^pcma2efr/dhf-check$ ^pcma2efr/pcma-input$ -^pcma2efr/pcma-input\.bin$ ^pcmu2efr/all-outputs\. ^pcmu2efr/amrefr-out$ @@ -31,7 +33,6 @@ ^pcmu2efr/comb-out$ ^pcmu2efr/dhf-check$ ^pcmu2efr/pcmu-input$ -^pcmu2efr/pcmu-input\.bin$ ^pcmu2efr/stdefr-diff$ ^pcmu2efr/stdefr-out$ diff -r e96e8d8973c0 -r ab7c80f6f02d ae-dec-dhf/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ae-dec-dhf/Makefile Tue May 14 08:13:01 2024 +0000 @@ -0,0 +1,15 @@ +CC= gcc +CFLAGS= -O2 +PROG= gen-test-frames +FILES= test-frames.gsmx + +all: ${PROG} ${FILES} + +${PROG}: ${PROG}.c + ${CC} ${CFLAGS} -o $@ $@.c -lgsmefr -ltwamr + +test-frames.gsmx: ${PROG} + ./${PROG} $@ + +clean: + rm -f *.o ${PROG} *.robe *.ul *.gsmx diff -r e96e8d8973c0 -r ab7c80f6f02d ae-dec-dhf/gen-test-frames.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ae-dec-dhf/gen-test-frames.c Tue May 14 08:13:01 2024 +0000 @@ -0,0 +1,59 @@ +/* + * This program generates some test EFR frames that are meant to be fed + * to the uplink input of the alien GSM network under study, seeking to + * test if the AMR-EFR hybrid decoder's handling of DHF matches our model. + */ + +#include +#include +#include +#include +#include +#include +#include + +static FILE *outf; + +static void +emit_mr122_dhf() +{ + uint8_t frame[EFR_RTP_FRAME_LEN]; + + EFR_params2frame(amr_dhf_mr122, frame); + fwrite(frame, 1, EFR_RTP_FRAME_LEN, outf); +} + +static void +emit_mixed_dhf() +{ + int16_t params[EFR_NUM_PARAMS]; + uint8_t frame[EFR_RTP_FRAME_LEN]; + + memcpy(params, amr_dhf_gsmefr, sizeof(int16_t) * 18); + memcpy(params + 18, amr_dhf_mr122 + 18, sizeof(int16_t) * 39); + EFR_params2frame(params, frame); + fwrite(frame, 1, EFR_RTP_FRAME_LEN, outf); +} + +main(argc, argv) + char **argv; +{ + if (argc != 2) { + fprintf(stderr, "usage: %s gsmx-out-file\n", argv[0]); + exit(1); + } + outf = fopen(argv[1], "w"); + if (!outf) { + perror(argv[1]); + exit(1); + } + emit_mr122_dhf(); + emit_mr122_dhf(); + emit_mixed_dhf(); + fwrite(EFR_decoder_homing_frame, 1, EFR_RTP_FRAME_LEN, outf); + emit_mixed_dhf(); + emit_mixed_dhf(); + emit_mr122_dhf(); + fclose(outf); + exit(0); +}