[313] | 1 | |
---|
| 2 | /** \file TAppEncLayerCfg.h |
---|
| 3 | \brief Handle encoder layer configuration parameters (header) |
---|
| 4 | */ |
---|
| 5 | #ifndef __TAPPENCLAYERCFG__ |
---|
| 6 | #define __TAPPENCLAYERCFG__ |
---|
| 7 | |
---|
[494] | 8 | #if SVC_EXTENSION |
---|
[313] | 9 | #include "TLibCommon/CommonDef.h" |
---|
| 10 | #include "TLibEncoder/TEncCfg.h" |
---|
| 11 | #include <sstream> |
---|
[916] | 12 | #include <iomanip> |
---|
[313] | 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_cInputFile; ///< source file name |
---|
| 31 | string m_cReconFile; ///< output reconstruction file |
---|
| 32 | |
---|
| 33 | Int m_iFrameRate; ///< source frame-rates (Hz) |
---|
| 34 | Int m_iSourceWidth; ///< source width in pixel |
---|
[442] | 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) |
---|
[313] | 37 | Int m_conformanceMode; |
---|
[823] | 38 | Int m_confWinLeft; |
---|
| 39 | Int m_confWinRight; |
---|
| 40 | Int m_confWinTop; |
---|
| 41 | Int m_confWinBottom; |
---|
[313] | 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) |
---|
[916] | 45 | ChromaFormat m_chromaFormatIDC; |
---|
| 46 | ChromaFormat m_InputChromaFormatIDC; |
---|
| 47 | ChromaFormat m_chromaFormatConstraint; |
---|
| 48 | UInt m_bitDepthConstraint; |
---|
[945] | 49 | Bool m_intraConstraintFlag; |
---|
| 50 | Bool m_lowerBitRateConstraintFlag; |
---|
[494] | 51 | #if AUXILIARY_PICTURES |
---|
[916] | 52 | Int m_auxId; |
---|
[494] | 53 | #endif |
---|
[313] | 54 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 55 | Int *m_samplePredRefLayerIds; |
---|
| 56 | Int m_numSamplePredRefLayers; |
---|
| 57 | Int *m_motionPredRefLayerIds; |
---|
| 58 | Int m_numMotionPredRefLayers; |
---|
| 59 | Int *m_predLayerIds; |
---|
| 60 | Int m_numActiveRefLayers; |
---|
| 61 | #endif |
---|
| 62 | |
---|
[494] | 63 | #if LAYER_CTB |
---|
| 64 | // coding unit (CU) definition |
---|
| 65 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
| 66 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
| 67 | UInt m_uiMaxCUDepth; ///< max. CU depth |
---|
| 68 | |
---|
| 69 | // transfom unit (TU) definition |
---|
| 70 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 71 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 72 | |
---|
| 73 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 74 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
| 75 | #endif |
---|
| 76 | |
---|
[313] | 77 | #if RC_SHVC_HARMONIZATION |
---|
| 78 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
| 79 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
| 80 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
| 81 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
| 82 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
| 83 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
| 84 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
| 85 | #endif |
---|
| 86 | |
---|
[442] | 87 | Int m_maxTidIlRefPicsPlus1; |
---|
[875] | 88 | 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. |
---|
| 89 | Int m_iWaveFrontSubstreams; ///< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
[313] | 90 | |
---|
| 91 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
| 92 | char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
| 93 | Int* m_aidQP; ///< array of slice QP values |
---|
| 94 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
[916] | 95 | Int m_numScaledRefLayerOffsets; |
---|
[540] | 96 | #if O0098_SCALED_REF_LAYER_ID |
---|
| 97 | Int m_scaledRefLayerId [MAX_LAYERS]; |
---|
| 98 | #endif |
---|
[313] | 99 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 100 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 101 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 102 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
[849] | 103 | #if REF_REGION_OFFSET |
---|
| 104 | Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; |
---|
| 105 | Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; |
---|
| 106 | Int m_refRegionLeftOffset [MAX_LAYERS]; |
---|
| 107 | Int m_refRegionTopOffset [MAX_LAYERS]; |
---|
| 108 | Int m_refRegionRightOffset [MAX_LAYERS]; |
---|
| 109 | Int m_refRegionBottomOffset[MAX_LAYERS]; |
---|
| 110 | #endif |
---|
| 111 | #if P0312_VERT_PHASE_ADJ |
---|
[644] | 112 | Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; |
---|
| 113 | #endif |
---|
[849] | 114 | #if R0209_GENERIC_PHASE |
---|
| 115 | Int m_phaseHorLuma [MAX_LAYERS]; |
---|
| 116 | Int m_phaseVerLuma [MAX_LAYERS]; |
---|
| 117 | Int m_phaseHorChroma[MAX_LAYERS]; |
---|
| 118 | Int m_phaseVerChroma[MAX_LAYERS]; |
---|
| 119 | Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; |
---|
| 120 | #endif |
---|
[644] | 121 | |
---|
[916] | 122 | Int m_inputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file |
---|
| 123 | Int m_outputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file |
---|
| 124 | Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension |
---|
| 125 | Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) |
---|
| 126 | UInt m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE]; |
---|
| 127 | Bool m_useExtendedPrecision; |
---|
| 128 | Bool m_useHighPrecisionPredictionWeighting; |
---|
| 129 | |
---|
[442] | 130 | #if REPN_FORMAT_IN_VPS |
---|
| 131 | Int m_repFormatIdx; |
---|
| 132 | #endif |
---|
[856] | 133 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
| 134 | string m_colourRemapSEIFile; ///< Colour Remapping Information SEI message parameters file |
---|
| 135 | Int m_colourRemapSEIId; |
---|
| 136 | Bool m_colourRemapSEICancelFlag; |
---|
| 137 | Bool m_colourRemapSEIPersistenceFlag; |
---|
[868] | 138 | Bool m_colourRemapSEIVideoSignalInfoPresentFlag; |
---|
| 139 | Bool m_colourRemapSEIFullRangeFlag; |
---|
[856] | 140 | Int m_colourRemapSEIPrimaries; |
---|
[868] | 141 | Int m_colourRemapSEITransferFunction; |
---|
| 142 | Int m_colourRemapSEIMatrixCoefficients; |
---|
| 143 | Int m_colourRemapSEIInputBitDepth; |
---|
| 144 | Int m_colourRemapSEIBitDepth; |
---|
[856] | 145 | Int m_colourRemapSEIPreLutNumValMinus1[3]; |
---|
| 146 | Int* m_colourRemapSEIPreLutCodedValue[3]; |
---|
| 147 | Int* m_colourRemapSEIPreLutTargetValue[3]; |
---|
| 148 | Bool m_colourRemapSEIMatrixPresentFlag; |
---|
| 149 | Int m_colourRemapSEILog2MatrixDenom; |
---|
| 150 | Int m_colourRemapSEICoeffs[3][3]; |
---|
| 151 | Int m_colourRemapSEIPostLutNumValMinus1[3]; |
---|
| 152 | Int* m_colourRemapSEIPostLutCodedValue[3]; |
---|
| 153 | Int* m_colourRemapSEIPostLutTargetValue[3]; |
---|
| 154 | #endif |
---|
[875] | 155 | |
---|
[979] | 156 | #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS |
---|
| 157 | Int m_layerSwitchOffBegin; |
---|
| 158 | Int m_layerSwitchOffEnd; |
---|
| 159 | #endif |
---|
| 160 | |
---|
[945] | 161 | #if MULTIPLE_PTL_SUPPORT |
---|
| 162 | // profile/level |
---|
| 163 | Int m_layerPTLIdx; |
---|
| 164 | #endif |
---|
| 165 | |
---|
[313] | 166 | public: |
---|
| 167 | TAppEncLayerCfg(); |
---|
| 168 | virtual ~TAppEncLayerCfg(); |
---|
| 169 | |
---|
| 170 | public: |
---|
| 171 | Void create (); ///< create option handling class |
---|
| 172 | Void destroy (); ///< destroy option handling class |
---|
| 173 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
| 174 | |
---|
| 175 | Void xPrintParameter(); |
---|
[442] | 176 | Bool xCheckParameter( Bool isField ); |
---|
[313] | 177 | |
---|
| 178 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
| 179 | |
---|
| 180 | string getInputFile() {return m_cInputFile; } |
---|
| 181 | string getReconFile() {return m_cReconFile; } |
---|
| 182 | Int getFrameRate() {return m_iFrameRate; } |
---|
| 183 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
| 184 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
[442] | 185 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
[313] | 186 | Int getConformanceMode() { return m_conformanceMode; } |
---|
| 187 | Int* getPad() {return m_aiPad; } |
---|
| 188 | Double getFloatQP() {return m_fQP; } |
---|
[823] | 189 | Int getConfWinLeft() {return m_confWinLeft; } |
---|
| 190 | Int getConfWinRight() {return m_confWinRight; } |
---|
| 191 | Int getConfWinTop() {return m_confWinTop; } |
---|
| 192 | Int getConfWinBottom() {return m_confWinBottom; } |
---|
[494] | 193 | #if AUXILIARY_PICTURES |
---|
[916] | 194 | ChromaFormat getInputChromaFormat() {return m_InputChromaFormatIDC;} |
---|
[494] | 195 | ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } |
---|
| 196 | Int getAuxId() {return m_auxId; } |
---|
| 197 | #endif |
---|
[313] | 198 | |
---|
| 199 | Int getIntQP() {return m_iQP; } |
---|
| 200 | Int* getdQPs() {return m_aidQP; } |
---|
| 201 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 202 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
| 203 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
| 204 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
| 205 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
| 206 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
| 207 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
| 208 | |
---|
| 209 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
| 210 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
| 211 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
| 212 | #endif |
---|
| 213 | #if RC_SHVC_HARMONIZATION |
---|
| 214 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
| 215 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
| 216 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
| 217 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
| 218 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
| 219 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
| 220 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
| 221 | #endif |
---|
[442] | 222 | #if REPN_FORMAT_IN_VPS |
---|
| 223 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
| 224 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
| 225 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
| 226 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
| 227 | #endif |
---|
| 228 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
[494] | 229 | #if LAYER_CTB |
---|
| 230 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
| 231 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
| 232 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
| 233 | #endif |
---|
[313] | 234 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
| 235 | |
---|
[494] | 236 | #endif //SVC_EXTENSION |
---|
| 237 | |
---|
[313] | 238 | //! \} |
---|
| 239 | |
---|
| 240 | #endif // __TAPPENCLAYERCFG__ |
---|