\hypertarget{classSPL_1_1MDecoder}{}\section{S\+P\+L\+:\+:M\+Decoder Class Reference}
\label{classSPL_1_1MDecoder}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}


The M-\/\+Coder (binary) arithmetic decoder class.  




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



Inherits S\+P\+L\+::\+M\+Coder.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSPL_1_1MDecoder_a645aa59cbbb599418f60d29e95b585e0}{M\+Decoder} (int num\+Contexts=0, \hyperlink{classSPL_1_1InputBitStream}{Input\+Bit\+Stream} $\ast$in=0)
\begin{DoxyCompactList}\small\item\em Create a decoder with the specified number of contexts that reads input from the given bit stream. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1MDecoder_acac1ed5bb56903729e7dab2a23e0d709}{$\sim$\+M\+Decoder} ()
\begin{DoxyCompactList}\small\item\em Destroy a decoder. \end{DoxyCompactList}\item 
void \hyperlink{classSPL_1_1MDecoder_a816e63850adfad2e826dc90ffc307da0}{set\+Num\+Contexts} (int num\+Contexts)
\begin{DoxyCompactList}\small\item\em Set the number of contexts. \end{DoxyCompactList}\item 
int \hyperlink{group__MCoder_ga77cf39ef2aa6c4849d0157811f27eec6}{get\+Num\+Contexts} () const 
\begin{DoxyCompactList}\small\item\em Get the number of contexts. \end{DoxyCompactList}\item 
void \hyperlink{group__MCoder_gabf86d03693319ab79346db06f90f5509}{set\+Input} (\hyperlink{classSPL_1_1InputBitStream}{Input\+Bit\+Stream} $\ast$in)
\begin{DoxyCompactList}\small\item\em Set the input bit stream (i.\+e., the bit stream from which encoded data is to be read). \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1InputBitStream}{Input\+Bit\+Stream} $\ast$ \hyperlink{group__MCoder_ga821e18b732ea366801f2391ea11b2497}{get\+Input} () const 
\begin{DoxyCompactList}\small\item\em Get the input bit stream (i.\+e., the bit stream from which encoded data is to be read). \end{DoxyCompactList}\item 
void \hyperlink{classSPL_1_1MDecoder_adb436fc7418cfec7fb61fb8be1a77ac4}{clear\+Contexts} ()
\begin{DoxyCompactList}\small\item\em Clear the state of all of the contexts. \end{DoxyCompactList}\item 
long \hyperlink{group__MCoder_ga4ead202da057105b90407072d3248da5}{get\+Bit\+Count} () const 
\begin{DoxyCompactList}\small\item\em Get the number of bits read so far. \end{DoxyCompactList}\item 
long \hyperlink{group__MCoder_gae1f478ac3741184867431971207900bf}{get\+Sym\+Count} () const 
\begin{DoxyCompactList}\small\item\em Get the number of symbols decoded so far. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MDecoder_a4d9913133431de178aae270196fb0fc1}{start} ()
\begin{DoxyCompactList}\small\item\em Prepare to decode an arithmetic code word. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MDecoder_aa937eb02e913e02f04afffbcee609c03}{terminate} ()
\begin{DoxyCompactList}\small\item\em Terminate the arithmetic code word. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MDecoder_ad1837bf7e12671d893f995ce0491d4b1}{decode\+Regular} (int context\+Id)
\begin{DoxyCompactList}\small\item\em Decode a symbol in the specified context. \end{DoxyCompactList}\item 
int \hyperlink{classSPL_1_1MDecoder_a1b09b7d419cc1d4a8127a780b92b0b9a}{decode\+Bypass} ()
\begin{DoxyCompactList}\small\item\em Decode a symbol in bypass mode (i.\+e., assuming both symbols are equiprobable). \end{DoxyCompactList}\item 
void \hyperlink{classSPL_1_1MDecoder_ab95651bbed89c6f08fbcdb333f495822}{dump} (std\+::ostream \&out) const 
\begin{DoxyCompactList}\small\item\em Dump the internal state information for the decoder to a stream (for debugging). \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{classSPL_1_1MDecoder_aecf100e02c58a93453de74b0f4a88631}{set\+Debug\+Level} (int debug\+Level)
\begin{DoxyCompactList}\small\item\em Set the debug level. \end{DoxyCompactList}\item 
static void \hyperlink{classSPL_1_1MDecoder_ab129ca8dc2c3ceaf10ce67a3df064f29}{set\+Debug\+Stream} (std\+::ostream \&debug\+Stream)
\begin{DoxyCompactList}\small\item\em Set the stream to use for debugging output. \end{DoxyCompactList}\item 
static std\+::ostream \& \hyperlink{classSPL_1_1MDecoder_a8d1f70a6cfabc37853ebea7c29482658}{get\+Debug\+Stream} ()
\begin{DoxyCompactList}\small\item\em Get the stream used for debugging output. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The M-\/\+Coder (binary) arithmetic decoder class. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classSPL_1_1MDecoder_a645aa59cbbb599418f60d29e95b585e0}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!M\+Decoder@{M\+Decoder}}
\index{M\+Decoder@{M\+Decoder}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{M\+Decoder}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+L\+::\+M\+Decoder\+::\+M\+Decoder (
\begin{DoxyParamCaption}
\item[{int}]{num\+Contexts = {\ttfamily 0}, }
\item[{{\bf Input\+Bit\+Stream} $\ast$}]{in = {\ttfamily 0}}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MDecoder_a645aa59cbbb599418f60d29e95b585e0}


Create a decoder with the specified number of contexts that reads input from the given bit stream. 

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


Destroy a decoder. 



\subsection{Member Function Documentation}
\hypertarget{classSPL_1_1MDecoder_adb436fc7418cfec7fb61fb8be1a77ac4}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!clear\+Contexts@{clear\+Contexts}}
\index{clear\+Contexts@{clear\+Contexts}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{clear\+Contexts}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+M\+Decoder\+::clear\+Contexts (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MDecoder_adb436fc7418cfec7fb61fb8be1a77ac4}


Clear the state of all of the contexts. 

\hypertarget{classSPL_1_1MDecoder_a1b09b7d419cc1d4a8127a780b92b0b9a}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!decode\+Bypass@{decode\+Bypass}}
\index{decode\+Bypass@{decode\+Bypass}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{decode\+Bypass}]{\setlength{\rightskip}{0pt plus 5cm}int S\+P\+L\+::\+M\+Decoder\+::decode\+Bypass (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MDecoder_a1b09b7d419cc1d4a8127a780b92b0b9a}


Decode a symbol in bypass mode (i.\+e., assuming both symbols are equiprobable). 

\hypertarget{classSPL_1_1MDecoder_ad1837bf7e12671d893f995ce0491d4b1}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!decode\+Regular@{decode\+Regular}}
\index{decode\+Regular@{decode\+Regular}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{decode\+Regular}]{\setlength{\rightskip}{0pt plus 5cm}int S\+P\+L\+::\+M\+Decoder\+::decode\+Regular (
\begin{DoxyParamCaption}
\item[{int}]{context\+Id}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MDecoder_ad1837bf7e12671d893f995ce0491d4b1}


Decode a symbol in the specified context. 

\hypertarget{classSPL_1_1MDecoder_ab95651bbed89c6f08fbcdb333f495822}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!dump@{dump}}
\index{dump@{dump}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{dump}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+M\+Decoder\+::dump (
\begin{DoxyParamCaption}
\item[{std\+::ostream \&}]{out}
\end{DoxyParamCaption}
) const}\label{classSPL_1_1MDecoder_ab95651bbed89c6f08fbcdb333f495822}


