FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/ec_gains.h @ 556:18aca50d68df default tip
doc/Calypso-TCH-downlink: update for FR1 BFI-with-data
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 11 Oct 2024 01:54:00 +0000 |
parents | 9cbd1b5d061f |
children |
rev | line source |
---|---|
362
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : ec_gains.h |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose: : Error concealment for pitch and codebook gains |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #ifndef ec_gains_h |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #define ec_gains_h "$Id $" |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 * INCLUDE FILES |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "typedef.h" |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "gc_pred.h" |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 * LOCAL VARIABLES AND TABLES |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 * DEFINITION OF DATA TYPES |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 typedef struct { |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 Word16 pbuf[5]; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 Word16 past_gain_pit; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 Word16 prev_gp; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 } ec_gain_pitchState; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 typedef struct { |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 Word16 gbuf[5]; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 Word16 past_gain_code; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 Word16 prev_gc; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 } ec_gain_codeState; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 * DECLARATION OF PROTOTYPES |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 ******************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 * Function : ec_gain_code_reset |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 * Purpose : Resets state memory |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 void ec_gain_code_reset ( |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 ec_gain_codeState *state |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 ); |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 * Function : ec_gain_code |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 * Purpose : conceal the codebook gain |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 * Call this function only in BFI (instead of normal gain |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 * decoding function) |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 void ec_gain_code ( |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 ec_gain_codeState *st, /* i/o : State struct */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 gc_predState *pred_state, /* i/o : MA predictor state */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 Word16 state, /* i : state of the state machine */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 Word16 *gain_code /* o : decoded innovation gain */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 ); |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 * Function : ec_gain_code_update |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 * Purpose : update the codebook gain concealment state; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 * limit gain_code if the previous frame was bad |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 * Call this function always after decoding (or concealing) |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 * the gain |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 void ec_gain_code_update ( |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 ec_gain_codeState *st, /* i/o : State struct */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 Word16 bfi, /* i : flag: frame is bad */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 Word16 prev_bf, /* i : flag: previous frame was bad */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 Word16 *gain_code /* i/o : decoded innovation gain */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 ); |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 * Function: ec_gain_pitch_reset |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 * Purpose: Resets state memory |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 void ec_gain_pitch_reset ( |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 ec_gain_pitchState *state |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 ); |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 * Function : ec_gain_pitch |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 * Purpose : conceal the pitch gain |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 * Call this function only in BFI (instead of normal gain |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 * decoding function) |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 void ec_gain_pitch ( |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 ec_gain_pitchState *st, /* i/o : state variables */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 Word16 state, /* i : state of the state machine */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 Word16 *gain_pitch /* o : pitch gain (Q14) */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 ); |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 /* |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 * Function : ec_gain_pitch_update |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 * Purpose : update the pitch gain concealment state; |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 * limit gain_pitch if the previous frame was bad |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 * Call this function always after decoding (or concealing) |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 * the gain |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 * |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 ************************************************************************** |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 void ec_gain_pitch_update ( |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 ec_gain_pitchState *st, /* i/o : state variables */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 Word16 bfi, /* i : flag: frame is bad */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 Word16 prev_bf, /* i : flag: previous frame was bad */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 Word16 *gain_pitch /* i/o : pitch gain */ |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 ); |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 |
9cbd1b5d061f
libtwamr: integrate ec_gains.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 #endif |