FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/cbsearch.h @ 454:4b6fa53a8240
INSTALL: document the new way
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 10 May 2024 06:19:24 +0000 |
parents | 4614f1a97e1a |
children |
rev | line source |
---|---|
328
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : cbsearch.h |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose : Inovative codebook search (find index and gain) |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #ifndef cbsearch_h |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #define cbsearch_h "$Id $" |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 * INCLUDE FILES |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "tw_amr.h" |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "typedef.h" |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /* |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 * LOCAL VARIABLES AND TABLES |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 /* |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 * DEFINITION OF DATA TYPES |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 /* |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 * PUBLIC PROGRAM CODE |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 ***************************************************************************** |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 int cbsearch(Word16 x[], /* i : target vector, Q0 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 Word16 h[], /* i : impulse response of weighted synthesis */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /* filter h[-L_subfr..-1] must be set to */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /* zero. Q12 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 Word16 T0, /* i : Pitch lag */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 Word16 pitch_sharp, /* i : Last quantized pitch gain, Q14 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 Word16 gain_pit,/* i : Pitch gain, Q14 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 Word16 res2[], /* i : Long term prediction residual, Q0 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 Word16 code[], /* o : Innovative codebook, Q13 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 Word16 y[], /* o : filtered fixed codebook excitation, Q12 */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 Word16 **anap, /* o : Signs of the pulses */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 enum Mode mode, /* i : coder mode */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 Word16 subNr) /* i : subframe number */ |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 ; |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 |
4614f1a97e1a
libtwamr: integrate cbsearch.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #endif |