\hypertarget{HDD_8h}{
\section{HDD.h File Reference}
\label{HDD_8h}\index{HDD.h@{HDD.h}}
}
Interface to the routines to decode a distribution of symbols previously encoded using HDE\_\-encodeSS.  


\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{HDD_8h_d31e804bb6ea253054e5667d7b46ef42}{
typedef struct \_\-HDD \textbf{HDD}}
\label{HDD_8h_d31e804bb6ea253054e5667d7b46ef42}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void $\ast$ \hyperlink{HDD_8h_4c6ab1a43ff64f97b6d3a94f5c2dd317}{HDD\_\-construct} (HDD $\ast$hde, unsigned int nhuff)
\begin{CompactList}\small\item\em Constructs (initializes) the specified HDD structure. \item\end{CompactList}\item 
unsigned int \hyperlink{HDD_8h_32d893cbdc2268c3f3bc47325708248b}{HDD\_\-sizeof} (unsigned int nhuff)
\begin{CompactList}\small\item\em Returns the size, in bytes, for a handle to hold a Huffman distribution of {\em huffman\_\-bins\/}. \item\end{CompactList}\item 
unsigned int \hyperlink{HDD_8h_40bca96a267e0c6bd62c116d57b7e6e5}{HDD\_\-decodeS} (HDD $\ast$hdd, const unsigned int $\ast$src, unsigned int pos, unsigned int max\_\-pos, short $\ast$syms, unsigned int nsyms)
\begin{CompactList}\small\item\em Unpacks the distribution encoded with HDD\_\-encodeSS. \item\end{CompactList}\item 
unsigned int \hyperlink{HDD_8h_839b2f1a20b6258a8906603fdcd20dbd}{HDD\_\-tableDecode} (HDD $\ast$hdd, const unsigned int $\ast$src, unsigned int pos, unsigned int max\_\-pos)
\begin{CompactList}\small\item\em Unpacks the table encoded with HDE\_\-tableEncode. \item\end{CompactList}\item 
unsigned int \hyperlink{HDD_8h_57ef04502ead730721a70189d31d44bc}{HDD\_\-symbolsDecodeS} (HDD $\ast$hdd, const unsigned int $\ast$src, unsigned int pos, unsigned int max\_\-pos, short $\ast$syms, unsigned int nsyms)
\begin{CompactList}\small\item\em Unpacks the distribution encoded with HDD\_\-symbolsEncodeS. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to the routines to decode a distribution of symbols previously encoded using HDE\_\-encodeSS. 

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


\footnotesize\begin{verbatim}

   CVS $Id: HDD.h,v 1.2 2010/08/06 18:58:49 saxton Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{HDD_8h_4c6ab1a43ff64f97b6d3a94f5c2dd317}{
\index{HDD.h@{HDD.h}!HDD\_\-construct@{HDD\_\-construct}}
\index{HDD\_\-construct@{HDD\_\-construct}!HDD.h@{HDD.h}}
\subsubsection[{HDD\_\-construct}]{\setlength{\rightskip}{0pt plus 5cm}void HDD\_\-construct (HDD $\ast$ {\em hdd}, \/  unsigned int {\em nhuff})}}
\label{HDD_8h_4c6ab1a43ff64f97b6d3a94f5c2dd317}


Constructs (initializes) the specified HDD structure. 

\begin{Desc}
\item[Returns:]The next address after this structure.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hdd}]The HDD control structure to construct \item[{\em nhuff}]The maximum number of Huffman encoding bins that this control structure is meant to support.\end{description}
\end{Desc}
The size of this structure should be acquired by a call to HDD\_\-sizeof. The parameter {\em huffman\_\-nbins\/} must be the same in the call to HDD\_\-sizeof and HDD\_\-construct. 

References HUFF\_\-dtableSizeof().\hypertarget{HDD_8h_40bca96a267e0c6bd62c116d57b7e6e5}{
\index{HDD.h@{HDD.h}!HDD\_\-decodeS@{HDD\_\-decodeS}}
\index{HDD\_\-decodeS@{HDD\_\-decodeS}!HDD.h@{HDD.h}}
\subsubsection[{HDD\_\-decodeS}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int HDD\_\-decodeS (HDD $\ast$ {\em hdd}, \/  const unsigned int $\ast$ {\em src}, \/  unsigned int {\em pos}, \/  unsigned int {\em max\_\-pos}, \/  short $\ast$ {\em syms}, \/  unsigned int {\em nsyms})}}
\label{HDD_8h_40bca96a267e0c6bd62c116d57b7e6e5}


