libosmocoding 1.10.0.27-aec32
Osmocom GSM/GPRS/EGPRS L1 channel coding library
gsm0503_coding.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <stdint.h>
8
9#include <osmocom/core/defs.h>
10#include <osmocom/core/bits.h>
11
16#define GSM0503_GPRS_BURSTS_NBITS (116 * 4)
17#define GSM0503_EGPRS_BURSTS_NBITS (348 * 4)
18
31};
32
33int gsm0503_xcch_encode(ubit_t *bursts, const uint8_t *l2_data);
34int gsm0503_xcch_decode(uint8_t *l2_data, const sbit_t *bursts,
35 int *n_errors, int *n_bits_total);
36
37int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len);
38int gsm0503_pdtch_decode(uint8_t *l2_data, const sbit_t *bursts, uint8_t *usf_p,
39 int *n_errors, int *n_bits_total);
40
41int gsm0503_pdtch_egprs_encode(ubit_t *bursts, const uint8_t *l2_data,
42 uint8_t l2_len);
43int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts,
44 uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total);
45
46int gsm0503_tch_fr_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
47 int net_order);
48int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order,
49 int efr, int *n_errors, int *n_bits_total);
50
51int gsm0503_tch_hr_encode(ubit_t *bursts, const uint8_t *tch_data, int len);
52int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
53 int *n_errors, int *n_bits_total)
54 OSMO_DEPRECATED("Use gsm0503_tch_hr_decode2() instead");
55int gsm0503_tch_hr_decode2(uint8_t *tch_data, const sbit_t *bursts, int odd,
56 int *n_errors, int *n_bits_total);
57
58int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
59 int codec_mode_req, const uint8_t *codec, int codecs, uint8_t ft,
60 uint8_t cmr);
61int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts,
62 int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
63 uint8_t *cmr, int *n_errors, int *n_bits_total);
64int gsm0503_tch_afs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts,
65 int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
66 uint8_t *cmr, int *n_errors, int *n_bits_total, uint8_t *dtx);
67
68int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len,
69 int codec_mode_req, const uint8_t *codec, int codecs, uint8_t ft, uint8_t cmr);
70int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd,
71 int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
72 uint8_t *cmr, int *n_errors, int *n_bits_total);
73int gsm0503_tch_ahs_decode_dtx(uint8_t *tch_data, const sbit_t *bursts, int odd,
74 int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft,
75 uint8_t *cmr, int *n_errors, int *n_bits_total, uint8_t *dtx);
76
77int gsm0503_rach_ext_encode(ubit_t *burst, uint16_t ra, uint8_t bsic, bool is_11bit);
78int gsm0503_rach_encode(ubit_t *burst, const uint8_t *ra, uint8_t bsic) OSMO_DEPRECATED("Use gsm0503_rach_ext_encode() instead");
79
80int gsm0503_rach_decode(uint8_t *ra, const sbit_t *burst, uint8_t bsic)
81 OSMO_DEPRECATED("Use gsm0503_rach_decode_ber() instead");
82int gsm0503_rach_decode_ber(uint8_t *ra, const sbit_t *burst, uint8_t bsic,
83 int *n_errors, int *n_bits_total);
84int gsm0503_rach_ext_decode(uint16_t *ra, const sbit_t *burst, uint8_t bsic)
85 OSMO_DEPRECATED("Use gsm0503_rach_ext_decode_ber() instead");
86int gsm0503_rach_ext_decode_ber(uint16_t *ra, const sbit_t *burst, uint8_t bsic,
87 int *n_errors, int *n_bits_total);
88
89int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info);
90int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst);
91
92int gsm0503_tch_fr96_encode(ubit_t *bursts, const ubit_t *data);
93int gsm0503_tch_fr96_decode(ubit_t *data, const sbit_t *bursts,
94 int *n_errors, int *n_bits_total);
95
96int gsm0503_tch_fr48_encode(ubit_t *bursts, const ubit_t *data);
97int gsm0503_tch_fr48_decode(ubit_t *data, const sbit_t *bursts,
98 int *n_errors, int *n_bits_total);
99
100int gsm0503_tch_hr48_encode(ubit_t *bursts, const ubit_t *data);
101int gsm0503_tch_hr48_decode(ubit_t *data, const sbit_t *bursts,
102 int *n_errors, int *n_bits_total);
103
104int gsm0503_tch_fr24_encode(ubit_t *bursts, const ubit_t *data);
105int gsm0503_tch_fr24_decode(ubit_t *data, const sbit_t *bursts,
106 int *n_errors, int *n_bits_total);
107
108int gsm0503_tch_hr24_encode(ubit_t *bursts, const ubit_t *data);
109int gsm0503_tch_hr24_decode(ubit_t *data, const sbit_t *bursts,
110 int *n_errors, int *n_bits_total);
111
112int gsm0503_tch_fr144_encode(ubit_t *bursts, const ubit_t *data);
113int gsm0503_tch_fr144_decode(ubit_t *data, const sbit_t *bursts,
114 int *n_errors, int *n_bits_total);
115
116int gsm0503_tch_fr_facch_encode(ubit_t *bursts, const uint8_t *data);
117int gsm0503_tch_fr_facch_decode(uint8_t *data, const sbit_t *bursts,
118 int *n_errors, int *n_bits_total);
119
120int gsm0503_tch_hr_facch_encode(ubit_t *bursts, const uint8_t *data);
121int gsm0503_tch_hr_facch_decode(uint8_t *data, const sbit_t *bursts,
122 int *n_errors, int *n_bits_total);
123
uint8_t ubit_t
int8_t sbit_t
int gsm0503_tch_afs_decode_dtx(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, uint8_t *dtx)
Perform channel decoding of a TCH/AFS channel according TS 05.03.
Definition: gsm0503_coding.c:2215
int gsm0503_tch_afs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, const 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:2472
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
int gsm0503_tch_fr24_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/F2.4 channel as per section 3.6.
Definition: gsm0503_coding.c:3598
int gsm0503_tch_ahs_encode(ubit_t *bursts, const uint8_t *tch_data, int len, int codec_mode_req, const 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:3009
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:3270
int gsm0503_tch_fr48_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/F4.8 channel as per section 3.4.
Definition: gsm0503_coding.c:3510
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
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
int gsm0503_tch_fr_facch_encode(ubit_t *bursts, const uint8_t *data)
Perform channel encoding of a FACCH/F data as per section 4.2.
Definition: gsm0503_coding.c:3743
int gsm0503_tch_hr48_encode(ubit_t *bursts, const ubit_t *data)
Perform channel encoding of a TCH/H4.8 channel as per section 3.5.
Definition: gsm0503_coding.c:3549
int gsm0503_tch_fr144_encode(ubit_t *bursts, const ubit_t *data)
Perform channel encoding of a TCH/F14.4 channel as per section 3.8.
Definition: gsm0503_coding.c:3680
int gsm0503_tch_hr24_encode(ubit_t *bursts, const ubit_t *data)
Perform channel encoding of a TCH/H2.4 channel as per section 3.7.
Definition: gsm0503_coding.c:3621
int gsm0503_tch_hr_facch_encode(ubit_t *bursts, const uint8_t *data)
Perform channel encoding of a FACCH/H data as per section 4.3.
Definition: gsm0503_coding.c:3805
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:3236
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:3253
int gsm0503_tch_hr_facch_decode(uint8_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a FACCH/H data as per section 4.3.
Definition: gsm0503_coding.c:3835
int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst)
Decode the SCH according to TS 05.03.
Definition: gsm0503_coding.c:3348
int gsm0503_tch_fr48_encode(ubit_t *bursts, const ubit_t *data)
Perform channel encoding of a TCH/F4.8 channel as per section 3.4.
Definition: gsm0503_coding.c:3470
int gsm0503_tch_fr96_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/F9.6 channel as per section 3.3.
Definition: gsm0503_coding.c:3441
int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) OSMO_DEPRECATED("Use gsm0503_tch_hr_decode2() instead")
Perform channel decoding of a HR(v1) channel according TS 05.03, deprecated legacy API.
Definition: gsm0503_coding.c:2090
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:1942
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:2192
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:1021
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:1858
int gsm0503_pdtch_encode(ubit_t *bursts, const uint8_t *l2_data, uint8_t l2_len)
GPRS DL message encoding.
Definition: gsm0503_coding.c:1450
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/AHS channel according TS 05.03.
Definition: gsm0503_coding.c:2707
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:2109
gsm0503_egprs_mcs
Definition: gsm0503_coding.h:19
int gsm0503_tch_fr144_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/14.4 channel as per section 3.8.
Definition: gsm0503_coding.c:3710
int gsm0503_tch_fr96_encode(ubit_t *bursts, const ubit_t *data)
Perform channel encoding of a TCH/F9.6 channel as per section 3.3.
Definition: gsm0503_coding.c:3411
int gsm0503_tch_hr_decode2(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:2006
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:3288
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:1355
int gsm0503_tch_fr_facch_decode(uint8_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a FACCH/F data as per section 4.2.
Definition: gsm0503_coding.c:3770
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:3317
int gsm0503_tch_hr48_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/H4.8 channel as per section 3.5.
Definition: gsm0503_coding.c:3562
int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info)
Encode the SCH according to TS 05.03.
Definition: gsm0503_coding.c:3368
int gsm0503_tch_fr24_encode(ubit_t *bursts, const ubit_t *data)
Perform channel encoding of a TCH/F2.4 channel as per section 3.6.
Definition: gsm0503_coding.c:3573
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:3306
int gsm0503_tch_ahs_decode_dtx(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, uint8_t *dtx)
Perform channel decoding of a TCH/AHS channel according TS 05.03.
Definition: gsm0503_coding.c:2731
int gsm0503_tch_hr24_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total)
Perform channel decoding of a TCH/H2.4 channel as per section 3.7.
Definition: gsm0503_coding.c:3647
@ EGPRS_NUM_MCS
Definition: gsm0503_coding.h:30
@ EGPRS_MCS3
Definition: gsm0503_coding.h:23
@ EGPRS_MCS2
Definition: gsm0503_coding.h:22
@ EGPRS_MCS4
Definition: gsm0503_coding.h:24
@ EGPRS_MCS1
Definition: gsm0503_coding.h:21
@ EGPRS_MCS8
Definition: gsm0503_coding.h:28
@ EGPRS_MCS6
Definition: gsm0503_coding.h:26
@ EGPRS_MCS0
Definition: gsm0503_coding.h:20
@ EGPRS_MCS5
Definition: gsm0503_coding.h:25
@ EGPRS_MCS7
Definition: gsm0503_coding.h:27
@ EGPRS_MCS9
Definition: gsm0503_coding.h:29
static size_t len(const char *str)
uint8_t data[0]
#define OSMO_DEPRECATED(text)