FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/ex_ctrl.h @ 397:9b699f30e6f3
libtwamr: integrate pre_proc.c
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 06 May 2024 19:02:44 +0000 |
parents | 3f27ca24c620 |
children |
rev | line source |
---|---|
364
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : ex_ctrl.h |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose : Excitation Control module in background noise |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #ifndef ex_ctrl_h |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #define ex_ctrl_h "$Id $" |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 * INCLUDE FILES |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "typedef.h" |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "cnst.h" |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /* |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 * LOCAL VARIABLES AND TABLES |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #define L_ENERGYHIST 60 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /* |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 * DEFINITION OF DATA TYPES |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 /* |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 * DECLARATION OF PROTOTYPES |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 ******************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /* |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 ************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 * |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 * Function : Ex_ctrl |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 * Purpose : Charaterice synthesis speech and detect background noise |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 * Returns : background noise decision; 0 = bgn, 1 = no bgn |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 * |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 ************************************************************************** |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 Word16 Ex_ctrl (Word16 excitation[], /*i/o: Current subframe excitation */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 Word16 excEnergy, /* i : Exc. Energy, sqrt(totEx*totEx)*/ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 Word16 exEnergyHist[], /* i : History of subframe energies */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 Word16 voicedHangover, /* i : # of fr. after last voiced fr.*/ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 Word16 prevBFI, /* i : Set i previous BFI */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 Word16 carefulFlag /* i : Restrict dymamic in scaling */ |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 ); |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
3f27ca24c620
libtwamr: integrate ex_ctrl.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #endif |