changeset 284:8d3cfa65a6c2

gsmfr-decode: convert to libgsmfr2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Apr 2024 05:59:15 +0000
parents 25649b3a83e9
children cfa3006a66da
files frtest/Makefile frtest/decode.c
diffstat 2 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/frtest/Makefile	Sun Apr 14 05:51:42 2024 +0000
+++ b/frtest/Makefile	Sun Apr 14 05:59:15 2024 +0000
@@ -13,8 +13,8 @@
 gsmfr-cod2std:	cod2std.o ${LIBFR2}
 	${CC} ${CFLAGS} -o $@ cod2std.o ${LIBFR2}
 
-gsmfr-decode:	decode.o ${LIBDEC}
-	${CC} ${CFLAGS} -o $@ decode.o ${LIBDEC} -lgsm
+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
--- a/frtest/decode.c	Sun Apr 14 05:51:42 2024 +0000
+++ b/frtest/decode.c	Sun Apr 14 05:59:15 2024 +0000
@@ -5,8 +5,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/wavwriter.h"
 #include "../libtest/pcmwrite.h"
@@ -16,8 +15,7 @@
 {
 	FILE *binf;
 	void *wav;
-	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;
@@ -36,14 +34,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 (;;) {
@@ -65,10 +58,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_wav(wav, pcm);
 	}
 	wav_write_close(wav);