1 | |
---|
2 | /** \file TAppEncLayerCfg.h |
---|
3 | \brief Handle encoder layer configuration parameters (header) |
---|
4 | */ |
---|
5 | #ifndef __TAPPENCLAYERCFG__ |
---|
6 | #define __TAPPENCLAYERCFG__ |
---|
7 | |
---|
8 | #if SVC_EXTENSION |
---|
9 | #include "TLibCommon/CommonDef.h" |
---|
10 | #include "TLibEncoder/TEncCfg.h" |
---|
11 | #include <sstream> |
---|
12 | |
---|
13 | using namespace std; |
---|
14 | class TAppEncCfg; |
---|
15 | //! \ingroup TAppEncoder |
---|
16 | //! \{ |
---|
17 | |
---|
18 | // ==================================================================================================================== |
---|
19 | // Class definition |
---|
20 | // ==================================================================================================================== |
---|
21 | |
---|
22 | /// encoder layer configuration class |
---|
23 | class TAppEncLayerCfg |
---|
24 | { |
---|
25 | friend class TAppEncCfg; |
---|
26 | friend class TAppEncTop; |
---|
27 | protected: |
---|
28 | // file I/O0 |
---|
29 | string m_cInputFile; ///< source file name |
---|
30 | string m_cReconFile; ///< output reconstruction file |
---|
31 | |
---|
32 | Int m_iFrameRate; ///< source frame-rates (Hz) |
---|
33 | Int m_iSourceWidth; ///< source width in pixel |
---|
34 | Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) |
---|
35 | Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) |
---|
36 | Int m_conformanceMode; |
---|
37 | Int m_confLeft; |
---|
38 | Int m_confRight; |
---|
39 | Int m_confTop; |
---|
40 | Int m_confBottom; |
---|
41 | Int m_aiPad[2]; ///< number of padded pixels for width and height |
---|
42 | Int m_iIntraPeriod; ///< period of I-slice (random access period) |
---|
43 | Double m_fQP; ///< QP value of key-picture (floating point) |
---|
44 | #if AUXILIARY_PICTURES |
---|
45 | ChromaFormat m_chromaFormatIDC; |
---|
46 | ChromaFormat m_InputChromaFormat; |
---|
47 | Int m_auxId; |
---|
48 | #endif |
---|
49 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
50 | Int *m_samplePredRefLayerIds; |
---|
51 | Int m_numSamplePredRefLayers; |
---|
52 | Int *m_motionPredRefLayerIds; |
---|
53 | Int m_numMotionPredRefLayers; |
---|
54 | Int *m_predLayerIds; |
---|
55 | Int m_numActiveRefLayers; |
---|
56 | #endif |
---|
57 | |
---|
58 | #if LAYER_CTB |
---|
59 | // coding unit (CU) definition |
---|
60 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
61 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
62 | UInt m_uiMaxCUDepth; ///< max. CU depth |
---|
63 | |
---|
64 | // transfom unit (TU) definition |
---|
65 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
66 | UInt m_uiQuadtreeTULog2MinSize; |
---|
67 | |
---|
68 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
69 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
70 | #endif |
---|
71 | |
---|
72 | #if RC_SHVC_HARMONIZATION |
---|
73 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
74 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
75 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
76 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
77 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
78 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
79 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
80 | #endif |
---|
81 | |
---|
82 | #if N0120_MAX_TID_REF_CFG |
---|
83 | Int m_maxTidIlRefPicsPlus1; |
---|
84 | #endif |
---|
85 | Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
86 | |
---|
87 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
88 | char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
89 | Int* m_aidQP; ///< array of slice QP values |
---|
90 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
91 | Int m_numScaledRefLayerOffsets ; |
---|
92 | #if O0098_SCALED_REF_LAYER_ID |
---|
93 | Int m_scaledRefLayerId [MAX_LAYERS]; |
---|
94 | #endif |
---|
95 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
96 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
97 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
98 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
99 | #if P0312_VERT_PHASE_ADJ |
---|
100 | Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; |
---|
101 | #endif |
---|
102 | |
---|
103 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
104 | Int m_inputBitDepthY; ///< bit-depth of input file (luma component) |
---|
105 | Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) |
---|
106 | Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) |
---|
107 | Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) |
---|
108 | Int m_outputBitDepthY; ///< bit-depth of output file (luma component) |
---|
109 | Int m_outputBitDepthC; ///< bit-depth of output file (chroma component) |
---|
110 | #endif |
---|
111 | #if REPN_FORMAT_IN_VPS |
---|
112 | Int m_repFormatIdx; |
---|
113 | #endif |
---|
114 | public: |
---|
115 | TAppEncLayerCfg(); |
---|
116 | virtual ~TAppEncLayerCfg(); |
---|
117 | |
---|
118 | public: |
---|
119 | Void create (); ///< create option handling class |
---|
120 | Void destroy (); ///< destroy option handling class |
---|
121 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
122 | |
---|
123 | #if AVC_SYNTAX |
---|
124 | Void xPrintParameter( UInt layerId ); |
---|
125 | #else |
---|
126 | Void xPrintParameter(); |
---|
127 | #endif |
---|
128 | Bool xCheckParameter( Bool isField ); |
---|
129 | |
---|
130 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
131 | |
---|
132 | string getInputFile() {return m_cInputFile; } |
---|
133 | string getReconFile() {return m_cReconFile; } |
---|
134 | Int getFrameRate() {return m_iFrameRate; } |
---|
135 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
136 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
137 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
138 | Int getConformanceMode() { return m_conformanceMode; } |
---|
139 | Int* getPad() {return m_aiPad; } |
---|
140 | Double getFloatQP() {return m_fQP; } |
---|
141 | Int getConfLeft() {return m_confLeft; } |
---|
142 | Int getConfRight() {return m_confRight; } |
---|
143 | Int getConfTop() {return m_confTop; } |
---|
144 | Int getConfBottom() {return m_confBottom; } |
---|
145 | #if AUXILIARY_PICTURES |
---|
146 | ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} |
---|
147 | ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } |
---|
148 | Int getAuxId() {return m_auxId; } |
---|
149 | #endif |
---|
150 | |
---|
151 | Int getIntQP() {return m_iQP; } |
---|
152 | Int* getdQPs() {return m_aidQP; } |
---|
153 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
154 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
155 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
156 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
157 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
158 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
159 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
160 | |
---|
161 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
162 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
163 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
164 | #endif |
---|
165 | #if RC_SHVC_HARMONIZATION |
---|
166 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
167 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
168 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
169 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
170 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
171 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
172 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
173 | #endif |
---|
174 | #if REPN_FORMAT_IN_VPS |
---|
175 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
176 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
177 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
178 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
179 | #endif |
---|
180 | #if N0120_MAX_TID_REF_CFG |
---|
181 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
182 | #endif |
---|
183 | #if LAYER_CTB |
---|
184 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
185 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
186 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
187 | #endif |
---|
188 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
189 | |
---|
190 | #endif //SVC_EXTENSION |
---|
191 | |
---|
192 | //! \} |
---|
193 | |
---|
194 | #endif // __TAPPENCLAYERCFG__ |
---|