comparison libgsmfr2/pp_state.c @ 256:a33edf624061

libgsmfr2: start with API definition and port of libgsmfrp code
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 12 Apr 2024 20:49:53 +0000
parents libgsmfrp/state.c@286d5f097eb4
children 573afa985df6
comparison
equal deleted inserted replaced
255:07f936338de1 256:a33edf624061
1 /*
2 * In this module we implement allocation and initialization
3 * of state structures for our GSM FR preprocessor.
4 */
5
6 #include <stdint.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include "tw_gsmfr.h"
10 #include "pp_internal.h"
11
12 struct gsmfr_preproc_state *gsmfr_preproc_create(void)
13 {
14 struct gsmfr_preproc_state *st;
15
16 st = malloc(sizeof(struct gsmfr_preproc_state));
17 if (st)
18 gsmfr_preproc_reset(st);
19 return st;
20 }
21
22 void gsmfr_preproc_reset(struct gsmfr_preproc_state *st)
23 {
24 memset(st, 0, sizeof(struct gsmfr_preproc_state));
25 st->cn_random_lfsr = PN_INITIAL_SEED;
26 }