\hypertarget{compress_8ic}{
\section{compress.ic File Reference}
\label{compress_8ic}\index{compress.ic@{compress.ic}}
}
The histogram and compress functions, as static inlines for efficiency. 

{\tt \#include \char`\"{}compress.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}LDT/APE.h\char`\"{}}\par
{\tt \#include \char`\"{}LDT/HDE.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{compress_8ic_24a382ff2ff8eb60c09830301b7c27b1}{
static \_\-\_\-inline void \textbf{LSEC\_\-compress} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, void $\ast$ctx, unsigned int sym)}
\label{compress_8ic_24a382ff2ff8eb60c09830301b7c27b1}

\item 
static \_\-\_\-inline unsigned \hyperlink{compress_8ic_b26a32b1985ac737382b9d0d0a980a7a}{LSEC\_\-compressH} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, int sym, unsigned int $\ast$buf, unsigned int pos)
\begin{CompactList}\small\item\em Encode a symbol using the Huffman table supplied by a compression. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{compress_8ic_832ce9e0343285714a2e4ef3a33da32d}{LSEC\_\-histogram} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, int sym)
\begin{CompactList}\small\item\em Increment the bin of a histogram. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{compress_8ic_7847b5e8c977b06ac85ef53feae45bf7}{LSEC\_\-histogramH} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, int sym)
\begin{CompactList}\small\item\em Increment the bin of a Huffman histogram. \item\end{CompactList}\item 
void \hyperlink{compress_8ic_7797744b3f94f0ce1b14309694cbcb90}{LSEC\_\-compress} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, void $\ast$ctx, unsigned sym)
\begin{CompactList}\small\item\em Encode a symbol using the frequency and lookup table supplied by a compression. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
The histogram and compress functions, as static inlines for efficiency. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
{\bf \$Id:} \hyperlink{compress_8ic}{compress.ic},v 1.8 2010/08/12 21:10:28 saxton Exp \$ 

\subsection{Function Documentation}
\hypertarget{compress_8ic_7797744b3f94f0ce1b14309694cbcb90}{
\index{compress.ic@{compress.ic}!LSEC_compress@{LSEC\_\-compress}}
\index{LSEC_compress@{LSEC\_\-compress}!compress.ic@{compress.ic}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-compress ({\bf LSEC\_\-compression} $\ast$ {\em cpr}, void $\ast$ {\em ctx}, unsigned {\em sym})}}
\label{compress_8ic_7797744b3f94f0ce1b14309694cbcb90}


Encode a symbol using the frequency and lookup table supplied by a compression. 

This function does not return errors since propogation of those errors to a point in LSEC where reasonable decisions about error handling can be made is problematic. Instead, errors are latched and can be checked using LSEC\_\-checkCompression.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpr}]Pointer to an initialsed, populated and processed compression structure\item[{\em ctx}]Context, pointer to the arithmetic encoder context\item[{\em sym}]Symbol to compress \end{description}
\end{Desc}
\hypertarget{compress_8ic_b26a32b1985ac737382b9d0d0a980a7a}{
\index{compress.ic@{compress.ic}!LSEC_compressH@{LSEC\_\-compressH}}
\index{LSEC_compressH@{LSEC\_\-compressH}!compress.ic@{compress.ic}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-compressH ({\bf LSEC\_\-compression} $\ast$ {\em cpr}, int {\em sym}, unsigned int $\ast$ {\em buf}, unsigned int {\em pos})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{compress_8ic_b26a32b1985ac737382b9d0d0a980a7a}


Encode a symbol using the Huffman table supplied by a compression. 

This function does not check for errors since only a programming error could cause one, and speed is of the essence.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpr}]Pointer to an initialsed, populated and processed compression structure\item[{\em sym}]Symbol to compress\item[{\em buf}]The address of the buffer to hold the encoded value.\item[{\em pos}]The current bit position within the buffer.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The updated bit position within buf. \end{Desc}
\hypertarget{compress_8ic_832ce9e0343285714a2e4ef3a33da32d}{
\index{compress.ic@{compress.ic}!LSEC_histogram@{LSEC\_\-histogram}}
\index{LSEC_histogram@{LSEC\_\-histogram}!compress.ic@{compress.ic}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-histogram ({\bf LSEC\_\-compression} $\ast$ {\em cpr}, int {\em sym})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{compress_8ic_832ce9e0343285714a2e4ef3a33da32d}


Increment the bin of a histogram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpr}]Pointer to an allocated, initialised, compression structure\item[{\em sym}]Symbol to add to the histogram\end{description}
\end{Desc}
This function does not return errors since propogation of those errors to a point in LSEC where reasonable decisions about error handling can be made is problematic. Instead, errors are latched and can be checked using LSEC\_\-checkCompression. \hypertarget{compress_8ic_7847b5e8c977b06ac85ef53feae45bf7}{
\index{compress.ic@{compress.ic}!LSEC_histogramH@{LSEC\_\-histogramH}}
\index{LSEC_histogramH@{LSEC\_\-histogramH}!compress.ic@{compress.ic}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-histogramH ({\bf LSEC\_\-compression} $\ast$ {\em cpr}, int {\em sym})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{compress_8ic_7847b5e8c977b06ac85ef53feae45bf7}


Increment the bin of a Huffman histogram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpr}]Pointer to an allocated, initialised, compression structure\item[{\em sym}]Symbol to add to the histogram\end{description}
\end{Desc}
This function does not check for errors. 