Unpacks the distribution encoded with HDD\_\-encodeSS. 

\begin{Desc}
\item[Returns:]The next bit position to read.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hdd}]The decode handle \item[{\em src}]The source stream \item[{\em pos}]The current bit read position \item[{\em max\_\-pos}]The maximum bit position, {\em i.e\/}. do not read past this point \item[{\em syms}]The array to receive the decoded symbols \item[{\em nsyms}]The number of symbols to decode \end{description}
\end{Desc}


References \_\-bfu\_\-constructW, \_\-bfu\_\-extractBoolean, \_\-bfu\_\-extractR, \_\-bfu\_\-get\_\-pos, \_\-bfu\_\-put\_\-pos, declare, dprintf, HUFF\_\-dtableBiase(), HUFF\_\-dtableBuild(), HUFF\_\-dtablePrint(), unpack\_\-code\_\-lens(), and unpack\_\-syms().\hypertarget{HDD_8h_32d893cbdc2268c3f3bc47325708248b}{
\index{HDD.h@{HDD.h}!HDD\_\-sizeof@{HDD\_\-sizeof}}
\index{HDD\_\-sizeof@{HDD\_\-sizeof}!HDD.h@{HDD.h}}
\subsubsection[{HDD\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int HDD\_\-sizeof (unsigned int {\em nhuff})}}
\label{HDD_8h_32d893cbdc2268c3f3bc47325708248b}


Returns the size, in bytes, for a handle to hold a Huffman distribution of {\em huffman\_\-bins\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nhuff}]The maximum number of Huffman codes\end{description}
\end{Desc}
For the most part, this only provides a working area. On host-based workstations with expandable stacks, this memory would go on the stack, except for the fact that it is variable length. 

References HUFF\_\-dtableSizeof().\hypertarget{HDD_8h_57ef04502ead730721a70189d31d44bc}{
\index{HDD.h@{HDD.h}!HDD\_\-symbolsDecodeS@{HDD\_\-symbolsDecodeS}}
\index{HDD\_\-symbolsDecodeS@{HDD\_\-symbolsDecodeS}!HDD.h@{HDD.h}}
\subsubsection[{HDD\_\-symbolsDecodeS}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int HDD\_\-symbolsDecodeS (HDD $\ast$ {\em hdd}, \/  const unsigned int $\ast$ {\em src}, \/  unsigned int {\em pos}, \/  unsigned int {\em max\_\-pos}, \/  short $\ast$ {\em syms}, \/  unsigned int {\em nsyms})}}
\label{HDD_8h_57ef04502ead730721a70189d31d44bc}


Unpacks the distribution encoded with HDD\_\-symbolsEncodeS. 

\begin{Desc}
\item[Returns:]The next bit position to read.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hdd}]The decode handle \item[{\em src}]The source stream \item[{\em pos}]The current bit read position \item[{\em max\_\-pos}]The maximum bit position, {\em i.e\/}. do not read past this point \item[{\em syms}]The array to receive the decoded symbols \item[{\em nsyms}]The number of symbols to decode \end{description}
\end{Desc}


References \_\-bfu\_\-constructW, \_\-bfu\_\-get\_\-pos, dprintf, and unpack\_\-syms().\hypertarget{HDD_8h_839b2f1a20b6258a8906603fdcd20dbd}{
\index{HDD.h@{HDD.h}!HDD\_\-tableDecode@{HDD\_\-tableDecode}}
\index{HDD\_\-tableDecode@{HDD\_\-tableDecode}!HDD.h@{HDD.h}}
\subsubsection[{HDD\_\-tableDecode}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int HDD\_\-tableDecode (HDD $\ast$ {\em hdd}, \/  const unsigned int $\ast$ {\em src}, \/  unsigned int {\em pos}, \/  unsigned int {\em max\_\-pos})}}
\label{HDD_8h_839b2f1a20b6258a8906603fdcd20dbd}


Unpacks the table encoded with HDE\_\-tableEncode. 

\begin{Desc}
\item[Returns:]The next bit position to read.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hdd}]The decode handle \item[{\em src}]The source stream \item[{\em pos}]The current bit read position \item[{\em max\_\-pos}]The maximum bit position, {\em i.e\/}. do not read past this point \end{description}
\end{Desc}


References \_\-bfu\_\-constructW, \_\-bfu\_\-extractBoolean, \_\-bfu\_\-get\_\-pos, \_\-bfu\_\-put\_\-pos, declare, dprintf, HUFF\_\-dtableBiase(), HUFF\_\-dtableBuild(), HUFF\_\-dtablePrint(), and unpack\_\-code\_\-lens().