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