VVC/JEM代码学习7: xIntraCodingTUBlock

      总结一下,xIntraCodingTUBlock()这个函数里面进行了多个过程,包括预测值的计算,残差信号的计算,变换和量化,反变换和反量化,重建信号,更新失真。其中,在进行预测值计算时分成两种情况,一种是使用CCLM进行色度预测--

                                      

       一种是使用传统的角度模式进行预测,特别的,如果是Cr分量,还要加上一个Cb的残差值才得到Cr的最终预测值--

                     

     

 xIntraCodingTUBlock()

      {

        //===== init availability pattern =====

           初始化一些参数;



        //===== get prediction signal ,计算预测值=====

         if(uiChFinalMode == 67 || IsLMMode(uiChFinalMode) )  //如果是CCLM模式(67,68,69,70,71,72)

             predLMIntraChroma();//则用亮度分量预测色度分量;

         else   //不使用CCLM预测

           {

              predIntraAng();//使用传统的角度预测模式计算色度的初始预测值;

              if( compID == COMPONENT_Cr && pcCU->getSlice()->getSPS()->getUseLMChroma() )//如果该分量是Cr分量

                 addCrossColorResi();//再在初始预测值的基础上加上Cb的残差得到最终的Cr预测值;

           }



         //===== get residual signal ,计算残差信号=====

          for( UInt uiY = 0; uiY < uiHeight; uiY++ )
            {
              for( UInt uiX = 0; uiX < uiWidth; uiX++ )
              {
                pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];//残差信号就等于原始值减去预测值;
               }

            }

         if (pcCU->getSlice()->getPPS()->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag())
         {//不太清楚这个函数要实现什么目的???

            if (bUseCrossCPrediction)

                     crossComponentPrediction();

           else if(isLuma(compID) && !bUseReconstructedResidualForEstimate)

                     xStoreCrossComponentPredictionResult();

          }



        //===== transform and quantization ,变换和量化=====

               m_pcTrQuant->transformNxN ();

               m_pcTrQuant->invTransformNxN(); 

 

       //===== reconstruction,重建 =====

        if (pcCU->getSlice()->getPPS()->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag())
         {

            if (bUseCrossCPrediction)

                     crossComponentPrediction();

           else if(isLuma(compID) && !bUseReconstructedResidualForEstimate)

                     xStoreCrossComponentPredictionResult();

          }

         for( UInt uiY = 0; uiY < uiHeight; uiY++ )
         {
             for( UInt uiX = 0; uiX < uiWidth; uiX++ )
             {

                  pReco[ uiX ] = Pel(ClipA( Int(pPred[uiX]) + Int(pResi[uiX]),  compID ));//重建值等于预测值加残差;

             }

          }



        //===== update distortion ,更新失真=====

          ruiDist += m_pcRdCost->getDistPart();

}

你可能感兴趣的:(JEM)