本文介绍EncodeDecision过程,对应的代码及注释如下:
/**
* \brief Encode bin
*
* \param binValue bin value
* \param rcCtxModel context model
*/
Void TEncBinCABAC::encodeBin( UInt binValue, ContextModel &rcCtxModel )
{
{
DTRACE_CABAC_VL( g_nSymbolCounter++ )
DTRACE_CABAC_T( "\tstate=" )
DTRACE_CABAC_V( ( rcCtxModel.getState() << 1 ) + rcCtxModel.getMps() )
DTRACE_CABAC_T( "\tsymbol=" )
DTRACE_CABAC_V( binValue )
DTRACE_CABAC_T( "\n" )
}
m_uiBinsCoded += m_binCountIncrement;
rcCtxModel.setBinsCoded( 1 );
//! qCodRangeIdx = (codIRange >> 6) & 3;
//! codIRangeLPS = rangeTabLPS[pStateIdx][qCodIRangeIdx];
//! codIRange = codIRange - codIRangeLPS
UInt uiLPS = TComCABACTables::sm_aucLPSTable[ rcCtxModel.getState() ][ ( m_uiRange >> 6 ) & 3 ];
m_uiRange -= uiLPS;
if( binValue != rcCtxModel.getMps() ) //!< binVal != valM