\doxysection{include/osmocom/coding/gsm0503\+\_\+coding.h File Reference}
\label{gsm0503__coding_8h}\index{include/osmocom/coding/gsm0503\_coding.h@{include/osmocom/coding/gsm0503\_coding.h}}


GSM TS 05.\+03 coding.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/defs.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/bits.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ GSM0503\+\_\+\+GPRS\+\_\+\+BURSTS\+\_\+\+NBITS}~(116 $\ast$ 4)
\item 
\#define \textbf{ GSM0503\+\_\+\+EGPRS\+\_\+\+BURSTS\+\_\+\+NBITS}~(348 $\ast$ 4)
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ gsm0503\+\_\+egprs\+\_\+mcs} \{ \newline
\textbf{ EGPRS\+\_\+\+MCS0}
, \newline
\textbf{ EGPRS\+\_\+\+MCS1}
, \newline
\textbf{ EGPRS\+\_\+\+MCS2}
, \newline
\textbf{ EGPRS\+\_\+\+MCS3}
, \newline
\textbf{ EGPRS\+\_\+\+MCS4}
, \newline
\textbf{ EGPRS\+\_\+\+MCS5}
, \newline
\textbf{ EGPRS\+\_\+\+MCS6}
, \newline
\textbf{ EGPRS\+\_\+\+MCS7}
, \newline
\textbf{ EGPRS\+\_\+\+MCS8}
, \newline
\textbf{ EGPRS\+\_\+\+MCS9}
, \newline
\textbf{ EGPRS\+\_\+\+NUM\+\_\+\+MCS}
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ gsm0503\+\_\+xcch\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$l2\+\_\+data)
\begin{DoxyCompactList}\small\item\em Encoding of x\+CCH data from L2 frame to bursts. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+xcch\+\_\+decode} (uint8\+\_\+t $\ast$l2\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Decoding of x\+CCH data from bursts to L2 frame. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+pdtch\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$l2\+\_\+data, uint8\+\_\+t l2\+\_\+len)
\begin{DoxyCompactList}\small\item\em GPRS DL message encoding. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+pdtch\+\_\+decode} (uint8\+\_\+t $\ast$l2\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, uint8\+\_\+t $\ast$usf\+\_\+p, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Decode GPRS PDTCH. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+pdtch\+\_\+egprs\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$l2\+\_\+data, uint8\+\_\+t l2\+\_\+len)
\begin{DoxyCompactList}\small\item\em EGPRS DL message encoding. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+pdtch\+\_\+egprs\+\_\+decode} (uint8\+\_\+t $\ast$l2\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, uint16\+\_\+t nbits, uint8\+\_\+t $\ast$usf\+\_\+p, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Decode EGPRS UL message. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$tch\+\_\+data, int \textbf{ len}, int net\+\_\+order)
\begin{DoxyCompactList}\small\item\em Perform channel encoding on a TCH/\+FS channel according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr\+\_\+decode} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int net\+\_\+order, int efr, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a FR/\+EFR channel according TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$tch\+\_\+data, int \textbf{ len})
\begin{DoxyCompactList}\small\item\em Perform channel encoding on a TCH/\+HS channel according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr\+\_\+decode} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int odd, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a HR(v1) channel according TS 05.\+03, deprecated legacy API. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr\+\_\+decode2} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int odd, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a HR(v1) channel according TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+afs\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$tch\+\_\+data, int \textbf{ len}, int codec\+\_\+mode\+\_\+req, const uint8\+\_\+t $\ast$codec, int codecs, uint8\+\_\+t ft, uint8\+\_\+t cmr)
\begin{DoxyCompactList}\small\item\em Perform channel encoding on a TCH/\+AFS channel according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+afs\+\_\+decode} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int codec\+\_\+mode\+\_\+req, uint8\+\_\+t $\ast$codec, int codecs, uint8\+\_\+t $\ast$ft, uint8\+\_\+t $\ast$cmr, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+AFS channel according TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+afs\+\_\+decode\+\_\+dtx} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int codec\+\_\+mode\+\_\+req, uint8\+\_\+t $\ast$codec, int codecs, uint8\+\_\+t $\ast$ft, uint8\+\_\+t $\ast$cmr, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total, uint8\+\_\+t $\ast$dtx)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+AFS channel according TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+ahs\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$tch\+\_\+data, int \textbf{ len}, int codec\+\_\+mode\+\_\+req, const uint8\+\_\+t $\ast$codec, int codecs, uint8\+\_\+t ft, uint8\+\_\+t cmr)
\begin{DoxyCompactList}\small\item\em Perform channel encoding on a TCH/\+AHS channel according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+ahs\+\_\+decode} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int odd, int codec\+\_\+mode\+\_\+req, uint8\+\_\+t $\ast$codec, int codecs, uint8\+\_\+t $\ast$ft, uint8\+\_\+t $\ast$cmr, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+AHS channel according TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+ahs\+\_\+decode\+\_\+dtx} (uint8\+\_\+t $\ast$tch\+\_\+data, const \textbf{ sbit\+\_\+t} $\ast$bursts, int odd, int codec\+\_\+mode\+\_\+req, uint8\+\_\+t $\ast$codec, int codecs, uint8\+\_\+t $\ast$ft, uint8\+\_\+t $\ast$cmr, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total, uint8\+\_\+t $\ast$dtx)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+AHS channel according TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+rach\+\_\+ext\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$burst, uint16\+\_\+t ra11, uint8\+\_\+t bsic, bool is\+\_\+11bit)
\begin{DoxyCompactList}\small\item\em Encode the Extended (11-\/bit) or regular (8-\/bit) RACH according to 3GPP TS 45.\+003. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+rach\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$burst, const uint8\+\_\+t $\ast$ra, uint8\+\_\+t bsic)
\begin{DoxyCompactList}\small\item\em Encode the (8-\/bit) RACH according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+rach\+\_\+decode} (uint8\+\_\+t $\ast$ra, const \textbf{ sbit\+\_\+t} $\ast$burst, uint8\+\_\+t bsic)
\begin{DoxyCompactList}\small\item\em Decode the (8-\/bit) RACH according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+rach\+\_\+decode\+\_\+ber} (uint8\+\_\+t $\ast$ra, const \textbf{ sbit\+\_\+t} $\ast$burst, uint8\+\_\+t bsic, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Decode the (8-\/bit) RACH according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+rach\+\_\+ext\+\_\+decode} (uint16\+\_\+t $\ast$ra, const \textbf{ sbit\+\_\+t} $\ast$burst, uint8\+\_\+t bsic)
\begin{DoxyCompactList}\small\item\em Decode the Extended (11-\/bit) RACH according to 3GPP TS 45.\+003. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+rach\+\_\+ext\+\_\+decode\+\_\+ber} (uint16\+\_\+t $\ast$ra, const \textbf{ sbit\+\_\+t} $\ast$burst, uint8\+\_\+t bsic, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Decode the Extended (11-\/bit) RACH according to 3GPP TS 45.\+003. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+sch\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$burst, const uint8\+\_\+t $\ast$sb\+\_\+info)
\begin{DoxyCompactList}\small\item\em Encode the SCH according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+sch\+\_\+decode} (uint8\+\_\+t $\ast$sb\+\_\+info, const \textbf{ sbit\+\_\+t} $\ast$burst)
\begin{DoxyCompactList}\small\item\em Decode the SCH according to TS 05.\+03. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr96\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const \textbf{ ubit\+\_\+t} $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a TCH/\+F9.\+6 channel as per section 3.\+3. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr96\+\_\+decode} (\textbf{ ubit\+\_\+t} $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+F9.\+6 channel as per section 3.\+3. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr48\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const \textbf{ ubit\+\_\+t} $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a TCH/\+F4.\+8 channel as per section 3.\+4. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr48\+\_\+decode} (\textbf{ ubit\+\_\+t} $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+F4.\+8 channel as per section 3.\+4. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr48\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const \textbf{ ubit\+\_\+t} $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a TCH/\+H4.\+8 channel as per section 3.\+5. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr48\+\_\+decode} (\textbf{ ubit\+\_\+t} $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+H4.\+8 channel as per section 3.\+5. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr24\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const \textbf{ ubit\+\_\+t} $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a TCH/\+F2.\+4 channel as per section 3.\+6. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr24\+\_\+decode} (\textbf{ ubit\+\_\+t} $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+F2.\+4 channel as per section 3.\+6. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr24\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const \textbf{ ubit\+\_\+t} $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a TCH/\+H2.\+4 channel as per section 3.\+7. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr24\+\_\+decode} (\textbf{ ubit\+\_\+t} $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/\+H2.\+4 channel as per section 3.\+7. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr144\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const \textbf{ ubit\+\_\+t} $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a TCH/\+F14.\+4 channel as per section 3.\+8. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr144\+\_\+decode} (\textbf{ ubit\+\_\+t} $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a TCH/14.\+4 channel as per section 3.\+8. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr\+\_\+facch\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a FACCH/F data as per section 4.\+2. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+fr\+\_\+facch\+\_\+decode} (uint8\+\_\+t $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a FACCH/F data as per section 4.\+2. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr\+\_\+facch\+\_\+encode} (\textbf{ ubit\+\_\+t} $\ast$bursts, const uint8\+\_\+t $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Perform channel encoding of a FACCH/H data as per section 4.\+3. \end{DoxyCompactList}\item 
int \textbf{ gsm0503\+\_\+tch\+\_\+hr\+\_\+facch\+\_\+decode} (uint8\+\_\+t $\ast$\textbf{ data}, const \textbf{ sbit\+\_\+t} $\ast$bursts, int $\ast$n\+\_\+errors, int $\ast$n\+\_\+bits\+\_\+total)
\begin{DoxyCompactList}\small\item\em Perform channel decoding of a FACCH/H data as per section 4.\+3. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
GSM TS 05.\+03 coding. 

