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_confWinLeft; |
---|
38 | Int m_confWinRight; |
---|
39 | Int m_confWinTop; |
---|
40 | Int m_confWinBottom; |
---|
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 | Int m_maxTidIlRefPicsPlus1; |
---|
83 | Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
84 | |
---|
85 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
86 | char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
87 | Int* m_aidQP; ///< array of slice QP values |
---|
88 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
89 | Int m_numScaledRefLayerOffsets ; |
---|
90 | #if O0098_SCALED_REF_LAYER_ID |
---|
91 | Int m_scaledRefLayerId [MAX_LAYERS]; |
---|
92 | #endif |
---|
93 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
94 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
95 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
96 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
97 | #if REF_REGION_OFFSET |
---|
98 | Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; |
---|
99 | Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; |
---|
100 | Int m_refRegionLeftOffset [MAX_LAYERS]; |
---|
101 | Int m_refRegionTopOffset [MAX_LAYERS]; |
---|
102 | Int m_refRegionRightOffset [MAX_LAYERS]; |
---|
103 | Int m_refRegionBottomOffset[MAX_LAYERS]; |
---|
104 | #endif |
---|
105 | #if P0312_VERT_PHASE_ADJ |
---|
106 | Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; |
---|
107 | #endif |
---|
108 | #if R0209_GENERIC_PHASE |
---|
109 | Int m_phaseHorLuma [MAX_LAYERS]; |
---|
110 | Int m_phaseVerLuma [MAX_LAYERS]; |
---|
111 | Int m_phaseHorChroma[MAX_LAYERS]; |
---|
112 | Int m_phaseVerChroma[MAX_LAYERS]; |
---|
113 | Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; |
---|
114 | #endif |
---|
115 | |
---|
116 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
117 | Int m_inputBitDepthY; ///< bit-depth of input file (luma component) |
---|
118 | Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) |
---|
119 | Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) |
---|
120 | Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) |
---|
121 | Int m_outputBitDepthY; ///< bit-depth of output file (luma component) |
---|
122 | Int m_outputBitDepthC; ///< bit-depth of output file (chroma component) |
---|
123 | #endif |
---|
124 | #if REPN_FORMAT_IN_VPS |
---|
125 | Int m_repFormatIdx; |
---|
126 | #endif |
---|
127 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
128 | string m_colourRemapSEIFile; ///< Colour Remapping Information SEI message parameters file |
---|
129 | Int m_colourRemapSEIId; |
---|
130 | Bool m_colourRemapSEICancelFlag; |
---|
131 | Bool m_colourRemapSEIPersistenceFlag; |
---|
132 | Bool m_colourRemapSEIVideoSignalInfoPresentFlag; |
---|
133 | Bool m_colourRemapSEIFullRangeFlag; |
---|
134 | Int m_colourRemapSEIPrimaries; |
---|
135 | Int m_colourRemapSEITransferFunction; |
---|
136 | Int m_colourRemapSEIMatrixCoefficients; |
---|
137 | Int m_colourRemapSEIInputBitDepth; |
---|
138 | Int m_colourRemapSEIBitDepth; |
---|
139 | Int m_colourRemapSEIPreLutNumValMinus1[3]; |
---|
140 | Int* m_colourRemapSEIPreLutCodedValue[3]; |
---|
141 | Int* m_colourRemapSEIPreLutTargetValue[3]; |
---|
142 | Bool m_colourRemapSEIMatrixPresentFlag; |
---|
143 | Int m_colourRemapSEILog2MatrixDenom; |
---|
144 | Int m_colourRemapSEICoeffs[3][3]; |
---|
145 | Int m_colourRemapSEIPostLutNumValMinus1[3]; |
---|
146 | Int* m_colourRemapSEIPostLutCodedValue[3]; |
---|
147 | Int* m_colourRemapSEIPostLutTargetValue[3]; |
---|
148 | #endif |
---|
149 | public: |
---|
150 | TAppEncLayerCfg(); |
---|
151 | virtual ~TAppEncLayerCfg(); |
---|
152 | |
---|
153 | public: |
---|
154 | Void create (); ///< create option handling class |
---|
155 | Void destroy (); ///< destroy option handling class |
---|
156 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
157 | |
---|
158 | Void xPrintParameter(); |
---|
159 | Bool xCheckParameter( Bool isField ); |
---|
160 | |
---|
161 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
162 | |
---|
163 | string getInputFile() {return m_cInputFile; } |
---|
164 | string getReconFile() {return m_cReconFile; } |
---|
165 | Int getFrameRate() {return m_iFrameRate; } |
---|
166 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
167 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
168 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
169 | Int getConformanceMode() { return m_conformanceMode; } |
---|
170 | Int* getPad() {return m_aiPad; } |
---|
171 | Double getFloatQP() {return m_fQP; } |
---|
172 | Int getConfWinLeft() {return m_confWinLeft; } |
---|
173 | Int getConfWinRight() {return m_confWinRight; } |
---|
174 | Int getConfWinTop() {return m_confWinTop; } |
---|
175 | Int getConfWinBottom() {return m_confWinBottom; } |
---|
176 | #if AUXILIARY_PICTURES |
---|
177 | ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} |
---|
178 | ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } |
---|
179 | Int getAuxId() {return m_auxId; } |
---|
180 | #endif |
---|
181 | |
---|
182 | Int getIntQP() {return m_iQP; } |
---|
183 | Int* getdQPs() {return m_aidQP; } |
---|
184 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
185 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
186 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
187 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
188 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
189 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
190 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
191 | |
---|
192 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
193 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
194 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
195 | #endif |
---|
196 | #if RC_SHVC_HARMONIZATION |
---|
197 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
198 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
199 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
200 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
201 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
202 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
203 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
204 | #endif |
---|
205 | #if REPN_FORMAT_IN_VPS |
---|
206 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
207 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
208 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
209 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
210 | #endif |
---|
211 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
212 | #if LAYER_CTB |
---|
213 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
214 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
215 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
216 | #endif |
---|
217 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
218 | |
---|
219 | #endif //SVC_EXTENSION |
---|
220 | |
---|
221 | //! \} |
---|
222 | |
---|
223 | #endif // __TAPPENCLAYERCFG__ |
---|