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