\hypertarget{decompress_8h}{
\section{decompress.h File Reference}
\label{decompress_8h}\index{decompress.h@{decompress.h}}
}
Lowest-level decompression routines. 

{\tt \#include \char`\"{}LDT/APD.h\char`\"{}}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par


Include dependency graph for decompress.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=116pt]{decompress_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=180pt]{decompress_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{decompress_8h_a0}{
typedef \hyperlink{structQSEC__decompression__}{QSEC\_\-decompression\_\-} \hyperlink{decompress_8h_a0}{QSEC\_\-decompression}}
\label{decompress_8h_a0}

\begin{CompactList}\small\item\em Declaration of the opaque decompression structure. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{decompress_8h_a1}{QSEC\_\-clear\-Decompression} (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcm)
\begin{CompactList}\small\item\em Clear the decompression structrure of any data from a previous cycle. \item\end{CompactList}\item 
\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ \hyperlink{decompress_8h_a2}{QSEC\_\-construct\-Decompression} (void $\ast$buffer, unsigned int nbits, const char $\ast$name)
\begin{CompactList}\small\item\em Initialise the buffer as a decompression structure. \item\end{CompactList}\item 
unsigned \hyperlink{decompress_8h_a3}{QSEC\_\-decompress} (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcm, APD\_\-dtx $\ast$dtx)
\begin{CompactList}\small\item\em Decode the next symbol. \item\end{CompactList}\item 
void \hyperlink{decompress_8h_a4}{QSEC\_\-delete\-Decompression} (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcm)
\begin{CompactList}\small\item\em Free the memory associated with the decompression structure. \item\end{CompactList}\item 
unsigned int \hyperlink{decompress_8h_a5}{QSEC\_\-get\-Count} (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcm)
\begin{CompactList}\small\item\em Return the number of non-zero bins in the histogram. \item\end{CompactList}\item 
\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ \hyperlink{decompress_8h_a6}{QSEC\_\-new\-Decompression} (unsigned int nbits, const char $\ast$name)
\begin{CompactList}\small\item\em Allocate and initialise a new decompression structure. \item\end{CompactList}\item 
void \hyperlink{decompress_8h_a7}{QSEC\_\-report\-Decompression} (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcm, FILE $\ast$fp)
\begin{CompactList}\small\item\em Describe the contents of the decompression structure in formatted ASCII send to the file {\em fp\/}. \item\end{CompactList}\item 
size\_\-t \hyperlink{decompress_8h_a8}{QSEC\_\-sizeof\-Decompression} (unsigned int nbits)
\begin{CompactList}\small\item\em Calculate the total size required to accomodate a decompression structure. \item\end{CompactList}\item 
const unsigned int $\ast$ \hyperlink{decompress_8h_a9}{QSEC\_\-unpack} (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcm, const unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Build the lookup and freqency tables by retrieving and unpacking data from the consignment. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Lowest-level decompression routines. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{decompress_8h}{decompress.h},v 1.2 2007/04/05 22:59:55 saxton Exp \end{Desc}


\subsection{Function Documentation}
\hypertarget{decompress_8h_a1}{
\index{decompress.h@{decompress.h}!QSEC_clearDecompression@{QSEC\_\-clearDecompression}}
\index{QSEC_clearDecompression@{QSEC\_\-clearDecompression}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-clearDecompression]{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-clear\-Decompression (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ {\em dcm})}}
\label{decompress_8h_a1}


Clear the decompression structrure of any data from a previous cycle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dcm}]Pointer to an allocated, initialised, decompression structure\end{description}
\end{Desc}
\hypertarget{decompress_8h_a2}{
\index{decompress.h@{decompress.h}!QSEC_constructDecompression@{QSEC\_\-constructDecompression}}
\index{QSEC_constructDecompression@{QSEC\_\-constructDecompression}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-constructDecompression]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression}$\ast$ QSEC\_\-construct\-Decompression (void $\ast$ {\em buffer}, unsigned int {\em nbits}, const char $\ast$ {\em name})}}
\label{decompress_8h_a2}


Initialise the buffer as a decompression structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buffer}]Pointer to the uninitialised memory to use for this decompression structure\item[{\em nbits}]Number of bits in the symbols to be handled by this decompression strcuture\item[{\em name}]String identifying this structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an initialised decompression structure\end{Desc}
\hypertarget{decompress_8h_a3}{
\index{decompress.h@{decompress.h}!QSEC_decompress@{QSEC\_\-decompress}}
\index{QSEC_decompress@{QSEC\_\-decompress}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-decompress]{\setlength{\rightskip}{0pt plus 5cm}unsigned QSEC\_\-decompress (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ {\em dcm}, APD\_\-dtx $\ast$ {\em dtx})}}
\label{decompress_8h_a3}


