annotate libgsmfrp/gsm_fr_preproc.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 2b5770c715ee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This header file is the external public interface to libgsmfrp;
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * it should be installed in the same system include directory
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * as <gsm.h> from libgsm, on which we depend.
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 */
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #ifndef __GSM_FR_PREPROC_H
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #define __GSM_FR_PREPROC_H
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <gsm.h>
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 struct gsmfr_preproc_state; /* opaque to external users */
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 extern struct gsmfr_preproc_state *gsmfr_preproc_create(void);
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 /* use standard free() call to free it afterward */
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 /* reset state to initial */
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 extern void gsmfr_preproc_reset(struct gsmfr_preproc_state *state);
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 /* main processing functions */
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 extern void gsmfr_preproc_good_frame(struct gsmfr_preproc_state *state,
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 gsm_byte *frame);
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 extern void gsmfr_preproc_bfi(struct gsmfr_preproc_state *state, int taf,
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 gsm_byte *frame_out);
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 /* utility function */
2
2b5770c715ee libgsmfrp: compiling utility functions
Mychaela Falconia <falcon@freecalypso.org>
parents: 1
diff changeset
27 extern int gsmfr_preproc_sid_classify(const gsm_byte *frame);
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 /* utility datum */
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 extern const gsm_frame gsmfr_preproc_silence_frame;
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #endif /* include guard */