libosmocodec
0.12.1
Osmocom codec library
|
GSM 06.90 - GSM AMR Codec. More...
#include <stdint.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <osmocom/core/utils.h>
#include <osmocom/codec/codec.h>
Functions | |
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. 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... | |
Variables | |
const uint16_t | gsm690_12_2_bitorder [244] |
const uint16_t | gsm690_10_2_bitorder [204] |
const uint16_t | gsm690_7_95_bitorder [159] |
const uint16_t | gsm690_7_4_bitorder [148] |
const uint16_t | gsm690_6_7_bitorder [134] |
const uint16_t | gsm690_5_9_bitorder [118] |
const uint16_t | gsm690_5_15_bitorder [103] |
const uint16_t | gsm690_4_75_bitorder [95] |
static const uint8_t | amr_len_by_ft [16] |
const struct value_string | osmo_amr_type_names [] |
GSM 06.90 - GSM AMR Codec.
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().
|
static |
Referenced by osmo_amr_rtp_dec(), and osmo_amr_rtp_enc().
const uint16_t gsm690_10_2_bitorder[204] |
const uint16_t gsm690_12_2_bitorder[244] |
const uint16_t gsm690_4_75_bitorder[95] |
const uint16_t gsm690_5_15_bitorder[103] |
const uint16_t gsm690_5_9_bitorder[118] |
const uint16_t gsm690_6_7_bitorder[134] |
const uint16_t gsm690_7_4_bitorder[148] |
const uint16_t gsm690_7_95_bitorder[159] |
const struct value_string osmo_amr_type_names[] |