首先进入编码encmain.cpp里的int main 函数,主函数的入口,里面包含的重要函数是时间计数函数和encode()函数。
在encode函数中开始编码。encode函数中,首先输入YUV序列,初始化内部类和成员变量,转换色彩空间,创建原始的YUV缓冲区,读取YUV文件,然后开始编码每一帧。最后删除原始YUV缓冲区及使用的类,打印总的码率。里面包含的重要函数是TEncTop::encode()。
在encode函数中,重要函数是compressGOP()。
compressGOP 中重要函数是predcompressSlice()和compressSlice().
compressSlice()中重要函数是compressCTU()。
compressCTU()中重要函数是xcompressCU().
xcompressCU()包含的重要函数是xComputeQP()、xCheckRDCostInter(),xCheckRDCostMerge2Nx2N()、xCheckRDCostIntra()、xCheckIntraPCM()、 xCheckBestMode()。
在xCheckRDCostInter()中重要函数是xCheckBestMode()用于检验是否是CU最优深度,以及predInterSearch()主要进行ME和MC。
predInterSearch()中重要函数是xEstimateMvPredAMVP()、 xMotionEstimation ()、xCheckBestMVP()、motionCompensation()、xMergeEstimation()、setWpScalingDistParam()。
xMotionEstimation ()中重要函数 xPatternSearch ()全搜索、xPatternSearchFast()快速搜索、xSetSearchRange()。
xPatternSearchFast()中重要函数 xTZSearch()、xTZSearchSelective()。
xTZSearch()中重要函数是xTZSearchHelp()、xTZ8PointDiamondSearch() 、 xTZ8PointSquareSearch()。
xEstimateMvPredAMVP()中重要函数是fillMvpCand()。
在xCheckRDCostMerge2Nx2N重要函数是motionCompensation()和encodeResAndCalcRdInterCU(),以及最重要的函数getInterMergeCandidates(),xCheckBestMode()。
xCheckRDCostIntra()中重要函数是estIntraPredLumaQT()、estIntraPredChromaQT()、xCheckBestMode()。
estIntraPredLumaQT()中重要函数是 predIntraAng()。
predIntraAng()中重要函数xPredIntraPlanar()、xPredIntraAng()。