\doxysection{amr.\+h}
\label{amr_8h_source}\index{include/osmocom/netif/amr.h@{include/osmocom/netif/amr.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ \_OSMO\_AMR\_H\_}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ \_OSMO\_AMR\_H\_}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <stddef.h>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <stdbool.h>}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <osmocom/core/endian.h>}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00010\ \textcolor{comment}{/*\ As\ defined\ by\ RFC3267:\ Adaptive\ Multi-\/Rate\ (AMR)\ */}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{comment}{/*}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ \ +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ |\ payload\ header\ |\ table\ of\ contents\ |\ speech\ data\ ...}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{comment}{/*}}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ 4.3.\ Bandwidth-\/Efficient\ Mode:}}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *\ Summary\ from\ 4.3.4:\ Same\ as\ Octet\ aligned\ (see\ below)\ but\ without\ padding\ after\ header\ and\ ToC:}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ \ 0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1}}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ \ 0\ 1\ 2\ 3\ 4\ 5\ 6\ 7\ 0\ 1\ 2\ 3\ 4\ 5\ 6\ 7}}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ +-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ |\ \ CMR\ \ |F|\ \ FT\ \ \ |Q|X\ X\ X\ X\ X\ X|}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ +-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ X\ means\ AMR\ payload\ (padding\ in\ case\ of\ FT=NO\_DATA).}}
\DoxyCodeLine{00029\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00030\ \textcolor{keyword}{struct\ }amr\_hdr\_bwe\ \{}
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#if\ OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{00032\ \ \ \ \ \ \ \ \ uint8\_t\ ft\_hi:3,\ \textcolor{comment}{/*\ coding\ mode\ highest\ part\ */}}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ f:1,}
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cmr:4;\ \ \textcolor{comment}{/*\ Codec\ Mode\ Request\ */}}
\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ uint8\_t\ data\_start:6,}
\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ q:1,\ \ \ \ \textcolor{comment}{/*\ OK\ (not\ damaged)\ at\ origin?\ */}}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ft\_lo:1;\ \ \ \ \ \ \ \ \textcolor{comment}{/*\ coding\ mode\ lowest\ bit\ */}}
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\#elif\ OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{00039\ \textcolor{comment}{/*\ auto-\/generated\ from\ the\ little\ endian\ part\ above\ (libosmocore/contrib/struct\_endianness.py)\ */}}
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ uint8\_t\ cmr:4,\ f:1,\ ft\_hi:3;}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ uint8\_t\ ft\_lo:1,\ q:1,\ data\_start:6;}
\DoxyCodeLine{00042\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ uint8\_t\ data[0];}
\DoxyCodeLine{00044\ \}\ \_\_attribute\_\_((packed));}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \textcolor{comment}{/*\ See\ diagram\ above:\ CMR\ (4)\ +\ F\ (1)\ +\ FT\ (4)\ +\ Q\ (1)\ =\ 10\ */}}
\DoxyCodeLine{00047\ \textcolor{preprocessor}{\#define\ AMR\_HDR\_BWE\_LEN\_BITS\ 10}}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \textcolor{comment}{/*}}
\DoxyCodeLine{00050\ \textcolor{comment}{\ *\ 4.4.\ Octet-\/aligned\ Mode:}}
\DoxyCodeLine{00051\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00052\ \textcolor{comment}{\ *\ 4.4.1.\ The\ Payload\ Header:}}
\DoxyCodeLine{00053\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00054\ \textcolor{comment}{\ *\ \ \ 0\ 1\ 2\ 3\ 4\ 5\ 6\ 7}}
\DoxyCodeLine{00055\ \textcolor{comment}{\ *\ \ +-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+}}
\DoxyCodeLine{00056\ \textcolor{comment}{\ *\ \ |\ \ CMR\ \ |X\ X\ X\ X|}}
\DoxyCodeLine{00057\ \textcolor{comment}{\ *\ \ +-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+}}
\DoxyCodeLine{00058\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00059\ \textcolor{comment}{\ *\ According\ to:\ 3GPP\ TS\ 26.201\ "{}AMR\ Wideband\ speech\ codec;\ Frame\ Structure"{},}}
\DoxyCodeLine{00060\ \textcolor{comment}{\ *\ version\ 5.0.0\ (2001-\/03),\ 3rd\ Generation\ Partnership\ Project\ (3GPP):}}
\DoxyCodeLine{00061\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00062\ \textcolor{comment}{\ *\ Possible\ Frame\ type\ /\ CMR\ values:}}
\DoxyCodeLine{00063\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00064\ \textcolor{comment}{\ *\ 0-\/8\ for\ AMR-\/WB\ (from\ 6.60\ kbit/s\ to\ 23.85\ kbit/s)}}
\DoxyCodeLine{00065\ \textcolor{comment}{\ *\ 9\ (SID)\ confort\ noise.}}
\DoxyCodeLine{00066\ \textcolor{comment}{\ *\ 10-\/13\ future\ use.}}
\DoxyCodeLine{00067\ \textcolor{comment}{\ *\ 14\ means\ lost\ speech\ frame\ (only\ available\ for\ AMR-\/WB)}}
\DoxyCodeLine{00068\ \textcolor{comment}{\ *\ 15\ means\ no\ data}}
\DoxyCodeLine{00069\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00070\ \textcolor{comment}{\ *\ 4.4.2.\ The\ table\ of\ contents:}}
\DoxyCodeLine{00071\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00072\ \textcolor{comment}{\ *\ \ \ 0\ 1\ 2\ 3\ 4\ 5\ 6\ 7}}
\DoxyCodeLine{00073\ \textcolor{comment}{\ *\ \ +-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+}}
\DoxyCodeLine{00074\ \textcolor{comment}{\ *\ \ |F|\ \ FT\ \ \ |Q|X\ X|}}
\DoxyCodeLine{00075\ \textcolor{comment}{\ *\ \ +-\/+-\/+-\/+-\/+-\/+-\/+-\/+-\/+}}
\DoxyCodeLine{00076\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00077\ \textcolor{comment}{\ *\ X\ means\ padding.}}
\DoxyCodeLine{00078\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{keyword}{struct\ }amr\_hdr\ \{}
\DoxyCodeLine{00081\ \textcolor{preprocessor}{\#if\ OSMO\_IS\_LITTLE\_ENDIAN}}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Payload\ Header\ */}}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ uint8\_t\ pad1:4,}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cmr:4;\ \ \textcolor{comment}{/*\ Codec\ Mode\ Request\ */}}
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Table\ of\ Contents\ */}}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ uint8\_t\ pad2:2,}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ q:1,\ \ \ \ \textcolor{comment}{/*\ OK\ (not\ damaged)\ at\ origin?\ */}}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ft:4,\ \ \ \textcolor{comment}{/*\ coding\ mode\ */}}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ f:1;\ \ \ \ \textcolor{comment}{/*\ followed\ by\ another\ speech\ frame?\ */}}
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#elif\ OSMO\_IS\_BIG\_ENDIAN}}
\DoxyCodeLine{00091\ \textcolor{comment}{/*\ auto-\/generated\ from\ the\ little\ endian\ part\ above\ (libosmocore/contrib/struct\_endianness.py)\ */}}
\DoxyCodeLine{00092\ \ \ \ \ \ \ \ \ uint8\_t\ cmr:4,\ pad1:4;}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \ \ uint8\_t\ f:1,\ ft:4,\ q:1,\ pad2:2;}
\DoxyCodeLine{00094\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00095\ \ \ \ \ \ \ \ \ uint8\_t\ data[0];}
\DoxyCodeLine{00096\ \}\ \_\_attribute\_\_((packed));}
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00098\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ *osmo\_amr\_get\_payload(\textcolor{keyword}{struct}\ amr\_hdr\ *amrh)}
\DoxyCodeLine{00099\ \{}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ (uint8\_t\ *)amrh\ +\ \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct\ }amr\_hdr);}
\DoxyCodeLine{00101\ \}}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ \textcolor{comment}{/*\ AMR\ voice\ frame\ type\ identifiers}}
\DoxyCodeLine{00104\ \textcolor{comment}{\ *\ See\ also\ 3GPP\ TS\ 26.101,\ Table\ 1a:\ Interpretation\ of\ Frame\ Type,\ Mode}}
\DoxyCodeLine{00105\ \textcolor{comment}{\ *\ Indication\ and\ Mode\ Request\ fields\ */}}
\DoxyCodeLine{00106\ \textcolor{preprocessor}{\#define\ AMR\_FT\_0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 4.75\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00107\ \textcolor{preprocessor}{\#define\ AMR\_FT\_1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 5.15\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00108\ \textcolor{preprocessor}{\#define\ AMR\_FT\_2\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 5.90\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00109\ \textcolor{preprocessor}{\#define\ AMR\_FT\_3\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 6.70\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00110\ \textcolor{preprocessor}{\#define\ AMR\_FT\_4\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 7.40\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00111\ \textcolor{preprocessor}{\#define\ AMR\_FT\_5\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 7.95\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00112\ \textcolor{preprocessor}{\#define\ AMR\_FT\_6\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 6\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 10.2\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00113\ \textcolor{preprocessor}{\#define\ AMR\_FT\_7\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 7\ \ \ \ \ \ \ }\textcolor{comment}{/*\ 12.2\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00114\ \textcolor{preprocessor}{\#define\ AMR\_FT\_SID\ \ \ \ \ \ \ \ \ \ \ \ \ \ 8\ \ \ \ \ \ \ }\textcolor{comment}{/*\ AMR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00115\ \textcolor{preprocessor}{\#define\ AMR\_FT\_GSM\_EFR\_SID\ \ \ \ \ \ 9\ \ \ \ \ \ \ }\textcolor{comment}{/*\ GSM-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00116\ \textcolor{preprocessor}{\#define\ AMR\_FT\_TDMA\_EFR\_SID\ \ \ \ \ 10\ \ \ \ \ \ }\textcolor{comment}{/*\ TDMA-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00117\ \textcolor{preprocessor}{\#define\ AMR\_FT\_PDC\_EFR\_SID\ \ \ \ \ \ 11\ \ \ \ \ \ }\textcolor{comment}{/*\ PDC-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00118\ \textcolor{comment}{/*\ version\ 16.0.0\ Release\ 16:\ 12-\/14\ for\ future\ use\ */}}
\DoxyCodeLine{00119\ \textcolor{preprocessor}{\#define\ AMR\_FT\_NO\_DATA\ \ \ \ \ \ \ \ \ \ 15\ \ \ \ \ \ }\textcolor{comment}{/*\ NO\_DATA\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00120\ \textcolor{preprocessor}{\#define\ AMR\_FT\_MAX\ \ \ \ \ \ \ \ \ \ \ \ \ \ 16\ \ \ \ \ \ }\textcolor{comment}{/*\ INTERNAL,\ NO\ NOT\ USE\ OUTSIDE\ libosmo-\/netif\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00122\ \textcolor{comment}{/*\ AMR\ voice\ frame\ length\ (in\ bits).}}
\DoxyCodeLine{00123\ \textcolor{comment}{\ *\ See\ also\ RFC\ 3267,\ chapter\ 3.6.}}
\DoxyCodeLine{00124\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00125\ \textcolor{comment}{\ *\ NOTE:\ These\ constants\ refer\ to\ the\ length\ of\ one\ AMR\ speech\ frame-\/block,}}
\DoxyCodeLine{00126\ \textcolor{comment}{\ *\ not\ counting\ CMR,\ TOC.\ */}}
\DoxyCodeLine{00127\ \textcolor{preprocessor}{\#define\ AMR\_FT\_0\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 95\ \ \ \ \ \ }\textcolor{comment}{/*\ 4.75\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00128\ \textcolor{preprocessor}{\#define\ AMR\_FT\_1\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 103\ \ \ \ \ }\textcolor{comment}{/*\ 5.15\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00129\ \textcolor{preprocessor}{\#define\ AMR\_FT\_2\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 118\ \ \ \ \ }\textcolor{comment}{/*\ 5.90\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00130\ \textcolor{preprocessor}{\#define\ AMR\_FT\_3\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 134\ \ \ \ \ }\textcolor{comment}{/*\ 6.70\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00131\ \textcolor{preprocessor}{\#define\ AMR\_FT\_4\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 148\ \ \ \ \ }\textcolor{comment}{/*\ 7.40\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00132\ \textcolor{preprocessor}{\#define\ AMR\_FT\_5\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 159\ \ \ \ \ }\textcolor{comment}{/*\ 7.95\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00133\ \textcolor{preprocessor}{\#define\ AMR\_FT\_6\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 204\ \ \ \ \ }\textcolor{comment}{/*\ 10.2\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00134\ \textcolor{preprocessor}{\#define\ AMR\_FT\_7\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 244\ \ \ \ \ }\textcolor{comment}{/*\ 12.2\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00135\ \textcolor{preprocessor}{\#define\ AMR\_FT\_SID\_LEN\_BITS\ \ \ \ \ \ \ \ \ \ \ \ \ 39\ \ \ \ \ \ }\textcolor{comment}{/*\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00136\ \textcolor{preprocessor}{\#define\ AMR\_FT\_GSM\_EFR\_SID\_LEN\_BITS\ \ \ \ \ 43\ \ \ \ \ \ }\textcolor{comment}{/*\ GSM-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00137\ \textcolor{preprocessor}{\#define\ AMR\_FT\_TDMA\_EFR\_SID\_LEN\_BITS\ \ \ \ 38\ \ \ \ \ \ }\textcolor{comment}{/*\ TDMA-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00138\ \textcolor{preprocessor}{\#define\ AMR\_FT\_PDC\_EFR\_SID\_LEN\_BITS\ \ \ \ \ 37\ \ \ \ \ \ }\textcolor{comment}{/*\ PDC-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00139\ \textcolor{comment}{/*\ version\ 16.0.0\ Release\ 16:\ 12-\/14\ for\ future\ use\ */}}
\DoxyCodeLine{00140\ \textcolor{preprocessor}{\#define\ AMR\_FT\_NO\_DATA\_LEN\_BITS\ \ \ \ \ \ \ \ \ 0\ \ \ \ \ \ \ }\textcolor{comment}{/*\ NO\_DATA\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00142\ \textcolor{comment}{/*\ AMR\ voice\ frame\ length\ (in\ bytes,\ rounded).}}
\DoxyCodeLine{00143\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00144\ \textcolor{comment}{\ *\ NOTE:\ These\ constants\ refer\ to\ the\ length\ of\ one\ AMR\ speech\ frame-\/block,}}
\DoxyCodeLine{00145\ \textcolor{comment}{\ *\ not\ counting\ CMR,\ TOC.\ */}}
\DoxyCodeLine{00146\ \textcolor{preprocessor}{\#define\ AMR\_FT\_0\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_0\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 4.75\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00147\ \textcolor{preprocessor}{\#define\ AMR\_FT\_1\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_1\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 5.15\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00148\ \textcolor{preprocessor}{\#define\ AMR\_FT\_2\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_2\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 5.90\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00149\ \textcolor{preprocessor}{\#define\ AMR\_FT\_3\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_3\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 6.70\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00150\ \textcolor{preprocessor}{\#define\ AMR\_FT\_4\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_4\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 7.40\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00151\ \textcolor{preprocessor}{\#define\ AMR\_FT\_5\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_5\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 7.95\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00152\ \textcolor{preprocessor}{\#define\ AMR\_FT\_6\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_6\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 10.2\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00153\ \textcolor{preprocessor}{\#define\ AMR\_FT\_7\_LEN\ \ \ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_7\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ 12.2\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00154\ \textcolor{preprocessor}{\#define\ AMR\_FT\_SID\_LEN\ \ \ \ \ \ \ \ \ \ ((AMR\_FT\_SID\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00155\ \textcolor{preprocessor}{\#define\ AMR\_FT\_GSM\_EFR\_SID\_LEN\ \ ((AMR\_FT\_GSM\_EFR\_SID\_LEN\_BITS+7)/8)\ \ \ \ \ }\textcolor{comment}{/*\ GSM-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00156\ \textcolor{preprocessor}{\#define\ AMR\_FT\_TDMA\_EFR\_SID\_LEN\ ((AMR\_FT\_TDMA\_EFR\_SID\_LEN\_BITS+7)/8)\ \ \ \ }\textcolor{comment}{/*\ TDMA-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00157\ \textcolor{preprocessor}{\#define\ AMR\_FT\_PDC\_EFR\_SID\_LEN\ \ ((AMR\_FT\_PDC\_EFR\_SID\_LEN\_BITS+7)/8)\ \ \ \ \ }\textcolor{comment}{/*\ PDC-\/EFR\ SID\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00158\ \textcolor{comment}{/*\ version\ 16.0.0\ Release\ 16:\ 12-\/14\ for\ future\ use\ */}}
\DoxyCodeLine{00159\ \textcolor{preprocessor}{\#define\ AMR\_FT\_NO\_DATA\_LEN\ \ \ \ \ \ ((AMR\_FT\_NO\_DATA\_LEN\_BITS+7)/8)\ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ NO\_DATA\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00161\ \textcolor{keywordtype}{int}\ osmo\_amr\_ft\_valid(uint8\_t\ amr\_ft);}
\DoxyCodeLine{00162\ \textcolor{keywordtype}{size\_t}\ osmo\_amr\_bytes(uint8\_t\ amr\_cmr);}
\DoxyCodeLine{00163\ \textcolor{keywordtype}{size\_t}\ osmo\_amr\_bits(uint8\_t\ amr\_ft);}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00165\ \textcolor{keywordtype}{bool}\ osmo\_amr\_is\_oa(\textcolor{keyword}{const}\ uint8\_t\ *payload,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_len);}
\DoxyCodeLine{00166\ \textcolor{keywordtype}{int}\ osmo\_amr\_oa\_to\_bwe(uint8\_t\ *payload,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_len);}
\DoxyCodeLine{00167\ \textcolor{keywordtype}{int}\ osmo\_amr\_bwe\_to\_oa(uint8\_t\ *payload,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_len,}
\DoxyCodeLine{00168\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_maxlen);}
\DoxyCodeLine{00169\ \textcolor{keywordtype}{int}\ osmo\_amr\_bwe\_to\_iuup(uint8\_t\ *payload,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_len);}
\DoxyCodeLine{00170\ \textcolor{keywordtype}{int}\ osmo\_amr\_iuup\_to\_bwe(uint8\_t\ *payload,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_len,}
\DoxyCodeLine{00171\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ payload\_maxlen);}
\DoxyCodeLine{00172\ \textcolor{keywordtype}{int}\ osmo\_amr\_bytes\_to\_ft(\textcolor{keywordtype}{size\_t}\ bytes);}
\DoxyCodeLine{00173\ }
\DoxyCodeLine{00174\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
