annotate libgsmefr/cnst.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 f9c9dd458d55
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 * Codec constant parameters (coder, decoder, and postfilter) *
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 *---------------------------------------------------------------------------*/
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 #define L_TOTAL 320 /* Total size of speech buffer. */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #define L_WINDOW 240 /* Window size in LP analysis */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #define L_FRAME 160 /* Frame size */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #define L_FRAME_BY2 80 /* Frame size divided by 2 */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #define L_SUBFR 40 /* Subframe size */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #define M 10 /* Order of LP filter */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #define MP1 (M+1) /* Order of LP filter + 1 */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #define AZ_SIZE (4*M+4) /* Size of array of LP filters in 4 subfr.s */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #define PIT_MIN 18 /* Minimum pitch lag */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #define PIT_MAX 143 /* Maximum pitch lag */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #define L_INTERPOL (10+1) /* Length of filter for interpolation */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #define PRM_SIZE 57 /* Size of vector of analysis parameters */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 #define MU 26214 /* Factor for tilt compensation filter 0.8 */
36e1363ad885 libgsmefr: initial import of ETSI header files
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #define AGC_FAC 29491 /* Factor for automatic gain control 0.9 */
50
9ae58ffb4197 libgsmefr/cnst.h: add DTX_HANGOVER definition,
Mychaela Falconia <falcon@freecalypso.org>
parents: 39
diff changeset
21
9ae58ffb4197 libgsmefr/cnst.h: add DTX_HANGOVER definition,
Mychaela Falconia <falcon@freecalypso.org>
parents: 39
diff changeset
22 #define DTX_HANGOVER 7 /* Period when SP=1 although VAD=0.
9ae58ffb4197 libgsmefr/cnst.h: add DTX_HANGOVER definition,
Mychaela Falconia <falcon@freecalypso.org>
parents: 39
diff changeset
23 Used for comfort noise averaging */