FreeCalypso > hg > gsm-codec-lib
comparison libgsmfr2/pp_internal.h @ 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/internal.h@6ac547f0b903 |
children | 573afa985df6 |
comparison
equal
deleted
inserted
replaced
255:07f936338de1 | 256:a33edf624061 |
---|---|
1 /* | |
2 * This header file is internal to libgsmfr2; | |
3 * here we define our state structure for the Rx DTX preprocessor component. | |
4 */ | |
5 | |
6 enum rx_dtx_st { | |
7 NO_DATA = 0, | |
8 SPEECH, | |
9 SPEECH_MUTING, | |
10 COMFORT_NOISE, | |
11 LOST_SID, | |
12 CN_MUTING, | |
13 }; | |
14 | |
15 struct gsmfr_preproc_state { | |
16 enum rx_dtx_st rx_state; | |
17 uint8_t speech_frame[GSMFR_RTP_FRAME_LEN]; | |
18 uint8_t sid_prefix[5]; | |
19 uint8_t sid_xmaxc; | |
20 uint32_t cn_random_lfsr; | |
21 unsigned cn_random_6fold; | |
22 }; | |
23 | |
24 /* we use the same LFSR PRNG for CN as ETSI EFR implementation */ | |
25 #define PN_INITIAL_SEED 0x70816958L /* Pseudo noise generator seed value */ | |
26 | |
27 /* internal functions */ | |
28 extern void gsmfr_preproc_gen_cn(struct gsmfr_preproc_state *state, | |
29 uint8_t *frame); | |
30 extern void gsmfr_preproc_sid2cn(struct gsmfr_preproc_state *state, | |
31 uint8_t *frame); | |
32 extern void gsmfr_preproc_invalid_sid(struct gsmfr_preproc_state *state, | |
33 uint8_t *frame); | |
34 extern uint16_t gsmfr_preproc_prng(struct gsmfr_preproc_state *state, | |
35 uint16_t no_bits); | |
36 extern uint8_t gsmfr_preproc_xmaxc_mean(const uint8_t *frame); |