changeset 527:f3246d109e2d

libgsmfr2: add gsmfr_fulldec_bfi_bits()
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 19 Sep 2024 07:03:12 +0000
parents 405a84110997
children f681fb758041
files libgsmfr2/full_dec.c libgsmfr2/tw_gsmfr.h
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmfr2/full_dec.c	Thu Sep 19 06:54:06 2024 +0000
+++ b/libgsmfr2/full_dec.c	Thu Sep 19 07:03:12 2024 +0000
@@ -74,3 +74,16 @@
 	gsmfr_preproc_bfi(&st->rx_dtx, taf, frame_mod);
 	gsmfr_0610_decode_frame(&st->dec_0610, frame_mod, pcm_out);
 }
+
+void gsmfr_fulldec_bfi_bits(struct gsmfr_fulldec_state *st,
+			    const uint8_t *bad_frame, int taf, int16_t *pcm_out)
+{
+	uint8_t frame_mod[GSMFR_RTP_FRAME_LEN];
+
+	if (st->is_homed) {
+		memset(pcm_out, 0, sizeof(int16_t) * 160);
+		return;
+	}
+	gsmfr_preproc_bfi_bits(&st->rx_dtx, bad_frame, taf, frame_mod);
+	gsmfr_0610_decode_frame(&st->dec_0610, frame_mod, pcm_out);
+}
--- a/libgsmfr2/tw_gsmfr.h	Thu Sep 19 06:54:06 2024 +0000
+++ b/libgsmfr2/tw_gsmfr.h	Thu Sep 19 07:03:12 2024 +0000
@@ -116,6 +116,8 @@
 				const uint8_t *frame, int16_t *pcm);
 void gsmfr_fulldec_bfi(struct gsmfr_fulldec_state *state, int taf,
 			int16_t *pcm);
+void gsmfr_fulldec_bfi_bits(struct gsmfr_fulldec_state *state,
+			    const uint8_t *bad_frame, int taf, int16_t *pcm);
 
 /* utility datum */
 extern const uint8_t gsmfr_decoder_homing_frame[GSMFR_RTP_FRAME_LEN];