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 | #include <iomanip> |
---|
13 | |
---|
14 | using namespace std; |
---|
15 | class TAppEncCfg; |
---|
16 | //! \ingroup TAppEncoder |
---|
17 | //! \{ |
---|
18 | |
---|
19 | // ==================================================================================================================== |
---|
20 | // Class definition |
---|
21 | // ==================================================================================================================== |
---|
22 | |
---|
23 | /// encoder layer configuration class |
---|
24 | class TAppEncLayerCfg |
---|
25 | { |
---|
26 | friend class TAppEncCfg; |
---|
27 | friend class TAppEncTop; |
---|
28 | protected: |
---|
29 | // file I/O0 |
---|
30 | string m_inputFileName; ///< source file name |
---|
31 | string m_reconFileName; ///< output reconstruction file |
---|
32 | Int m_layerId; ///< layer Id |
---|
33 | Int m_iFrameRate; ///< source frame-rates (Hz) |
---|
34 | Int m_iSourceWidth; ///< source width in pixel |
---|
35 | Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) |
---|
36 | Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) |
---|
37 | Int m_conformanceWindowMode; |
---|
38 | Int m_confWinLeft; |
---|
39 | Int m_confWinRight; |
---|
40 | Int m_confWinTop; |
---|
41 | Int m_confWinBottom; |
---|
42 | Int m_aiPad[2]; ///< number of padded pixels for width and height |
---|
43 | Int m_iIntraPeriod; ///< period of I-slice (random access period) |
---|
44 | Double m_fQP; ///< QP value of key-picture (floating point) |
---|
45 | ChromaFormat m_chromaFormatIDC; |
---|
46 | ChromaFormat m_InputChromaFormatIDC; |
---|
47 | ChromaFormat m_chromaFormatConstraint; |
---|
48 | UInt m_bitDepthConstraint; |
---|
49 | Bool m_intraConstraintFlag; |
---|
50 | Bool m_lowerBitRateConstraintFlag; |
---|
51 | Bool m_onePictureOnlyConstraintFlag; |
---|
52 | #if AUXILIARY_PICTURES |
---|
53 | Int m_auxId; |
---|
54 | #endif |
---|
55 | |
---|
56 | Int *m_samplePredRefLayerIds; |
---|
57 | Int m_numSamplePredRefLayers; |
---|
58 | Int *m_motionPredRefLayerIds; |
---|
59 | Int m_numMotionPredRefLayers; |
---|
60 | Int *m_predLayerIds; |
---|
61 | Int m_numActiveRefLayers; |
---|
62 | |
---|
63 | Int m_iMaxCuDQPDepth; ///< Max. depth for a minimum CuDQPSize (0:default) |
---|
64 | |
---|
65 | // coding unit (CU) definition |
---|
66 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
67 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
68 | UInt m_uiMaxCUDepth; ///< max. CU depth (as specified by command line) |
---|
69 | UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure |
---|
70 | UInt m_uiLog2DiffMaxMinCodingBlockSize; ///< difference between largest and smallest CU depth |
---|
71 | |
---|
72 | // transfom unit (TU) definition |
---|
73 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
74 | UInt m_uiQuadtreeTULog2MinSize; |
---|
75 | |
---|
76 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
77 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
78 | |
---|
79 | #if RC_SHVC_HARMONIZATION |
---|
80 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
81 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
82 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
83 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
84 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
85 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
86 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
87 | #if U0132_TARGET_BITS_SATURATION |
---|
88 | Bool m_RCCpbSaturationEnabled; ///< enable target bits saturation to avoid CPB overflow and underflow |
---|
89 | UInt m_RCCpbSize; ///< CPB size |
---|
90 | Double m_RCInitialCpbFullness; ///< initial CPB fullness |
---|
91 | #endif |
---|
92 | #endif |
---|
93 | |
---|
94 | Bool m_bUseSAO; |
---|
95 | |
---|
96 | ScalingListMode m_useScalingListId; ///< using quantization matrix |
---|
97 | std::string m_scalingListFileName; ///< quantization matrix file name |
---|
98 | |
---|
99 | Int m_maxTidIlRefPicsPlus1; |
---|
100 | Int m_waveFrontSynchro; ///< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current. |
---|
101 | Int m_waveFrontFlush; ///< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs. |
---|
102 | |
---|
103 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
104 | std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) |
---|
105 | Int* m_aidQP; ///< array of slice QP values |
---|
106 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
107 | Int m_numRefLayerLocationOffsets; |
---|
108 | Int m_refLocationOffsetLayerId [MAX_LAYERS]; |
---|
109 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
110 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
111 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
112 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
113 | Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; |
---|
114 | Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; |
---|
115 | Int m_refRegionLeftOffset [MAX_LAYERS]; |
---|
116 | Int m_refRegionTopOffset [MAX_LAYERS]; |
---|
117 | Int m_refRegionRightOffset [MAX_LAYERS]; |
---|
118 | Int m_refRegionBottomOffset[MAX_LAYERS]; |
---|
119 | Int m_phaseHorLuma [MAX_LAYERS]; |
---|
120 | Int m_phaseVerLuma [MAX_LAYERS]; |
---|
121 | Int m_phaseHorChroma[MAX_LAYERS]; |
---|
122 | Int m_phaseVerChroma[MAX_LAYERS]; |
---|
123 | Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; |
---|
124 | |
---|
125 | Int m_inputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file |
---|
126 | Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file |
---|
127 | Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension |
---|
128 | Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) |
---|
129 | |
---|
130 | Int m_repFormatIdx; |
---|
131 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
132 | string m_colourRemapSEIFileName; ///< Colour Remapping Information SEI message parameters file |
---|
133 | Int m_colourRemapSEIId; |
---|
134 | Bool m_colourRemapSEICancelFlag; |
---|
135 | Bool m_colourRemapSEIPersistenceFlag; |
---|
136 | Bool m_colourRemapSEIVideoSignalInfoPresentFlag; |
---|
137 | Bool m_colourRemapSEIFullRangeFlag; |
---|
138 | Int m_colourRemapSEIPrimaries; |
---|
139 | Int m_colourRemapSEITransferFunction; |
---|
140 | Int m_colourRemapSEIMatrixCoefficients; |
---|
141 | Int m_colourRemapSEIInputBitDepth; |
---|
142 | Int m_colourRemapSEIBitDepth; |
---|
143 | Int m_colourRemapSEIPreLutNumValMinus1[3]; |
---|
144 | Int* m_colourRemapSEIPreLutCodedValue[3]; |
---|
145 | Int* m_colourRemapSEIPreLutTargetValue[3]; |
---|
146 | Bool m_colourRemapSEIMatrixPresentFlag; |
---|
147 | Int m_colourRemapSEILog2MatrixDenom; |
---|
148 | Int m_colourRemapSEICoeffs[3][3]; |
---|
149 | Int m_colourRemapSEIPostLutNumValMinus1[3]; |
---|
150 | Int* m_colourRemapSEIPostLutCodedValue[3]; |
---|
151 | Int* m_colourRemapSEIPostLutTargetValue[3]; |
---|
152 | #endif |
---|
153 | |
---|
154 | Int m_layerSwitchOffBegin; |
---|
155 | Int m_layerSwitchOffEnd; |
---|
156 | |
---|
157 | // profile/level |
---|
158 | Int m_layerPTLIdx; |
---|
159 | |
---|
160 | public: |
---|
161 | TAppEncLayerCfg(); |
---|
162 | virtual ~TAppEncLayerCfg(); |
---|
163 | |
---|
164 | public: |
---|
165 | Void create (); ///< create option handling class |
---|
166 | Void destroy (); ///< destroy option handling class |
---|
167 | |
---|
168 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
169 | |
---|
170 | string& getInputFileName() {return m_inputFileName; } |
---|
171 | string& getReconFileName() {return m_reconFileName; } |
---|
172 | Double getFloatQP() {return m_fQP; } |
---|
173 | Int getConfWinLeft() {return m_confWinLeft; } |
---|
174 | Int getConfWinRight() {return m_confWinRight; } |
---|
175 | Int getConfWinTop() {return m_confWinTop; } |
---|
176 | Int getConfWinBottom() {return m_confWinBottom; } |
---|
177 | |
---|
178 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
179 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
180 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
181 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
182 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
183 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
184 | |
---|
185 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
186 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
187 | Int getPredLayerIdx(Int i) {return m_predLayerIds[i]; } |
---|
188 | |
---|
189 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
190 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
191 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
192 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
193 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
194 | #if LAYER_CTB |
---|
195 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
196 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
197 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
198 | #endif |
---|
199 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
200 | |
---|
201 | #endif //SVC_EXTENSION |
---|
202 | |
---|
203 | //! \} |
---|
204 | |
---|
205 | #endif // __TAPPENCLAYERCFG__ |
---|