FreeCalypso > hg > gsm-codec-lib
annotate libgsmefr/vad.h @ 183:452c1d5a6268
libgsmefr BFI w/o data: emit zero output after decoder reset
In real-life usage, each EFR decoder session will most likely begin
with lots of BFI frames before the first real frame arrives. However,
because the spec-defined home state of the decoder is speech rather
than CN, our regular logic for BFI w/o data would have to feed
pseudorandom noise to the decoder (in the "fixed codebook excitation
pulses" part), which is silly to do at the beginning of the decoder
session right out of reset. Therefore, let's check reset_flag_old,
and if we are still in the reset state, simply emit zero output.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 03 Jan 2023 00:12:18 +0000 |
parents | 756605c4850f |
children |
rev | line source |
---|---|
39
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /*************************************************************************** |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * File Name: vad.h |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * Purpose: Contains the prototypes for all functions of voice activity |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * detection. Also contains the type definition for the pseudo |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * floating point data type. |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 * |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 **************************************************************************/ |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
52
988fd7ff514f
libgsmefr: add state pointers to ETSI function prototypes
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
11 void vad_reset (struct EFR_encoder_state *st); |
39
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 Word16 vad_computation ( |
52
988fd7ff514f
libgsmefr: add state pointers to ETSI function prototypes
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
14 struct EFR_encoder_state *st, |
39
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 Word16 r_h[], |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 Word16 r_l[], |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 Word16 scal_acf, |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 Word16 rc[], |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 Word16 ptch |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 ); |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 void periodicity_update ( |
52
988fd7ff514f
libgsmefr: add state pointers to ETSI function prototypes
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
23 struct EFR_encoder_state *st, |
988fd7ff514f
libgsmefr: add state pointers to ETSI function prototypes
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
24 Word16 lags[] |
39
36e1363ad885
libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 ); |