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 | #if Q0074_SEI_COLOR_MAPPING |
---|
58 | string m_cSeiColorMappingFile; |
---|
59 | #endif |
---|
60 | |
---|
61 | #if LAYER_CTB |
---|
62 | // coding unit (CU) definition |
---|
63 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
64 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
65 | UInt m_uiMaxCUDepth; ///< max. CU depth |
---|
66 | |
---|
67 | // transfom unit (TU) definition |
---|
68 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
69 | UInt m_uiQuadtreeTULog2MinSize; |
---|
70 | |
---|
71 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
72 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
73 | #endif |
---|
74 | |
---|
75 | #if RC_SHVC_HARMONIZATION |
---|
76 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
77 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
78 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
79 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
80 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
81 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
82 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
83 | #endif |
---|
84 | |
---|
85 | Int m_maxTidIlRefPicsPlus1; |
---|
86 | Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
87 | |
---|
88 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
89 | char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
90 | Int* m_aidQP; ///< array of slice QP values |
---|
91 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
92 | Int m_numScaledRefLayerOffsets ; |
---|
93 | #if O0098_SCALED_REF_LAYER_ID |
---|
94 | Int m_scaledRefLayerId [MAX_LAYERS]; |
---|
95 | #endif |
---|
96 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
97 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
98 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
99 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
100 | #if P0312_VERT_PHASE_ADJ |
---|
101 | Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; |
---|
102 | #endif |
---|
103 | |
---|
104 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
105 | Int m_inputBitDepthY; ///< bit-depth of input file (luma component) |
---|
106 | Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) |
---|
107 | Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) |
---|
108 | Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) |
---|
109 | Int m_outputBitDepthY; ///< bit-depth of output file (luma component) |
---|
110 | Int m_outputBitDepthC; ///< bit-depth of output file (chroma component) |
---|
111 | #endif |
---|
112 | #if REPN_FORMAT_IN_VPS |
---|
113 | Int m_repFormatIdx; |
---|
114 | #endif |
---|
115 | public: |
---|
116 | TAppEncLayerCfg(); |
---|
117 | virtual ~TAppEncLayerCfg(); |
---|
118 | |
---|
119 | public: |
---|
120 | Void create (); ///< create option handling class |
---|
121 | Void destroy (); ///< destroy option handling class |
---|
122 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
123 | |
---|
124 | #if AVC_SYNTAX |
---|
125 | Void xPrintParameter( UInt layerId ); |
---|
126 | #else |
---|
127 | Void xPrintParameter(); |
---|
128 | #endif |
---|
129 | Bool xCheckParameter( Bool isField ); |
---|
130 | |
---|
131 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
132 | |
---|
133 | string getInputFile() {return m_cInputFile; } |
---|
134 | string getReconFile() {return m_cReconFile; } |
---|
135 | Int getFrameRate() {return m_iFrameRate; } |
---|
136 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
137 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
138 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
139 | Int getConformanceMode() { return m_conformanceMode; } |
---|
140 | Int* getPad() {return m_aiPad; } |
---|
141 | Double getFloatQP() {return m_fQP; } |
---|
142 | Int getConfLeft() {return m_confLeft; } |
---|
143 | Int getConfRight() {return m_confRight; } |
---|
144 | Int getConfTop() {return m_confTop; } |
---|
145 | Int getConfBottom() {return m_confBottom; } |
---|
146 | #if AUXILIARY_PICTURES |
---|
147 | ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} |
---|
148 | ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } |
---|
149 | Int getAuxId() {return m_auxId; } |
---|
150 | #endif |
---|
151 | |
---|
152 | Int getIntQP() {return m_iQP; } |
---|
153 | Int* getdQPs() {return m_aidQP; } |
---|
154 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
155 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
156 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
157 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
158 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
159 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
160 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
161 | |
---|
162 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
163 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
164 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
165 | #endif |
---|
166 | #if RC_SHVC_HARMONIZATION |
---|
167 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
168 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
169 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
170 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
171 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
172 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
173 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
174 | #endif |
---|
175 | #if REPN_FORMAT_IN_VPS |
---|
176 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
177 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
178 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
179 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
180 | #endif |
---|
181 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
182 | #if LAYER_CTB |
---|
183 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
184 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
185 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
186 | #endif |
---|
187 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
188 | |
---|
189 | #endif //SVC_EXTENSION |
---|
190 | |
---|
191 | //! \} |
---|
192 | |
---|
193 | #endif // __TAPPENCLAYERCFG__ |
---|