\hypertarget{classSPL_1_1MultiArithEncoder}{}\section{S\+P\+L\+:\+:Multi\+Arith\+Encoder Class Reference}
\label{classSPL_1_1MultiArithEncoder}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}


M-\/ary arithmetic encoder class.  




{\ttfamily \#include $<$arith\+Coder.\+hpp$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSPL_1_1MultiArithEncoder_aa306c31664f855994dc1a317d38a1bda}{Multi\+Arith\+Encoder} (int max\+Contexts, \hyperlink{classSPL_1_1OutputBitStream}{Output\+Bit\+Stream} $\ast$out=nullptr)
\begin{DoxyCompactList}\small\item\em Create an encoder with the specified number of contexts that sends output to the given bit stream. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1MultiArithEncoder_a7cfccb4a9c7cb555f35db953c28d104e}{$\sim$\+Multi\+Arith\+Encoder} ()
\begin{DoxyCompactList}\small\item\em Destroy an encoder. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1OutputBitStream}{Output\+Bit\+Stream} $\ast$ \hyperlink{group__ArithCoder_gaca2c2b248f8b8e9b98003a4097cd8d07}{get\+Output} ()
\begin{DoxyCompactList}\small\item\em Get the bit stream used for output. \end{DoxyCompactList}\item 
void \hyperlink{group__ArithCoder_ga3df5b555de01fd3255bda608cd9b5582}{set\+Output} (\hyperlink{classSPL_1_1OutputBitStream}{Output\+Bit\+Stream} $\ast$out)
\begin{DoxyCompactList}\small\item\em Set the bit stream used for output. \end{DoxyCompactList}\item 
S\+P\+L\+\_\+\+Arith\+Coder\+\_\+ulong \hyperlink{group__ArithCoder_ga3f0a1bebb853d58407f98bacbbd241a2}{get\+Sym\+Count} () const 
\begin{DoxyCompactList}\small\item\em Get the number of symbols encoded so far. \end{DoxyCompactList}\item 
S\+P\+L\+\_\+\+Arith\+Coder\+\_\+ulong \hyperlink{group__ArithCoder_ga1477dac99a483fad329d8668a467a7c8}{get\+Bit\+Count} () const 
\begin{DoxyCompactList}\small\item\em Get the number of bits of output generated so far including bits awaiting output. \end{DoxyCompactList}\item 
int \hyperlink{group__ArithCoder_ga5abf803588b6797443aae8a24314de28}{get\+Max\+Contexts} () const 
\begin{DoxyCompactList}\small\item\em Get the maximum number of contexts. \end{DoxyCompactList}\item 
void \hyperlink{classSPL_1_1MultiArithEncoder_a5dfc18d2dd4b6fc7cdffe2e74148d5ff}{set\+Context} (int context\+Id, int num\+Syms)
\begin{DoxyCompactList}\small\item\em Set the specified context to have the given number of symbols which are initially equiprobable. \end{DoxyCompactList}\item 
void \hyperlink{classSPL_1_1MultiArithEncoder_a8820c85e5dab31c95f93d7de6ce52ebf}{set\+Context} (int context\+Id, const std\+::vector$<$ Arith\+Coder\+::\+Freq $>$ \&sym\+Freqs, bool adaptive)
\begin{DoxyCompactList}\small\item\em Set the specified context to have symbols with the given frequencies and the given adaptivity. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MultiArithEncoder_a22af54b35b00e225de772c8e95655d41}{start} ()
\begin{DoxyCompactList}\small\item\em Start a code word. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MultiArithEncoder_a4df66b1c2285456b45f42ef7bb1118ca}{terminate} ()
\begin{DoxyCompactList}\small\item\em Terminate the code word. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MultiArithEncoder_a4a54f3a1de640f5060b0bd352a2ec7f2}{encode\+Regular} (int context\+Id, int sym)
\begin{DoxyCompactList}\small\item\em Encode the given symbol in the specified context. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MultiArithEncoder_ac8e932a40ea568994c4b89659f0cd7fd}{encode\+Bypass} (int num\+Syms, int sym)
\begin{DoxyCompactList}\small\item\em Encode the given symbol in bypass mode (i.\+e., a fixed probablity distribution where all symbols are equiprobable). \end{DoxyCompactList}\item 
void \hyperlink{classSPL_1_1MultiArithEncoder_a98fb14fe137953acd3452f5bdd5ddabd}{dump} (std\+::ostream \&out) const 
\begin{DoxyCompactList}\small\item\em Dump the internal state of the encoder to the specified stream for debugging purposes. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{group__ArithCoder_ga23d9628fb6a39e5e419de26c588e3238}{set\+Debug\+Level} (int debug\+Level)
\begin{DoxyCompactList}\small\item\em Set the debug level. \end{DoxyCompactList}\item 
static void \hyperlink{group__ArithCoder_ga1b6fff935d0aac375f58d6b9535947d1}{set\+Debug\+Stream} (std\+::ostream \&out)
\begin{DoxyCompactList}\small\item\em Set the stream for debugging output. \end{DoxyCompactList}\item 
static std\+::ostream \& \hyperlink{group__ArithCoder_gacd0f0dfac4695c99c42724c4b5ff3ecc}{get\+Debug\+Stream} ()
\begin{DoxyCompactList}\small\item\em Get the stream for debugging output. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
M-\/ary arithmetic encoder class. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classSPL_1_1MultiArithEncoder_aa306c31664f855994dc1a317d38a1bda}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!Multi\+Arith\+Encoder@{Multi\+Arith\+Encoder}}
\index{Multi\+Arith\+Encoder@{Multi\+Arith\+Encoder}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{Multi\+Arith\+Encoder}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+L\+::\+Multi\+Arith\+Encoder\+::\+Multi\+Arith\+Encoder (
\begin{DoxyParamCaption}
\item[{int}]{max\+Contexts, }
\item[{{\bf Output\+Bit\+Stream} $\ast$}]{out = {\ttfamily nullptr}}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_aa306c31664f855994dc1a317d38a1bda}


Create an encoder with the specified number of contexts that sends output to the given bit stream. 

\hypertarget{classSPL_1_1MultiArithEncoder_a7cfccb4a9c7cb555f35db953c28d104e}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!````~Multi\+Arith\+Encoder@{$\sim$\+Multi\+Arith\+Encoder}}
\index{````~Multi\+Arith\+Encoder@{$\sim$\+Multi\+Arith\+Encoder}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{$\sim$\+Multi\+Arith\+Encoder}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+L\+::\+Multi\+Arith\+Encoder\+::$\sim$\+Multi\+Arith\+Encoder (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_a7cfccb4a9c7cb555f35db953c28d104e}


Destroy an encoder. 



\subsection{Member Function Documentation}
\hypertarget{classSPL_1_1MultiArithEncoder_a98fb14fe137953acd3452f5bdd5ddabd}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!dump@{dump}}
\index{dump@{dump}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{dump}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+Multi\+Arith\+Encoder\+::dump (
\begin{DoxyParamCaption}
\item[{std\+::ostream \&}]{out}
\end{DoxyParamCaption}
) const}\label{classSPL_1_1MultiArithEncoder_a98fb14fe137953acd3452f5bdd5ddabd}


