annotate libgsmefr/enc_wrap.c @ 287:f00925b533b7

gsmfr-encode: convert to libgsmfr2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Apr 2024 06:16:47 +0000
parents 269d341db403
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
113
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module contains our EFR_encode_frame() function, which is the primary
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * (most common, most useful) interface to our EFR encoder.
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include "gsm_efr.h"
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 void EFR_encode_frame(struct EFR_encoder_state *st, const int16_t *pcm_in,
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 uint8_t *frame, int *sp_out, int *vad_out)
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 {
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 int16_t params[EFR_NUM_PARAMS];
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 int sp;
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 EFR_encode_params(st, pcm_in, params, &sp, vad_out);
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 EFR_params2frame(params, frame);
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 if (!sp)
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 EFR_insert_sid_codeword(frame);
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 if (sp_out)
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 *sp_out = sp;
269d341db403 libgsmefr: implement main encoder wrapper
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 }