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