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