annotate libgsmfr2/ed_state.c @ 540:5595293e4f29

gsmx-to-tw5a utility: use emit_hex_frame() in libtest
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 22 Sep 2024 00:36:35 +0000
parents 3a617e4e9b27
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
3 * of state structures for our GSM 06.10 encoder & decoder
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
4 * based on libgsm from TU-Berlin.
3
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
4
286d5f097eb4 libgsmfrp: implement comfort noise generation
Mychaela Falconia <falcon@freecalypso.org>
parents: 3
diff changeset
7 #include <stdint.h>
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <stdlib.h>
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <string.h>
256
a33edf624061 libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents: 4
diff changeset
10 #include "tw_gsmfr.h"
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
11 #include "typedef.h"
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
12 #include "ed_state.h"
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
533
3a617e4e9b27 libgsmfr2: add const words with struct sizes
Mychaela Falconia <falcon@freecalypso.org>
parents: 263
diff changeset
14 const unsigned gsmfr_0610_state_size = sizeof(struct gsmfr_0610_state);
3a617e4e9b27 libgsmfr2: add const words with struct sizes
Mychaela Falconia <falcon@freecalypso.org>
parents: 263
diff changeset
15
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
16 struct gsmfr_0610_state *gsmfr_0610_create(void)
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 {
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
18 struct gsmfr_0610_state *st;
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
20 st = malloc(sizeof(struct gsmfr_0610_state));
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 if (st)
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
22 gsmfr_0610_reset(st);
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 return st;
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 }
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
26 void gsmfr_0610_reset(struct gsmfr_0610_state *st)
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 {
263
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
28 memset(st, 0, sizeof(struct gsmfr_0610_state));
ffdcdb27d673 libgsmfr2: integrate e/d state from TU-Berlin code
Mychaela Falconia <falcon@freecalypso.org>
parents: 262
diff changeset
29 st->nrp = 40;
3
3cd5ad24b1d4 libgsmfrp: implement internal state
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 }