libosmocodec
0.9.6.20171026
Osmocom codec library
|
Go to the source code of this file.
Enumerations | |
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 } |
Functions | |
static bool | osmo_amr_is_speech (enum osmo_amr_type ft) |
Check if given AMR Frame Type is a speech frame. More... | |
bool | osmo_fr_check_sid (const uint8_t *rtp_payload, size_t payload_len) |
Check whether RTP frame contains FR SID code word according to TS 101 318 §5.1.2. More... | |
bool | osmo_hr_check_sid (const uint8_t *rtp_payload, size_t payload_len) |
Check whether RTP frame contains HR SID code word according to TS 101 318 §5.2.2. More... | |
int | osmo_amr_rtp_enc (uint8_t *payload, uint8_t cmr, enum osmo_amr_type ft, enum osmo_amr_quality bfi) |
Encode various AMR parameters from RTP payload (RFC 4867) More... | |
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) |
Decode various AMR parameters from RTP payload (RFC 4867) acording to 3GPP TS 26.101. More... | |
Variables | |
const uint16_t | gsm610_bitorder [] |
const uint16_t | gsm620_unvoiced_bitorder [] |
const uint16_t | gsm620_voiced_bitorder [] |
const uint16_t | gsm660_bitorder [] |
const uint16_t | gsm690_12_2_bitorder [] |
const uint16_t | gsm690_10_2_bitorder [] |
const uint16_t | gsm690_7_95_bitorder [] |
const uint16_t | gsm690_7_4_bitorder [] |
const uint16_t | gsm690_6_7_bitorder [] |
const uint16_t | gsm690_5_9_bitorder [] |
const uint16_t | gsm690_5_15_bitorder [] |
const uint16_t | gsm690_4_75_bitorder [] |
const struct value_string | osmo_amr_type_names [] |
enum osmo_amr_quality |
enum osmo_amr_type |
|
inlinestatic |
Check if given AMR Frame Type is a speech frame.
[in] | ft | AMR Frame Type |
References AMR_10_2, AMR_12_2, AMR_4_75, AMR_5_15, AMR_5_90, AMR_6_70, AMR_7_40, AMR_7_95, osmo_amr_rtp_dec(), osmo_amr_rtp_enc(), osmo_fr_check_sid(), and osmo_hr_check_sid().
int osmo_amr_rtp_dec | ( | const uint8_t * | rtppayload, |
int | payload_len, | ||
uint8_t * | cmr, | ||
int8_t * | cmi, | ||
enum osmo_amr_type * | ft, | ||
enum osmo_amr_quality * | bfi, | ||
int8_t * | sti | ||
) |
Decode various AMR parameters from RTP payload (RFC 4867) acording to 3GPP TS 26.101.
[in] | rtppayload | Payload from RTP packet |
[in] | payload_len | length of rtppayload |
[out] | cmr | AMR Codec Mode Request, not filled if NULL |
[out] | cmi | AMR Codec Mode Indicator, -1 if not applicable for this type, not filled if NULL |
[out] | ft | AMR Frame Type, not filled if NULL |
[out] | bfi | AMR Bad Frame Indicator, not filled if NULL |
[out] | sti | AMR SID Type Indicator, -1 if not applicable for this type, not filled if NULL |
References amr_len_by_ft, AMR_SID, and type.
Referenced by osmo_amr_is_speech().
int osmo_amr_rtp_enc | ( | uint8_t * | payload, |
uint8_t | cmr, | ||
enum osmo_amr_type | ft, | ||
enum osmo_amr_quality | bfi | ||
) |
Encode various AMR parameters from RTP payload (RFC 4867)
[out] | payload | Payload for RTP packet, contains speech data (if any) except for have 2 first bytes where header will be built |
[in] | cmr | AMR codec Mode Request |
[in] | ft | AMR Frame Type |
[in] | bfi | AMR Bad Frame Indicator |
Note: only octet-aligned mode is supported so the header occupies 2 full bytes. Optional interleaving header is not supported.
References amr_len_by_ft.
Referenced by osmo_amr_is_speech().
bool osmo_fr_check_sid | ( | const uint8_t * | rtp_payload, |
size_t | payload_len | ||
) |
Check whether RTP frame contains FR SID code word according to TS 101 318 §5.1.2.
[in] | rtp_payload | Buffer with RTP payload |
[in] | payload_len | Length of payload |
References ARRAY_SIZE, bitvec_get_bit_pos(), bitvec::data, bitvec::data_len, and ZERO.
Referenced by osmo_amr_is_speech().
bool osmo_hr_check_sid | ( | const uint8_t * | rtp_payload, |
size_t | payload_len | ||
) |
Check whether RTP frame contains HR SID code word according to TS 101 318 §5.2.2.
[in] | rtp_payload | Buffer with RTP payload |
[in] | payload_len | Length of payload |
References ARRAY_SIZE, bitvec_get_uint(), bitvec::cur_bit, bitvec::data, bitvec::data_len, and mask().
Referenced by osmo_amr_is_speech().
const uint16_t gsm610_bitorder[] |
const uint16_t gsm620_unvoiced_bitorder[] |
const uint16_t gsm620_voiced_bitorder[] |
const uint16_t gsm660_bitorder[] |
const uint16_t gsm690_10_2_bitorder[] |
const uint16_t gsm690_12_2_bitorder[] |
const uint16_t gsm690_4_75_bitorder[] |
const uint16_t gsm690_5_15_bitorder[] |
const uint16_t gsm690_5_9_bitorder[] |
const uint16_t gsm690_6_7_bitorder[] |
const uint16_t gsm690_7_4_bitorder[] |
const uint16_t gsm690_7_95_bitorder[] |
const struct value_string osmo_amr_type_names[] |