FreeCalypso > hg > gsm-codec-lib
annotate libgsmfrp/state.c @ 3:3cd5ad24b1d4
libgsmfrp: implement internal state
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 19 Nov 2022 09:03:57 +0000 |
parents | |
children | 286d5f097eb4 |
rev | line source |
---|---|
3
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * In this module we implement allocation and initialization |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * of state structures for our GSM FR preprocessor. |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdlib.h> |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <string.h> |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include "gsm_fr_preproc.h" |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include "internal.h" |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 struct gsmfr_preproc_state *gsmfr_preproc_create(void) |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 { |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 struct gsmfr_preproc_state *st; |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 st = malloc(sizeof(struct gsmfr_preproc_state)); |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 if (st) |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 gsmfr_preproc_reset(st); |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 return st; |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 } |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 void gsmfr_preproc_reset(struct gsmfr_preproc_state *st) |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 { |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 memset(st, 0, sizeof(struct gsmfr_preproc_state)); |
3cd5ad24b1d4
libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 } |