summaryrefslogtreecommitdiffstats
path: root/include/osmocom/codec/codec.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom/codec/codec.h')
-rw-r--r--include/osmocom/codec/codec.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h
index d126e0f7..b7bcc788 100644
--- a/include/osmocom/codec/codec.h
+++ b/include/osmocom/codec/codec.h
@@ -2,6 +2,8 @@
#include <stdint.h>
+#include <osmocom/core/utils.h>
+
extern const uint16_t gsm610_bitorder[]; /* FR */
extern const uint16_t gsm620_unvoiced_bitorder[]; /* HR unvoiced */
extern const uint16_t gsm620_voiced_bitorder[]; /* HR voiced */
@@ -15,3 +17,32 @@ extern const uint16_t gsm690_6_7_bitorder[]; /* AMR 6.7 kbits */
extern const uint16_t gsm690_5_9_bitorder[]; /* AMR 5.9 kbits */
extern const uint16_t gsm690_5_15_bitorder[]; /* AMR 5.15 kbits */
extern const uint16_t gsm690_4_75_bitorder[]; /* AMR 4.75 kbits */
+
+extern const struct value_string osmo_amr_type_names[];
+
+enum osmo_amr_type {
+ AMR_4_75 = 0,
+ AMR_5_15 = 1,
+ AMR_5_90 = 2,
+ AMR_6_70 = 3,
+ AMR_7_40 = 4,
+ AMR_7_95 = 5,
+ AMR_10_2 = 6,
+ AMR_12_2 = 7,
+ AMR_SID = 8,
+ AMR_GSM_EFR_SID = 9,
+ AMR_TDMA_EFR_SID = 10,
+ AMR_PDC_EFR_SID = 11,
+ AMR_NO_DATA = 15,
+};
+
+enum osmo_amr_quality {
+ AMR_BAD = 0,
+ AMR_GOOD = 1
+};
+
+int osmo_amr_rtp_enc(uint8_t *payload, uint8_t cmr, enum osmo_amr_type ft,
+ enum osmo_amr_quality bfi);
+int osmo_amr_rtp_dec(const uint8_t *payload, int payload_len, uint8_t *cmr,
+ int8_t *cmi, enum osmo_amr_type *ft,
+ enum osmo_amr_quality *bfi, int8_t *sti);