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

Last change on this file since 212 was 211, checked in by ustc, 13 years ago

JCTVC-M0037. rate control harmonization with SHVC.

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