\hypertarget{APD_8h}{
\section{APD.h File Reference}
\label{APD_8h}\index{APD.h@{APD.h}}
}
Arithmetic Word Decoder interface file.  




This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=39pt]{APD_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__APD__dtx}{\_\-APD\_\-dtx}
\begin{CompactList}\small\item\em Decoding context. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{struct__APD__dtx}{\_\-APD\_\-dtx} \hyperlink{APD_8h_a0}{APD\_\-dtx}
\begin{CompactList}\small\item\em Typedef for struct {\em \hyperlink{struct__APD__dtx}{\_\-APD\_\-dtx}\/}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{APD_8h_a1}{APD\_\-start} (\hyperlink{struct__APD__dtx}{APD\_\-dtx} $\ast$dtx, const unsigned char $\ast$in, unsigned int boff)
\begin{CompactList}\small\item\em Begins a decoding session. \item\end{CompactList}\item 
unsigned int \hyperlink{APD_8h_a2}{APD\_\-decode} (\hyperlink{struct__APD__dtx}{APD\_\-dtx} $\ast$dtx, const unsigned int $\ast$table)
\begin{CompactList}\small\item\em Decodes the next symbol. \item\end{CompactList}\item 
int \hyperlink{APD_8h_a3}{APD\_\-bdecompress} (unsigned char $\ast$out, int cnt, const unsigned char $\ast$in, unsigned int boff, const unsigned int $\ast$table)
\begin{CompactList}\small\item\em Convenience routine to decode a bit stream using the specified table. \item\end{CompactList}\item 
int \hyperlink{APD_8h_a4}{APD\_\-finish} (\hyperlink{struct__APD__dtx}{APD\_\-dtx} $\ast$dtx)
\begin{CompactList}\small\item\em Finishes the decoding, cleaning up any inprogress context. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Arithmetic Word Decoder interface file. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}  CVS $Id: APD.h,v 1.1.1.1 2005/09/23 06:41:07 russell Exp $ \end{verbatim}\normalsize


Interface specification for routines to decode streams using an arithmetic word (32-bit) encoding technique. It is based on a 32-bit table (hence the word notation) giving the relative probabilities of the encoded symbols.

\subsection{Typedef Documentation}
\hypertarget{APD_8h_a0}{
\index{APD.h@{APD.h}!APD_dtx@{APD\_\-dtx}}
\index{APD_dtx@{APD\_\-dtx}!APD.h@{APD.h}}
\subsubsection[APD\_\-dtx]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__APD__dtx}{APD\_\-dtx}}}
\label{APD_8h_a0}


Typedef for struct {\em \hyperlink{struct__APD__dtx}{\_\-APD\_\-dtx}\/}. 

While this is defined in the public interface, this structure should be treated like a C++ private member. All manipulation of this structure should be through the APD routines. 

\subsection{Function Documentation}
\hypertarget{APD_8h_a3}{
\index{APD.h@{APD.h}!APD_bdecompress@{APD\_\-bdecompress}}
\index{APD_bdecompress@{APD\_\-bdecompress}!APD.h@{APD.h}}
\subsubsection[APD\_\-bdecompress]{\setlength{\rightskip}{0pt plus 5cm}int APD\_\-bdecompress (unsigned char $\ast$ {\em out}, int {\em cnt}, const unsigned char $\ast$ {\em in}, unsigned int {\em boff}, const unsigned int $\ast$ {\em table})}}
\label{APD_8h_a3}


Convenience routine to decode a bit stream using the specified table. 

\begin{Desc}
\item[Returns:]The number of decoded bits\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em out}]The output buffer \item[{\em cnt}]The number of bytes in the output buffer \item[{\em in}]The input buffer \item[{\em boff}]The bit offset to start at in the input buffer \item[{\em table}]The decoding table\end{description}
\end{Desc}
This is a convenience routine, combining APD\_\-start, APD\_\-decode and APD\_\-finish. This routine can only be used if the decoding table is the same for all symbols in the input stream. 

Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=135pt]{APD_8h_a3_cgraph}
\end{center}
\end{figure}
\hypertarget{APD_8h_a2}{
\index{APD.h@{APD.h}!APD_decode@{APD\_\-decode}}
\index{APD_decode@{APD\_\-decode}!APD.h@{APD.h}}
\subsubsection[APD\_\-decode]{\setlength{\rightskip}{0pt plus 5cm}unsigned int APD\_\-decode (\hyperlink{struct__APD__dtx}{APD\_\-dtx} $\ast$ {\em dtx}, const unsigned int $\ast$ {\em table})}}
\label{APD_8h_a2}


Decodes the next symbol. 

\begin{Desc}
\item[Returns:]The decoded symbol\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dtx}]The decoding context \item[{\em table}]The table to use in the decoding \end{description}
\end{Desc}
\hypertarget{APD_8h_a4}{
\index{APD.h@{APD.h}!APD_finish@{APD\_\-finish}}
\index{APD_finish@{APD\_\-finish}!APD.h@{APD.h}}
\subsubsection[APD\_\-finish]{\setlength{\rightskip}{0pt plus 5cm}int APD\_\-finish (\hyperlink{struct__APD__dtx}{APD\_\-dtx} $\ast$ {\em dtx})}}
\label{APD_8h_a4}


Finishes the decoding, cleaning up any inprogress context. 

\begin{Desc}
\item[Returns:]The number of bits decoded \end{Desc}
\hypertarget{APD_8h_a1}{
\index{APD.h@{APD.h}!APD_start@{APD\_\-start}}
\index{APD_start@{APD\_\-start}!APD.h@{APD.h}}
\subsubsection[APD\_\-start]{\setlength{\rightskip}{0pt plus 5cm}void APD\_\-start (\hyperlink{struct__APD__dtx}{APD\_\-dtx} $\ast$ {\em dtx}, const unsigned char $\ast$ {\em in}, unsigned int {\em boff})}}
\label{APD_8h_a1}


Begins a decoding session. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dtx}]The decoding context to be initialized \item[{\em in}]The input bit stream \item[{\em boff}]The bit offset into the input bit stream \end{description}
\end{Desc}
