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