[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 |
---|
[431] | 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 | |
---|
| 59 | #if RC_SHVC_HARMONIZATION |
---|
| 60 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
| 61 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
| 62 | Bool m_RCKeepHierarchicalBit; ///< whether keeping hierarchical bit allocation structure or not |
---|
| 63 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control |
---|
| 64 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level |
---|
| 65 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
| 66 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
| 67 | #endif |
---|
| 68 | |
---|
[397] | 69 | #if N0120_MAX_TID_REF_CFG |
---|
| 70 | Int m_maxTidIlRefPicsPlus1; |
---|
| 71 | #endif |
---|
[313] | 72 | #if SVC_EXTENSION |
---|
| 73 | Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
| 74 | #endif |
---|
| 75 | |
---|
| 76 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
| 77 | char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
| 78 | Int* m_aidQP; ///< array of slice QP values |
---|
| 79 | TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config |
---|
| 80 | #if SCALED_REF_LAYER_OFFSETS |
---|
| 81 | Int m_numScaledRefLayerOffsets ; |
---|
| 82 | Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 83 | Int m_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 84 | Int m_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 85 | Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; |
---|
| 86 | #endif |
---|
[345] | 87 | #if FINAL_RPL_CHANGE_N0082 |
---|
| 88 | GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer |
---|
| 89 | #endif |
---|
[389] | 90 | #if REPN_FORMAT_IN_VPS |
---|
| 91 | Int m_repFormatIdx; |
---|
| 92 | #endif |
---|
[313] | 93 | public: |
---|
| 94 | TAppEncLayerCfg(); |
---|
| 95 | virtual ~TAppEncLayerCfg(); |
---|
| 96 | |
---|
| 97 | public: |
---|
| 98 | Void create (); ///< create option handling class |
---|
| 99 | Void destroy (); ///< destroy option handling class |
---|
| 100 | bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables |
---|
| 101 | |
---|
| 102 | #if AVC_SYNTAX |
---|
| 103 | Void xPrintParameter( UInt layerId ); |
---|
| 104 | #else |
---|
| 105 | Void xPrintParameter(); |
---|
| 106 | #endif |
---|
[431] | 107 | Bool xCheckParameter( Bool isField ); |
---|
[313] | 108 | |
---|
| 109 | Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } |
---|
| 110 | |
---|
| 111 | string getInputFile() {return m_cInputFile; } |
---|
| 112 | string getReconFile() {return m_cReconFile; } |
---|
| 113 | Int getFrameRate() {return m_iFrameRate; } |
---|
| 114 | Int getSourceWidth() {return m_iSourceWidth; } |
---|
| 115 | Int getSourceHeight() {return m_iSourceHeight; } |
---|
[431] | 116 | Int getSourceHeightOrg() {return m_iSourceHeightOrg; } |
---|
[313] | 117 | Int getConformanceMode() { return m_conformanceMode; } |
---|
| 118 | Int* getPad() {return m_aiPad; } |
---|
| 119 | Double getFloatQP() {return m_fQP; } |
---|
| 120 | Int getConfLeft() {return m_confLeft; } |
---|
| 121 | Int getConfRight() {return m_confRight; } |
---|
| 122 | Int getConfTop() {return m_confTop; } |
---|
| 123 | Int getConfBottom() {return m_confBottom; } |
---|
| 124 | |
---|
| 125 | Int getIntQP() {return m_iQP; } |
---|
| 126 | Int* getdQPs() {return m_aidQP; } |
---|
| 127 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 128 | #if M0457_PREDICTION_INDICATIONS |
---|
| 129 | Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } |
---|
| 130 | Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } |
---|
| 131 | Int getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; } |
---|
| 132 | Int getNumMotionPredRefLayers() {return m_numMotionPredRefLayers; } |
---|
| 133 | Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } |
---|
| 134 | Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } |
---|
| 135 | #else |
---|
| 136 | Int getNumDirectRefLayers() {return m_numDirectRefLayers;} |
---|
| 137 | Int* getRefLayerIds() {return m_refLayerIds; } |
---|
| 138 | Int getRefLayerId(Int i) {return m_refLayerIds[i]; } |
---|
| 139 | #endif |
---|
| 140 | |
---|
| 141 | Int getNumActiveRefLayers() {return m_numActiveRefLayers;} |
---|
| 142 | Int* getPredLayerIds() {return m_predLayerIds; } |
---|
| 143 | Int getPredLayerId(Int i) {return m_predLayerIds[i]; } |
---|
| 144 | #endif |
---|
| 145 | #if RC_SHVC_HARMONIZATION |
---|
| 146 | Bool getRCEnableRateControl() {return m_RCEnableRateControl; } |
---|
| 147 | Int getRCTargetBitrate() {return m_RCTargetBitrate; } |
---|
| 148 | Bool getRCKeepHierarchicalBit() {return m_RCKeepHierarchicalBit; } |
---|
| 149 | Bool getRCLCULevelRC() {return m_RCLCULevelRC; } |
---|
| 150 | Bool getRCUseLCUSeparateModel() {return m_RCUseLCUSeparateModel; } |
---|
| 151 | Int getRCInitialQP() {return m_RCInitialQP; } |
---|
| 152 | Bool getRCForceIntraQP() {return m_RCForceIntraQP; } |
---|
| 153 | #endif |
---|
[345] | 154 | #if FINAL_RPL_CHANGE_N0082 |
---|
| 155 | GOPEntry getGOPEntry(Int i ) {return m_GOPListLayer[i]; } |
---|
| 156 | #endif |
---|
[389] | 157 | #if REPN_FORMAT_IN_VPS |
---|
[403] | 158 | Int getRepFormatIdx() { return m_repFormatIdx; } |
---|
| 159 | Void setRepFormatIdx(Int x) { m_repFormatIdx = x; } |
---|
| 160 | Void setSourceWidth(Int x) { m_iSourceWidth = x; } |
---|
| 161 | Void setSourceHeight(Int x) { m_iSourceHeight = x; } |
---|
[389] | 162 | #endif |
---|
[397] | 163 | #if N0120_MAX_TID_REF_CFG |
---|
| 164 | Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } |
---|
| 165 | #endif |
---|
[313] | 166 | }; // END CLASS DEFINITION TAppEncLayerCfg |
---|
| 167 | |
---|
| 168 | //! \} |
---|
| 169 | |
---|
| 170 | #endif // __TAPPENCLAYERCFG__ |
---|