FreeCalypso > hg > gsm-codec-lib
comparison libtwamr/dtx_enc.h @ 407:5a1d18542f8a
libtwamr: integrate dtx_dec.c and dtx_enc.c
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 07 May 2024 00:05:12 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
406:85e9768d497f | 407:5a1d18542f8a |
---|---|
1 /* | |
2 ******************************************************************************** | |
3 * | |
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 | |
5 * R99 Version 3.3.0 | |
6 * REL-4 Version 4.1.0 | |
7 * | |
8 ******************************************************************************** | |
9 * | |
10 * File : dtx_enc.h | |
11 * Purpose : DTX mode computation of SID parameters | |
12 * | |
13 ******************************************************************************** | |
14 */ | |
15 #ifndef dtx_enc_h | |
16 #define dtx_enc_h "$Id $" | |
17 | |
18 /* | |
19 ******************************************************************************** | |
20 * INCLUDE FILES | |
21 ******************************************************************************** | |
22 */ | |
23 #include "tw_amr.h" | |
24 #include "typedef.h" | |
25 #include "cnst.h" | |
26 #include "q_plsf.h" | |
27 #include "gc_pred.h" | |
28 #include "dtx_common.h" | |
29 | |
30 /* | |
31 ******************************************************************************** | |
32 * DEFINITION OF DATA TYPES | |
33 ******************************************************************************** | |
34 */ | |
35 typedef struct { | |
36 Word16 lsp_hist[M * DTX_HIST_SIZE]; | |
37 Word16 log_en_hist[DTX_HIST_SIZE]; | |
38 Word16 hist_ptr; | |
39 Word16 log_en_index; | |
40 Word16 init_lsf_vq_index; | |
41 Word16 lsp_index[3]; | |
42 | |
43 /* DTX handler stuff */ | |
44 Word16 dtxHangoverCount; | |
45 Word16 decAnaElapsedCount; | |
46 | |
47 } dtx_encState; | |
48 /* | |
49 ******************************************************************************** | |
50 * DECLARATION OF PROTOTYPES | |
51 ******************************************************************************** | |
52 */ | |
53 | |
54 /* | |
55 ************************************************************************** | |
56 * | |
57 * Function : dtx_enc_reset | |
58 * Purpose : Resets state memory | |
59 * Returns : 0 on success | |
60 * | |
61 ************************************************************************** | |
62 */ | |
63 void dtx_enc_reset (dtx_encState *st); | |
64 | |
65 /* | |
66 ************************************************************************** | |
67 * | |
68 * Function : dtx_enc | |
69 * Purpose : | |
70 * Description : | |
71 * | |
72 ************************************************************************** | |
73 */ | |
74 int dtx_enc(dtx_encState *st, /* i/o : State struct */ | |
75 Word16 computeSidFlag, /* i : compute SID */ | |
76 Q_plsfState *qSt, /* i/o : Qunatizer state struct */ | |
77 gc_predState* predState, /* i/o : State struct */ | |
78 Word16 **anap /* o : analysis parameters */ | |
79 ); | |
80 | |
81 /* | |
82 ************************************************************************** | |
83 * | |
84 * Function : dtx_buffer | |
85 * Purpose : handles the DTX buffer | |
86 * | |
87 ************************************************************************** | |
88 */ | |
89 int dtx_buffer(dtx_encState *st, /* i/o : State struct */ | |
90 Word16 lsp_new[], /* i : LSP vector */ | |
91 Word16 speech[] /* i : speech samples */ | |
92 ); | |
93 | |
94 /* | |
95 ************************************************************************** | |
96 * | |
97 * Function : tx_dtx_handler | |
98 * Purpose : adds extra speech hangover to analyze speech on the decoding side. | |
99 * Description : returns 1 when a new SID analysis may be made | |
100 * otherwise it adds the appropriate hangover after a sequence | |
101 * with out updates of SID parameters . | |
102 * | |
103 ************************************************************************** | |
104 */ | |
105 Word16 tx_dtx_handler(dtx_encState *st, /* i/o : State struct */ | |
106 Word16 vadFlag, /* i : vad control variable */ | |
107 enum Mode *usedMode /* o : mode changed or not */ | |
108 ); | |
109 | |
110 #endif |