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