HEVC official software HM source code simple analysis-Decoder tappdecoder

Source: Internet
Author: User

This document records the source code structure of the HEVC official reference software HM. HM compared to JM, the object-oriented programming method is adopted, so the structure is relatively clearer. HM contains the video decoder Tappdecoder and the video encoder Tappencoder. This document records the structure of the video decoder Tappdecoder.


Function call graph

The function call diagram for the HEVC video decoder Tappdecoder in HM is shown below.


Click to see a larger image

The following explains the meaning of a key marker.


function background Color

The function is shown as a box in the diagram. Different background colors mark the different functions of the function:
function on white background: normal inner function.
Pink background function: analytic function (Parser). These functions are used to parse information such as SPS, PPS, and so on.
function of the purple background: Entropy decoding function (Entropy decoding). These functions read the bitstream data and perform CABAC entropy decoding.
Function of the green background: decoding function (Decode). These functions decode CU compressed data through intra-frame prediction, inter-frame prediction, and DCT inverse transformation.

function of the yellow background: loop filter function (loops filter). These functions filter the decoded data to remove the block effect and the ringing effect.


Arrow Line
The Arrow line flags the function's call relationship:
Black Arrow Line: an indiscriminate call relationship.
Pink Arrow Line: The call relationship between analytic functions (Parser).
Purple Arrow Line: The call relationship between the Entropy decoding function (Entropy decoding).
Green Arrow Line: The call relationship between decoding functions (Decode).
Yellow Arrow Line: The call relationship between loop filter function (loop filter).

The file where the function resides

Each function identifies the file path in which it resides.


Several key sections in the chart are documented below.

Ordinary intrinsic functions refer to functions that are not yet classified in Tappdecoder. For example:
The decoder's main () function calls the Tappdectop class related to the Create (), parsecfg (), Decode (), Destroy (), and other methods.
Decoder's main decoding function: Decode () in Tdectop, Xdecodeslice (), Decompressslice in Tdecgop (), Tdecslice in Decompressslice (), etc.

analytic functions (Parser)Analytic functions (Parser) are used to parse some information in the HEVC stream (e.g., SPS, PPS, etc.). These parsing functions are called in Tdectop's decode () to complete the parsing. Here are some examples of analytic functions.
Xdecodevps (): Analytic VPS;
Xdecodesps (): Analysis of SPS;
Xdecodepps (): Analytic pps;

entropy decoding function (Entropy decoding)The Entropy decoding function (Entropy decoding) reads the bitstream data and Cabac entropy decoding. The entropy decoding work is done in TDECCU's decodectu () function. Where recursive invocation of XDECODECU () completed the specific entropy decoding work.

decoding function (Decode)The decoding function (Decode) decodes CU compressed data through intra-frame prediction, inter-frame prediction and other methods. The decoding work is done in TDECCU's decompressctu () function. Where recursive invocation of Xdecompresscu () completes the specific decoding work.
Xdecompresscu () calls XRECONINTRAQT () to complete the decoding of the predicted CU within the frame, and Xreconinter () completes the decoding of the predicted CU between frames.
XRECONINTRAQT () calls XINTRARECQT (), and XINTRARECQT () calls Xintrarecblk (). XINTRARECBLK () calls the Predintraang () of the Tcomprediction class to complete the work of the intra-frame prediction, and the INVTRANSFORMNXN () of the Tcomtrquant class is called to complete the work of the residual data DCT inverse transformation.
Xreconinter () calls Tcomprediction's Motioncompensation () to complete the work of motion compensation, and calls Xdecodeintertexture () to complete the DCT inverse transformation of the residual data. Motioncompensation () calls Xpredinteruni () to complete the motion compensation of the one-way prediction, while the call Xpredinterbi () completes the motion compensation of the bidirectional prediction. where Xpredinteruni () calls XPREDINTERBLK () to complete the motion compensation of a component block, and XPREDINTERBLK () invokes the Filterhor () of the Tcominterpolationfilter class and Filterver () completed the interpolation of sub-pixel work.
Xdecodeintertexture () calls the INVRECURTRANSFORMNXN () of the Tcomtrquant class, and Invrecurtransformnxn () calls Invtransformnxn (). INVTRANSFORMNXN () calls Xdequant () to complete the work of the inverse quantization, calling the XIT () to complete the work of the DCT inverse transformation. XIT () calls XITRMXN () to complete the DCT inverse of the MXN, and XITRMXN () calls PartialButterflyInverse4 (), PartialButterflyInverse8, depending on the dimensions of the DCT matrix, respectively. (), PartialButterflyInverse16 (), partialButterflyInverse32 () several butterfly-shaped algorithms.

Loop Filter function (loops filter)The Loop filter function filters the decoded data to remove the block effect and ringing effect. The de-block effect filter is done in the Tdectop executeloopfilters (). Executeloopfilters () called Tdecgop's Filterpicture (). Filterpicture () calls the Loopfilterpic () of the Tcomloopfilter class to complete the work of the de-block effect filter; Call Saoprocess of the Tcomsampleadaptiveoffset class () The work of the Sao filter to remove the ringing effect is completed.




Lei Huawei
[Email protected]
http://blog.csdn.net/leixiaohua1020



HEVC official software HM source code simple analysis-Decoder tappdecoder

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.