# HG changeset patch # User Mychaela Falconia # Date 1713073902 0 # Node ID 25649b3a83e973078aaa82fb21d28353c5f25e46 # Parent 9ee8ad3d4d3094434855379af62ce6dc4218b27e gsmfr-cod2std: convert to libgsmfr2 diff -r 9ee8ad3d4d30 -r 25649b3a83e9 frtest/Makefile --- a/frtest/Makefile Sun Apr 14 05:44:47 2024 +0000 +++ b/frtest/Makefile Sun Apr 14 05:51:42 2024 +0000 @@ -2,6 +2,7 @@ CFLAGS= -O2 PROGS= gsmfr-cod2std gsmfr-decode gsmfr-decode-r gsmfr-dlcap-gsmx \ gsmfr-dlcap-parse gsmfr-encode gsmfr-encode-r gsmfr-preproc +LIBFR2= ../libgsmfr2/libgsmfr2.a LIBPP= ../libgsmfrp/libgsmfrp.a LIBTEST=../libtest/libtest.a LIBDEC= ${LIBTEST} ${LIBPP} @@ -9,8 +10,8 @@ all: ${PROGS} -gsmfr-cod2std: cod2std.o - ${CC} ${CFLAGS} -o $@ cod2std.o -lgsm +gsmfr-cod2std: cod2std.o ${LIBFR2} + ${CC} ${CFLAGS} -o $@ cod2std.o ${LIBFR2} gsmfr-decode: decode.o ${LIBDEC} ${CC} ${CFLAGS} -o $@ decode.o ${LIBDEC} -lgsm diff -r 9ee8ad3d4d30 -r 25649b3a83e9 frtest/cod2std.c --- a/frtest/cod2std.c Sun Apr 14 05:44:47 2024 +0000 +++ b/frtest/cod2std.c Sun Apr 14 05:51:42 2024 +0000 @@ -8,12 +8,12 @@ #include #include #include -#include +#include "../libgsmfr2/tw_gsmfr.h" static void bytes_to_params(bytes, params, big_endian) uint8_t *bytes; - gsm_signal *params; + int16_t *params; { uint8_t *sp; unsigned n; @@ -35,11 +35,10 @@ { char *infname, *outfname; FILE *inf, *outf; - gsm dummy_state; int big_endian; unsigned frame_no; uint8_t input_bytes[76*2], frame[33]; - gsm_signal params[76]; + int16_t params[76]; int cc; if (argc == 3 && argv[1][0] != '-') { @@ -65,11 +64,6 @@ perror(outfname); exit(1); } - dummy_state = gsm_create(); - if (!dummy_state) { - fprintf(stderr, "gsm_create() failed!\n"); - exit(1); - } for (frame_no = 0; ; frame_no++) { cc = fread(input_bytes, 2, 76, inf); if (cc == 0) @@ -79,7 +73,7 @@ exit(1); } bytes_to_params(input_bytes, params, big_endian); - gsm_implode(dummy_state, params, frame); + gsmfr_pack_from_array(params, frame); fwrite(frame, 1, sizeof frame, outf); } fclose(outf);