[313] | 1 | |
---|
| 2 | /** \file TAppEncLayerCfg.h |
---|
| 3 | \brief Handle encoder layer configuration parameters (header) |
---|
| 4 | */ |
---|
| 5 | #ifndef __TAPPENCLAYERCFG__ |
---|
| 6 | #define __TAPPENCLAYERCFG__ |
---|
| 7 | |
---|
| 8 | #include "TLibCommon/CommonDef.h" |
---|
| 9 | #include "TLibEncoder/TEncCfg.h" |
---|
| 10 | #include <sstream> |
---|
| 11 | |
---|
| 12 | using namespace std; |
---|
| 13 | #if SVC_EXTENSION |
---|
| 14 | class TAppEncCfg; |
---|
| 15 | #endif |
---|
| 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; |
---|
| 38 | Int m_confLeft; |
---|
| 39 | Int m_confRight; |
---|
| 40 | Int m_confTop; |
---|
| 41 | Int m_confBottom; |
---|
| 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) |
---|
| 45 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 46 | #if M0457_PREDICTION_INDICATIONS |
---|
| 47 | Int *m_samplePredRefLayerIds; |
---|
| 48 | Int m_numSamplePredRefLayers; |
---|
| 49 | Int *m_motionPredRefLayerIds; |
---|
| 50 | Int m_numMotionPredRefLayers; |
---|
| 51 | #else |
---|
| 52 | Int *m_refLayerIds; |
---|
| 53 | Int m_numDirectRefLayers; |
---|
| 54 | #endif |
---|
| 55 | Int *m_predLayerIds; |
---|
| 56 | Int m_numActiveRefLayers; |
---|
| 57 | #endif |
---|
| 58 | |
---|
[445] | 59 | #if LAYER_CTB |
---|
| 60 | // coding unit (CU) definition |
---|
| 61 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
| 62 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
| 63 | UInt m_uiMaxCUDepth; ///< max. CU depth |
---|
| 64 | |
---|
| 65 | // transfom unit (TU) definition |
---|
| 66 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 67 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 68 | |
---|
| 69 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 70 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
| 71 | #endif |
---|
| 72 | |
---|
[313] | 73 | #if RC_SHVC_HARMONIZATION |
---|
| 74 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
| 75 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
| 76 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
| 77 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
| 78 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
| 79 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
| 80 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
| 81 | #endif |
---|
| 82 | |
---|
[442] | 83 | #if N0120_MAX_TID_REF_CFG |
---|
| 84 | Int m_maxTidIlRefPicsPlus1; |
---|
| 85 | #endif |
---|
[313] | 86 | #if SVC_EXTENSION |
---|
| 87 | Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
| 88 | #endif |
---|
| 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 | #if SCALED_REF_LAYER_OFFSETS |
---|
| 95 | Int m_numScaledRefLayerOffsets ; |
---|
| 96 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 97 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 98 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 99 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
| 100 | #endif |
---|
[345] | 101 | #if FINAL_RPL_CHANGE_N0082 |
---|
| 102 | GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer |
---|
| 103 | #endif |
---|
[442] | 104 | #if REPN_FORMAT_IN_VPS |
---|
| 105 | Int m_repFormatIdx; |
---|
| 106 | #endif |
---|
[313] | 107 | public: |
---|
| 108 | TAppEncLayerCfg(); |
---|
| 109 | virtual ~TAppEncLayerCfg(); |
---|
| 110 | |
---|
| 111 | public: |
---|
| 112 | Void create (); ///< create option handling class |
---|
| 113 | Void destroy (); ///< destroy option handling class |
---|
| 114 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
| 115 | |
---|
| 116 | #if AVC_SYNTAX |
---|
| 117 | Void xPrintParameter( UInt layerId ); |
---|
| 118 | #else |
---|
| 119 | Void xPrintParameter(); |
---|
| 120 | #endif |
---|
[442] | 121 | Bool xCheckParameter( Bool isField ); |
---|
[313] | 122 | |
---|
| 123 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
| 124 | |
---|
| 125 | string getInputFile() {return m_cInputFile; } |
---|
| 126 | string getReconFile() {return m_cReconFile; } |
---|
| 127 | Int getFrameRate() {return m_iFrameRate; } |
---|
| 128 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
| 129 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
[442] | 130 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
[313] | 131 | Int getConformanceMode() { return m_conformanceMode; } |
---|
| 132 | Int* getPad() {return m_aiPad; } |
---|
| 133 | Double getFloatQP() {return m_fQP; } |
---|
| 134 | Int getConfLeft() {return m_confLeft; } |
---|
| 135 | Int getConfRight() {return m_confRight; } |
---|
| 136 | Int getConfTop() {return m_confTop; } |
---|
| 137 | Int getConfBottom() {return m_confBottom; } |
---|
| 138 | |
---|
| 139 | Int getIntQP() {return m_iQP; } |
---|
| 140 | Int* getdQPs() {return m_aidQP; } |
---|
| 141 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 142 | #if M0457_PREDICTION_INDICATIONS |
---|
| 143 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
| 144 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
| 145 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
| 146 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
| 147 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
| 148 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
| 149 | #else |
---|
| 150 | Int getNumDirectRefLayers() {return m_numDirectRefLayers;} |
---|
| 151 | Int* getRefLayerIds() {return m_refLayerIds; } |
---|
| 152 | Int getRefLayerId(Int i) {return m_refLayerIds[i]; } |
---|
| 153 | #endif |
---|
| 154 | |
---|
| 155 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
| 156 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
| 157 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
| 158 | #endif |
---|
| 159 | #if RC_SHVC_HARMONIZATION |
---|
| 160 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
| 161 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
| 162 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
| 163 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
| 164 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
| 165 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
| 166 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
| 167 | #endif |
---|
[345] | 168 | #if FINAL_RPL_CHANGE_N0082 |
---|
| 169 | GOPEntry getGOPEntry(Int i ) {return m_GOPListLayer[i]; } |
---|
| 170 | #endif |
---|
[442] | 171 | #if REPN_FORMAT_IN_VPS |
---|
| 172 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
| 173 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
| 174 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
| 175 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
| 176 | #endif |
---|
| 177 | #if N0120_MAX_TID_REF_CFG |
---|
| 178 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
[445] | 179 | #endif |
---|
| 180 | #if LAYER_CTB |
---|
| 181 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
| 182 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
| 183 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
| 184 | #endif |
---|
[313] | 185 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
| 186 | |
---|
| 187 | //! \} |
---|
| 188 | |
---|
| 189 | #endif // __TAPPENCLAYERCFG__ |
---|