changeset 99:7152cc7d1ca3

libgsmefr: implement EFR_decode_bfi_nodata()
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 26 Nov 2022 21:51:52 +0000
parents 18866c0354ef
children d5bab777865a
files libgsmefr/Makefile libgsmefr/bfi_nodata.c
diffstat 2 files changed, 28 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmefr/Makefile	Sat Nov 26 21:31:58 2022 +0000
+++ b/libgsmefr/Makefile	Sat Nov 26 21:51:52 2022 +0000
@@ -1,12 +1,12 @@
 CC=	gcc
 CFLAGS=	-O2
-OBJS=	agc.o autocorr.o az_lsp.o basicop2.o c1035pf.o cod_12k2.o convolve.o \
-	d1035pf.o d_gains.o d_homing.o d_plsf_5.o dec_12k2.o dec_create.o \
-	dec_lag6.o dec_main.o dec_wrap.o dtx.o e_homing.o enc_create.o \
-	enc_lag6.o frame2params.o g_code.o g_pitch.o int_lpc.o inter_6.o \
-	inv_sqrt.o lag_wind.o levinson.o log2.o lsp_az.o lsp_lsf.o oper_32b.o \
-	params2frame.o pitch_f6.o pitch_ol.o pow2.o pre_proc.o pred_lt6.o \
-	preemph.o pstfilt2.o q_gains.o q_plsf_5.o reorder.o residu.o \
+OBJS=	agc.o autocorr.o az_lsp.o basicop2.o bfi_nodata.o c1035pf.o cod_12k2.o \
+	convolve.o d1035pf.o d_gains.o d_homing.o d_plsf_5.o dec_12k2.o \
+	dec_create.o dec_lag6.o dec_main.o dec_wrap.o dtx.o e_homing.o \
+	enc_create.o enc_lag6.o frame2params.o g_code.o g_pitch.o int_lpc.o \
+	inter_6.o inv_sqrt.o lag_wind.o levinson.o log2.o lsp_az.o lsp_lsf.o \
+	oper_32b.o params2frame.o pitch_f6.o pitch_ol.o pow2.o pre_proc.o \
+	pred_lt6.o preemph.o pstfilt2.o q_gains.o q_plsf_5.o reorder.o residu.o\
 	sid_class.o sid_insert.o syn_filt.o tls_flags.o weight_a.o
 HDRS=	basic_op.h cnst.h codec.h d_homing.h dec_state.h dtx.h e_homing.h \
 	enc_state.h gains_tb.h gsm_efr.h memops.h namespace.h no_count.h \
--- /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);
+}