"HEVC Learning and research" 1, the basic structure of HM-16.7 Encoder

Source: Internet
Author: User

The project name of the encoder in the entire HM solution is Tappencoder, and the entry point function is located in the Encmain.cpp file:

1 intMainintargcChar*argv[])2 {3 tappenctop ctappenctop;4 5   //Print Information6fprintf (stdout,"\ n" );7fprintf (stdout,"HM software:encoder Version [%s] (including REXT)", nv_version);8 fprintf (stdout, nvm_onos);9 fprintf (stdout, nvm_compiledby);Ten fprintf (stdout, nvm_bits); Onefprintf (stdout,"\ n" ); A  -   //Create application Encoder class - ctappenctop.create (); the  -   //Parse Configuration -   Try -   { +     if(!ctappenctop.parsecfg (argc, argv)) -     { + Ctappenctop.destroy (); A #ifEnvironment_variable_debug_and_test at Envvar::p rintenvvar (); - #endif -       return 1; -     } -   } -   Catch(DF::p rogram_options_lite::P arsefailure &e) in   { -Std::cerr <<"Error parsing option \ ""<< E.arg <<"\ "with argument \""<< E.val <<"\"."<<Std::endl; to     return 1; +   } -  the #ifPrint_macro_values * printmacrosettings (); $ #endifPanax Notoginseng  - #ifEnvironment_variable_debug_and_test the Envvar::p rintenvvarinuse (); + #endif A  the   //Starting Time + Double Dresult; -clock_t Lbefore =clock (); $  $   //Call encoding function - Ctappenctop.encode (); -  the   //Ending time -Dresult = (Double) (Clock ()-lbefore)/clocks_per_sec;Wuyiprintf"\ n Total time:%12.3f sec.\n", Dresult); the  -   //Destroy Application Encoder class Wu Ctappenctop.destroy (); -  About   return 0; $}
Main

Mainly include:
    1. The entry point function main () "creates the Ctappenctop class, parses the input configuration function, sets the time-dependent parameters"
    2. Ctappenctop.encode () "Initializes several objects used by the encoder, allocates YUV data caches, and loops through the YUV file"
    3. M_ctenctop.encode (...) "Call M_CGOPENCODER.COMPRESSGOP () to implement the actual encoding of a GOP"
    4. M_CGOPENCODER.COMPRESSGOP () "Call Initgop to set the parameters of the GOP; call M_pcsliceencoder->initencslice () to create encoded slice objects with information from SPS and PPS ; Call M_pcsliceencoder->compressslice (Pcpic) to encode a slice. 】
    5. M_pcsliceencoder->compressslice (Pcpic) "Sets the parameters of the encoding slice and processes each cu in slice"
    6. Tenccu::compresscu () "Encode a CU"

Each of these functions is called in the previous function to form a structure similar to a reverse call stack.

"HEVC Learning and research" 1, the basic structure of HM-16.7 Encoder

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.