gsm0503_coding.h File Reference
Coding
`#include <stdint.h>`
`#include <osmocom/core/defs.h>`
`#include <osmocom/core/bits.h>`

Go to the source code of this file.

## Macros

#define | GSM0503_GPRS_BURSTS_NBITS (116 * 4)
#define | GSM0503_EGPRS_BURSTS_NBITS (348 * 4)

## 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...

## Detailed Description

GSM TS 05.03 coding

gsm0503_xcch_deinterleave
void gsm0503_xcch_deinterleave(sbit_t *cB, const sbit_t *iB)
De-Interleave burst bits according to TS 05.03 4.1.4.
Definition: gsm0503_interleaving.c:86
tch_fr_disassemble
static void tch_fr_disassemble(ubit_t *b_bits, const uint8_t *tch_data, int net_order)
Definition: gsm0503_coding.c:1539
EGPRS_MCS8
@ EGPRS_MCS8
Definition: gsm0503_coding.h:28
gsm0503_mcs5_dl_burst_map
void gsm0503_mcs5_dl_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, const ubit_t *up, int B)
Definition: gsm0503_mapping.c:100
egprs_type1_unmap
static int egprs_type1_unmap(const sbit_t *bursts, sbit_t *hc, sbit_t *c1, sbit_t *c2, int msc)
Definition: gsm0503_coding.c:722
egprs_type3_map
static int egprs_type3_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf)
Definition: gsm0503_coding.c:1161
gsm0503_tch_hr_interleaving
const uint8_t gsm0503_tch_hr_interleaving[228][2]
Definition: gsm0503_tables.c:1692
gsm0503_puncture_mcs3_p1
const uint8_t gsm0503_puncture_mcs3_p1[948]
Definition: gsm0503_tables.c:285
gsm0503_mcs8_ul_deinterleave
void gsm0503_mcs8_ul_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
De-Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4.
Definition: gsm0503_interleaving.c:516
gsm0503_mcs_code::hdr_len
uint8_t hdr_len
Length of header (bits)
Definition: gsm0503_coding.c:157
gsm0503_puncture_mcs1_p1
const uint8_t gsm0503_puncture_mcs1_p1[588]
Definition: gsm0503_tables.c:167
gsm0503_puncture_mcs5_p1
const uint8_t gsm0503_puncture_mcs5_p1[1404]
Definition: gsm0503_tables.c:576
tch_amr_unmerge
static void tch_amr_unmerge(ubit_t *d, ubit_t *p, const ubit_t *u, int len, int prot)
Definition: gsm0503_coding.c:1781
tch_efr_reassemble
static void tch_efr_reassemble(uint8_t *tch_data, const ubit_t *b_bits)
Definition: gsm0503_coding.c:1588
gsm0503_mapping.h
gsm0503_sch_encode
int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info)
Encode the SCH according to TS 05.03.
Definition: gsm0503_coding.c:3009
gsm0503_puncture_mcs7_dl_hdr
const uint8_t gsm0503_puncture_mcs7_dl_hdr[135]
Definition: gsm0503_tables.c:816
gsm0503_mcs_crc8_hdr
const struct osmo_crc8gen_code gsm0503_mcs_crc8_hdr
Definition: gsm0503_parity.h:15
tch_efr_disassemble
static void tch_efr_disassemble(ubit_t *b_bits, const uint8_t *tch_data)
Definition: gsm0503_coding.c:1599
EGPRS_DATA_C2
#define EGPRS_DATA_C2
Definition: gsm0503_coding.c:132
tch_hr_b_to_d
static void tch_hr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits)
Definition: gsm0503_coding.c:1661
gsm0503_ahs_ic_sbit
const sbit_t gsm0503_ahs_ic_sbit[4][4]
Definition: gsm0503_tables.c:1685
EGPRS_DATA_U_MAX
#define EGPRS_DATA_U_MAX
Definition: gsm0503_coding.c:122
gsm0503_interleaving.h
gsm0503_puncture_mcs7_ul_hdr
const uint8_t gsm0503_puncture_mcs7_ul_hdr[162]
Definition: gsm0503_tables.c:833
gsm0503_pdtch_edge_hl_hn_ubit
const ubit_t gsm0503_pdtch_edge_hl_hn_ubit[3][8]
Definition: gsm0503_tables.c:47
GSM0503_EGPRS_BURSTS_NBITS
#define GSM0503_EGPRS_BURSTS_NBITS
Definition: gsm0503_coding.h:17
osmo_conv_decode_ber
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.
Definition: gsm0503_coding.c:578
gsm0503_tch_fr_crc3
const struct osmo_crc8gen_code gsm0503_tch_fr_crc3
Definition: gsm0503_parity.h:19
gsm0503_puncture_mcs9_p3
const uint8_t gsm0503_puncture_mcs9_p3[1836]
Definition: gsm0503_tables.c:1456
gsm0503_mcs5_dl_interleave
void gsm0503_mcs5_dl_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di)
Interleave MCS5 DL burst bits according to TS 05.03 5.1.9.1.5.
Definition: gsm0503_interleaving.c:312
gsm0503_pdtch_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.
Definition: gsm0503_coding.c:1009
EGPRS_MCS4
@ EGPRS_MCS4
Definition: gsm0503_coding.h:24
gsm0503_xcch_burst_map
void gsm0503_xcch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *hl, const ubit_t *hn)
Definition: gsm0503_mapping.c:53
gprs_rlc_dl_hdr_egprs::type2
struct gprs_rlc_dl_header_egprs_2 type2
Definition: gsm0503_coding.c:144
tch_fr_unreorder
static void tch_fr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u)
Definition: gsm0503_coding.c:1702
gsm0503_tch_ahs_encode
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.
Definition: gsm0503_coding.c:2680
gsm0503_mcs1_ul_deinterleave
void gsm0503_mcs1_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *iB)
Interleave MCS1 UL burst bits according to TS 05.03 5.1.5.2.4.
Definition: gsm0503_interleaving.c:194
gsm0503_coding.h
gsm0503_puncture_mcs2_p2
const uint8_t gsm0503_puncture_mcs2_p2[732]
Definition: gsm0503_tables.c:257
gsm0503_tch_fr_interleave
void gsm0503_tch_fr_interleave(const ubit_t *cB, ubit_t *iB)
GSM TCH FR/EFR/AFS Interleaving and burst mapping.
Definition: gsm0503_interleaving.c:646
gsm0503_mcs_code::data_code_len
uint16_t data_code_len
length of data convolutional code
Definition: gsm0503_coding.c:171
gsm0503_mcs_code::data_punc
const uint8_t * data_punc[3]
data puncturing sequences
Definition: gsm0503_coding.c:177
gsm0503_rach_ext_decode
int gsm0503_rach_ext_decode(uint16_t *ra, const sbit_t *burst, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_ext_decode_ber() instead")
Decode the Extended (11-bit) RACH according to 3GPP TS 45.003.
Definition: gsm0503_coding.c:2878
gsm0503_puncture_mcs1_dl_hdr
const uint8_t gsm0503_puncture_mcs1_dl_hdr[108]
Definition: gsm0503_tables.c:147
gsm0503_mcs5_ul_burst_map
void gsm0503_mcs5_ul_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, int B)
Definition: gsm0503_mapping.c:142
gsm0503_rach_ext_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.
Definition: gsm0503_coding.c:2912
gsm0503_rach_ext_encode
int gsm0503_rach_ext_encode(ubit_t *burst, uint16_t ra, uint8_t bsic, bool is_11bit)
Encode the Extended (11-bit) or regular (8-bit) RACH according to 3GPP TS 45.003.
Definition: gsm0503_coding.c:2959
gsm0503_mcs5_ul_deinterleave
void gsm0503_mcs5_ul_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di)
De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4.
Definition: gsm0503_interleaving.c:285
EGPRS_DATA_C_MAX
#define EGPRS_DATA_C_MAX
Definition: gsm0503_coding.c:125
gsm0503_mcs1_dl_deinterleave
void gsm0503_mcs1_dl_deinterleave(sbit_t *u, sbit_t *hc, sbit_t *dc, const sbit_t *iB)
De-Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5.
Definition: gsm0503_interleaving.c:116
gsm0503_mcs8_ul_interleave
void gsm0503_mcs8_ul_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
Interleave MCS8 UL burst bits according to TS 05.03 5.1.12.2.4.
Definition: gsm0503_interleaving.c:486
gsm0503_sch_crc10
const struct osmo_crc16gen_code gsm0503_sch_crc10
Definition: gsm0503_parity.h:18
egprs_parse_ul_cps
static int egprs_parse_ul_cps(struct egprs_cps *cps, union gprs_rlc_ul_hdr_egprs *hdr, int type)
Definition: gsm0503_coding.c:836
gsm0503_tch_hr_deinterleave
void gsm0503_tch_hr_deinterleave(sbit_t *cB, const sbit_t *iB)
GSM TCH HR/AHS De-Interleaving and burst mapping.
Definition: gsm0503_interleaving.c:660
gsm0503_puncture_mcs8_p2
const uint8_t gsm0503_puncture_mcs8_p2[1692]
Definition: gsm0503_tables.c:1146
EGPRS_MCS7
@ EGPRS_MCS7
Definition: gsm0503_coding.h:27
gsm0503_mcs_code::data_len
uint16_t data_len
length of data (bits)
Definition: gsm0503_coding.c:169
gsm0503_puncture_mcs3_p3
const uint8_t gsm0503_puncture_mcs3_p3[948]
Definition: gsm0503_tables.c:397
gprs_rlc_dl_hdr_egprs::type3
struct gprs_rlc_dl_header_egprs_3 type3
Definition: gsm0503_coding.c:145
gsm0503_mcs7_ul_burst_map
void gsm0503_mcs7_ul_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, int B)
Definition: gsm0503_mapping.c:216
gsm0503_mcs5_usf_precode_table
const ubit_t gsm0503_mcs5_usf_precode_table[8][36]
Definition: gsm0503_tables.c:1736
gsm0503_puncture_mcs4_p3
const uint8_t gsm0503_puncture_mcs4_p3[1116]
Definition: gsm0503_tables.c:535
gsm0503_puncture_mcs9_p1
const uint8_t gsm0503_puncture_mcs9_p1[1836]
Definition: gsm0503_tables.c:1246
GSM0503_GPRS_BURSTS_NBITS
#define GSM0503_GPRS_BURSTS_NBITS
Definition: gsm0503_coding.h:16
gsm0503_puncture_mcs5_p2
const uint8_t gsm0503_puncture_mcs5_p2[1404]
Definition: gsm0503_tables.c:631
gsm0503_interleave_mcs5
const uint16_t gsm0503_interleave_mcs5[1248]
Definition: gsm0503_tables.c:1561
EGPRS_HDR_UPP_MAX
#define EGPRS_HDR_UPP_MAX
Definition: gsm0503_coding.c:113
gsm0503_puncture_mcs3_p2
const uint8_t gsm0503_puncture_mcs3_p2[948]
Definition: gsm0503_tables.c:341
gsm0503_puncture_cs3
const uint8_t gsm0503_puncture_cs3[676]
Definition: gsm0503_tables.c:121
tch_efr_reorder
static void tch_efr_reorder(ubit_t *w, const ubit_t *s, const ubit_t *p)
Definition: gsm0503_coding.c:1740
_xcch_encode_cB
static int _xcch_encode_cB(ubit_t *cB, const uint8_t *l2_data)
convenience wrapper for encoding to coded bits
Definition: gsm0503_coding.c:615
gsm0503_tch_fr_deinterleave
void gsm0503_tch_fr_deinterleave(sbit_t *cB, const sbit_t *iB)
GSM TCH FR/EFR/AFS De-Interleaving and burst mapping.
Definition: gsm0503_interleaving.c:632
gsm0503_puncture_mcs8_p3
const uint8_t gsm0503_puncture_mcs8_p3[1692]
Definition: gsm0503_tables.c:1196
gsm0503_tch_hr_decode
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.
Definition: gsm0503_coding.c:1945
gsm0503_gsm_efr_protected_bits
const uint8_t gsm0503_gsm_efr_protected_bits[65]
Definition: gsm0503_tables.c:1653
gsm0503_mcs5_dl_burst_unmap
void gsm0503_mcs5_dl_burst_unmap(sbit_t *di, const sbit_t *eB, sbit_t *hi, sbit_t *up, int B)
Definition: gsm0503_mapping.c:122
EGPRS_MCS2
@ EGPRS_MCS2
Definition: gsm0503_coding.h:22
EGPRS_HDR_C_MAX
#define EGPRS_HDR_C_MAX
Definition: gsm0503_coding.c:116
gsm0503_mcs_code::data_punc_len
uint16_t data_punc_len
length of data code puncturing sequence
Definition: gsm0503_coding.c:173
EGPRS_MCS6
@ EGPRS_MCS6
Definition: gsm0503_coding.h:26
egprs_decode_hdr
static int egprs_decode_hdr(union gprs_rlc_ul_hdr_egprs *hdr, const sbit_t *bursts, uint16_t nbits)
Definition: gsm0503_coding.c:800
gsm0503_ahs_ic_ubit
const ubit_t gsm0503_ahs_ic_ubit[4][4]
Definition: gsm0503_tables.c:1678
gsm0503_puncture_mcs6_p2
const uint8_t gsm0503_puncture_mcs6_p2[1836]
Definition: gsm0503_tables.c:751
egprs_encode_data
static int egprs_encode_data(ubit_t *c, const uint8_t *l2_data, int mcs, int p, int blk)
Definition: gsm0503_coding.c:1252
gsm0503_puncture_mcs6_p1
const uint8_t gsm0503_puncture_mcs6_p1[1836]
Definition: gsm0503_tables.c:686
gprs_rlc_dl_hdr_egprs
union across the three different EGPRS Downlink header types
Definition: gsm0503_coding.c:142
gsm0503_sch_decode
int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst)
Decode the SCH according to TS 05.03.
Definition: gsm0503_coding.c:2989
gsm0503_usf2twelve_sbit
const sbit_t gsm0503_usf2twelve_sbit[8][12]
Definition: gsm0503_tables.c:88
gsm0503_mcs_code::usf_len
uint8_t usf_len
Length of Uplink Stealing Flag (USF) in bits.
Definition: gsm0503_coding.c:153
tch_efr_w_to_d
static void tch_efr_w_to_d(ubit_t *d_bits, const ubit_t *b_bits)
Definition: gsm0503_coding.c:1685
gsm0503_rach_crc6
const struct osmo_crc8gen_code gsm0503_rach_crc6
Definition: gsm0503_parity.h:17
tch_hr_reorder
static void tch_hr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p)
Definition: gsm0503_coding.c:1734
gsm0503_pdtch_encode
int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len)
GPRS DL message encoding.
Definition: gsm0503_coding.c:1419
gsm0503_xcch_interleave
void gsm0503_xcch_interleave(const ubit_t *cB, ubit_t *iB)
Interleave burst bits according to TS 05.03 4.1.4.
Definition: gsm0503_interleaving.c:100
gsm0503_mcs_code
Structure describing a Modulation and Coding Scheme.
Definition: gsm0503_coding.c:149
gprs_rlc_ul_hdr_egprs::type3
struct gprs_rlc_ul_header_egprs_3 type3
Definition: gsm0503_coding.c:138
tch_amr_reassemble
static void tch_amr_reassemble(uint8_t *tch_data, const ubit_t *d_bits, int len)
Definition: gsm0503_coding.c:1608
egprs_type1_map
static int egprs_type1_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, int usf, int mcs)
Definition: gsm0503_coding.c:1195
gsm0503_mcs5_burst_swap
void gsm0503_mcs5_burst_swap(sbit_t *eB)
Definition: gsm0503_mapping.c:250
tch_efr_protected
static void tch_efr_protected(const ubit_t *s_bits, ubit_t *b_bits)
Definition: gsm0503_coding.c:1694
tch_amr_merge
static void tch_amr_merge(ubit_t *u, const ubit_t *d, const ubit_t *p, int len, int prot)
Definition: gsm0503_coding.c:1774
gprs_rlc_dl_hdr_egprs::type1
struct gprs_rlc_dl_header_egprs_1 type1
Definition: gsm0503_coding.c:143
tch_fr_reassemble
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
Definition: gsm0503_coding.c:1507
osmo_conv_decode_ber_punctured
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.
Definition: gsm0503_coding.c:539
gsm0503_puncture_mcs4_p1
const uint8_t gsm0503_puncture_mcs4_p1[1116]
Definition: gsm0503_tables.c:453
rach_apply_bsic
static void rach_apply_bsic(ubit_t *d, uint8_t bsic, uint8_t start)
Definition: gsm0503_coding.c:2843
gsm0503_tch_fr_encode
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.
Definition: gsm0503_coding.c:1880
_xcch_decode_cB
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
Definition: gsm0503_coding.c:592
gsm0503_mcs7_dl_interleave
void gsm0503_mcs7_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5.
Definition: gsm0503_interleaving.c:362
gsm0503_mcs_code::data_conv
const struct osmo_conv_code * data_conv
data convolutional code
Definition: gsm0503_coding.c:175
gsm0503_amr_crc6
const struct osmo_crc8gen_code gsm0503_amr_crc6
Definition: gsm0503_parity.h:21
gsm0503_tch_efr_crc8
const struct osmo_crc8gen_code gsm0503_tch_efr_crc8
Definition: gsm0503_parity.h:20
gsm0503_pdtch_egprs_decode
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.
Definition: gsm0503_coding.c:932
gsm0503_mcs_dl_codes
const struct gsm0503_mcs_code gsm0503_mcs_dl_codes[EGPRS_NUM_MCS]
Definition: gsm0503_coding.c:354
gprs_rlc_ul_hdr_egprs::type2
struct gprs_rlc_ul_header_egprs_2 type2
Definition: gsm0503_coding.c:137
gsm0503_afs_ic_ubit
const ubit_t gsm0503_afs_ic_ubit[4][8]
Definition: gsm0503_tables.c:1664
egprs_type2_map
static int egprs_type2_map(ubit_t *bursts, const ubit_t *hc, const ubit_t *dc, int usf)
Definition: gsm0503_coding.c:1177
gsm0503_puncture_mcs2_p1
const uint8_t gsm0503_puncture_mcs2_p1[732]
Definition: gsm0503_tables.c:229
gsm0503_xcch_decode
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.
Definition: gsm0503_coding.c:638
gsm0503_puncture_mcs1_p2
const uint8_t gsm0503_puncture_mcs1_p2[588]
Definition: gsm0503_tables.c:198
tch_efr_unreorder
static void tch_efr_unreorder(ubit_t *s, ubit_t *p, const ubit_t *w)
Definition: gsm0503_coding.c:1754
EGPRS_MCS9
@ EGPRS_MCS9
Definition: gsm0503_coding.h:29
tch_hr_d_to_b
static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits)
Definition: gsm0503_coding.c:1645
gsm0503_pdtch_egprs_encode
int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len)
EGPRS DL message encoding.
Definition: gsm0503_coding.c:1324
gsm0503_mcs5_ul_burst_unmap
void gsm0503_mcs5_ul_burst_unmap(sbit_t *di, const sbit_t *eB, sbit_t *hi, int B)
Definition: gsm0503_mapping.c:159
gsm0503_tch_burst_unmap
void gsm0503_tch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *h, int odd)
Definition: gsm0503_mapping.c:65
gsm0503_tch_burst_map
void gsm0503_tch_burst_map(const ubit_t *iB, ubit_t *eB, const ubit_t *h, int odd)
Definition: gsm0503_mapping.c:85
gsm0503_mcs1_ul_interleave
void gsm0503_mcs1_ul_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *iB)
Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.2.4.
Definition: gsm0503_interleaving.c:228
gsm0503_usf2twelve_ubit
const ubit_t gsm0503_usf2twelve_ubit[8][12]
Definition: gsm0503_tables.c:77
gsm0503_mcs7_ul_deinterleave
void gsm0503_mcs7_ul_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
De-Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4.
Definition: gsm0503_interleaving.c:453
gsm0503_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.
Definition: gsm0503_coding.c:2930
gsm0503_puncture_mcs9_p2
const uint8_t gsm0503_puncture_mcs9_p2[1836]
Definition: gsm0503_tables.c:1351
gsm0503_puncture_mcs8_p1
const uint8_t gsm0503_puncture_mcs8_p1[1692]
Definition: gsm0503_tables.c:1096
gsm0503_mcs_crc12
const struct osmo_crc16gen_code gsm0503_mcs_crc12
Definition: gsm0503_parity.h:16
gsm0503_mcs_code::hdr_punc
const uint8_t * hdr_punc
header puncturing sequence
Definition: gsm0503_coding.c:165
gsm0503_afs_ic_sbit
const sbit_t gsm0503_afs_ic_sbit[4][8]
Definition: gsm0503_tables.c:1671
tch_fr_reorder
static void tch_fr_reorder(ubit_t *u, const ubit_t *d, const ubit_t *p)
Definition: gsm0503_coding.c:1715
EGPRS_MCS1
@ EGPRS_MCS1
Definition: gsm0503_coding.h:21
egprs_type2_unmap
static int egprs_type2_unmap(const sbit_t *bursts, sbit_t *hc, sbit_t *dc)
Definition: gsm0503_coding.c:699
gsm0503_tables.h
gsm0503_mcs_code::hdr_conv
const struct osmo_conv_code * hdr_conv
header convolutional code
Definition: gsm0503_coding.c:163
EGPRS_DATA_C1
#define EGPRS_DATA_C1
Definition: gsm0503_coding.c:131
tch_hr_unreorder
static void tch_hr_unreorder(ubit_t *d, ubit_t *p, const ubit_t *u)
Definition: gsm0503_coding.c:1728
tch_fr_b_to_d
static void tch_fr_b_to_d(ubit_t *d_bits, const ubit_t *b_bits)
Definition: gsm0503_coding.c:1636
gsm0503_gsm_fr_map
const uint8_t gsm0503_gsm_fr_map[76]
Definition: gsm0503_tables.c:1644
gsm0503_fire_crc40
const struct osmo_crc64gen_code gsm0503_fire_crc40
Definition: gsm0503_parity.h:13
egprs_decode_data
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)
Definition: gsm0503_coding.c:866
gsm0503_puncture_mcs4_p2
const uint8_t gsm0503_puncture_mcs4_p2[1116]
Definition: gsm0503_tables.c:494
egprs_parse_dl_cps
static int egprs_parse_dl_cps(struct egprs_cps *cps, const union gprs_rlc_dl_hdr_egprs *hdr, int type)
Definition: gsm0503_coding.c:1297
gsm0503_mcs7_ul_interleave
void gsm0503_mcs7_ul_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
Interleave MCS7 UL burst bits according to TS 05.03 5.1.11.2.4.
Definition: gsm0503_interleaving.c:424
tch_efr_d_to_w
static void tch_efr_d_to_w(ubit_t *b_bits, const ubit_t *d_bits)
Definition: gsm0503_coding.c:1676
EGPRS_MCS5
@ EGPRS_MCS5
Definition: gsm0503_coding.h:25
gsm0503_xcch_encode
int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data)
Encoding of xCCH data from L2 frame to bursts.
Definition: gsm0503_coding.c:657
gsm0503_puncture_mcs7_p1
const uint8_t gsm0503_puncture_mcs7_p1[1404]
Definition: gsm0503_tables.c:853
tch_hr_disassemble
static void tch_hr_disassemble(ubit_t *b_bits, const uint8_t *tch_data)
Definition: gsm0503_coding.c:1579
gsm0503_tch_afs_decode
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.
Definition: gsm0503_coding.c:2088
gsm0503_cs234_crc16
const struct osmo_crc16gen_code gsm0503_cs234_crc16
Definition: gsm0503_parity.h:14
egprs_type3_unmap
static int egprs_type3_unmap(const sbit_t *bursts, sbit_t *hc, sbit_t *dc)
Definition: gsm0503_coding.c:680
gsm0503_mcs_code::hdr_code_len
uint8_t hdr_code_len
Length of header convolutional code.
Definition: gsm0503_coding.c:159
gsm0503_pdtch_hl_hn_ubit
const ubit_t gsm0503_pdtch_hl_hn_ubit[4][8]
Definition: gsm0503_tables.c:40
gsm0503_mcs8_dl_deinterleave
void gsm0503_mcs8_dl_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
De-Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5.
Definition: gsm0503_interleaving.c:578
tch_hr_reassemble
static void tch_hr_reassemble(uint8_t *tch_data, const ubit_t *b_bits)
Definition: gsm0503_coding.c:1568
gsm0503_mcs8_dl_interleave
void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di)
Interleave MCS8 DL burst bits according to TS 05.03 5.1.12.1.5.
Definition: gsm0503_interleaving.c:549
gsm0503_pdtch_edge_hl_hn_sbit
const sbit_t gsm0503_pdtch_edge_hl_hn_sbit[3][8]
Definition: gsm0503_tables.c:60
gsm0503_mcs7_dl_burst_unmap
void gsm0503_mcs7_dl_burst_unmap(sbit_t *di, const sbit_t *eB, sbit_t *hi, sbit_t *up, int B)
Definition: gsm0503_mapping.c:196
gsm0503_mcs7_ul_burst_unmap
void gsm0503_mcs7_ul_burst_unmap(sbit_t *di, const sbit_t *eB, sbit_t *hi, int B)
Definition: gsm0503_mapping.c:234
tch_fr_d_to_b
static void tch_fr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits)
Definition: gsm0503_coding.c:1627
gsm0503_pdtch_hl_hn_sbit
const sbit_t gsm0503_pdtch_hl_hn_sbit[4][8]
Definition: gsm0503_tables.c:53
gsm0503_mcs1_dl_interleave
void gsm0503_mcs1_dl_interleave(const ubit_t *up, const ubit_t *hc, const ubit_t *dc, ubit_t *iB)
Interleave MCS1 DL burst bits according to TS 05.03 5.1.5.1.5.
Definition: gsm0503_interleaving.c:157
_egprs_decode_hdr
static int _egprs_decode_hdr(const sbit_t *hc, int mcs, union gprs_rlc_ul_hdr_egprs *hdr)
Definition: gsm0503_coding.c:752
rach_decode_ber
static int16_t rach_decode_ber(const sbit_t *burst, uint8_t bsic, bool is_11bit, int *n_errors, int *n_bits_total)
Definition: gsm0503_coding.c:2852
gsm0503_mcs7_dl_burst_map
void gsm0503_mcs7_dl_burst_map(const ubit_t *di, ubit_t *eB, const ubit_t *hi, const ubit_t *up, int B)
Definition: gsm0503_mapping.c:174
gsm0503_parity.h
gsm0503_rach_decode
int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_decode_ber() instead")
Decode the (8-bit) RACH according to TS 05.03.
Definition: gsm0503_coding.c:2895
EGPRS_MCS0
@ EGPRS_MCS0
Definition: gsm0503_coding.h:20
gsm0503_tch_afs_encode
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.
Definition: gsm0503_coding.c:2293
gsm0503_puncture_mcs7_p2
const uint8_t gsm0503_puncture_mcs7_p2[1404]
Definition: gsm0503_tables.c:934
egprs_encode_hdr
static int egprs_encode_hdr(ubit_t *hc, const uint8_t *l2_data, int mcs)
Definition: gsm0503_coding.c:1218
gsm0503_puncture_mcs7_p3
const uint8_t gsm0503_puncture_mcs7_p3[1404]
Definition: gsm0503_tables.c:1015
EGPRS_HDR_HC_MAX
#define EGPRS_HDR_HC_MAX
Definition: gsm0503_coding.c:119
gsm0503_puncture_cs2
const uint8_t gsm0503_puncture_cs2[588]
Definition: gsm0503_tables.c:99
gsm0503_rach_encode
int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_ext_encode() instead")
Encode the (8-bit) RACH according to TS 05.03.
Definition: gsm0503_coding.c:2948
gsm0503_tch_hr_interleave
void gsm0503_tch_hr_interleave(const ubit_t *cB, ubit_t *iB)
GSM TCH HR/AHS Interleaving and burst mapping.
Definition: gsm0503_interleaving.c:674
gsm0503_mcs5_ul_interleave
void gsm0503_mcs5_ul_interleave(const ubit_t *hc, const ubit_t *dc, ubit_t *hi, ubit_t *di)
Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.2.4.
Definition: gsm0503_interleaving.c:263
gprs_rlc_ul_hdr_egprs
union across the three different EGPRS Uplink header types
Definition: gsm0503_coding.c:135
EGPRS_DATA_DC_MAX
#define EGPRS_DATA_DC_MAX
Definition: gsm0503_coding.c:128
gsm0503_mcs7_dl_deinterleave
void gsm0503_mcs7_dl_deinterleave(sbit_t *hc, sbit_t *c1, sbit_t *c2, const sbit_t *hi, const sbit_t *di)
De-Interleave MCS7 DL burst bits according to TS 05.03 5.1.11.1.5.
Definition: gsm0503_interleaving.c:391
gsm0503_puncture_mcs1_ul_hdr
const uint8_t gsm0503_puncture_mcs1_ul_hdr[117]
Definition: gsm0503_tables.c:154
gsm0503_mcs_ul_codes
const struct gsm0503_mcs_code gsm0503_mcs_ul_codes[EGPRS_NUM_MCS]
Definition: gsm0503_coding.c:183
gsm0503_usf2six
const ubit_t gsm0503_usf2six[8][6]
Definition: gsm0503_tables.c:66
EGPRS_MCS3
@ EGPRS_MCS3
Definition: gsm0503_coding.h:23
gsm0503_mcs_code::hdr_punc_len
uint8_t hdr_punc_len
Length of header code puncturing sequence.
Definition: gsm0503_coding.c:161
gsm0503_tch_fr_decode
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.
Definition: gsm0503_coding.c:1796
gsm0503_tch_ahs_decode
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.
Definition: gsm0503_coding.c:2467
gprs_rlc_ul_hdr_egprs::type1
struct gprs_rlc_ul_header_egprs_1 type1
Definition: gsm0503_coding.c:136
gsm0503_mcs_code::mcs
uint8_t mcs
Modulation and Coding Scheme (MSC) number.
Definition: gsm0503_coding.c:151
gsm0503_xcch_burst_unmap
void gsm0503_xcch_burst_unmap(sbit_t *iB, const sbit_t *eB, sbit_t *hl, sbit_t *hn)
Definition: gsm0503_mapping.c:40
tch_amr_disassemble
static void tch_amr_disassemble(ubit_t *d_bits, const uint8_t *tch_data, int len)
Definition: gsm0503_coding.c:1618
gsm0503_mcs5_dl_deinterleave
void gsm0503_mcs5_dl_deinterleave(sbit_t *hc, sbit_t *dc, const sbit_t *hi, const sbit_t *di)
De-Interleave MCS5 UL burst bits according to TS 05.03 5.1.9.1.5.
Definition: gsm0503_interleaving.c:334
gsm0503_tch_hr_encode
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.
Definition: gsm0503_coding.c:2020
EGPRS_NUM_MCS
@ EGPRS_NUM_MCS
Definition: gsm0503_coding.h:30