FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/qua_gain.h @ 443:526a7f0e027d
amrtest: implement twamr-encode
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 May 2024 21:00:33 +0000 |
parents | b02e043dcba0 |
children |
rev | line source |
---|---|
377
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : qua_gain.h |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose : Quantization of pitch and codebook gains. |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #ifndef qua_gain_h |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #define qua_gain_h "$Id $" |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 * INCLUDE FILES |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "tw_amr.h" |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "typedef.h" |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /* |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 * DECLARATION OF PROTOTYPES |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ******************************************************************************** |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 /************************************************************************* |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 * FUNCTION: Qua_gain() |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 * PURPOSE: Quantization of pitch and codebook gains. |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 * (using predicted codebook gain) |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 * |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 *************************************************************************/ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 Word16 |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 Qua_gain( /* o : index of quantization. */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 enum Mode mode, /* i : AMR mode */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 Word16 exp_gcode0, /* i : predicted CB gain (exponent), Q0 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 Word16 frac_gcode0, /* i : predicted CB gain (fraction), Q15 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 Word16 frac_coeff[], /* i : energy coeff. (5), fraction part, Q15 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 Word16 exp_coeff[], /* i : energy coeff. (5), exponent part, Q0 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /* (frac_coeff and exp_coeff computed in */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 /* calc_filt_energies()) */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 Word16 gp_limit, /* i : pitch gain limit */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 Word16 *gain_pit, /* o : Pitch gain, Q14 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 Word16 *gain_cod, /* o : Code gain, Q1 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 Word16 *qua_ener_MR122, /* o : quantized energy error, Q10 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 /* (for MR122 MA predictor update) */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 Word16 *qua_ener /* o : quantized energy error, Q10 */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 /* (for other MA predictor update) */ |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 ); |
b02e043dcba0
libtwamr: integrate qua_gain.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #endif |