FreeCalypso > hg > gsm-codec-lib
diff frtest/decode.c @ 284:8d3cfa65a6c2
gsmfr-decode: convert to libgsmfr2
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Apr 2024 05:59:15 +0000 |
parents | b9a842775f40 |
children |
line wrap: on
line diff
--- 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);