\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
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{compress_8ic_55624ddf95451ff091813e804b3f3283}{
\#define \textbf{LSEC\_\-N\_\-ENCODE}~32}
\label{compress_8ic_55624ddf95451ff091813e804b3f3283}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline 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}\item 
static \_\-\_\-inline void \hyperlink{compress_8ic_598673551cacb663e35564243d48d3b6}{LSEC\_\-compressD} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, void $\ast$ctx, unsigned int sym, const unsigned int $\ast$$\ast$tables, unsigned short $\ast$syms, int $\ast$nsyms)
\begin{CompactList}\small\item\em Encode a symbol using the frequency and lookup table supplied by a compression. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{compress_8ic_12e1ebaa5df8234460d1fea6298abd93}{LSEC\_\-histogram} (\hyperlink{struct__LSEC__compression}{LSEC\_\-compression} $\ast$cpr, unsigned sym)
\begin{CompactList}\small\item\em Increment the bin of the histogram corresponding. \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.7 2010/05/25 19:16:36 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})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\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_598673551cacb663e35564243d48d3b6}{
\index{compress.ic@{compress.ic}!LSEC_compressD@{LSEC\_\-compressD}}
\index{LSEC_compressD@{LSEC\_\-compressD}!compress.ic@{compress.ic}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-compressD ({\bf LSEC\_\-compression} $\ast$ {\em cpr}, void $\ast$ {\em ctx}, unsigned int {\em sym}, const unsigned int $\ast$$\ast$ {\em tables}, unsigned short $\ast$ {\em syms}, int $\ast$ {\em nsyms})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{compress_8ic_598673551cacb663e35564243d48d3b6}


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

This function does not do the encoding immediately. It instead collects the table and symbol to be used into a pair of supplied arrays, and encodes the arrays when they become full.

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 encode.\item[{\em tables}]Pointer to an array of size LSEC\_\-N\_\-ENCODE to hold the table pointers for deferred encoding.\item[{\em syms}]Pointer to an array of size LSEC\_\-N\_\-ENCODE to hold the symbols for deferred encoding.\item[{\em nsyms}]Pointer to an integer to hold the number of symbols to be encoded. \end{description}
\end{Desc}
\hypertarget{compress_8ic_12e1ebaa5df8234460d1fea6298abd93}{
\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}, unsigned {\em sym})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{compress_8ic_12e1ebaa5df8234460d1fea6298abd93}


Increment the bin of the histogram corresponding. 

\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. 