diff libgsmefr/bfi_nodata.c @ 99:7152cc7d1ca3

libgsmefr: implement EFR_decode_bfi_nodata()
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 26 Nov 2022 21:51:52 +0000
parents
children eefef9f6d533
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgsmefr/bfi_nodata.c	Sat Nov 26 21:51:52 2022 +0000
@@ -0,0 +1,21 @@
+/*
+ * In the expected usage mode of our libgsmefr decoder as part of "soft TRAU"
+ * uplink implementation, there will be times when the radio subsystem tells
+ * us that a frame has been lost, but we don't have any errored bits to feed
+ * to the decoder as ETSI canon calls for.  We could of course call
+ * EFR_decode_frame() with a dummy frame of all zeros and BFI=1, but the
+ * EFR_decode_bfi_nodata() function provided in this module accomplishes
+ * the same effect more efficiently.
+ */
+
+#include <string.h>
+#include "gsm_efr.h"
+
+void EFR_decode_bfi_nodata(struct EFR_decoder_state *st, int taf,
+			   int16_t *pcm_out)
+{
+	int16_t params[EFR_NUM_PARAMS];
+
+	memset(params, 0, sizeof(int16_t) * EFR_NUM_PARAMS);
+	EFR_decode_params(st, params, 1, 0, taf, pcm_out);
+}