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 | Int m_iGOPSize; ///< GOP size of hierarchical structure |
---|
45 | Double m_fQP; ///< QP value of key-picture (floating point) |
---|
46 | ChromaFormat m_chromaFormatIDC; |
---|
47 | ChromaFormat m_InputChromaFormatIDC; |
---|
48 | ChromaFormat m_chromaFormatConstraint; |
---|
49 | UInt m_bitDepthConstraint; |
---|
50 | Bool m_intraConstraintFlag; |
---|
51 | Bool m_lowerBitRateConstraintFlag; |
---|
52 | Bool m_onePictureOnlyConstraintFlag; |
---|
53 | #if AUXILIARY_PICTURES |
---|
54 | Int m_auxId; |
---|
55 | #endif |
---|
56 | |
---|
57 | Int m_extraRPSs; ///< extra RPSs added to handle CRA |
---|
58 | GOPEntry m_GOPList[MAX_GOP]; ///< the enhancement layer coding structure entries from the config file |
---|
59 | Int m_inheritCodingStruct; ///< inherit coding structure from certain layer |
---|
60 | Int m_maxTempLayer; ///< Max temporal layer |
---|
61 | |
---|
62 | Int *m_samplePredRefLayerIds; |
---|
63 | Int m_numSamplePredRefLayers; |
---|
64 | Int *m_motionPredRefLayerIds; |
---|
65 | Int m_numMotionPredRefLayers; |
---|
66 | Int *m_predLayerIds; |
---|
67 | Int m_numActiveRefLayers; |
---|
68 | |
---|
69 | Int m_iMaxCuDQPDepth; ///< Max. depth for a minimum CuDQPSize (0:default) |
---|
70 | |
---|
71 | // coding unit (CU) definition |
---|
72 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
73 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
74 | UInt m_uiMaxCUDepth; ///< max. CU depth (as specified by command line) |
---|
75 | UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure |
---|
76 | UInt m_uiLog2DiffMaxMinCodingBlockSize; ///< difference between largest and smallest CU depth |
---|
77 | |
---|
78 | // transfom unit (TU) definition |
---|
79 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
80 | UInt m_uiQuadtreeTULog2MinSize; |
---|
81 | |
---|
82 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
83 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
84 | |
---|
85 | #if RC_SHVC_HARMONIZATION |
---|
86 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
87 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
88 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
89 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
90 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
91 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
92 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
93 | #if U0132_TARGET_BITS_SATURATION |
---|
94 | Bool m_RCCpbSaturationEnabled; ///< enable target bits saturation to avoid CPB overflow and underflow |
---|
95 | UInt m_RCCpbSize; ///< CPB size |
---|
96 | Double m_RCInitialCpbFullness; ///< initial CPB fullness |
---|
97 | #endif |
---|
98 | #endif |
---|
99 | |
---|
100 | Bool m_bUseSAO; |
---|
101 | |
---|
102 | ScalingListMode m_useScalingListId; ///< using quantization matrix |
---|
103 | std::string m_scalingListFileName; ///< quantization matrix file name |
---|
104 | |
---|
105 | Int m_maxTidIlRefPicsPlus1; |
---|
106 | Bool m_entropyCodingSyncEnabledFlag; |
---|
107 | |
---|
108 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
109 | std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) |
---|
110 | Int* m_aidQP; ///< array of slice QP values |
---|
111 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
112 | Int m_numRefLayerLocationOffsets; |
---|
113 | Int m_refLocationOffsetLayerId [MAX_LAYERS]; |
---|
114 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
115 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
116 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
117 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
118 | Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; |
---|
119 | Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; |
---|
120 | Int m_refRegionLeftOffset [MAX_LAYERS]; |
---|
121 | Int m_refRegionTopOffset [MAX_LAYERS]; |
---|
122 | Int m_refRegionRightOffset [MAX_LAYERS]; |
---|
123 | Int m_refRegionBottomOffset[MAX_LAYERS]; |
---|
124 | Int m_phaseHorLuma [MAX_LAYERS]; |
---|
125 | Int m_phaseVerLuma [MAX_LAYERS]; |
---|
126 | Int m_phaseHorChroma[MAX_LAYERS]; |
---|
127 | Int m_phaseVerChroma[MAX_LAYERS]; |
---|
128 | Bool m_resamplePhaseSetPresentFlag[MAX_LAYERS]; |
---|
129 | |
---|
130 | Int m_inputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file |
---|
131 | Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file |
---|
132 | Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension |
---|
133 | Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) |
---|
134 | |
---|
135 | Int m_repFormatIdx; |
---|
136 | string m_colourRemapSEIFileRoot; |
---|
137 | |
---|
138 | Int m_layerSwitchOffBegin; |
---|
139 | Int m_layerSwitchOffEnd; |
---|
140 | |
---|
141 | // profile/level |
---|
142 | Int m_layerPTLIdx; |
---|
143 | |
---|
144 | public: |
---|
145 | TAppEncLayerCfg(); |
---|
146 | virtual ~TAppEncLayerCfg(); |
---|
147 | |
---|
148 | public: |
---|
149 | Void setAppEncCfg(TAppEncCfg* p) { m_cAppEncCfg = p; } |
---|
150 | |
---|
151 | string& getInputFileName() { return m_inputFileName; } |
---|
152 | string& getReconFileName() { return m_reconFileName; } |
---|
153 | Double getFloatQP() const { return m_fQP; } |
---|
154 | Int getConfWinLeft() const { return m_confWinLeft; } |
---|
155 | Int getConfWinRight() const { return m_confWinRight; } |
---|
156 | Int getConfWinTop() const { return m_confWinTop; } |
---|
157 | Int getConfWinBottom() const { return m_confWinBottom; } |
---|
158 | |
---|
159 | Int getNumSamplePredRefLayers() const { return m_numSamplePredRefLayers; } |
---|
160 | Int* getSamplePredRefLayerIds() const { return m_samplePredRefLayerIds; } |
---|
161 | Int getSamplePredRefLayerId(Int i) const { return m_samplePredRefLayerIds[i]; } |
---|
162 | Int getNumMotionPredRefLayers() const { return m_numMotionPredRefLayers; } |
---|
163 | Int* getMotionPredRefLayerIds() const { return m_motionPredRefLayerIds; } |
---|
164 | Int getMotionPredRefLayerId(Int i) const { return m_motionPredRefLayerIds[i]; } |
---|
165 | |
---|
166 | Int getNumActiveRefLayers() const { return m_numActiveRefLayers; } |
---|
167 | Int* getPredLayerIds() const { return m_predLayerIds; } |
---|
168 | Int getPredLayerIdx(Int i) const { return m_predLayerIds[i]; } |
---|
169 | |
---|
170 | Int getRepFormatIdx() const { return m_repFormatIdx; } |
---|
171 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
172 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
173 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
174 | Int getMaxTidIlRefPicsPlus1() const { return m_maxTidIlRefPicsPlus1; } |
---|
175 | #if LAYER_CTB |
---|
176 | UInt getMaxCUWidth() const { return m_uiMaxCUWidth; } |
---|
177 | UInt getMaxCUHeight() const { return m_uiMaxCUHeight; } |
---|
178 | UInt getMaxCUDepth() const { return m_uiMaxCUDepth; } |
---|
179 | #endif |
---|
180 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
181 | |
---|
182 | #endif //SVC_EXTENSION |
---|
183 | |
---|
184 | //! \} |
---|
185 | |
---|
186 | #endif // __TAPPENCLAYERCFG__ |
---|