changeset 51:722959d9410f

libgsmefr: implement EFR_{en,de}coder_create() functions
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 Nov 2022 06:46:22 +0000
parents 9ae58ffb4197
children 988fd7ff514f
files libgsmefr/Makefile libgsmefr/dec_create.c libgsmefr/enc_create.c
diffstat 3 files changed, 42 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmefr/Makefile	Fri Nov 25 06:39:10 2022 +0000
+++ b/libgsmefr/Makefile	Fri Nov 25 06:46:22 2022 +0000
@@ -1,7 +1,7 @@
 CC=	gcc
 CFLAGS=	-O2
-OBJS=	basicop2.o frame2params.o params2frame.o sid_class.o sid_insert.o \
-	tls_flags.o
+OBJS=	basicop2.o dec_create.o enc_create.o frame2params.o params2frame.o \
+	sid_class.o sid_insert.o tls_flags.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 namespace.h no_count.h oper_32b.h \
 	sig_proc.h typedef.h vad.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgsmefr/dec_create.c	Fri Nov 25 06:46:22 2022 +0000
@@ -0,0 +1,20 @@
+/*
+ * In this module we implement allocation and initialization
+ * of state structures for our GSM EFR decoder.
+ */
+
+#include <stdlib.h>
+#include "gsm_efr.h"
+#include "typedef.h"
+#include "cnst.h"
+#include "dec_state.h"
+
+struct EFR_decoder_state *EFR_decoder_create(void)
+{
+	struct EFR_decoder_state *st;
+
+	st = malloc(sizeof(struct EFR_decoder_state));
+	if (st)
+		EFR_decoder_reset(st);
+	return st;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgsmefr/enc_create.c	Fri Nov 25 06:46:22 2022 +0000
@@ -0,0 +1,20 @@
+/*
+ * In this module we implement allocation and initialization
+ * of state structures for our GSM EFR encoder.
+ */
+
+#include <stdlib.h>
+#include "gsm_efr.h"
+#include "typedef.h"
+#include "cnst.h"
+#include "enc_state.h"
+
+struct EFR_encoder_state *EFR_encoder_create(int dtx)
+{
+	struct EFR_encoder_state *st;
+
+	st = malloc(sizeof(struct EFR_encoder_state));
+	if (st)
+		EFR_encoder_reset(st, dtx);
+	return st;
+}