Dump the internal state of the encoder to the specified stream for debugging purposes. 

\hypertarget{classSPL_1_1MultiArithEncoder_ac8e932a40ea568994c4b89659f0cd7fd}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!encode\+Bypass@{encode\+Bypass}}
\index{encode\+Bypass@{encode\+Bypass}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{encode\+Bypass}]{\setlength{\rightskip}{0pt plus 5cm}int S\+P\+L\+::\+Multi\+Arith\+Encoder\+::encode\+Bypass (
\begin{DoxyParamCaption}
\item[{int}]{num\+Syms, }
\item[{int}]{sym}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_ac8e932a40ea568994c4b89659f0cd7fd}


Encode the given symbol in bypass mode (i.\+e., a fixed probablity distribution where all symbols are equiprobable). 

\hypertarget{classSPL_1_1MultiArithEncoder_a4a54f3a1de640f5060b0bd352a2ec7f2}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!encode\+Regular@{encode\+Regular}}
\index{encode\+Regular@{encode\+Regular}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{encode\+Regular}]{\setlength{\rightskip}{0pt plus 5cm}int S\+P\+L\+::\+Multi\+Arith\+Encoder\+::encode\+Regular (
\begin{DoxyParamCaption}
\item[{int}]{context\+Id, }
\item[{int}]{sym}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_a4a54f3a1de640f5060b0bd352a2ec7f2}


Encode the given symbol in the specified context. 

\hypertarget{classSPL_1_1MultiArithEncoder_a5dfc18d2dd4b6fc7cdffe2e74148d5ff}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!set\+Context@{set\+Context}}
\index{set\+Context@{set\+Context}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{set\+Context}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+Multi\+Arith\+Encoder\+::set\+Context (
\begin{DoxyParamCaption}
\item[{int}]{context\+Id, }
\item[{int}]{num\+Syms}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_a5dfc18d2dd4b6fc7cdffe2e74148d5ff}


Set the specified context to have the given number of symbols which are initially equiprobable. 

\hypertarget{classSPL_1_1MultiArithEncoder_a8820c85e5dab31c95f93d7de6ce52ebf}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!set\+Context@{set\+Context}}
\index{set\+Context@{set\+Context}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{set\+Context}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+Multi\+Arith\+Encoder\+::set\+Context (
\begin{DoxyParamCaption}
\item[{int}]{context\+Id, }
\item[{const std\+::vector$<$ Arith\+Coder\+::\+Freq $>$ \&}]{sym\+Freqs, }
\item[{bool}]{adaptive}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_a8820c85e5dab31c95f93d7de6ce52ebf}


Set the specified context to have symbols with the given frequencies and the given adaptivity. 

\hypertarget{classSPL_1_1MultiArithEncoder_a22af54b35b00e225de772c8e95655d41}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!start@{start}}
\index{start@{start}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}int S\+P\+L\+::\+Multi\+Arith\+Encoder\+::start (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_a22af54b35b00e225de772c8e95655d41}


Start a code word. 

This function must be called before attempting to encode any symbols. \hypertarget{classSPL_1_1MultiArithEncoder_a4df66b1c2285456b45f42ef7bb1118ca}{}\index{S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}!terminate@{terminate}}
\index{terminate@{terminate}!S\+P\+L\+::\+Multi\+Arith\+Encoder@{S\+P\+L\+::\+Multi\+Arith\+Encoder}}
\subsubsection[{terminate}]{\setlength{\rightskip}{0pt plus 5cm}int S\+P\+L\+::\+Multi\+Arith\+Encoder\+::terminate (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MultiArithEncoder_a4df66b1c2285456b45f42ef7bb1118ca}


Terminate the code word. 



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{arithCoder_8hpp}{arith\+Coder.\+hpp}\item 
arith\+Coder.\+cpp\end{DoxyCompactItemize}