Dump the internal state information for the decoder to a stream (for debugging). 

\hypertarget{classSPL_1_1MDecoder_a8d1f70a6cfabc37853ebea7c29482658}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!get\+Debug\+Stream@{get\+Debug\+Stream}}
\index{get\+Debug\+Stream@{get\+Debug\+Stream}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{get\+Debug\+Stream}]{\setlength{\rightskip}{0pt plus 5cm}std\+::ostream \& S\+P\+L\+::\+M\+Decoder\+::get\+Debug\+Stream (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classSPL_1_1MDecoder_a8d1f70a6cfabc37853ebea7c29482658}


Get the stream used for debugging output. 

\hypertarget{classSPL_1_1MDecoder_aecf100e02c58a93453de74b0f4a88631}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!set\+Debug\+Level@{set\+Debug\+Level}}
\index{set\+Debug\+Level@{set\+Debug\+Level}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{set\+Debug\+Level}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+M\+Decoder\+::set\+Debug\+Level (
\begin{DoxyParamCaption}
\item[{int}]{debug\+Level}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classSPL_1_1MDecoder_aecf100e02c58a93453de74b0f4a88631}


Set the debug level. 

\hypertarget{classSPL_1_1MDecoder_ab129ca8dc2c3ceaf10ce67a3df064f29}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!set\+Debug\+Stream@{set\+Debug\+Stream}}
\index{set\+Debug\+Stream@{set\+Debug\+Stream}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{set\+Debug\+Stream}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+M\+Decoder\+::set\+Debug\+Stream (
\begin{DoxyParamCaption}
\item[{std\+::ostream \&}]{debug\+Stream}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classSPL_1_1MDecoder_ab129ca8dc2c3ceaf10ce67a3df064f29}


Set the stream to use for debugging output. 

\hypertarget{classSPL_1_1MDecoder_a816e63850adfad2e826dc90ffc307da0}{}\index{S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}!set\+Num\+Contexts@{set\+Num\+Contexts}}
\index{set\+Num\+Contexts@{set\+Num\+Contexts}!S\+P\+L\+::\+M\+Decoder@{S\+P\+L\+::\+M\+Decoder}}
\subsubsection[{set\+Num\+Contexts}]{\setlength{\rightskip}{0pt plus 5cm}void S\+P\+L\+::\+M\+Decoder\+::set\+Num\+Contexts (
\begin{DoxyParamCaption}
\item[{int}]{num\+Contexts}
\end{DoxyParamCaption}
)}\label{classSPL_1_1MDecoder_a816e63850adfad2e826dc90ffc307da0}


Set the number of contexts. 

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


Prepare to decode an arithmetic code word. 

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


Terminate the arithmetic code word. 



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