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

Last change on this file since 461 was 448, checked in by seregin, 12 years ago

remove SCALED_REF_LAYER_OFFSETS macro

  • Property svn:eol-style set to native
File size: 8.4 KB
Line 
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
12using namespace std;
13#if SVC_EXTENSION
14class TAppEncCfg;
15#endif
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
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_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 SVC_EXTENSION
46#if VPS_EXTN_DIRECT_REF_LAYERS
47#if M0457_PREDICTION_INDICATIONS
48  Int       *m_samplePredRefLayerIds;
49  Int       m_numSamplePredRefLayers;
50  Int       *m_motionPredRefLayerIds;
51  Int       m_numMotionPredRefLayers;
52#else
53  Int       *m_refLayerIds;
54  Int       m_numDirectRefLayers;
55#endif
56  Int       *m_predLayerIds;
57  Int       m_numActiveRefLayers;
58#endif
59
60#if LAYER_CTB
61  // coding unit (CU) definition
62  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
63  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
64  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth
65 
66  // transfom unit (TU) definition
67  UInt      m_uiQuadtreeTULog2MaxSize;
68  UInt      m_uiQuadtreeTULog2MinSize;
69 
70  UInt      m_uiQuadtreeTUMaxDepthInter;
71  UInt      m_uiQuadtreeTUMaxDepthIntra;
72#endif
73
74#if RC_SHVC_HARMONIZATION
75  Bool      m_RCEnableRateControl;                ///< enable rate control or not
76  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
77  Bool      m_RCKeepHierarchicalBit;              ///< whether keeping hierarchical bit allocation structure or not
78  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control
79  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level
80  Int       m_RCInitialQP;                        ///< inital QP for rate control
81  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
82#endif
83
84#if N0120_MAX_TID_REF_CFG
85  Int       m_maxTidIlRefPicsPlus1;
86#endif
87  Int       m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles).
88#endif //SVC_EXTENSION
89
90  Int       m_iQP;                                            ///< QP value of key-picture (integer)
91  char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
92  Int*      m_aidQP;                                          ///< array of slice QP values
93  TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
94#if SVC_EXTENSION
95  Int       m_numScaledRefLayerOffsets  ;
96  Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
97  Int       m_scaledRefLayerTopOffset   [MAX_LAYERS];
98  Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
99  Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
100#if FINAL_RPL_CHANGE_N0082
101  GOPEntry  m_GOPListLayer[MAX_GOP];                            ///< for layer
102#endif
103#if REPN_FORMAT_IN_VPS
104  Int       m_repFormatIdx;
105#endif
106#endif //SVC_EXTENSION
107public:
108  TAppEncLayerCfg();
109  virtual ~TAppEncLayerCfg();
110
111public:
112  Void  create    ();                                         ///< create option handling class
113  Void  destroy   ();                                         ///< destroy option handling class
114  bool  parseCfg  ( const string& cfgFileName );              ///< parse layer configuration file to fill member variables
115
116#if AVC_SYNTAX
117  Void  xPrintParameter( UInt layerId );
118#else
119  Void  xPrintParameter();
120#endif
121  Bool  xCheckParameter( Bool isField );
122
123  Void    setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p;          }
124
125  string  getInputFile()              {return m_cInputFile;       }
126  string  getReconFile()              {return m_cReconFile;       }
127  Int     getFrameRate()              {return m_iFrameRate;       }
128  Int     getSourceWidth()            {return m_iSourceWidth;     }
129  Int     getSourceHeight()           {return m_iSourceHeight;    }
130  Int     getSourceHeightOrg()        {return m_iSourceHeightOrg; }
131  Int     getConformanceMode()        { return m_conformanceMode; }
132  Int*    getPad()                    {return m_aiPad;            }
133  Double  getFloatQP()                {return m_fQP;              }
134  Int     getConfLeft()               {return m_confLeft;         }
135  Int     getConfRight()              {return m_confRight;        }
136  Int     getConfTop()                {return m_confTop;          }
137  Int     getConfBottom()             {return m_confBottom;       }
138
139  Int     getIntQP()                  {return m_iQP;              } 
140  Int*    getdQPs()                   {return m_aidQP;            }
141#if SVC_EXTENSION
142#if VPS_EXTN_DIRECT_REF_LAYERS
143#if M0457_PREDICTION_INDICATIONS
144  Int     getNumSamplePredRefLayers()    {return m_numSamplePredRefLayers;   }
145  Int*    getSamplePredRefLayerIds()     {return m_samplePredRefLayerIds;    }
146  Int     getSamplePredRefLayerId(Int i) {return m_samplePredRefLayerIds[i]; }
147  Int     getNumMotionPredRefLayers()    {return m_numMotionPredRefLayers;   }
148  Int*    getMotionPredRefLayerIds()     {return m_motionPredRefLayerIds;    }
149  Int     getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; }
150#else
151  Int     getNumDirectRefLayers()     {return m_numDirectRefLayers;}
152  Int*    getRefLayerIds()            {return m_refLayerIds;      }
153  Int     getRefLayerId(Int i)        {return m_refLayerIds[i];   }
154#endif
155
156  Int     getNumActiveRefLayers()     {return m_numActiveRefLayers;}
157  Int*    getPredLayerIds()           {return m_predLayerIds;     }
158  Int     getPredLayerId(Int i)       {return m_predLayerIds[i];  }
159#endif
160#if RC_SHVC_HARMONIZATION
161  Bool    getRCEnableRateControl()    {return m_RCEnableRateControl;   }
162  Int     getRCTargetBitrate()        {return m_RCTargetBitrate;       }
163  Bool    getRCKeepHierarchicalBit()  {return m_RCKeepHierarchicalBit; }
164  Bool    getRCLCULevelRC()           {return m_RCLCULevelRC;          }
165  Bool    getRCUseLCUSeparateModel()  {return m_RCUseLCUSeparateModel; }
166  Int     getRCInitialQP()            {return m_RCInitialQP;           }
167  Bool    getRCForceIntraQP()         {return m_RCForceIntraQP;        }
168#endif
169#if FINAL_RPL_CHANGE_N0082
170  GOPEntry getGOPEntry(Int i )        {return m_GOPListLayer[i];  }
171#endif
172#if REPN_FORMAT_IN_VPS
173  Int     getRepFormatIdx()           { return m_repFormatIdx;  }
174  Void    setRepFormatIdx(Int x)      { m_repFormatIdx = x;     }
175  Void    setSourceWidth(Int x)       { m_iSourceWidth = x;     }
176  Void    setSourceHeight(Int x)      { m_iSourceHeight = x;    }
177#endif
178#if N0120_MAX_TID_REF_CFG
179  Int     getMaxTidIlRefPicsPlus1()   { return m_maxTidIlRefPicsPlus1; }
180#endif
181#if LAYER_CTB
182  UInt getMaxCUWidth()             {return m_uiMaxCUWidth;      }
183  UInt getMaxCUHeight()            {return m_uiMaxCUHeight;     }
184  UInt getMaxCUDepth()             {return m_uiMaxCUDepth;      }
185#endif
186#endif //SVC_EXTENSION
187}; // END CLASS DEFINITION TAppEncLayerCfg
188
189//! \}
190
191#endif // __TAPPENCLAYERCFG__
Note: See TracBrowser for help on using the repository browser.