source: SHVCSoftware/branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h @ 1347

Last change on this file since 1347 was 1316, checked in by seregin, 10 years ago

port rev 4391

  • Property svn:eol-style set to native
File size: 10.8 KB
Line 
1
2/** \file     TAppEncLayerCfg.h
3    \brief    Handle encoder layer configuration parameters (header)
4*/
5#ifndef __TAPPENCLAYERCFG__
6#define __TAPPENCLAYERCFG__
7
8#if SVC_EXTENSION
9#include "TLibCommon/CommonDef.h"
10#include "TLibEncoder/TEncCfg.h"
11#include <sstream>
12#include <iomanip>
13
14using namespace std;
15class TAppEncCfg;
16//! \ingroup TAppEncoder
17//! \{
18
19// ====================================================================================================================
20// Class definition
21// ====================================================================================================================
22
23/// encoder layer configuration class
24class TAppEncLayerCfg
25{
26  friend class TAppEncCfg;
27  friend class TAppEncTop;
28protected:
29  // file I/O0
30  string    m_cInputFile;                                     ///< source file name
31  string    m_cReconFile;                                     ///< output reconstruction file
32  Int       m_layerId;                                        ///< layer Id
33  Int       m_iFrameRate;                                     ///< source frame-rates (Hz)
34  Int       m_iSourceWidth;                                   ///< source width in pixel
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)
37  Int       m_conformanceMode;
38  Int       m_confWinLeft;
39  Int       m_confWinRight;
40  Int       m_confWinTop;
41  Int       m_confWinBottom;
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  ChromaFormat m_chromaFormatIDC;
46  ChromaFormat m_InputChromaFormatIDC;
47  ChromaFormat m_chromaFormatConstraint;
48  UInt      m_bitDepthConstraint;
49  Bool      m_intraConstraintFlag;
50  Bool      m_lowerBitRateConstraintFlag;
51#if AUXILIARY_PICTURES
52  Int       m_auxId;
53#endif
54
55  Int       *m_samplePredRefLayerIds;
56  Int       m_numSamplePredRefLayers;
57  Int       *m_motionPredRefLayerIds;
58  Int       m_numMotionPredRefLayers;
59  Int       *m_predLayerIds;
60  Int       m_numActiveRefLayers;
61
62  Int       m_iMaxCuDQPDepth;                                 ///< Max. depth for a minimum CuDQPSize (0:default)
63
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 (as specified by command line)
68  UInt      m_uiMaxTotalCUDepth;                              ///< max. total CU depth - includes depth of transform-block structure
69  UInt      m_uiLog2DiffMaxMinCodingBlockSize;                ///< difference between largest and smallest CU depth
70 
71  // transfom unit (TU) definition
72  UInt      m_uiQuadtreeTULog2MaxSize;
73  UInt      m_uiQuadtreeTULog2MinSize;
74 
75  UInt      m_uiQuadtreeTUMaxDepthInter;
76  UInt      m_uiQuadtreeTUMaxDepthIntra;
77
78#if RC_SHVC_HARMONIZATION
79  Bool      m_RCEnableRateControl;                ///< enable rate control or not
80  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
81  Bool      m_RCKeepHierarchicalBit;              ///< whether keeping hierarchical bit allocation structure or not
82  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control
83  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level
84  Int       m_RCInitialQP;                        ///< inital QP for rate control
85  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
86#endif
87
88  Int       m_maxTidIlRefPicsPlus1;
89  Int       m_waveFrontSynchro;                   ///< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current.
90  Int       m_waveFrontFlush;                     ///< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs.
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_numRefLayerLocationOffsets;
97  Int       m_refLocationOffsetLayerId  [MAX_LAYERS];
98  Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
99  Int       m_scaledRefLayerTopOffset   [MAX_LAYERS];
100  Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
101  Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
102  Bool      m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS];
103  Bool      m_refRegionOffsetPresentFlag      [MAX_LAYERS];
104  Int       m_refRegionLeftOffset  [MAX_LAYERS];
105  Int       m_refRegionTopOffset   [MAX_LAYERS];
106  Int       m_refRegionRightOffset [MAX_LAYERS];
107  Int       m_refRegionBottomOffset[MAX_LAYERS];
108  Int       m_phaseHorLuma  [MAX_LAYERS];
109  Int       m_phaseVerLuma  [MAX_LAYERS];
110  Int       m_phaseHorChroma[MAX_LAYERS];
111  Int       m_phaseVerChroma[MAX_LAYERS];
112  Bool      m_resamplePhaseSetPresentFlag [MAX_LAYERS];
113
114  Int       m_inputBitDepth[MAX_NUM_CHANNEL_TYPE];            ///< bit-depth of input file
115  Int       m_outputBitDepth[MAX_NUM_CHANNEL_TYPE];           ///< bit-depth of output file
116  Int       m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE];      ///< bit-depth of input samples after MSB extension
117  Int       m_internalBitDepth[MAX_NUM_CHANNEL_TYPE];         ///< bit-depth codec operates at (input/output files will be converted)
118  UInt      m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE];
119  Bool      m_extendedPrecisionProcessingFlag;
120  Bool      m_highPrecisionOffsetsEnabledFlag;
121
122  Int       m_repFormatIdx;
123#if Q0074_COLOUR_REMAPPING_SEI
124  string    m_colourRemapSEIFileRoot;                           ///< Colour Remapping Information SEI message parameters file
125  Int       m_colourRemapSEIId;
126  Bool      m_colourRemapSEICancelFlag;
127  Bool      m_colourRemapSEIPersistenceFlag;
128  Bool      m_colourRemapSEIVideoSignalInfoPresentFlag;
129  Bool      m_colourRemapSEIFullRangeFlag;
130  Int       m_colourRemapSEIPrimaries;
131  Int       m_colourRemapSEITransferFunction;
132  Int       m_colourRemapSEIMatrixCoefficients;
133  Int       m_colourRemapSEIInputBitDepth;
134  Int       m_colourRemapSEIBitDepth;
135  Int       m_colourRemapSEIPreLutNumValMinus1[3];
136  Int*      m_colourRemapSEIPreLutCodedValue[3];
137  Int*      m_colourRemapSEIPreLutTargetValue[3];
138  Bool      m_colourRemapSEIMatrixPresentFlag;
139  Int       m_colourRemapSEILog2MatrixDenom;
140  Int       m_colourRemapSEICoeffs[3][3];
141  Int       m_colourRemapSEIPostLutNumValMinus1[3];
142  Int*      m_colourRemapSEIPostLutCodedValue[3];
143  Int*      m_colourRemapSEIPostLutTargetValue[3];
144#endif
145
146  Int       m_layerSwitchOffBegin;
147  Int       m_layerSwitchOffEnd;
148
149  // profile/level
150  Int       m_layerPTLIdx;
151
152public:
153  TAppEncLayerCfg();
154  virtual ~TAppEncLayerCfg();
155
156public:
157  Void  create    ();                                         ///< create option handling class
158  Void  destroy   ();                                         ///< destroy option handling class
159  bool  parseCfg  ( const string& cfgFileName );              ///< parse layer configuration file to fill member variables
160
161  Void  xPrintParameter();
162  Bool  xCheckParameter( Bool isField );
163
164  Void    setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p;          }
165
166  string  getInputFile()              {return m_cInputFile;       }
167  string  getReconFile()              {return m_cReconFile;       }
168  Int     getFrameRate()              {return m_iFrameRate;       }
169  Int     getSourceWidth()            {return m_iSourceWidth;     }
170  Int     getSourceHeight()           {return m_iSourceHeight;    }
171  Int     getSourceHeightOrg()        {return m_iSourceHeightOrg; }
172  Int     getConformanceMode()        { return m_conformanceMode; }
173  Int*    getPad()                    {return m_aiPad;            }
174  Double  getFloatQP()                {return m_fQP;              }
175  Int     getConfWinLeft()            {return m_confWinLeft;         }
176  Int     getConfWinRight()           {return m_confWinRight;        }
177  Int     getConfWinTop()             {return m_confWinTop;          }
178  Int     getConfWinBottom()          {return m_confWinBottom;       }
179#if AUXILIARY_PICTURES
180  ChromaFormat getInputChromaFormat()   {return m_InputChromaFormatIDC;}
181  ChromaFormat getChromaFormatIDC()     {return m_chromaFormatIDC;  }
182  Int          getAuxId()               {return m_auxId;            }
183#endif
184
185  Int     getIntQP()                  {return m_iQP;              } 
186  Int*    getdQPs()                   {return m_aidQP;            }
187
188  Int     getNumSamplePredRefLayers()    {return m_numSamplePredRefLayers;   }
189  Int*    getSamplePredRefLayerIds()     {return m_samplePredRefLayerIds;    }
190  Int     getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; }
191  Int     getNumMotionPredRefLayers()    {return m_numMotionPredRefLayers;   }
192  Int*    getMotionPredRefLayerIds()     {return m_motionPredRefLayerIds;    }
193  Int     getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; }
194
195  Int     getNumActiveRefLayers()     {return m_numActiveRefLayers;}
196  Int*    getPredLayerIds()           {return m_predLayerIds;     }
197  Int     getPredLayerIdx(Int i)      {return m_predLayerIds[i];  }
198
199#if RC_SHVC_HARMONIZATION
200  Bool    getRCEnableRateControl()    {return m_RCEnableRateControl;   }
201  Int     getRCTargetBitrate()        {return m_RCTargetBitrate;       }
202  Bool    getRCKeepHierarchicalBit()  {return m_RCKeepHierarchicalBit; }
203  Bool    getRCLCULevelRC()           {return m_RCLCULevelRC;          }
204  Bool    getRCUseLCUSeparateModel()  {return m_RCUseLCUSeparateModel; }
205  Int     getRCInitialQP()            {return m_RCInitialQP;           }
206  Bool    getRCForceIntraQP()         {return m_RCForceIntraQP;        }
207#endif
208  Int     getRepFormatIdx()           { return m_repFormatIdx;  }
209  Void    setRepFormatIdx(Int x)      { m_repFormatIdx = x;     }
210  Void    setSourceWidth(Int x)       { m_iSourceWidth = x;     }
211  Void    setSourceHeight(Int x)      { m_iSourceHeight = x;    }
212  Int     getMaxTidIlRefPicsPlus1()   { return m_maxTidIlRefPicsPlus1; }
213#if LAYER_CTB
214  UInt    getMaxCUWidth()             {return m_uiMaxCUWidth;      }
215  UInt    getMaxCUHeight()            {return m_uiMaxCUHeight;     }
216  UInt    getMaxCUDepth()             {return m_uiMaxCUDepth;      }
217#endif
218}; // END CLASS DEFINITION TAppEncLayerCfg
219
220#endif //SVC_EXTENSION
221
222//! \}
223
224#endif // __TAPPENCLAYERCFG__
Note: See TracBrowser for help on using the repository browser.