[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> |
---|
| 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 |
---|
[442] | 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) |
---|
[313] | 36 | Int m_conformanceMode; |
---|
[823] | 37 | Int m_confWinLeft; |
---|
| 38 | Int m_confWinRight; |
---|
| 39 | Int m_confWinTop; |
---|
| 40 | Int m_confWinBottom; |
---|
[313] | 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) |
---|
[494] | 44 | #if AUXILIARY_PICTURES |
---|
| 45 | ChromaFormat m_chromaFormatIDC; |
---|
| 46 | ChromaFormat m_InputChromaFormat; |
---|
| 47 | Int m_auxId; |
---|
| 48 | #endif |
---|
[313] | 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 |
---|
[713] | 57 | #if Q0074_SEI_COLOR_MAPPING |
---|
| 58 | string m_cSeiColorMappingFile; |
---|
| 59 | #endif |
---|
[313] | 60 | |
---|
[494] | 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 | |
---|
[313] | 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 | |
---|
[442] | 85 | Int m_maxTidIlRefPicsPlus1; |
---|
[313] | 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 ; |
---|
[540] | 93 | #if O0098_SCALED_REF_LAYER_ID |
---|
| 94 | Int m_scaledRefLayerId [MAX_LAYERS]; |
---|
| 95 | #endif |
---|
[313] | 96 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 97 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 98 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 99 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
[849] | 100 | #if REF_REGION_OFFSET |
---|
| 101 | Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; |
---|
| 102 | Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; |
---|
| 103 | Int m_refRegionLeftOffset [MAX_LAYERS]; |
---|
| 104 | Int m_refRegionTopOffset [MAX_LAYERS]; |
---|
| 105 | Int m_refRegionRightOffset [MAX_LAYERS]; |
---|
| 106 | Int m_refRegionBottomOffset[MAX_LAYERS]; |
---|
| 107 | #endif |
---|
| 108 | #if P0312_VERT_PHASE_ADJ |
---|
[644] | 109 | Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; |
---|
| 110 | #endif |
---|
[849] | 111 | #if R0209_GENERIC_PHASE |
---|
| 112 | Int m_phaseHorLuma [MAX_LAYERS]; |
---|
| 113 | Int m_phaseVerLuma [MAX_LAYERS]; |
---|
| 114 | Int m_phaseHorChroma[MAX_LAYERS]; |
---|
| 115 | Int m_phaseVerChroma[MAX_LAYERS]; |
---|
| 116 | Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; |
---|
| 117 | #endif |
---|
[644] | 118 | |
---|
[494] | 119 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
| 120 | Int m_inputBitDepthY; ///< bit-depth of input file (luma component) |
---|
| 121 | Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) |
---|
| 122 | Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) |
---|
| 123 | Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) |
---|
| 124 | Int m_outputBitDepthY; ///< bit-depth of output file (luma component) |
---|
| 125 | Int m_outputBitDepthC; ///< bit-depth of output file (chroma component) |
---|
[345] | 126 | #endif |
---|
[442] | 127 | #if REPN_FORMAT_IN_VPS |
---|
| 128 | Int m_repFormatIdx; |
---|
| 129 | #endif |
---|
[313] | 130 | public: |
---|
| 131 | TAppEncLayerCfg(); |
---|
| 132 | virtual ~TAppEncLayerCfg(); |
---|
| 133 | |
---|
| 134 | public: |
---|
| 135 | Void create (); ///< create option handling class |
---|
| 136 | Void destroy (); ///< destroy option handling class |
---|
| 137 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
| 138 | |
---|
| 139 | Void xPrintParameter(); |
---|
[442] | 140 | Bool xCheckParameter( Bool isField ); |
---|
[313] | 141 | |
---|
| 142 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
| 143 | |
---|
| 144 | string getInputFile() {return m_cInputFile; } |
---|
| 145 | string getReconFile() {return m_cReconFile; } |
---|
| 146 | Int getFrameRate() {return m_iFrameRate; } |
---|
| 147 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
| 148 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
[442] | 149 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
[313] | 150 | Int getConformanceMode() { return m_conformanceMode; } |
---|
| 151 | Int* getPad() {return m_aiPad; } |
---|
| 152 | Double getFloatQP() {return m_fQP; } |
---|
[823] | 153 | Int getConfWinLeft() {return m_confWinLeft; } |
---|
| 154 | Int getConfWinRight() {return m_confWinRight; } |
---|
| 155 | Int getConfWinTop() {return m_confWinTop; } |
---|
| 156 | Int getConfWinBottom() {return m_confWinBottom; } |
---|
[494] | 157 | #if AUXILIARY_PICTURES |
---|
| 158 | ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} |
---|
| 159 | ChromaFormat getChromaFormatIDC() {return m_chromaFormatIDC; } |
---|
| 160 | Int getAuxId() {return m_auxId; } |
---|
| 161 | #endif |
---|
[313] | 162 | |
---|
| 163 | Int getIntQP() {return m_iQP; } |
---|
| 164 | Int* getdQPs() {return m_aidQP; } |
---|
| 165 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 166 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
| 167 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
| 168 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
| 169 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
| 170 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
| 171 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
| 172 | |
---|
| 173 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
| 174 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
| 175 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
| 176 | #endif |
---|
| 177 | #if RC_SHVC_HARMONIZATION |
---|
| 178 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
| 179 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
| 180 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
| 181 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
| 182 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
| 183 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
| 184 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
| 185 | #endif |
---|
[442] | 186 | #if REPN_FORMAT_IN_VPS |
---|
| 187 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
| 188 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
| 189 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
| 190 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
| 191 | #endif |
---|
| 192 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
[494] | 193 | #if LAYER_CTB |
---|
| 194 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
| 195 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
| 196 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
| 197 | #endif |
---|
[313] | 198 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
| 199 | |
---|
[494] | 200 | #endif //SVC_EXTENSION |
---|
| 201 | |
---|
[313] | 202 | //! \} |
---|
| 203 | |
---|
| 204 | #endif // __TAPPENCLAYERCFG__ |
---|