\doxysection{src/core/conv\+\_\+acc.c File Reference}
\label{conv__acc_8c}\index{src/core/conv\_acc.c@{src/core/conv\_acc.c}}


Accelerated Viterbi decoder implementation.  


{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/core/conv.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ vtrellis}
\item 
struct \textbf{ vdecoder}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ BIT2\+NRZ}(REG,  N)~(((REG $>$$>$ N) \& 0x01) $\ast$ 2 -\/ 1) $\ast$ -\/1
\item 
\#define \textbf{ NUM\+\_\+\+STATES}(\textbf{ K})~(\textbf{ K} == 7 ? 64 \+: 16)
\item 
\#define \textbf{ INIT\+\_\+\+POINTERS}(simd)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((visibility(\char`\"{}hidden\char`\"{})))
\item 
static int \textbf{ conv\+\_\+code\+\_\+recursive} (const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code)
\item 
static unsigned \textbf{ vstate\+\_\+lshift} (unsigned reg, int \textbf{ k}, int val)
\item 
static unsigned \textbf{ bitswap2} (unsigned v)
\item 
static unsigned \textbf{ bitswap3} (unsigned v)
\item 
static unsigned \textbf{ bitswap4} (unsigned v)
\item 
static unsigned \textbf{ bitswap5} (unsigned v)
\item 
static unsigned \textbf{ bitswap6} (unsigned v)
\item 
static unsigned \textbf{ bitswap} (unsigned v, unsigned \textbf{ n})
\item 
static unsigned \textbf{ gen\+\_\+output} (struct vstate $\ast$state, int val, const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code)
\item 
static int \textbf{ gen\+\_\+state\+\_\+info} (uint8\+\_\+t $\ast$val, unsigned reg, int16\+\_\+t $\ast$output, const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code)
\item 
static unsigned \textbf{ gen\+\_\+recursive\+\_\+output} (struct vstate $\ast$state, uint8\+\_\+t $\ast$val, unsigned reg, const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code, int pos)
\item 
static int \textbf{ gen\+\_\+recursive\+\_\+state\+\_\+info} (uint8\+\_\+t $\ast$val, unsigned reg, int16\+\_\+t $\ast$output, const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code)
\item 
static void \textbf{ free\+\_\+trellis} (struct \textbf{ vtrellis} $\ast$trellis)
\item 
static int \textbf{ generate\+\_\+trellis} (struct \textbf{ vdecoder} $\ast$dec, const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code)
\item 
static void \textbf{ \+\_\+traceback} (struct \textbf{ vdecoder} $\ast$dec, unsigned state, uint8\+\_\+t $\ast$out, int \textbf{ len})
\item 
static void \textbf{ \+\_\+traceback\+\_\+rec} (struct \textbf{ vdecoder} $\ast$dec, unsigned state, uint8\+\_\+t $\ast$out, int \textbf{ len})
\item 
static int \textbf{ traceback} (struct \textbf{ vdecoder} $\ast$dec, uint8\+\_\+t $\ast$out, int term, int \textbf{ len})
\item 
static void \textbf{ vdec\+\_\+deinit} (struct \textbf{ vdecoder} $\ast$dec)
\item 
static int \textbf{ vdec\+\_\+init} (struct \textbf{ vdecoder} $\ast$dec, const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code)
\item 
static int \textbf{ depuncture} (const int8\+\_\+t $\ast$in, const int $\ast$punc, int8\+\_\+t $\ast$out, int \textbf{ len})
\item 
static void \textbf{ forward\+\_\+traverse} (struct \textbf{ vdecoder} $\ast$dec, const int8\+\_\+t $\ast$seq)
\item 
static int \textbf{ conv\+\_\+decode} (struct \textbf{ vdecoder} $\ast$dec, const int8\+\_\+t $\ast$seq, const int $\ast$punc, uint8\+\_\+t $\ast$out, int \textbf{ len}, int term)
\item 
static void \textbf{ osmo\+\_\+conv\+\_\+init} (void)
\item 
int \textbf{ osmo\+\_\+conv\+\_\+decode\+\_\+acc} (const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$code, const \textbf{ sbit\+\_\+t} $\ast$input, \textbf{ ubit\+\_\+t} $\ast$output)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static int \textbf{ init\+\_\+complete} = 0
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Accelerated Viterbi decoder implementation. 



