aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-02-27 12:29:19 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2019-03-07 10:22:22 +0100
commitfa7df8726001146c902d3a93e2a4b425fa9024b0 (patch)
tree69f5ad07e901d1bdc2f1d74cdd8b668c9da5e6fe /include
parent0fe9b3664a8d0b74d5e1c67593b350d67de3f98f (diff)
AMR: add functions to convert between bw-efficient and octet-alignedpmaier/amrmangle
RFC 3267 describes two different AMR frame formats. Octet Aligned and Bandwidth efficient mode. In Bandwith efficient mode the padding bits, which are used to align CMR, TOC and payload on octet boundaries are saved and the fielda are packed directly one after another. - Add functions to convert from one mode to the other and vice versa. - Add function to detect in which mode an AMR frame is encoded. Change-Id: I5b5a0fa644d8dbb1f04f9d7e35312683c7b3d196 Related: SYS#4470
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/netif/amr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/osmocom/netif/amr.h b/include/osmocom/netif/amr.h
index 1f048b1..46ec86a 100644
--- a/include/osmocom/netif/amr.h
+++ b/include/osmocom/netif/amr.h
@@ -95,7 +95,15 @@ static inline void *osmo_amr_get_payload(struct amr_hdr *amrh)
#define AMR_FT_7_LEN 31 /* 12.2 */
#define AMR_FT_SID_LEN 5 /* SID */
+/* NOTE: the above constant refers to the length of one AMR speech frame-block,
+ * not counting CMR, TOC. */
+
int osmo_amr_ft_valid(uint8_t amr_ft);
size_t osmo_amr_bytes(uint8_t amr_cmr);
+bool osmo_amr_is_oa(uint8_t *payload, unsigned int payload_len);
+int osmo_amr_oa_to_bwe(uint8_t *payload, unsigned int payload_len);
+int osmo_amr_bwe_to_oa(uint8_t *payload, unsigned int payload_len,
+ unsigned int payload_maxlen);
+
#endif