Decode the next symbol. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dcm}]Pointer to an initialsed, populated and processed decompression structure\item[{\em dtx}]Pointer to the arithmetic encoder context\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The next symbol\end{Desc}
\hypertarget{decompress_8h_a4}{
\index{decompress.h@{decompress.h}!QSEC_deleteDecompression@{QSEC\_\-deleteDecompression}}
\index{QSEC_deleteDecompression@{QSEC\_\-deleteDecompression}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-deleteDecompression]{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-delete\-Decompression (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ {\em dcm})}}
\label{decompress_8h_a4}


Free the memory associated with the decompression structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dcm}]Pointer to an allocated decompression structure\end{description}
\end{Desc}
\hypertarget{decompress_8h_a5}{
\index{decompress.h@{decompress.h}!QSEC_getCount@{QSEC\_\-getCount}}
\index{QSEC_getCount@{QSEC\_\-getCount}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-getCount]{\setlength{\rightskip}{0pt plus 5cm}unsigned int QSEC\_\-get\-Count (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ {\em dcm})}}
\label{decompress_8h_a5}


Return the number of non-zero bins in the histogram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dcm}]Pointer to a decompression structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of non-zero bins in the histogram\end{Desc}
\hypertarget{decompress_8h_a6}{
\index{decompress.h@{decompress.h}!QSEC_newDecompression@{QSEC\_\-newDecompression}}
\index{QSEC_newDecompression@{QSEC\_\-newDecompression}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-newDecompression]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression}$\ast$ QSEC\_\-new\-Decompression (unsigned int {\em nbits}, const char $\ast$ {\em name})}}
\label{decompress_8h_a6}


Allocate and initialise a new decompression structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]String used in the reporting of error to identify a decompression structure\item[{\em nbits}]Number of symbols in the complete range of possible symbols (including excluded internal sub-ranges), hence the number of bins in the histogram and frequency tables\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an allocated and initialised QSEC\_\-decompression structure\end{Desc}
\hypertarget{decompress_8h_a7}{
\index{decompress.h@{decompress.h}!QSEC_reportDecompression@{QSEC\_\-reportDecompression}}
\index{QSEC_reportDecompression@{QSEC\_\-reportDecompression}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-reportDecompression]{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-report\-Decompression (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ {\em dcm}, FILE $\ast$ {\em fp})}}
\label{decompress_8h_a7}


Describe the contents of the decompression structure in formatted ASCII send to the file {\em fp\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dcm}]Pointer to the decompression structure\item[{\em fp}]Pointer to the file used as the destination\end{description}
\end{Desc}
\hypertarget{decompress_8h_a8}{
\index{decompress.h@{decompress.h}!QSEC_sizeofDecompression@{QSEC\_\-sizeofDecompression}}
\index{QSEC_sizeofDecompression@{QSEC\_\-sizeofDecompression}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-sizeofDecompression]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t QSEC\_\-sizeof\-Decompression (unsigned int {\em nbits})}}
\label{decompress_8h_a8}


Calculate the total size required to accomodate a decompression structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nbits}]Number of symbols in the complete range of possible symbols (including excluded internal sub-ranges), hence the number of bins in the histogram and frequency tables\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of memory block required to accomodate a decompression structure\end{Desc}
\hypertarget{decompress_8h_a9}{
\index{decompress.h@{decompress.h}!QSEC_unpack@{QSEC\_\-unpack}}
\index{QSEC_unpack@{QSEC\_\-unpack}!decompress.h@{decompress.h}}
\subsubsection[QSEC\_\-unpack]{\setlength{\rightskip}{0pt plus 5cm}const unsigned int$\ast$ QSEC\_\-unpack (\hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$ {\em dcm}, const unsigned int $\ast$ {\em buffer})}}
\label{decompress_8h_a9}


Build the lookup and freqency tables by retrieving and unpacking data from the consignment. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dcm}]Pointer to an initialsed decompression structure\item[{\em buffer}]Pointer to the start of the buffer holding the packed structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next input location or NULL if there is an error in the unpacking\end{Desc}
