/** initialize prediction data with enabling sub-LCU-level delta QP*\param uiDepth depth of the current CU*\param qp qp for the current CU*- set CU width and CU height according to depth*- set qp value according to input qp *- set last-coded qp value according to input last-coded qp */Void TComDataCU::initEstData( UInt uiDepth, Int qp ){ m_dTotalCost = MAX_DOUBLE;//double 類型成員函數 總的分割代價sum of partition RD costs m_uiTotalDistortion = 0; //無符號int 類型變數 總的分割失真sum of partition distortion m_uiTotalBits = 0; //sum of partition bits bits是編碼後的位元數 m_uiTotalBins = 0; //sum of partition bins bin是句法元素的二進位位元 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; UChar uhHeight = g_uiMaxCUHeight >> uiDepth; for (UInt ui = 0; ui < m_uiNumPartition; ui++)//64x64/4x4=256 { if(getPic()->getPicSym()->getInverseCUOrderMap(getAddr())*m_pcPic->getNumPartInCU()+m_uiAbsIdxInLCU+ui >= getSlice()->getSliceSegmentCurStartCUAddr()) { //Char* m_apiMVPIdx[2]; ///< array of motion vector predictor candidates //Char* m_apiMVPNum[2]; ///< array of number of possible motion vectors predictors單向預測和雙向預測 m_apiMVPIdx[0][ui] = -1; m_apiMVPIdx[1][ui] = -1; m_apiMVPNum[0][ui] = -1; m_apiMVPNum[1][ui] = -1; m_puhDepth [ui] = uiDepth; m_puhWidth [ui] = uhWidth; m_puhHeight [ui] = uhHeight; m_puhTrIdx [ui] = 0; //UChar* m_puhTransformSkip[3];///< array of transform skipping flags m_puhTransformSkip[0][ui] = 0;//QP for Y m_puhTransformSkip[1][ui] = 0;//QP forCb m_puhTransformSkip[2][ui] = 0;//QP forCr from JCTVC-L1003_v34.doc 8.6.2Scaling and transformation process m_skipFlag[ui] = false; m_pePartSize[ui] = SIZE_NONE; // SIZE_NONE=15 不支援幀內幀間分割模式 m_pePredMode[ui] = MODE_NONE; // MODE_NONE = 15 不是幀內幀間預測模式 m_CUTransquantBypass[ui] = false; m_pbIPCMFlag[ui] = 0; m_phQP[ui] = qp; m_pbMergeFlag[ui] = 0; m_puhMergeIndex[ui] = 0; m_puhLumaIntraDir[ui] = DC_IDX;//#define DC_IDX 1 //index for intra DC mode m_puhChromaIntraDir[ui] = 0; m_puhInterDir[ui] = 0; //UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) m_puhCbf[0][ui] = 0; m_puhCbf[1][ui] = 0; m_puhCbf[2][ui] = 0; } } UInt uiTmp = uhWidth*uhHeight; if(getPic()->getPicSym()->getInverseCUOrderMap(getAddr())*m_pcPic->getNumPartInCU()+m_uiAbsIdxInLCU >= getSlice()->getSliceSegmentCurStartCUAddr()) { m_acCUMvField[0].clearMvField(); m_acCUMvField[1].clearMvField(); uiTmp = uhWidth*uhHeight; //亮度採樣係數緩衝器 3種 memset( m_pcTrCoeffY, 0, uiTmp * sizeof( *m_pcTrCoeffY ) );#if ADAPTIVE_QP_SELECTION memset( m_pcArlCoeffY , 0, uiTmp * sizeof( *m_pcArlCoeffY ) );#endif memset( m_pcIPCMSampleY, 0, uiTmp * sizeof( *m_pcIPCMSampleY ) );//色度採樣系統緩衝器 3種 uiTmp>>=2;//除以4,對於色度長寬各減半//Tr:transformed變換後的 memset( m_pcTrCoeffCb, 0, uiTmp * sizeof( *m_pcTrCoeffCb ) ); memset( m_pcTrCoeffCr, 0, uiTmp * sizeof( *m_pcTrCoeffCr ) );#if ADAPTIVE_QP_SELECTION //採用自適應QP選擇 ARL:Adaptive Reconstruction Level memset( m_pcArlCoeffCb, 0, uiTmp * sizeof( *m_pcArlCoeffCb ) ); memset( m_pcArlCoeffCr, 0, uiTmp * sizeof( *m_pcArlCoeffCr ) );#endif //採用PCM模式進行色度採樣 memset( m_pcIPCMSampleCb, 0, uiTmp * sizeof( *m_pcIPCMSampleCb ) ); memset( m_pcIPCMSampleCr, 0, uiTmp * sizeof( *m_pcIPCMSampleCr ) ); }}