1 | |
---|
2 | |
---|
3 | #include <list> |
---|
4 | #include <stdio.h> |
---|
5 | #include <fcntl.h> |
---|
6 | #include <assert.h> |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | #ifndef __TAppRENDERERCFG__ |
---|
11 | #define __TAppRENDERERCFG__ |
---|
12 | |
---|
13 | #include "../TAppCommon/TAppComCamPara.h" |
---|
14 | #include "../../Lib/TLibCommon/CommonDef.h" |
---|
15 | #include "../../Lib/TLibCommon/TComMVDRefData.h" |
---|
16 | #include "../../Lib/TLibRenderer/TRenModel.h" |
---|
17 | #include "../../Lib/TLibRenderer/TRenModSetupStrParser.h" |
---|
18 | #include <string> |
---|
19 | #include <vector> |
---|
20 | |
---|
21 | // ==================================================================================================================== |
---|
22 | // Class definition |
---|
23 | // ==================================================================================================================== |
---|
24 | |
---|
25 | /// encoder configuration class |
---|
26 | class TAppRendererCfg |
---|
27 | { |
---|
28 | protected: |
---|
29 | |
---|
30 | //// file I/O //// |
---|
31 | Char* m_pchVideoInputFileBaseName; ///< input video file base name, placeholder for numbering $$ |
---|
32 | Char* m_pchDepthInputFileBaseName; ///< input depth file base name, placeholder for numbering $$ |
---|
33 | Char* m_pchSynthOutputFileBaseName; ///< output synth file base name, placeholder for numbering $$ |
---|
34 | Bool m_bContOutputFileNumbering; ///< use continous numbering instead of view numbering |
---|
35 | Bool m_bSweep; ///< 1: Store view range in file |
---|
36 | |
---|
37 | // derived |
---|
38 | std::vector<Char*> m_pchVideoInputFileList; ///< source file names |
---|
39 | std::vector<Char*> m_pchDepthInputFileList; ///< source depth file names |
---|
40 | std::vector<Char*> m_pchSynthOutputFileList; ///< output reconstruction file names |
---|
41 | |
---|
42 | //// source specification //// |
---|
43 | Int m_iSourceWidth; ///< source width in pixel |
---|
44 | Int m_iSourceHeight; ///< source height in pixel |
---|
45 | Int m_iFrameSkip; ///< number of skipped frames from the beginning |
---|
46 | Int m_iFramesToBeRendered; ///< number of rendered frames |
---|
47 | |
---|
48 | ////camera specification //// |
---|
49 | Char* m_pchCameraParameterFile; ///< camera parameter file |
---|
50 | Char* m_pchSynthViewCameraNumbers; ///< numbers of views to synthesize |
---|
51 | Char* m_pchViewConfig; ///< String to setup renderer |
---|
52 | Char* m_pchBaseViewCameraNumbers; ///< numbers of base views |
---|
53 | |
---|
54 | // derived |
---|
55 | TAppComCamPara m_cCameraData; ///< class to store camera parameters |
---|
56 | TRenModSetupStrParser m_cRenModStrParser; ///< class to manage View to be rendered |
---|
57 | Bool m_bUseSetupString; ///< true if setup string is used |
---|
58 | |
---|
59 | Int m_iNumberOfInputViews; ///< number of input Views |
---|
60 | Int m_iNumberOfOutputViews; ///< number views to synthesize |
---|
61 | |
---|
62 | //// renderer Modes //// |
---|
63 | Int m_iRenderDirection; ///< 0: interpolate, 1: extrapolate from left, 2: extrapolate from right |
---|
64 | |
---|
65 | Int m_iLog2SamplingFactor; ///< factor for horizontal upsampling before processing |
---|
66 | Bool m_bUVUp; ///< upsampling of chroma planes before processing |
---|
67 | Int m_iPreProcMode; ///< depth pre-processing: 0 = none, 1 = binominal filtering |
---|
68 | Int m_iPreFilterSize; ///< for PreProcMode = 1: size of filter kernel |
---|
69 | Bool m_bSimEnhance; ///< Similarity enhancement before blending |
---|
70 | Int m_iBlendMode; ///< merging of left and right image: 0 = average, 1 = only holes from right, 2 = only holes from left |
---|
71 | Int m_iBlendZThresPerc; ///< z-difference threshold for blending in percent of total z-range |
---|
72 | Bool m_bBlendUseDistWeight; ///< 0: blend using average; 1: blend factor depends on view distance |
---|
73 | Int m_iBlendHoleMargin; ///< Margin around boundaries |
---|
74 | Bool m_bTempDepthFilter; ///< Zheijang temporal enhancement filter |
---|
75 | Int m_iInterpolationMode; ///< 0: NN, 1: linear, 2: cspline |
---|
76 | Int m_iHoleFillingMode; ///< 0: none, 1: line wise background extension |
---|
77 | Int m_iPostProcMode; ///< 0: none, 1: horizontal 3-tap median |
---|
78 | Int m_iRenderMode; ///< 0: use renderer |
---|
79 | Int m_iShiftPrecision; ///< Precision used for Interpolation Mode 4 |
---|
80 | Int m_iUsedPelMapMarExt; ///< Used Pel map extra margin |
---|
81 | |
---|
82 | Void xCheckParameter (); ///< check validity of configuration values |
---|
83 | Void xPrintParameter (); ///< print configuration values |
---|
84 | Void xPrintUsage (); ///< print usage |
---|
85 | Void xSetGlobal(); |
---|
86 | |
---|
87 | Void xCreateFileNames(); |
---|
88 | Void xGetMaxPrecision( std::vector< Int > adIn, Int& iPrecBefore, Int& iPrecAfter ); |
---|
89 | Void xAddNumberToFileName( Char* pchSourceFileName, Char*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter ); |
---|
90 | public: |
---|
91 | TAppRendererCfg(); |
---|
92 | virtual ~TAppRendererCfg(); |
---|
93 | |
---|
94 | public: |
---|
95 | Void create (); ///< create option handling class |
---|
96 | Void destroy (); ///< destroy option handling class |
---|
97 | Bool parseCfg ( Int argc, Char* argv[] ); ///< parse configuration file to fill member variables |
---|
98 | Bool xConfirmParameter(Bool bflag, const Char* message); |
---|
99 | |
---|
100 | |
---|
101 | };// END CLASS DEFINITION TAppRendererCfg |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | #endif // __TAppRENDERERCFG__ |
---|
106 | |
---|