HEVC Test Model (HM)  HM-16.3
encmain.cpp
Go to the documentation of this file.
1 /* The copyright in this software is being made available under the BSD
2  * License, included below. This software may be subject to other third party
3  * and contributor rights, including patent rights, and no such rights are
4  * granted under this license.
5  *
6  * Copyright (c) 2010-2015, ITU/ISO/IEC
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18  * be used to endorse or promote products derived from this software without
19  * specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31  * THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
38 #include <time.h>
39 #include <iostream>
40 #include "TAppEncTop.h"
42 
45 
46 #include "../Lib/TLibCommon/Debug.h"
47 
48 // ====================================================================================================================
49 // Main function
50 // ====================================================================================================================
51 
52 int main(int argc, char* argv[])
53 {
54  TAppEncTop cTAppEncTop;
55 
56  // print information
57  fprintf( stdout, "\n" );
58  fprintf( stdout, "HM software: Encoder Version [%s] (including RExt)", NV_VERSION );
59  fprintf( stdout, NVM_ONOS );
60  fprintf( stdout, NVM_COMPILEDBY );
61  fprintf( stdout, NVM_BITS );
62  fprintf( stdout, "\n\n" );
63 
64  // create application encoder class
65  cTAppEncTop.create();
66 
67  // parse configuration
68  try
69  {
70  if(!cTAppEncTop.parseCfg( argc, argv ))
71  {
72  cTAppEncTop.destroy();
73 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
75 #endif
76  return 1;
77  }
78  }
80  {
81  std::cerr << "Error parsing option \""<< e.arg <<"\" with argument \""<< e.val <<"\"." << std::endl;
82  return 1;
83  }
84 
85 #if PRINT_MACRO_VALUES
87 #endif
88 
89 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
91 #endif
92 
93  // starting time
94  Double dResult;
95  clock_t lBefore = clock();
96 
97  // call encoding function
98  cTAppEncTop.encode();
99 
100  // ending time
101  dResult = (Double)(clock()-lBefore) / CLOCKS_PER_SEC;
102  printf("\n Total Time: %12.3f sec.\n", dResult);
103 
104  // destroy application encoder class
105  cTAppEncTop.destroy();
106 
107  return 0;
108 }
109 
Void create()
create option handling class
Definition: TAppEncCfg.cpp:145
Encoder application class (header)
Void printMacroSettings()
Definition: Debug.cpp:167
int main(int argc, char *argv[])
Definition: encmain.cpp:52
Bool parseCfg(Int argc, Char *argv[])
parse configuration file to fill member variables
Definition: TAppEncCfg.cpp:638
#define NVM_BITS
used for checking 64-bit O/S
Definition: CommonDef.h:97
static Void printEnvVar()
Definition: Debug.cpp:96
#define NVM_ONOS
Definition: CommonDef.h:94
encoder application class
Definition: TAppEncTop.h:57
#define NVM_COMPILEDBY
Definition: CommonDef.h:82
static Void printEnvVarInUse()
Definition: Debug.cpp:107
Void destroy()
destroy option handling class
Definition: TAppEncCfg.cpp:149
Void encode()
main encoding function
Definition: TAppEncTop.cpp:406
#define NV_VERSION
Current software version.
Definition: CommonDef.h:60
double Double
Definition: TypeDef.h:298