[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> |
---|
[1029] | 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 |
---|
[1057] | 32 | Int m_layerId; ///< layer Id |
---|
[313] | 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) |
---|
[1029] | 45 | ChromaFormat m_chromaFormatIDC; |
---|
| 46 | ChromaFormat m_InputChromaFormatIDC; |
---|
| 47 | ChromaFormat m_chromaFormatConstraint; |
---|
| 48 | UInt m_bitDepthConstraint; |
---|
| 49 | Bool m_intraConstraintFlag; |
---|
| 50 | Bool m_lowerBitRateConstraintFlag; |
---|
[494] | 51 | #if AUXILIARY_PICTURES |
---|
[1029] | 52 | Int m_auxId; |
---|
[494] | 53 | #endif |
---|
[1148] | 54 | |
---|
[313] | 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 | |
---|
[1235] | 62 | Int m_iMaxCuDQPDepth; ///< Max. depth for a minimum CuDQPSize (0:default) |
---|
| 63 | |
---|
[494] | 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 | |
---|
[313] | 76 | #if RC_SHVC_HARMONIZATION |
---|
| 77 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
| 78 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
| 79 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
| 80 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
| 81 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
| 82 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
| 83 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
| 84 | #endif |
---|
| 85 | |
---|
[442] | 86 | Int m_maxTidIlRefPicsPlus1; |
---|
[875] | 87 | 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. |
---|
[313] | 88 | |
---|
| 89 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
| 90 | char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
| 91 | Int* m_aidQP; ///< array of slice QP values |
---|
| 92 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
[1030] | 93 | Int m_numRefLayerLocationOffsets; |
---|
| 94 | Int m_refLocationOffsetLayerId [MAX_LAYERS]; |
---|
[313] | 95 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 96 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 97 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 98 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
[849] | 99 | Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; |
---|
| 100 | Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; |
---|
| 101 | Int m_refRegionLeftOffset [MAX_LAYERS]; |
---|
| 102 | Int m_refRegionTopOffset [MAX_LAYERS]; |
---|
| 103 | Int m_refRegionRightOffset [MAX_LAYERS]; |
---|
| 104 | Int m_refRegionBottomOffset[MAX_LAYERS]; |
---|
| 105 | Int m_phaseHorLuma [MAX_LAYERS]; |
---|
| 106 | Int m_phaseVerLuma [MAX_LAYERS]; |
---|
| 107 | Int m_phaseHorChroma[MAX_LAYERS]; |
---|
| 108 | Int m_phaseVerChroma[MAX_LAYERS]; |
---|
| 109 | Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; |
---|
[644] | 110 | |
---|
[1284] | 111 | Int m_inputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file |
---|
| 112 | Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file |
---|
[1029] | 113 | Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension |
---|
| 114 | Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) |
---|
| 115 | UInt m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE]; |
---|
| 116 | Bool m_useExtendedPrecision; |
---|
| 117 | Bool m_useHighPrecisionPredictionWeighting; |
---|
| 118 | |
---|
[442] | 119 | Int m_repFormatIdx; |
---|
[856] | 120 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
[1089] | 121 | string m_colourRemapSEIFileRoot; ///< Colour Remapping Information SEI message parameters file |
---|
[856] | 122 | Int m_colourRemapSEIId; |
---|
| 123 | Bool m_colourRemapSEICancelFlag; |
---|
| 124 | Bool m_colourRemapSEIPersistenceFlag; |
---|
[868] | 125 | Bool m_colourRemapSEIVideoSignalInfoPresentFlag; |
---|
| 126 | Bool m_colourRemapSEIFullRangeFlag; |
---|
[856] | 127 | Int m_colourRemapSEIPrimaries; |
---|
[868] | 128 | Int m_colourRemapSEITransferFunction; |
---|
| 129 | Int m_colourRemapSEIMatrixCoefficients; |
---|
| 130 | Int m_colourRemapSEIInputBitDepth; |
---|
| 131 | Int m_colourRemapSEIBitDepth; |
---|
[856] | 132 | Int m_colourRemapSEIPreLutNumValMinus1[3]; |
---|
| 133 | Int* m_colourRemapSEIPreLutCodedValue[3]; |
---|
| 134 | Int* m_colourRemapSEIPreLutTargetValue[3]; |
---|
| 135 | Bool m_colourRemapSEIMatrixPresentFlag; |
---|
| 136 | Int m_colourRemapSEILog2MatrixDenom; |
---|
| 137 | Int m_colourRemapSEICoeffs[3][3]; |
---|
| 138 | Int m_colourRemapSEIPostLutNumValMinus1[3]; |
---|
| 139 | Int* m_colourRemapSEIPostLutCodedValue[3]; |
---|
| 140 | Int* m_colourRemapSEIPostLutTargetValue[3]; |
---|
| 141 | #endif |
---|
[875] | 142 | |
---|
[978] | 143 | Int m_layerSwitchOffBegin; |
---|
| 144 | Int m_layerSwitchOffEnd; |
---|
| 145 | |
---|
[1029] | 146 | // profile/level |
---|
| 147 | Int m_layerPTLIdx; |
---|
| 148 | |
---|
[313] | 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(); |
---|
[442] | 159 | Bool xCheckParameter( Bool isField ); |
---|
[313] | 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; } |
---|
[442] | 168 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
[313] | 169 | Int getConformanceMode() { return m_conformanceMode; } |
---|
| 170 | Int* getPad() {return m_aiPad; } |
---|
| 171 | Double getFloatQP() {return m_fQP; } |
---|
[823] | 172 | Int getConfWinLeft() {return m_confWinLeft; } |
---|
| 173 | Int getConfWinRight() {return m_confWinRight; } |
---|
| 174 | Int getConfWinTop() {return m_confWinTop; } |
---|
| 175 | Int getConfWinBottom() {return m_confWinBottom; } |
---|
[494] | 176 | #if AUXILIARY_PICTURES |
---|
[1029] | 177 | ChromaFormat getInputChromaFormat() {return m_InputChromaFormatIDC;} |
---|
[494] | 178 | ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } |
---|
| 179 | Int getAuxId() {return m_auxId; } |
---|
| 180 | #endif |
---|
[313] | 181 | |
---|
| 182 | Int getIntQP() {return m_iQP; } |
---|
| 183 | Int* getdQPs() {return m_aidQP; } |
---|
[1148] | 184 | |
---|
[313] | 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; } |
---|
[1057] | 194 | Int getPredLayerIdx(Int i) {return m_predLayerIds[i]; } |
---|
[1148] | 195 | |
---|
[313] | 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 |
---|
[442] | 205 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
| 206 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
| 207 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
| 208 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
| 209 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
[494] | 210 | #if LAYER_CTB |
---|
| 211 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
| 212 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
| 213 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
| 214 | #endif |
---|
[313] | 215 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
| 216 | |
---|
[494] | 217 | #endif //SVC_EXTENSION |
---|
| 218 | |
---|
[313] | 219 | //! \} |
---|
| 220 | |
---|
| 221 | #endif // __TAPPENCLAYERCFG__ |
---|