3D-HEVC's official standard test software solution HM_VC10 has 11 projects, respectively, Tappcommon,tappdecoder,tappencoder,tappextractor,tapprender,tlibcommon, Tlibdecoder,tlibencoder,tlibextractor,tlibrender and Tlibvideoio. Among them, the Tappdecoder project has Decmain.cpp,tappdeccfg.cpp and TAppDecTop.cpp three CPP files, as well as TAppDecCfg.h and TAppDecTop.h two header files.
Here's a look at Decmain.cpp, which is the main function of the decoder application Tappdecoder.
#include <stdlib.h> #include <stdio.h> #include <time.h> #include "TAppDecTop.h" bool G_md5_mismatch = False < top level flag This indicates if there has been a decoding mismatch
As shown above, contains four header files, and defines a bool variable G_md5_mismatch, assigned to false, meaning that a high-level flag indicates whether there is a decoding mismatch.
Next enter the main function:
int main (int argc, char* argv[]) {tappdectop ctappdectop; Print information fprintf (stdout, "\ n"); #if h_mv fprintf (stdout, "3d-htm software:decoder Version [%s] based on H M Version [%s] ", Nv_version, hm_version); #else fprintf (stdout, "HM software:decoder Version [%s]", nv_version), #endif fprintf (stdout, Nvm_onos); fprintf (stdout, nvm_compiledby); fprintf (stdout, nvm_bits); fprintf (stdout, "\ n"); Create Application Decoder class ctappdectop.create (); Parse Configuration if (!ctappdectop.parsecfg (argc, argv)) {Ctappdectop.destroy (); return 1; }//Starting time double dresult; Long Lbefore = Clock (); Call decoding function Ctappdectop.decode (); if (g_md5_mismatch) {printf ("\n\n***error*** A decoding mismatch occured:signalled md5sum does not match\n"); }//Ending Time Dresult = (double) (clock ()-lbefore)/clocks_per_sec; printf ("\ n Total time:%12.3f sec.\n", Dresult); Destroy application Decoder class CtappdectoP.destroy (); Return G_md5_mismatch? exit_failure:exit_success;}
In the main function, first define a class of tappdectop called Ctappdectop (defined in TAppDecTop.h), and then use fprintf to output some information to the console. Where macro H_MV is defined in the TypeDef.h file in the Tlibcommon project.
Then use Ctappdectop.create () to create a decoder application class, and then use Ctappdectop.create (argc, argv) to determine whether the configuration resolution is complete, or if the end of the Ctappdectop.destroy () decoder application class.
Then define a double variable dresult and use the clock () function to calculate the starting and ending time. The middle calls the decoding function Ctappdectop.decode () in the TAppDecTop.cpp file and uses the previously defined g_md5_mismatch to determine whether the decoding is mismatch. Finally, you want to destroy the decoder application class and return the G_md5_mismatch.
3D-HEVC Decoder One