\doxysubsection{Macro Definition Documentation}
\mbox{\label{conv__acc_8c_a76c065b149bf937cc9eb7566134057dc}} 
\index{conv\_acc.c@{conv\_acc.c}!BIT2NRZ@{BIT2NRZ}}
\index{BIT2NRZ@{BIT2NRZ}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{BIT2NRZ}
{\footnotesize\ttfamily \#define BIT2\+NRZ(\begin{DoxyParamCaption}\item[{}]{REG,  }\item[{}]{N }\end{DoxyParamCaption})~(((REG $>$$>$ N) \& 0x01) $\ast$ 2 -\/ 1) $\ast$ -\/1}

\mbox{\label{conv__acc_8c_ae1f11f70700b9fc4e4aab8e1b69f8b2e}} 
\index{conv\_acc.c@{conv\_acc.c}!INIT\_POINTERS@{INIT\_POINTERS}}
\index{INIT\_POINTERS@{INIT\_POINTERS}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{INIT\_POINTERS}
{\footnotesize\ttfamily \#define INIT\+\_\+\+POINTERS(\begin{DoxyParamCaption}\item[{}]{simd }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\{ \(\backslash\)}
\DoxyCodeLine{        osmo\_conv\_metrics\_k5\_n2 = osmo\_conv\_\#\#simd\#\#\_metrics\_k5\_n2; \(\backslash\)}
\DoxyCodeLine{        osmo\_conv\_metrics\_k5\_n3 = osmo\_conv\_\#\#simd\#\#\_metrics\_k5\_n3; \(\backslash\)}
\DoxyCodeLine{        osmo\_conv\_metrics\_k5\_n4 = osmo\_conv\_\#\#simd\#\#\_metrics\_k5\_n4; \(\backslash\)}
\DoxyCodeLine{        osmo\_conv\_metrics\_k7\_n2 = osmo\_conv\_\#\#simd\#\#\_metrics\_k7\_n2; \(\backslash\)}
\DoxyCodeLine{        osmo\_conv\_metrics\_k7\_n3 = osmo\_conv\_\#\#simd\#\#\_metrics\_k7\_n3; \(\backslash\)}
\DoxyCodeLine{        osmo\_conv\_metrics\_k7\_n4 = osmo\_conv\_\#\#simd\#\#\_metrics\_k7\_n4; \(\backslash\)}
\DoxyCodeLine{        vdec\_malloc = \&osmo\_conv\_\#\#simd\#\#\_vdec\_malloc; \(\backslash\)}
\DoxyCodeLine{        vdec\_free = \&osmo\_conv\_\#\#simd\#\#\_vdec\_free; \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}
\mbox{\label{conv__acc_8c_a20c9430a355d765fea6d45d0eaa55349}} 
\index{conv\_acc.c@{conv\_acc.c}!NUM\_STATES@{NUM\_STATES}}
\index{NUM\_STATES@{NUM\_STATES}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{NUM\_STATES}
{\footnotesize\ttfamily \#define NUM\+\_\+\+STATES(\begin{DoxyParamCaption}\item[{}]{\textbf{ K} }\end{DoxyParamCaption})~(\textbf{ K} == 7 ? 64 \+: 16)}



\doxysubsection{Function Documentation}
\mbox{\label{conv__acc_8c_a654f220adbb8eaed520587f774ec00d3}} 
\index{conv\_acc.c@{conv\_acc.c}!\_\_attribute\_\_@{\_\_attribute\_\_}}
\index{\_\_attribute\_\_@{\_\_attribute\_\_}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{\_\_attribute\_\_()}
{\footnotesize\ttfamily \+\_\+\+\_\+attribute\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{(visibility(\char`\"{}hidden\char`\"{}))}]{ }\end{DoxyParamCaption})}

\mbox{\label{conv__acc_8c_a80e9a40c56cd504a3e6283716705f2cb}} 
\index{conv\_acc.c@{conv\_acc.c}!\_traceback@{\_traceback}}
\index{\_traceback@{\_traceback}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{\_traceback()}
{\footnotesize\ttfamily static void \+\_\+traceback (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{unsigned}]{state,  }\item[{uint8\+\_\+t $\ast$}]{out,  }\item[{int}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ vdecoder\+::k}, \textbf{ len()}, \textbf{ vdecoder\+::paths}, \textbf{ vdecoder\+::trellis}, \textbf{ vtrellis\+::vals}, and \textbf{ vstate\+\_\+lshift()}.



Referenced by \textbf{ traceback()}.

\mbox{\label{conv__acc_8c_aa07977cf3617982997a0212b02225b8b}} 
\index{conv\_acc.c@{conv\_acc.c}!\_traceback\_rec@{\_traceback\_rec}}
\index{\_traceback\_rec@{\_traceback\_rec}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{\_traceback\_rec()}
{\footnotesize\ttfamily static void \+\_\+traceback\+\_\+rec (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{unsigned}]{state,  }\item[{uint8\+\_\+t $\ast$}]{out,  }\item[{int}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ vdecoder\+::k}, \textbf{ len()}, \textbf{ vdecoder\+::paths}, \textbf{ vdecoder\+::trellis}, \textbf{ vtrellis\+::vals}, and \textbf{ vstate\+\_\+lshift()}.



Referenced by \textbf{ traceback()}.

\mbox{\label{conv__acc_8c_a046b4b87cc347221fbaae822e6bb3809}} 
\index{conv\_acc.c@{conv\_acc.c}!bitswap@{bitswap}}
\index{bitswap@{bitswap}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{bitswap()}
{\footnotesize\ttfamily static unsigned bitswap (\begin{DoxyParamCaption}\item[{unsigned}]{v,  }\item[{unsigned}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ bitswap2()}, \textbf{ bitswap3()}, \textbf{ bitswap4()}, \textbf{ bitswap5()}, \textbf{ bitswap6()}, and \textbf{ n}.



Referenced by \textbf{ gen\+\_\+output()}, and \textbf{ gen\+\_\+recursive\+\_\+output()}.

\mbox{\label{conv__acc_8c_a9978f94dd716b403ef6620a5472b4cb8}} 
\index{conv\_acc.c@{conv\_acc.c}!bitswap2@{bitswap2}}
\index{bitswap2@{bitswap2}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{bitswap2()}
{\footnotesize\ttfamily static unsigned bitswap2 (\begin{DoxyParamCaption}\item[{unsigned}]{v }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Referenced by \textbf{ bitswap()}.

\mbox{\label{conv__acc_8c_ab7d743a5f9b69cc48febb3e28a589f87}} 
\index{conv\_acc.c@{conv\_acc.c}!bitswap3@{bitswap3}}
\index{bitswap3@{bitswap3}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{bitswap3()}
{\footnotesize\ttfamily static unsigned bitswap3 (\begin{DoxyParamCaption}\item[{unsigned}]{v }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Referenced by \textbf{ bitswap()}.

\mbox{\label{conv__acc_8c_aedc617bdb47a2e22829a8eefb492396e}} 
\index{conv\_acc.c@{conv\_acc.c}!bitswap4@{bitswap4}}
\index{bitswap4@{bitswap4}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{bitswap4()}
{\footnotesize\ttfamily static unsigned bitswap4 (\begin{DoxyParamCaption}\item[{unsigned}]{v }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Referenced by \textbf{ bitswap()}.

\mbox{\label{conv__acc_8c_add7a0dbee68a7227d4308f962ab1a09e}} 
\index{conv\_acc.c@{conv\_acc.c}!bitswap5@{bitswap5}}
\index{bitswap5@{bitswap5}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{bitswap5()}
{\footnotesize\ttfamily static unsigned bitswap5 (\begin{DoxyParamCaption}\item[{unsigned}]{v }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Referenced by \textbf{ bitswap()}.

\mbox{\label{conv__acc_8c_a509c042b725c136b692f83d4fa976761}} 
\index{conv\_acc.c@{conv\_acc.c}!bitswap6@{bitswap6}}
\index{bitswap6@{bitswap6}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{bitswap6()}
{\footnotesize\ttfamily static unsigned bitswap6 (\begin{DoxyParamCaption}\item[{unsigned}]{v }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Referenced by \textbf{ bitswap()}.

\mbox{\label{conv__acc_8c_ac70c7000438d44459661ddc872ba21fe}} 
\index{conv\_acc.c@{conv\_acc.c}!conv\_code\_recursive@{conv\_code\_recursive}}
\index{conv\_code\_recursive@{conv\_code\_recursive}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{conv\_code\_recursive()}
{\footnotesize\ttfamily static int conv\+\_\+code\+\_\+recursive (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ osmo\+\_\+conv\+\_\+code\+::next\+\_\+term\+\_\+output}.



Referenced by \textbf{ vdec\+\_\+init()}.

\mbox{\label{conv__acc_8c_ae0c968e5640cabf20da4ded3b437173a}} 
\index{conv\_acc.c@{conv\_acc.c}!conv\_decode@{conv\_decode}}
\index{conv\_decode@{conv\_decode}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{conv\_decode()}
{\footnotesize\ttfamily static int conv\+\_\+decode (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{const int8\+\_\+t $\ast$}]{seq,  }\item[{const int $\ast$}]{punc,  }\item[{uint8\+\_\+t $\ast$}]{out,  }\item[{int}]{len,  }\item[{int}]{term }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ CONV\+\_\+\+TERM\+\_\+\+TAIL\+\_\+\+BITING}, \textbf{ depuncture()}, \textbf{ forward\+\_\+traverse()}, \textbf{ len()}, \textbf{ vdecoder\+::len}, \textbf{ vdecoder\+::n}, and \textbf{ traceback()}.



Referenced by \textbf{ osmo\+\_\+conv\+\_\+decode\+\_\+acc()}.

\mbox{\label{conv__acc_8c_a45c29d56b7e0f6446ff9f1b383827bce}} 
\index{conv\_acc.c@{conv\_acc.c}!depuncture@{depuncture}}
\index{depuncture@{depuncture}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{depuncture()}
{\footnotesize\ttfamily static int depuncture (\begin{DoxyParamCaption}\item[{const int8\+\_\+t $\ast$}]{in,  }\item[{const int $\ast$}]{punc,  }\item[{int8\+\_\+t $\ast$}]{out,  }\item[{int}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ len()}, and \textbf{ n}.



Referenced by \textbf{ conv\+\_\+decode()}.

\mbox{\label{conv__acc_8c_a7bf7f718e7952f1a67f72e8e1c333036}} 
\index{conv\_acc.c@{conv\_acc.c}!forward\_traverse@{forward\_traverse}}
\index{forward\_traverse@{forward\_traverse}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{forward\_traverse()}
{\footnotesize\ttfamily static void forward\+\_\+traverse (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{const int8\+\_\+t $\ast$}]{seq }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ vdecoder\+::intrvl}, \textbf{ vdecoder\+::len}, \textbf{ vdecoder\+::metric\+\_\+func}, \textbf{ vdecoder\+::n}, \textbf{ vtrellis\+::outputs}, \textbf{ vdecoder\+::paths}, \textbf{ vtrellis\+::sums}, and \textbf{ vdecoder\+::trellis}.



Referenced by \textbf{ conv\+\_\+decode()}.

\mbox{\label{conv__acc_8c_a27eb3aa70df7d3774d30ecd5f97a53d4}} 
\index{conv\_acc.c@{conv\_acc.c}!free\_trellis@{free\_trellis}}
\index{free\_trellis@{free\_trellis}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{free\_trellis()}
{\footnotesize\ttfamily static void free\+\_\+trellis (\begin{DoxyParamCaption}\item[{struct \textbf{ vtrellis} $\ast$}]{trellis }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ vtrellis\+::outputs}, \textbf{ vtrellis\+::sums}, and \textbf{ vtrellis\+::vals}.



Referenced by \textbf{ generate\+\_\+trellis()}, and \textbf{ vdec\+\_\+deinit()}.

\mbox{\label{conv__acc_8c_a6200956aaba08ca5394f171b2a9f65f9}} 
\index{conv\_acc.c@{conv\_acc.c}!gen\_output@{gen\_output}}
\index{gen\_output@{gen\_output}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{gen\_output()}
{\footnotesize\ttfamily static unsigned gen\+\_\+output (\begin{DoxyParamCaption}\item[{struct vstate $\ast$}]{state,  }\item[{int}]{val,  }\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ bitswap()}, \textbf{ osmo\+\_\+conv\+\_\+code\+::K}, \textbf{ osmo\+\_\+conv\+\_\+code\+::N}, and \textbf{ osmo\+\_\+conv\+\_\+code\+::next\+\_\+output}.



Referenced by \textbf{ gen\+\_\+state\+\_\+info()}.

\mbox{\label{conv__acc_8c_abae71c041d2d51a32b1cbc6c6f9b251c}} 
\index{conv\_acc.c@{conv\_acc.c}!gen\_recursive\_output@{gen\_recursive\_output}}
\index{gen\_recursive\_output@{gen\_recursive\_output}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{gen\_recursive\_output()}
{\footnotesize\ttfamily static unsigned gen\+\_\+recursive\+\_\+output (\begin{DoxyParamCaption}\item[{struct vstate $\ast$}]{state,  }\item[{uint8\+\_\+t $\ast$}]{val,  }\item[{unsigned}]{reg,  }\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code,  }\item[{int}]{pos }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ bitswap()}, \textbf{ osmo\+\_\+conv\+\_\+code\+::K}, \textbf{ osmo\+\_\+conv\+\_\+code\+::N}, \textbf{ osmo\+\_\+conv\+\_\+code\+::next\+\_\+output}, \textbf{ osmo\+\_\+conv\+\_\+code\+::next\+\_\+term\+\_\+output}, and \textbf{ vstate\+\_\+lshift()}.



Referenced by \textbf{ gen\+\_\+recursive\+\_\+state\+\_\+info()}.

\mbox{\label{conv__acc_8c_ab6da1ac7d9a4a9fd4331a8793c280bc9}} 
\index{conv\_acc.c@{conv\_acc.c}!gen\_recursive\_state\_info@{gen\_recursive\_state\_info}}
\index{gen\_recursive\_state\_info@{gen\_recursive\_state\_info}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{gen\_recursive\_state\_info()}
{\footnotesize\ttfamily static int gen\+\_\+recursive\+\_\+state\+\_\+info (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{val,  }\item[{unsigned}]{reg,  }\item[{int16\+\_\+t $\ast$}]{output,  }\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ BIT2\+NRZ}, \textbf{ gen\+\_\+recursive\+\_\+output()}, \textbf{ osmo\+\_\+conv\+\_\+code\+::K}, \textbf{ osmo\+\_\+conv\+\_\+code\+::N}, \textbf{ osmo\+\_\+conv\+\_\+code\+::next\+\_\+output}, \textbf{ NUM\+\_\+\+STATES}, and \textbf{ vstate\+\_\+lshift()}.



Referenced by \textbf{ generate\+\_\+trellis()}.

\mbox{\label{conv__acc_8c_a862f9d99b5020f4158f9e5fc12dc5ce5}} 
\index{conv\_acc.c@{conv\_acc.c}!gen\_state\_info@{gen\_state\_info}}
\index{gen\_state\_info@{gen\_state\_info}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{gen\_state\_info()}
{\footnotesize\ttfamily static int gen\+\_\+state\+\_\+info (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{val,  }\item[{unsigned}]{reg,  }\item[{int16\+\_\+t $\ast$}]{output,  }\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ BIT2\+NRZ}, \textbf{ gen\+\_\+output()}, \textbf{ osmo\+\_\+conv\+\_\+code\+::K}, \textbf{ osmo\+\_\+conv\+\_\+code\+::N}, and \textbf{ vstate\+\_\+lshift()}.



Referenced by \textbf{ generate\+\_\+trellis()}.

\mbox{\label{conv__acc_8c_a78fe1ea00525a570479816bb6ddb5b7c}} 
\index{conv\_acc.c@{conv\_acc.c}!generate\_trellis@{generate\_trellis}}
\index{generate\_trellis@{generate\_trellis}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{generate\_trellis()}
{\footnotesize\ttfamily static int generate\+\_\+trellis (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

For termination other than tail-\/biting, initialize the zero state as the encoder starting state. Initialize with the maximum accumulated sum at length equal to the constraint length.

References \textbf{ CONV\+\_\+\+TERM\+\_\+\+TAIL\+\_\+\+BITING}, \textbf{ free\+\_\+trellis()}, \textbf{ gen\+\_\+recursive\+\_\+state\+\_\+info()}, \textbf{ gen\+\_\+state\+\_\+info()}, \textbf{ osmo\+\_\+conv\+\_\+code\+::K}, \textbf{ osmo\+\_\+conv\+\_\+code\+::N}, \textbf{ NUM\+\_\+\+STATES}, \textbf{ vtrellis\+::num\+\_\+states}, \textbf{ vtrellis\+::outputs}, \textbf{ vdecoder\+::recursive}, \textbf{ vtrellis\+::sums}, \textbf{ osmo\+\_\+conv\+\_\+code\+::term}, \textbf{ vdecoder\+::trellis}, and \textbf{ vtrellis\+::vals}.



Referenced by \textbf{ vdec\+\_\+init()}.

\mbox{\label{conv__acc_8c_acaf1f612de7825b6e3a39acfa272e7f9}} 
\index{conv\_acc.c@{conv\_acc.c}!osmo\_conv\_init@{osmo\_conv\_init}}
\index{osmo\_conv\_init@{osmo\_conv\_init}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{osmo\_conv\_init()}
{\footnotesize\ttfamily static void osmo\+\_\+conv\+\_\+init (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

Usage of curly braces is mandatory, because we use multi-\/line define.

References \textbf{ init\+\_\+complete}, \textbf{ INIT\+\_\+\+POINTERS}, and \textbf{ sse41\+\_\+supported}.



Referenced by \textbf{ osmo\+\_\+conv\+\_\+decode\+\_\+acc()}.

\mbox{\label{conv__acc_8c_af5802946276d2353d542260d115fec95}} 
\index{conv\_acc.c@{conv\_acc.c}!traceback@{traceback}}
\index{traceback@{traceback}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{traceback()}
{\footnotesize\ttfamily static int traceback (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{uint8\+\_\+t $\ast$}]{out,  }\item[{int}]{term,  }\item[{int}]{len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ \+\_\+traceback()}, \textbf{ \+\_\+traceback\+\_\+rec()}, \textbf{ CONV\+\_\+\+TERM\+\_\+\+FLUSH}, \textbf{ CONV\+\_\+\+TERM\+\_\+\+TAIL\+\_\+\+BITING}, \textbf{ vdecoder\+::k}, \textbf{ len()}, \textbf{ vdecoder\+::len}, \textbf{ vtrellis\+::num\+\_\+states}, \textbf{ vdecoder\+::paths}, \textbf{ vdecoder\+::recursive}, \textbf{ vtrellis\+::sums}, \textbf{ vdecoder\+::trellis}, and \textbf{ vstate\+\_\+lshift()}.



Referenced by \textbf{ conv\+\_\+decode()}.

\mbox{\label{conv__acc_8c_adc93f22e8b2105210040cd5c7800f292}} 
\index{conv\_acc.c@{conv\_acc.c}!vdec\_deinit@{vdec\_deinit}}
\index{vdec\_deinit@{vdec\_deinit}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{vdec\_deinit()}
{\footnotesize\ttfamily static void vdec\+\_\+deinit (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ free\+\_\+trellis()}, \textbf{ vdecoder\+::paths}, and \textbf{ vdecoder\+::trellis}.



Referenced by \textbf{ osmo\+\_\+conv\+\_\+decode\+\_\+acc()}, and \textbf{ vdec\+\_\+init()}.

\mbox{\label{conv__acc_8c_a33c960c468ec0d4255374c9747198954}} 
\index{conv\_acc.c@{conv\_acc.c}!vdec\_init@{vdec\_init}}
\index{vdec\_init@{vdec\_init}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{vdec\_init()}
{\footnotesize\ttfamily static int vdec\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ vdecoder} $\ast$}]{dec,  }\item[{const struct \textbf{ osmo\+\_\+conv\+\_\+code} $\ast$}]{code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ conv\+\_\+code\+\_\+recursive()}, \textbf{ CONV\+\_\+\+TERM\+\_\+\+FLUSH}, \textbf{ generate\+\_\+trellis()}, \textbf{ if()}, \textbf{ vdecoder\+::intrvl}, \textbf{ osmo\+\_\+conv\+\_\+code\+::K}, \textbf{ vdecoder\+::k}, \textbf{ osmo\+\_\+conv\+\_\+code\+::len}, \textbf{ vdecoder\+::len}, \textbf{ vdecoder\+::metric\+\_\+func}, \textbf{ osmo\+\_\+conv\+\_\+code\+::N}, \textbf{ vdecoder\+::n}, \textbf{ NUM\+\_\+\+STATES}, \textbf{ vdecoder\+::paths}, \textbf{ vdecoder\+::recursive}, \textbf{ osmo\+\_\+conv\+\_\+code\+::term}, and \textbf{ vdec\+\_\+deinit()}.



Referenced by \textbf{ osmo\+\_\+conv\+\_\+decode\+\_\+acc()}.

\mbox{\label{conv__acc_8c_a519bd65bd7fe657aa425cfefff2c659d}} 
\index{conv\_acc.c@{conv\_acc.c}!vstate\_lshift@{vstate\_lshift}}
\index{vstate\_lshift@{vstate\_lshift}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{vstate\_lshift()}
{\footnotesize\ttfamily static unsigned vstate\+\_\+lshift (\begin{DoxyParamCaption}\item[{unsigned}]{reg,  }\item[{int}]{k,  }\item[{int}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ k}.



Referenced by \textbf{ \+\_\+traceback()}, \textbf{ \+\_\+traceback\+\_\+rec()}, \textbf{ gen\+\_\+recursive\+\_\+output()}, \textbf{ gen\+\_\+recursive\+\_\+state\+\_\+info()}, \textbf{ gen\+\_\+state\+\_\+info()}, and \textbf{ traceback()}.



\doxysubsection{Variable Documentation}
\mbox{\label{conv__acc_8c_affedb1db4fd97829fb75619a5ed89ac4}} 
\index{conv\_acc.c@{conv\_acc.c}!init\_complete@{init\_complete}}
\index{init\_complete@{init\_complete}!conv\_acc.c@{conv\_acc.c}}
\doxysubsubsection{init\_complete}
{\footnotesize\ttfamily int init\+\_\+complete = 0\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ osmo\+\_\+conv\+\_\+decode\+\_\+acc()}, and \textbf{ osmo\+\_\+conv\+\_\+init()}.

