現在已經可以在下面這個函數下獲得當前LCU的所有4X4塊的深度信息,但是怎麼獲得當前LCU的上面一個LCU的信息,乃至左上角的信息呢??這個是很麻煩的問題,還待持續解決中。。。
// analysis of CU
xCompressCU( m_ppcBestCU[0], m_ppcTempCU[0], 0 );
在Void TEncSlice::compressSlice( TComPic*& rpcPic )函數中有關於TR的信息,也許這是一個突破口。
UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth )
{
TComDataCU* pcTempCU;
UInt uiTempPartIdx;
UInt uiCtx;
// Get left split flag
#if DEPENDENT_SLICES
Bool bDepSliceRestriction = ( !m_pcSlice->getPPS()->getDependentSliceEnabledFlag());
pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );
#else
pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
#endif
uiCtx = ( pcTempCU ) ? ( ( pcTempCU->getDepth( uiTempPartIdx ) > uiDepth ) ? 1 : 0 ) : 0;
// Get above split flag
#if DEPENDENT_SLICES
pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );
#else
pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
#endif
uiCtx += ( pcTempCU ) ? ( ( pcTempCU->getDepth( uiTempPartIdx ) > uiDepth ) ? 1 : 0 ) : 0;
return uiCtx;
}
現在已經找到解決辦法:
左邊:
PredModeL= pcCU->getCULeft()->getDepth(i);
上邊:
PredModeT=pcCU->getCUAbove()->getDepth(i);
左上:
PredModeLT=pcCU->getCUAboveLeft()->getDepth(i);
前一幀:
PredModeCo1=pcCU->getCUColocated((RefPicList)0)->getDepth(i);
注意:其中i表示某個LCU中第i個4x4塊,即該方式獲得是4x4塊的深度值,由於同一個CU內所有的4x4塊的深度值相等,因此某個CU的左上角4x4塊即可以表示整個CU的深度。