annotate libgsmefr/gsm_efr.h @ 449:2af2b5c12268

Library-versions: libtwamr is officially version 1.0.0
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 10 May 2024 01:43:05 +0000
parents 9499d12d315b
children ea89eb8291bf
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 /*
425
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
2 * This header file is the external public interface to libgsmefr:
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
3 * Themyscira Wireless implementation of GSM-EFR speech codec
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
4 * based on the original ETSI code of GSM 06.53, adapted to the
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
5 * RTP frame format of ETSI TS 101 318.
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
6 *
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
7 * This header file should be installed in some system include directory
9499d12d315b libgsmefr/gsm_efr.h: update header comment
Mychaela Falconia <falcon@freecalypso.org>
parents: 33
diff changeset
8 * such that it can be included by C sources as <gsm_efr.h>.
1
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
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
11 #ifndef __GSM_EFR_H
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
12 #define __GSM_EFR_H
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
14 #include <stdint.h>
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
33
88468d5b3590 libgsmefr: implement frame packing
Mychaela Falconia <falcon@freecalypso.org>
parents: 30
diff changeset
16 #define EFR_RTP_FRAME_LEN 31
88468d5b3590 libgsmefr: implement frame packing
Mychaela Falconia <falcon@freecalypso.org>
parents: 30
diff changeset
17 #define EFR_NUM_PARAMS 57
88468d5b3590 libgsmefr: implement frame packing
Mychaela Falconia <falcon@freecalypso.org>
parents: 30
diff changeset
18
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
19 struct EFR_encoder_state; /* opaque to external users */
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
20 struct EFR_decoder_state; /* ditto */
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
22 extern struct EFR_encoder_state *EFR_encoder_create(int dtx);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
23 extern struct EFR_decoder_state *EFR_decoder_create(void);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
24 /* use standard free() call to free both afterward */
1
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 /* reset state to initial */
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
27 extern void EFR_encoder_reset(struct EFR_encoder_state *st, int dtx);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
28 extern void EFR_decoder_reset(struct EFR_decoder_state *st);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
29
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
30 /* encoder public functions */
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
31
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
32 extern void EFR_encode_params(struct EFR_encoder_state *st, const int16_t *pcm,
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
33 int16_t *params, int *sp, int *vad);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
34 extern void EFR_encode_frame(struct EFR_encoder_state *st, const int16_t *pcm,
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
35 uint8_t *frame, int *sp, int *vad);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
36
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
37 /* decoder public functions */
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
39 extern void EFR_decode_params(struct EFR_decoder_state *st,
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
40 const int16_t *params, int bfi, int sid, int taf,
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
41 int16_t *pcm);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
42 extern void EFR_decode_frame(struct EFR_decoder_state *st, const uint8_t *frame,
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
43 int bfi, int taf, int16_t *pcm);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
44 extern void EFR_decode_bfi_nodata(struct EFR_decoder_state *st, int taf,
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
45 int16_t *pcm);
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
47 /* stateless utility functions */
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48
30
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
49 extern int EFR_sid_classify(const uint8_t *frame);
2272ba6f6879 libgsmefr: beginning with API definition
Mychaela Falconia <falcon@freecalypso.org>
parents: 2
diff changeset
50 extern void EFR_frame2params(const uint8_t *frame, int16_t *params);
33
88468d5b3590 libgsmefr: implement frame packing
Mychaela Falconia <falcon@freecalypso.org>
parents: 30
diff changeset
51 extern void EFR_params2frame(const int16_t *params, uint8_t *frame);
88468d5b3590 libgsmefr: implement frame packing
Mychaela Falconia <falcon@freecalypso.org>
parents: 30
diff changeset
52 extern void EFR_insert_sid_codeword(uint8_t *frame);
1
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
6780b23654bd libgsmfrp: starting with the silence frame
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #endif /* include guard */