\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 $<$compress.h$>$}\par
{\tt \#include $<$LSEC\_\-p.h$>$}\par
{\tt \#include $<$LDT/APE.h$>$}\par
{\tt \#include $<$LDT/HDE.h$>$}\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.9 2011/03/27 17:48:20 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[{LSEC\_\-compress}]{\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}


References \_\-LSEC\_\-compression::encerr, \_\-LSEC\_\-compression::fwlu, \_\-LSEC\_\-compression::mask, \_\-LSEC\_\-compression::ovrflw, and \_\-LSEC\_\-compression::table.\hypertarget{compress_8ic_b26a32b1985ac737382b9d0d0a980a7a}{
\index{compress.ic@{compress.ic}!LSEC\_\-compressH@{LSEC\_\-compressH}}
\index{LSEC\_\-compressH@{LSEC\_\-compressH}!compress.ic@{compress.ic}}
\subsubsection[{LSEC\_\-compressH}]{\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}


References \_\-LSEC\_\-compression::hde.

Referenced by LSEC\_\-encodeCal().\hypertarget{compress_8ic_832ce9e0343285714a2e4ef3a33da32d}{
\index{compress.ic@{compress.ic}!LSEC\_\-histogram@{LSEC\_\-histogram}}
\index{LSEC\_\-histogram@{LSEC\_\-histogram}!compress.ic@{compress.ic}}
\subsubsection[{LSEC\_\-histogram}]{\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. 

References \_\-LSEC\_\-compression::hist, \_\-LSEC\_\-compression::mask, and \_\-LSEC\_\-compression::ovrflw.

Referenced by LSEC\_\-histoCalMeans().\hypertarget{compress_8ic_7847b5e8c977b06ac85ef53feae45bf7}{
\index{compress.ic@{compress.ic}!LSEC\_\-histogramH@{LSEC\_\-histogramH}}
\index{LSEC\_\-histogramH@{LSEC\_\-histogramH}!compress.ic@{compress.ic}}
\subsubsection[{LSEC\_\-histogramH}]{\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. 

References \_\-LSEC\_\-compression::hist0.

Referenced by LSEC\_\-histogramCal().