changeset 285:cfa3006a66da

gsmfr-decode-r: convert to libgsmfr2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Apr 2024 06:04:32 +0000
parents 8d3cfa65a6c2
children 251aed72925e
files frtest/Makefile frtest/decode-r.c
diffstat 2 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/frtest/Makefile	Sun Apr 14 05:59:15 2024 +0000
+++ b/frtest/Makefile	Sun Apr 14 06:04:32 2024 +0000
@@ -16,8 +16,8 @@
 gsmfr-decode:	decode.o ${LIBTEST} ${LIBFR2}
 	${CC} ${CFLAGS} -o $@ decode.o ${LIBTEST} ${LIBFR2}
 
-gsmfr-decode-r:	decode-r.o ${LIBDEC}
-	${CC} ${CFLAGS} -o $@ decode-r.o ${LIBDEC} -lgsm
+gsmfr-decode-r:	decode-r.o ${LIBTEST} ${LIBFR2}
+	${CC} ${CFLAGS} -o $@ decode-r.o ${LIBTEST} ${LIBFR2}
 
 gsmfr-dlcap-gsmx:	dlcap-gsmx.o tidsp.o ${LIBTEST}
 	${CC} ${CFLAGS} -o $@ dlcap-gsmx.o tidsp.o ${LIBTEST}
--- a/frtest/decode-r.c	Sun Apr 14 05:59:15 2024 +0000
+++ b/frtest/decode-r.c	Sun Apr 14 06:04:32 2024 +0000
@@ -6,8 +6,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include <gsm.h>
-#include "../libgsmfrp/gsm_fr_preproc.h"
+#include "../libgsmfr2/tw_gsmfr.h"
 #include "../libtest/binreader.h"
 #include "../libtest/robewrite.h"
 
@@ -15,8 +14,7 @@
 	char **argv;
 {
 	FILE *binf, *outf;
-	gsm dec_state;
-	struct gsmfr_preproc_state *pp_state;
+	struct gsmfr_fulldec_state *fd_state;
 	uint8_t frame[BINFILE_MAX_FRAME];
 	int16_t pcm[160];
 	int rc, bfi, taf;
@@ -35,14 +33,9 @@
 		perror(argv[2]);
 		exit(1);
 	}
-	dec_state = gsm_create();
-	if (!dec_state) {
-		fprintf(stderr, "gsm_create() failed!\n");
-		exit(1);
-	}
-	pp_state = gsmfr_preproc_create();
-	if (!pp_state) {
-		fprintf(stderr, "gsmfr_preproc_create() failed!\n");
+	fd_state = gsmfr_fulldec_create();
+	if (!fd_state) {
+		fprintf(stderr, "gsmfr_fulldec_create() failed!\n");
 		exit(1);
 	}
 	for (;;) {
@@ -64,10 +57,9 @@
 			exit(1);
 		}
 		if (bfi)
-			gsmfr_preproc_bfi(pp_state, taf, frame);
+			gsmfr_fulldec_bfi(fd_state, taf, pcm);
 		else
-			gsmfr_preproc_good_frame(pp_state, frame);
-		gsm_decode(dec_state, frame, pcm);
+			gsmfr_fulldec_good_frame(fd_state, frame, pcm);
 		write_pcm_to_robe(outf, pcm);
 	}
 	fclose(outf);