HM Coding Architecture

First enter the int main function in the encoding encmain.cpp, the entrance of the main function, the important functions contained in it are the time counting function and the encode() function.

Start encoding in the encode function. In the encode function, first input the YUV sequence, initialize the inner class and member variables, convert the color space, create the original YUV buffer, read the YUV file, and then start encoding each frame. Finally, delete the original YUV buffer and the used class, and print the total code rate. The important function contained in it is TEncTop::encode.

In the encode function, the file is initialized, the buffer area is calculated, and the GOP is compressed after calculating the image features. The important function is compressGOP().

The important functions in compressGOP are predcompressSlice() and compressSlice().

The important function in compressSlice() is compressCTU().

The important function in compressCTU() is xcompressCU().

xcompressCU() encodes each CU. First, initialize and calculate parameters. Then do inter prediction and intra prediction. The important function included is xComputeQP(), which is used to calculate QP, and other important functions are not included in this function. In inter-frame prediction, the important function is xCheckRDCostInter(), the important functions inside are xCheckRDCostInter and xCheckRDCostMerge2Nx2N, and the important function in xCheckRDCostInter is xCheckBestMode() to check whether it is the optimal depth of CU. The important functions in xCheckRDCostMerge2Nx2N are motionCompensation() and encodeResAndCalcRdInterCU, and the most important functions getInterMergeCandidates(), xCheckBestMode

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324853638&siteId=291194637