FreeCalypso > hg > gsm-codec-lib
comparison libgsmhr1/dec_state.c @ 596:8e4ecdfadf5a
libgsmhr1: capture decoder state
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Thu, 04 Dec 2025 06:25:54 +0000 |
| parents | libgsmhr1/rxfe_create.c@9cda792c0dd7 |
| children |
comparison
equal
deleted
inserted
replaced
| 595:1e75556ab6c0 | 596:8e4ecdfadf5a |
|---|---|
| 1 /* | |
| 2 * Here we implement gsmhr_decoder_create() and gsmhr_decoder_reset() | |
| 3 * functions: allocation and initialization of full speech decoder state. | |
| 4 */ | |
| 5 | |
| 6 #include <stdint.h> | |
| 7 #include <stdlib.h> | |
| 8 #include <string.h> | |
| 9 #include "tw_gsmhr.h" | |
| 10 #include "typedefs.h" | |
| 11 #include "namespace.h" | |
| 12 #include "dec_state.h" | |
| 13 #include "dtx_const.h" | |
| 14 | |
| 15 struct gsmhr_decoder_state *gsmhr_decoder_create(void) | |
| 16 { | |
| 17 struct gsmhr_decoder_state *st; | |
| 18 | |
| 19 st = malloc(sizeof(struct gsmhr_decoder_state)); | |
| 20 if (st) | |
| 21 gsmhr_decoder_reset(st); | |
| 22 return st; | |
| 23 } | |
| 24 | |
| 25 void gsmhr_decoder_reset(struct gsmhr_decoder_state *st) | |
| 26 { | |
| 27 int i; | |
| 28 | |
| 29 memset(st, 0, sizeof(struct gsmhr_decoder_state)); | |
| 30 gsmhr_rxfe_reset(&st->rxfe); | |
| 31 for (i = 0; i < 4; i++) { | |
| 32 st->plSubfrEnergyMem[i] = 80; | |
| 33 st->swLevelMem[i] = -72; | |
| 34 } | |
| 35 st->swRxDTXState = CNINTPER - 1; | |
| 36 st->is_homed = 1; | |
| 37 } |
