FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/p_ol_wgh.h @ 443:526a7f0e027d
amrtest: implement twamr-encode
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 May 2024 21:00:33 +0000 |
parents | 48c7f8e8c9af |
children |
rev | line source |
---|---|
416
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : p_ol_wgh.h |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose : Compute the open loop pitch lag with weighting. |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #ifndef p_ol_wgh_h |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #define p_ol_wgh_h "$Id $" |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 * INCLUDE FILES |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "tw_amr.h" |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "typedef.h" |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "vad.h" |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 /* |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 * DEFINITION OF DATA TYPES |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 /* state variable */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 typedef struct { |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 Word16 old_T0_med; |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 Word16 ada_w; |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 Word16 wght_flg; |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 } pitchOLWghtState; |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 /* |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 * DECLARATION OF PROTOTYPES |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 ******************************************************************************** |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 void p_ol_wgh_reset (pitchOLWghtState *st); |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /* reset of pre processing state (i.e. set state memory to zero) |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 returns 0 on success |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 Word16 Pitch_ol_wgh ( /* o : open loop pitch lag */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 pitchOLWghtState *st, /* i/o : State struct */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 vadState *vadSt, /* i/o : VAD state struct */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 Word16 signal[], /* i : signal used to compute the open loop pitch */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 /* signal[-pit_max] to signal[-1] should be known */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 Word16 pit_min, /* i : minimum pitch lag */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 Word16 pit_max, /* i : maximum pitch lag */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 Word16 L_frame, /* i : length of frame to compute pitch */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 Word16 old_lags[], /* i : history with old stored Cl lags */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 Word16 ol_gain_flg[], /* i : OL gain flag */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 Word16 idx, /* i : index */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 Flag dtx /* i : dtx flag; use dtx=1, do not use dtx=0 */ |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 ); |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 |
48c7f8e8c9af
libtwamr: integrate p_ol_wgh.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 #endif |