libosmocoding
0.12.1
Osmocom GSM/GPRS/EGPRS L1 channel coding library
|
GSM TS 05.03 coding. More...
Files | |
file | gsm0503_coding.h |
GSM TS 05.03 coding. | |
file | gsm0503_coding.c |
Data Structures | |
union | gprs_rlc_ul_hdr_egprs |
union across the three different EGPRS Uplink header types More... | |
union | gprs_rlc_dl_hdr_egprs |
union across the three different EGPRS Downlink header types More... | |
struct | gsm0503_mcs_code |
Structure describing a Modulation and Coding Scheme. More... | |
Macros | |
#define | GSM0503_GPRS_BURSTS_NBITS (116 * 4) |
#define | GSM0503_EGPRS_BURSTS_NBITS (348 * 4) |
#define | EGPRS_HDR_UPP_MAX 54 |
#define | EGPRS_HDR_C_MAX 162 |
#define | EGPRS_HDR_HC_MAX 160 |
#define | EGPRS_DATA_U_MAX 612 |
#define | EGPRS_DATA_C_MAX 1836 |
#define | EGPRS_DATA_DC_MAX 1248 |
#define | EGPRS_DATA_C1 612 |
#define | EGPRS_DATA_C2 EGPRS_DATA_C1 |
Enumerations | |
enum | gsm0503_egprs_mcs { EGPRS_MCS0, EGPRS_MCS1, EGPRS_MCS2, EGPRS_MCS3, EGPRS_MCS4, EGPRS_MCS5, EGPRS_MCS6, EGPRS_MCS7, EGPRS_MCS8, EGPRS_MCS9, EGPRS_NUM_MCS } |
Functions | |
int | gsm0503_xcch_encode (ubit_t *bursts, const uint8_t *l2_data) |
Encoding of xCCH data from L2 frame to bursts. More... | |
int | gsm0503_xcch_decode (uint8_t *l2_data, const sbit_t *bursts, int *n_errors, int *n_bits_total) |
Decoding of xCCH data from bursts to L2 frame. More... | |
int | gsm0503_pdtch_encode (ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) |
GPRS DL message encoding. More... | |
int | gsm0503_pdtch_decode (uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p, int *n_errors, int *n_bits_total) |
Decode GPRS PDTCH. More... | |
int | gsm0503_pdtch_egprs_encode (ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len) |
EGPRS DL message encoding. More... | |
int | gsm0503_pdtch_egprs_decode (uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) |
Decode EGPRS UL message. More... | |
int | gsm0503_tch_fr_encode (ubit_t *bursts, const uint8_t *tch_data, int len, int net_order) |
Perform channel encoding on a TCH/FS channel according to TS 05.03. More... | |
int | gsm0503_tch_fr_decode (uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) |
Perform channel decoding of a FR/EFR channel according TS 05.03. More... | |
int | gsm0503_tch_hr_encode (ubit_t *bursts, const uint8_t *tch_data, int len) |
Perform channel encoding on a TCH/HS channel according to TS 05.03. More... | |
int | gsm0503_tch_hr_decode (uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) |
Perform channel decoding of a HR(v1) channel according TS 05.03. More... | |
int | gsm0503_tch_afs_encode (ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) |
Perform channel encoding on a TCH/AFS channel according to TS 05.03. More... | |
int | gsm0503_tch_afs_decode (uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) |
Perform channel decoding of a TCH/AFS channel according TS 05.03. More... | |
int | gsm0503_tch_ahs_encode (ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr) |
Perform channel encoding on a TCH/AHS channel according to TS 05.03. More... | |
int | gsm0503_tch_ahs_decode (uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) |
Perform channel decoding of a TCH/AFS channel according TS 05.03. More... | |
int | gsm0503_rach_ext_encode (ubit_t *burst, uint16_t ra11, uint8_t bsic, bool is_11bit) |
Encode the Extended (11-bit) or regular (8-bit) RACH according to 3GPP TS 45.003. More... | |
int | gsm0503_rach_encode (ubit_t *burst, const uint8_t *ra, uint8_t bsic) |
Encode the (8-bit) RACH according to TS 05.03. More... | |
int | gsm0503_rach_decode (uint8_t *ra, const sbit_t *burst, uint8_t bsic) |
Decode the (8-bit) RACH according to TS 05.03. More... | |
int | gsm0503_rach_decode_ber (uint8_t *ra, const sbit_t *burst, uint8_t bsic, int *n_errors, int *n_bits_total) |
Decode the (8-bit) RACH according to TS 05.03. More... | |
int | gsm0503_rach_ext_decode (uint16_t *ra, const sbit_t *burst, uint8_t bsic) |
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003. More... | |
int | gsm0503_rach_ext_decode_ber (uint16_t *ra, const sbit_t *burst, uint8_t bsic, int *n_errors, int *n_bits_total) |
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003. More... | |
int | gsm0503_sch_encode (ubit_t *burst, const uint8_t *sb_info) |
Encode the SCH according to TS 05.03. More... | |
int | gsm0503_sch_decode (uint8_t *sb_info, const sbit_t *burst) |
Decode the SCH according to TS 05.03. More... | |
static int | osmo_conv_decode_ber_punctured (const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output, int *n_errors, int *n_bits_total, const uint8_t *data_punc) |
Convolutional Decode + compute BER for punctured codes. More... | |
static int | osmo_conv_decode_ber (const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output, int *n_errors, int *n_bits_total) |
Convolutional Decode + compute BER for non-punctured codes. More... | |
static int | _xcch_decode_cB (uint8_t *l2_data, const sbit_t *cB, int *n_errors, int *n_bits_total) |
convenience wrapper for decoding coded bits More... | |
static int | _xcch_encode_cB (ubit_t *cB, const uint8_t *l2_data) |
convenience wrapper for encoding to coded bits More... | |
static int | egprs_type3_unmap (const sbit_t *bursts, sbit_t *hc, sbit_t *dc) |
static int | egprs_type2_unmap (const sbit_t *bursts, sbit_t *hc, sbit_t *dc) |
static int | egprs_type1_unmap (const sbit_t *bursts, sbit_t *hc, sbit_t *c1, sbit_t *c2, int msc) |
static int | _egprs_decode_hdr (const sbit_t *hc, int mcs, union gprs_rlc_ul_hdr_egprs *hdr) |
static int | egprs_decode_hdr (union gprs_rlc_ul_hdr_egprs *hdr, const sbit_t *bursts, uint16_t nbits) |
static int | egprs_parse_ul_cps (struct egprs_cps *cps, union gprs_rlc_ul_hdr_egprs *hdr, int type) |
static int | egprs_decode_data (uint8_t *l2_data, const sbit_t *c, int mcs, int p, int blk, int *n_errors, int *n_bits_total) |
static int | egprs_type3_map (ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) |
static int | egprs_type2_map (ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf) |
static int | egprs_type1_map (ubit_t *bursts, const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, int usf, int mcs) |
static int | egprs_encode_hdr (ubit_t *hc, const uint8_t *l2_data, int mcs) |
static int | egprs_encode_data (ubit_t *c, const uint8_t *l2_data, int mcs, int p, int blk) |
static int | egprs_parse_dl_cps (struct egprs_cps *cps, const union gprs_rlc_dl_hdr_egprs *hdr, int type) |
static void | tch_fr_reassemble (uint8_t *tch_data, const ubit_t *b_bits, int net_order) |
assemble a FR codec frame in format as used inside RTP More... | |
static void | tch_fr_disassemble (ubit_t *b_bits, const uint8_t *tch_data, int net_order) |
static void | tch_hr_reassemble (uint8_t *tch_data, const ubit_t *b_bits) |
static void | tch_hr_disassemble (ubit_t *b_bits, const uint8_t *tch_data) |
static void | tch_efr_reassemble (uint8_t *tch_data, const ubit_t *b_bits) |
static void | tch_efr_disassemble (ubit_t *b_bits, const uint8_t *tch_data) |
static void | tch_amr_reassemble (uint8_t *tch_data, const ubit_t *d_bits, int len) |
static void | tch_amr_disassemble (ubit_t *d_bits, const uint8_t *tch_data, int len) |
static void | tch_fr_d_to_b (ubit_t *b_bits, const ubit_t *d_bits) |
static void | tch_fr_b_to_d (ubit_t *d_bits, const ubit_t *b_bits) |
static void | tch_hr_d_to_b (ubit_t *b_bits, const ubit_t *d_bits) |
static void | tch_hr_b_to_d (ubit_t *d_bits, const ubit_t *b_bits) |
static void | tch_efr_d_to_w (ubit_t *b_bits, const ubit_t *d_bits) |
static void | tch_efr_w_to_d (ubit_t *d_bits, const ubit_t *b_bits) |
static void | tch_efr_protected (const ubit_t *s_bits, ubit_t *b_bits) |
static void | tch_fr_unreorder (ubit_t *d, ubit_t *p, const ubit_t *u) |
static void | tch_fr_reorder (ubit_t *u, const ubit_t *d, const ubit_t *p) |
static void | tch_hr_unreorder (ubit_t *d, ubit_t *p, const ubit_t *u) |
static void | tch_hr_reorder (ubit_t *u, const ubit_t *d, const ubit_t *p) |
static void | tch_efr_reorder (ubit_t *w, const ubit_t *s, const ubit_t *p) |
static void | tch_efr_unreorder (ubit_t *s, ubit_t *p, const ubit_t *w) |
static void | tch_amr_merge (ubit_t *u, const ubit_t *d, const ubit_t *p, int len, int prot) |
static void | tch_amr_unmerge (ubit_t *d, ubit_t *p, const ubit_t *u, int len, int prot) |
static void | rach_apply_bsic (ubit_t *d, uint8_t bsic, uint8_t start) |
static int16_t | rach_decode_ber (const sbit_t *burst, uint8_t bsic, bool is_11bit, int *n_errors, int *n_bits_total) |
Variables | |
const struct gsm0503_mcs_code | gsm0503_mcs_ul_codes [EGPRS_NUM_MCS] |
const struct gsm0503_mcs_code | gsm0503_mcs_dl_codes [EGPRS_NUM_MCS] |
GSM TS 05.03 coding.
This module is the "master module" of libosmocoding. It uses the various other modules (mapping, parity, interleaving) in order to implement the complete channel coding (and decoding) chain for the various channel types as defined in TS 05.03 / 45.003.
#define EGPRS_DATA_C1 612 |
Referenced by egprs_type1_map(), egprs_type1_unmap(), gsm0503_pdtch_egprs_decode(), and gsm0503_pdtch_egprs_encode().
#define EGPRS_DATA_C2 EGPRS_DATA_C1 |
Referenced by gsm0503_pdtch_egprs_decode(), and gsm0503_pdtch_egprs_encode().
#define EGPRS_DATA_C_MAX 1836 |
Referenced by egprs_decode_data(), egprs_encode_data(), gsm0503_pdtch_egprs_encode(), and osmo_conv_decode_ber_punctured().
#define EGPRS_DATA_DC_MAX 1248 |
Referenced by egprs_type2_map(), egprs_type2_unmap(), gsm0503_pdtch_egprs_decode(), and gsm0503_pdtch_egprs_encode().
#define EGPRS_DATA_U_MAX 612 |
Referenced by egprs_decode_data(), and egprs_encode_data().
#define EGPRS_HDR_C_MAX 162 |
Referenced by _egprs_decode_hdr(), and egprs_encode_hdr().
#define EGPRS_HDR_HC_MAX 160 |
Referenced by egprs_decode_hdr(), egprs_type1_map(), egprs_type1_unmap(), egprs_type2_map(), and egprs_type2_unmap().
#define EGPRS_HDR_UPP_MAX 54 |
Referenced by _egprs_decode_hdr(), and egprs_encode_hdr().
#define GSM0503_EGPRS_BURSTS_NBITS (348 * 4) |
Referenced by egprs_decode_hdr(), gsm0503_pdtch_egprs_decode(), and gsm0503_pdtch_egprs_encode().
#define GSM0503_GPRS_BURSTS_NBITS (116 * 4) |
Referenced by egprs_decode_hdr(), gsm0503_pdtch_egprs_decode(), gsm0503_pdtch_egprs_encode(), and gsm0503_pdtch_encode().
enum gsm0503_egprs_mcs |
|
static |
References EGPRS_HDR_C_MAX, EGPRS_HDR_UPP_MAX, EGPRS_MCS5, EGPRS_MCS6, gsm0503_mcs_crc8_hdr, gsm0503_mcs_code::hdr_code_len, gsm0503_mcs_code::hdr_conv, gsm0503_mcs_code::hdr_len, gsm0503_mcs_code::hdr_punc, gsm0503_mcs_code::hdr_punc_len, gsm0503_mcs_code::mcs, osmo_conv_decode_ber(), osmo_crc8gen_check_bits(), and osmo_ubit2pbit_ext().
Referenced by egprs_decode_hdr().
|
static |
convenience wrapper for decoding coded bits
[out] | l2_data | caller-allocated buffer for L2 Frame |
[in] | cB | 456 coded (soft) bits as per TS 05.03 4.1.3 |
[out] | n_errors | Number of detected errors |
[out] | n_bits_total | Number of total coded bits |
References gsm0503_fire_crc40, osmo_conv_decode_ber(), osmo_crc64gen_check_bits(), and osmo_ubit2pbit_ext().
Referenced by gsm0503_tch_afs_decode(), gsm0503_tch_ahs_decode(), gsm0503_tch_fr_decode(), gsm0503_tch_hr_decode(), and gsm0503_xcch_decode().
|
static |
convenience wrapper for encoding to coded bits
[out] | cB | caller-allocated buffer for 456 coded bits as per TS 05.03 4.1.3 |
[out] | l2_data | to-be-encoded L2 Frame |
References gsm0503_fire_crc40, osmo_conv_encode(), osmo_crc64gen_set_bits(), and osmo_pbit2ubit_ext().
Referenced by gsm0503_tch_afs_encode(), gsm0503_tch_ahs_encode(), gsm0503_tch_fr_encode(), gsm0503_tch_hr_encode(), and gsm0503_xcch_encode().
|
static |
References gsm0503_mcs_code::data_code_len, gsm0503_mcs_code::data_conv, gsm0503_mcs_code::data_len, gsm0503_mcs_code::data_punc, gsm0503_mcs_code::data_punc_len, EGPRS_DATA_C_MAX, EGPRS_DATA_U_MAX, EGPRS_MCS7, gsm0503_mcs_crc12, gsm0503_mcs_code::hdr_len, gsm0503_mcs_code::mcs, OSMO_BYTES_FOR_BITS, osmo_conv_decode_ber_punctured(), osmo_crc16gen_check_bits(), and osmo_ubit2pbit_ext().
Referenced by gsm0503_pdtch_egprs_decode().
|
static |
|
static |
References gsm0503_mcs_code::data_code_len, gsm0503_mcs_code::data_conv, gsm0503_mcs_code::data_len, gsm0503_mcs_code::data_punc, EGPRS_DATA_C_MAX, EGPRS_DATA_U_MAX, EGPRS_MCS7, gsm0503_mcs_crc12, gsm0503_mcs_code::hdr_len, gsm0503_mcs_code::mcs, osmo_conv_encode(), osmo_crc16gen_set_bits(), osmo_pbit2ubit_ext(), and gsm0503_mcs_code::usf_len.
Referenced by gsm0503_pdtch_egprs_encode().
|
static |
References EGPRS_HDR_C_MAX, EGPRS_HDR_UPP_MAX, EGPRS_MCS5, EGPRS_MCS6, gsm0503_mcs_crc8_hdr, gsm0503_mcs_code::hdr_code_len, gsm0503_mcs_code::hdr_conv, gsm0503_mcs_code::hdr_len, gsm0503_mcs_code::hdr_punc, gsm0503_mcs_code::mcs, osmo_conv_encode(), osmo_crc8gen_set_bits(), osmo_pbit2ubit_ext(), and gsm0503_mcs_code::usf_len.
Referenced by gsm0503_pdtch_egprs_encode().
|
static |
References gprs_rlc_dl_hdr_egprs::type1, gprs_rlc_dl_hdr_egprs::type2, and gprs_rlc_dl_hdr_egprs::type3.
Referenced by gsm0503_pdtch_egprs_encode().
|
static |
References gprs_rlc_ul_hdr_egprs::type1, gprs_rlc_ul_hdr_egprs::type2, and gprs_rlc_ul_hdr_egprs::type3.
Referenced by gsm0503_pdtch_egprs_decode().
|
static |
References EGPRS_DATA_C1, EGPRS_HDR_HC_MAX, EGPRS_MCS7, gsm0503_mcs5_burst_swap(), gsm0503_mcs7_ul_burst_unmap(), gsm0503_mcs7_ul_deinterleave(), and gsm0503_mcs8_ul_deinterleave().
Referenced by egprs_decode_hdr(), and gsm0503_pdtch_egprs_decode().
References EGPRS_DATA_DC_MAX, EGPRS_HDR_HC_MAX, gsm0503_mcs5_burst_swap(), gsm0503_mcs5_ul_burst_unmap(), and gsm0503_mcs5_ul_deinterleave().
Referenced by egprs_decode_hdr(), and gsm0503_pdtch_egprs_decode().
|
static |
References gsm0503_mcs1_dl_interleave(), gsm0503_pdtch_hl_hn_ubit, gsm0503_usf2six, and gsm0503_xcch_burst_map().
Referenced by gsm0503_pdtch_egprs_encode().
References gsm0503_mcs1_ul_deinterleave(), and gsm0503_xcch_burst_unmap().
Referenced by egprs_decode_hdr(), and gsm0503_pdtch_egprs_decode().
int gsm0503_pdtch_decode | ( | uint8_t * | l2_data, |
const sbit_t * | bursts, | ||
uint8_t * | usf_p, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Decode GPRS PDTCH.
[out] | l2_data | caller-allocated buffer for L2 Frame |
[in] | bursts | burst input data as soft unpacked bits |
[out] | usf_p | uplink stealing flag |
[out] | n_errors | number of detected bit-errors |
[out] | n_bits_total | total number of dcoded bits |
References gsm0503_cs234_crc16, gsm0503_fire_crc40, gsm0503_pdtch_hl_hn_sbit, gsm0503_puncture_cs2, gsm0503_puncture_cs3, gsm0503_usf2six, gsm0503_usf2twelve_sbit, gsm0503_xcch_burst_unmap(), gsm0503_xcch_deinterleave(), osmo_conv_decode_ber(), osmo_crc16gen_check_bits(), osmo_crc64gen_check_bits(), and osmo_ubit2pbit_ext().
int gsm0503_pdtch_egprs_decode | ( | uint8_t * | l2_data, |
const sbit_t * | bursts, | ||
uint16_t | nbits, | ||
uint8_t * | usf_p, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Decode EGPRS UL message.
[out] | l2_data | caller-allocated buffer for L2 Frame |
[in] | bursts | burst input data as soft unpacked bits |
[in] | nbits | number of bits in bursts |
usf_p | unused argument ?!? | |
[out] | n_errors | number of detected bit-errors |
[out] | n_bits_total | total number of decoded bits |
References EGPRS_DATA_C1, EGPRS_DATA_C2, EGPRS_DATA_DC_MAX, egprs_decode_data(), egprs_decode_hdr(), EGPRS_MCS0, EGPRS_MCS1, EGPRS_MCS2, EGPRS_MCS3, EGPRS_MCS4, EGPRS_MCS5, EGPRS_MCS6, EGPRS_MCS7, EGPRS_MCS8, EGPRS_MCS9, egprs_parse_ul_cps(), egprs_type1_unmap(), egprs_type2_unmap(), egprs_type3_unmap(), GSM0503_EGPRS_BURSTS_NBITS, GSM0503_GPRS_BURSTS_NBITS, and type.
int gsm0503_pdtch_egprs_encode | ( | ubit_t * | bursts, |
const uint8_t * | l2_data, | ||
uint8_t | l2_len | ||
) |
EGPRS DL message encoding.
[out] | bursts | caller-allocated buffer for unpacked burst bits |
[in] | l2_data | L2 (MAC) block to be encoded |
[in] | l2_len | length of l2_data in bytes, used to determine MCS |
References EGPRS_DATA_C1, EGPRS_DATA_C2, EGPRS_DATA_C_MAX, EGPRS_DATA_DC_MAX, egprs_encode_data(), egprs_encode_hdr(), EGPRS_MCS1, EGPRS_MCS2, EGPRS_MCS3, EGPRS_MCS4, EGPRS_MCS5, EGPRS_MCS6, EGPRS_MCS7, EGPRS_MCS8, EGPRS_MCS9, egprs_parse_dl_cps(), egprs_type1_map(), egprs_type2_map(), egprs_type3_map(), GSM0503_EGPRS_BURSTS_NBITS, GSM0503_GPRS_BURSTS_NBITS, gsm0503_mcs_code::mcs, gprs_rlc_dl_hdr_egprs::type1, gprs_rlc_dl_hdr_egprs::type2, and gprs_rlc_dl_hdr_egprs::type3.
int gsm0503_pdtch_encode | ( | ubit_t * | bursts, |
const uint8_t * | l2_data, | ||
uint8_t | l2_len | ||
) |
GPRS DL message encoding.
[out] | bursts | caller-allocated buffer for unpacked burst bits |
[in] | l2_data | L2 (MAC) block to be encoded |
[in] | l2_len | length of l2_data in bytes, used to determine CS |
References gsm0503_cs234_crc16, gsm0503_fire_crc40, GSM0503_GPRS_BURSTS_NBITS, gsm0503_pdtch_hl_hn_ubit, gsm0503_puncture_cs2, gsm0503_puncture_cs3, gsm0503_usf2six, gsm0503_usf2twelve_ubit, gsm0503_xcch_burst_map(), gsm0503_xcch_interleave(), osmo_conv_encode(), osmo_crc16gen_set_bits(), osmo_crc64gen_set_bits(), and osmo_pbit2ubit_ext().
int gsm0503_rach_decode | ( | uint8_t * | ra, |
const sbit_t * | burst, | ||
uint8_t | bsic | ||
) |
Decode the (8-bit) RACH according to TS 05.03.
[out] | ra | output buffer for RACH data |
[in] | burst | Input burst data |
[in] | bsic | BSIC used in this cell |
References rach_decode_ber().
int gsm0503_rach_decode_ber | ( | uint8_t * | ra, |
const sbit_t * | burst, | ||
uint8_t | bsic, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Decode the (8-bit) RACH according to TS 05.03.
[out] | ra | output buffer for RACH data |
[in] | burst | Input burst data |
[in] | bsic | BSIC used in this cell |
[out] | n_errors | Number of detected bit errors |
[out] | n_bits_total | Total number of bits |
References rach_decode_ber().
int gsm0503_rach_encode | ( | ubit_t * | burst, |
const uint8_t * | ra, | ||
uint8_t | bsic | ||
) |
Encode the (8-bit) RACH according to TS 05.03.
[out] | burst | Caller-allocated output burst buffer |
[in] | ra | Input RACH data |
[in] | bsic | BSIC used in this cell |
References gsm0503_rach_ext_encode().
int gsm0503_rach_ext_decode | ( | uint16_t * | ra, |
const sbit_t * | burst, | ||
uint8_t | bsic | ||
) |
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003.
[out] | ra | output buffer for RACH data |
[in] | burst | Input burst data |
[in] | bsic | BSIC used in this cell |
References rach_decode_ber().
int gsm0503_rach_ext_decode_ber | ( | uint16_t * | ra, |
const sbit_t * | burst, | ||
uint8_t | bsic, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003.
[out] | ra | output buffer for RACH data |
[in] | burst | Input burst data |
[in] | bsic | BSIC used in this cell |
[out] | n_errors | Number of detected bit errors |
[out] | n_bits_total | Total number of bits |
References rach_decode_ber().
int gsm0503_rach_ext_encode | ( | ubit_t * | burst, |
uint16_t | ra11, | ||
uint8_t | bsic, | ||
bool | is_11bit | ||
) |
Encode the Extended (11-bit) or regular (8-bit) RACH according to 3GPP TS 45.003.
[out] | burst | Caller-allocated output burst buffer |
[in] | ra11 | Input RACH data |
[in] | bsic | BSIC used in this cell |
[in] | is_11bit | whether given RA is 11 bit or not |
References gsm0503_rach_crc6, osmo_conv_encode(), osmo_crc8gen_set_bits(), osmo_pbit2ubit_ext(), and rach_apply_bsic().
Referenced by gsm0503_rach_encode().
int gsm0503_sch_decode | ( | uint8_t * | sb_info, |
const sbit_t * | burst | ||
) |
Decode the SCH according to TS 05.03.
[out] | sb_info | output buffer for SCH data |
[in] | burst | Input burst data |
References gsm0503_sch_crc10, osmo_conv_decode(), osmo_crc16gen_check_bits(), and osmo_ubit2pbit_ext().
int gsm0503_sch_encode | ( | ubit_t * | burst, |
const uint8_t * | sb_info | ||
) |
Encode the SCH according to TS 05.03.
[out] | burst | Caller-allocated output burst buffer |
[in] | sb_info | Input SCH data |
References gsm0503_sch_crc10, osmo_conv_encode(), osmo_crc16gen_set_bits(), and osmo_pbit2ubit_ext().
int gsm0503_tch_afs_decode | ( | uint8_t * | tch_data, |
const sbit_t * | bursts, | ||
int | codec_mode_req, | ||
uint8_t * | codec, | ||
int | codecs, | ||
uint8_t * | ft, | ||
uint8_t * | cmr, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Perform channel decoding of a TCH/AFS channel according TS 05.03.
[out] | tch_data | Codec frame in RTP payload format |
[in] | bursts | buffer containing the symbols of 8 bursts |
[in] | codec_mode_req | is this CMR (1) or CMC (0) |
[in] | codec | array of active codecs (active codec set) |
[in] | codecs | number of codecs in codec |
ft | Frame Type; Input if codec_mode_req = 1, Output * otherwise | |
[out] | cmr | Output in codec_mode_req = 1 |
[out] | n_errors | Number of detected bit errors |
[out] | n_bits_total | Total number of bits |
References _xcch_decode_cB(), gsm0503_afs_ic_sbit, gsm0503_amr_crc6, gsm0503_tch_burst_unmap(), gsm0503_tch_fr_deinterleave(), osmo_conv_decode_ber(), osmo_crc8gen_check_bits(), tch_amr_reassemble(), and tch_amr_unmerge().
int gsm0503_tch_afs_encode | ( | ubit_t * | bursts, |
const uint8_t * | tch_data, | ||
int | len, | ||
int | codec_mode_req, | ||
uint8_t * | codec, | ||
int | codecs, | ||
uint8_t | ft, | ||
uint8_t | cmr | ||
) |
Perform channel encoding on a TCH/AFS channel according to TS 05.03.
[out] | bursts | caller-allocated output buffer for bursts bits |
[in] | tch_data | Codec input data in RTP payload format |
[in] | len | Length of tch_data in bytes |
[in] | codec_mode_req | Use CMR (1) or FT (0) |
[in] | codec | Array of codecs (active codec set) |
[in] | codecs | Number of entries in codec |
[in] | ft | Frame Type to be used for encoding (index to codec) |
[in] | cmr | Codec Mode Request (used in codec_mode_req = 1 only) |
References _xcch_encode_cB(), gsm0503_afs_ic_ubit, gsm0503_amr_crc6, gsm0503_tch_burst_map(), gsm0503_tch_fr_interleave(), osmo_conv_encode(), osmo_crc8gen_set_bits(), tch_amr_disassemble(), and tch_amr_merge().
int gsm0503_tch_ahs_decode | ( | uint8_t * | tch_data, |
const sbit_t * | bursts, | ||
int | odd, | ||
int | codec_mode_req, | ||
uint8_t * | codec, | ||
int | codecs, | ||
uint8_t * | ft, | ||
uint8_t * | cmr, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Perform channel decoding of a TCH/AFS channel according TS 05.03.
[out] | tch_data | Codec frame in RTP payload format |
[in] | bursts | buffer containing the symbols of 8 bursts |
[in] | odd | Is this an odd (1) or even (0) frame number? |
[in] | codec_mode_req | is this CMR (1) or CMC (0) |
[in] | codec | array of active codecs (active codec set) |
[in] | codecs | number of codecs in codec |
ft | Frame Type; Input if codec_mode_req = 1, Output * otherwise | |
[out] | cmr | Output in codec_mode_req = 1 |
[out] | n_errors | Number of detected bit errors |
[out] | n_bits_total | Total number of bits |
References _xcch_decode_cB(), gsm0503_ahs_ic_sbit, gsm0503_amr_crc6, gsm0503_tch_burst_unmap(), gsm0503_tch_fr_deinterleave(), gsm0503_tch_hr_deinterleave(), osmo_conv_decode_ber(), osmo_crc8gen_check_bits(), tch_amr_reassemble(), and tch_amr_unmerge().
int gsm0503_tch_ahs_encode | ( | ubit_t * | bursts, |
const uint8_t * | tch_data, | ||
int | len, | ||
int | codec_mode_req, | ||
uint8_t * | codec, | ||
int | codecs, | ||
uint8_t | ft, | ||
uint8_t | cmr | ||
) |
Perform channel encoding on a TCH/AHS channel according to TS 05.03.
[out] | bursts | caller-allocated output buffer for bursts bits |
[in] | tch_data | Codec input data in RTP payload format |
[in] | len | Length of tch_data in bytes |
[in] | codec_mode_req | Use CMR (1) or FT (0) |
[in] | codec | Array of codecs (active codec set) |
[in] | codecs | Number of entries in codec |
[in] | ft | Frame Type to be used for encoding (index to codec) |
[in] | cmr | Codec Mode Request (used in codec_mode_req = 1 only) |
References _xcch_encode_cB(), gsm0503_afs_ic_ubit, gsm0503_amr_crc6, gsm0503_tch_burst_map(), gsm0503_tch_fr_interleave(), gsm0503_tch_hr_interleave(), osmo_conv_encode(), osmo_crc8gen_set_bits(), tch_amr_disassemble(), and tch_amr_merge().
int gsm0503_tch_fr_decode | ( | uint8_t * | tch_data, |
const sbit_t * | bursts, | ||
int | net_order, | ||
int | efr, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Perform channel decoding of a FR/EFR channel according TS 05.03.
[out] | tch_data | Codec frame in RTP payload format |
[in] | bursts | buffer containing the symbols of 8 bursts |
[in] | net_order | FIXME |
[in] | efr | Is this channel using EFR (1) or FR (0) |
[out] | n_errors | Number of detected bit errors |
[out] | n_bits_total | Total number of bits |
References _xcch_decode_cB(), gsm0503_tch_burst_unmap(), gsm0503_tch_efr_crc8, gsm0503_tch_fr_crc3, gsm0503_tch_fr_deinterleave(), osmo_conv_decode_ber(), osmo_crc8gen_check_bits(), tch_efr_d_to_w(), tch_efr_protected(), tch_efr_reassemble(), tch_efr_unreorder(), tch_fr_d_to_b(), tch_fr_reassemble(), and tch_fr_unreorder().
int gsm0503_tch_fr_encode | ( | ubit_t * | bursts, |
const uint8_t * | tch_data, | ||
int | len, | ||
int | net_order | ||
) |
Perform channel encoding on a TCH/FS channel according to TS 05.03.
[out] | bursts | caller-allocated output buffer for bursts bits |
[in] | tch_data | Codec input data in RTP payload format |
[in] | len | Length of tch_data in bytes |
[in] | net_order | FIXME |
References _xcch_encode_cB(), gsm0503_tch_burst_map(), gsm0503_tch_efr_crc8, gsm0503_tch_fr_crc3, gsm0503_tch_fr_interleave(), osmo_conv_encode(), osmo_crc8gen_set_bits(), tch_efr_disassemble(), tch_efr_protected(), tch_efr_reorder(), tch_efr_w_to_d(), tch_fr_b_to_d(), tch_fr_disassemble(), and tch_fr_reorder().
int gsm0503_tch_hr_decode | ( | uint8_t * | tch_data, |
const sbit_t * | bursts, | ||
int | odd, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Perform channel decoding of a HR(v1) channel according TS 05.03.
[out] | tch_data | Codec frame in RTP payload format |
[in] | bursts | buffer containing the symbols of 8 bursts |
[in] | odd | Odd (1) or even (0) frame number |
[out] | n_errors | Number of detected bit errors |
[out] | n_bits_total | Total number of bits |
References _xcch_decode_cB(), gsm0503_tch_burst_unmap(), gsm0503_tch_fr_crc3, gsm0503_tch_fr_deinterleave(), gsm0503_tch_hr_deinterleave(), osmo_conv_decode_ber(), osmo_crc8gen_check_bits(), tch_hr_d_to_b(), tch_hr_reassemble(), and tch_hr_unreorder().
int gsm0503_tch_hr_encode | ( | ubit_t * | bursts, |
const uint8_t * | tch_data, | ||
int | len | ||
) |
Perform channel encoding on a TCH/HS channel according to TS 05.03.
[out] | bursts | caller-allocated output buffer for bursts bits |
[in] | tch_data | Codec input data in RTP payload format |
[in] | len | Length of tch_data in bytes |
References _xcch_encode_cB(), gsm0503_tch_burst_map(), gsm0503_tch_fr_crc3, gsm0503_tch_fr_interleave(), gsm0503_tch_hr_interleave(), osmo_conv_encode(), osmo_crc8gen_set_bits(), tch_hr_b_to_d(), tch_hr_disassemble(), and tch_hr_reorder().
int gsm0503_xcch_decode | ( | uint8_t * | l2_data, |
const sbit_t * | bursts, | ||
int * | n_errors, | ||
int * | n_bits_total | ||
) |
Decoding of xCCH data from bursts to L2 frame.
[out] | l2_data | caller-allocated output data buffer |
[in] | bursts | four GSM bursts in soft-bits |
[out] | n_errors | Number of detected errors |
[out] | n_bits_total | Number of total coded bits |
References _xcch_decode_cB(), gsm0503_xcch_burst_unmap(), and gsm0503_xcch_deinterleave().
int gsm0503_xcch_encode | ( | ubit_t * | bursts, |
const uint8_t * | l2_data | ||
) |
Encoding of xCCH data from L2 frame to bursts.
[out] | bursts | caller-allocated burst data (unpacked bits) |
[in] | l2_data | L2 input data (MAC block) |
References _xcch_encode_cB(), gsm0503_xcch_burst_map(), and gsm0503_xcch_interleave().
|
static |
Convolutional Decode + compute BER for non-punctured codes.
[in] | code | Description of Convolutional Code |
[in] | input | Input soft-bits (-127...127) |
[out] | output | bits |
[out] | n_errors | Number of bit-errors |
[out] | n_bits_total | Number of bits |
References osmo_conv_decode_ber_punctured().
Referenced by _egprs_decode_hdr(), _xcch_decode_cB(), gsm0503_pdtch_decode(), gsm0503_tch_afs_decode(), gsm0503_tch_ahs_decode(), gsm0503_tch_fr_decode(), gsm0503_tch_hr_decode(), and rach_decode_ber().
|
static |
Convolutional Decode + compute BER for punctured codes.
[in] | code | Description of Convolutional Code |
[in] | input | Input soft-bits (-127...127) |
[out] | output | bits |
[out] | n_errors | Number of bit-errors |
[out] | n_bits_total | Number of bits |
[in] | data_punc | Puncturing mask array. Can be NULL. |
References EGPRS_DATA_C_MAX, OSMO_ASSERT, osmo_conv_decode(), osmo_conv_encode(), and res.
Referenced by egprs_decode_data(), and osmo_conv_decode_ber().
|
inlinestatic |
Referenced by gsm0503_rach_ext_encode(), and rach_decode_ber().
|
inlinestatic |
|
static |
Referenced by gsm0503_tch_afs_encode(), and gsm0503_tch_ahs_encode().
|
static |
Referenced by gsm0503_tch_afs_encode(), and gsm0503_tch_ahs_encode().
|
static |
Referenced by gsm0503_tch_afs_decode(), and gsm0503_tch_ahs_decode().
Referenced by gsm0503_tch_afs_decode(), and gsm0503_tch_ahs_decode().
Referenced by gsm0503_tch_fr_decode().
|
static |
Referenced by gsm0503_tch_fr_encode().
References gsm0503_gsm_efr_protected_bits.
Referenced by gsm0503_tch_fr_decode(), and gsm0503_tch_fr_encode().
|
static |
Referenced by gsm0503_tch_fr_decode().
Referenced by gsm0503_tch_fr_encode().
Referenced by gsm0503_tch_fr_decode().
Referenced by gsm0503_tch_fr_encode().
Referenced by gsm0503_tch_fr_encode().
Referenced by gsm0503_tch_fr_decode().
|
static |
References gsm0503_gsm_fr_map.
Referenced by gsm0503_tch_fr_encode().
|
static |
assemble a FR codec frame in format as used inside RTP
[out] | tch_data | Codec frame in RTP format |
[in] | b_bits | Codec frame in 'native' format |
[in] | net_order | FIXME |
References gsm0503_gsm_fr_map.
Referenced by gsm0503_tch_fr_decode().
Referenced by gsm0503_tch_fr_encode().
Referenced by gsm0503_tch_fr_decode().
Referenced by gsm0503_tch_hr_encode().
Referenced by gsm0503_tch_hr_decode().
|
static |
Referenced by gsm0503_tch_hr_encode().
|
static |
Referenced by gsm0503_tch_hr_decode().
Referenced by gsm0503_tch_hr_encode().
Referenced by gsm0503_tch_hr_decode().
const struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS] |
const struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS] |