Changeset 56 in 3DVCSoftware for trunk/source/App/TAppEncoder/TAppEncCfg.h


Ignore:
Timestamp:
11 May 2012, 21:20:17 (13 years ago)
Author:
hschwarz
Message:

updated trunk (move to HM6.1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r42 r56  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license.
     4 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2011, ISO/IEC
     6 * Copyright (c) 2010-2012, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    1515 *    this list of conditions and the following disclaimer in the documentation
    1616 *    and/or other materials provided with the distribution.
    17  *  * Neither the name of the ISO/IEC nor the names of its contributors may
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    1818 *    be used to endorse or promote products derived from this software without
    1919 *    specific prior written permission.
     
    3232 */
    3333
    34 
    35 
    3634/** \file     TAppEncCfg.h
    3735    \brief    Handle encoder configuration parameters (header)
     
    4139#define __TAPPENCCFG__
    4240
    43 #include "../../Lib/TLibCommon/CommonDef.h"
    44 #include "../../Lib/TLibCommon/TComMVDRefData.h"
    45 #include "../../App/TAppCommon/TAppComCamPara.h"
    46 #include "../../Lib/TLibRenderer/TRenTop.h"
    47 #include "../../Lib/TLibRenderer/TRenModel.h"
    48 #include "../../Lib/TLibRenderer/TRenModSetupStrParser.h"
    49 
    50 #include <string>
     41#include "TLibCommon/CommonDef.h"
     42
     43#include "TLibEncoder/TEncCfg.h"
     44#include "TAppCommon/TAppComCamPara.h"
     45#include "TLibRenderer/TRenTop.h"
     46#include "TLibRenderer/TRenModel.h"
     47#include "TLibRenderer/TRenModSetupStrParser.h"
     48
     49#include <sstream>
    5150#include <vector>
     51
     52//! \ingroup TAppEncoder
     53//! \{
    5254
    5355// ====================================================================================================================
     
    6062protected:
    6163  // file I/O
    62   char*     m_pchBitstreamFile;                               ///< output bitstream file
    63 
    6464  std::vector<char*>     m_pchInputFileList;                  ///< source file names
    6565  std::vector<char*>     m_pchDepthInputFileList;             ///< source depth file names
    6666  std::vector<char*>     m_pchReconFileList;                  ///< output reconstruction file names
    6767  std::vector<char*>     m_pchDepthReconFileList;             ///< output depth reconstruction file names
    68 
    69   std::vector<char*>     m_pchERRefFileList;                  ///< virtual external reference view files names
    70 
     68  char*     m_pchBitstreamFile;                               ///< output bitstream file
     69  Double    m_adLambdaModifier[ MAX_TLAYER ];                 ///< Lambda modifier array for each temporal layer
    7170  // source specification
    7271  Int       m_iFrameRate;                                     ///< source frame-rates (Hz)
     
    7473  Int       m_iSourceWidth;                                   ///< source width in pixel
    7574  Int       m_iSourceHeight;                                  ///< source height in pixel
     75#if PIC_CROPPING
     76  Int       m_croppingMode;
     77  Int       m_cropLeft;
     78  Int       m_cropRight;
     79  Int       m_cropTop;
     80  Int       m_cropBottom;
     81#endif
    7682  Int       m_iFrameToBeEncoded;                              ///< number of encoded frames
     83#if !PIC_CROPPING
    7784  Bool      m_bUsePAD;                                        ///< flag for using source padding
     85#endif
    7886  Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
    79 
    80   Int       m_iNumberOfViews;                                ///< number Views to Encode
    81   Bool      m_bUsingDepthMaps ;
    82 
    83 #if FLEX_CODING_ORDER
    84   char*         m_pchMVCJointCodingOrder;               ///<  texture-depth coding order
    85   Bool          m_b3DVFlexOrder;                ///<  flexible coding order flag
    86 #endif
    87 
    88 
     87 
     88  Int       m_iNumberOfViews;                                 ///< number Views to Encode
     89  Bool      m_bUsingDepthMaps;
    8990  // coding structure
    90 #if DCM_DECODING_REFRESH
     91  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
    9192  Int       m_iDecodingRefreshType;                           ///< random access type
    92 #endif
    93   UInt      m_uiCodedPictureStoreSize ;
    9493  Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
    95   Int       m_iRateGOPSize;                                   ///< GOP size for QP variance
    96 #if !HHI_NO_LowDelayCoding
    97   Bool      m_bUseLDC;                                        ///< flag for using low-delay coding mode
    98 #endif
    99 #if DCM_COMB_LIST
     94  Int       m_extraRPSs[MAX_VIEW_NUM];
     95  GOPEntryMvc m_GOPListsMvc[MAX_VIEW_NUM][MAX_GOP+1];
     96#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     97  Int       m_numReorderPics[MAX_VIEW_NUM][MAX_TLAYER];       ///< total number of reorder pictures
     98  Int       m_maxDecPicBuffering[MAX_VIEW_NUM][MAX_TLAYER];   ///< total number of reference pictures needed for decoding
     99#else
     100  Int       m_numReorderFrames;                               ///< total number of reorder pictures
     101  Int       m_maxNumberOfReferencePictures;                   ///< total number of reference pictures needed for decoding
     102#endif
    100103  Bool      m_bUseLComb;                                      ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421)
    101104  Bool      m_bLCMod;                                         ///< flag for specifying whether the combined reference list for uni-prediction in B-slices is uploaded explicitly
    102 #endif
    103   std::string     m_cInputFormatString ;                            // GOP string
     105  Bool      m_bDisInter4x4;
     106  Bool      m_enableNSQT;                                     ///< flag for enabling NSQT
     107  Bool      m_enableAMP;
    104108  // coding quality
    105 
    106109  std::vector<Double>  m_adQP;                                ///< QP value of key-picture (floating point) [0] video, [1] depth
    107   std::vector<Int>     m_aiQP;                                ///< QP value of key-picture (integer)
    108 
     110  std::vector<Int>     m_aiQP;                                ///< QP value of key-picture (integer) [0] video, [1] depth
    109111  Int       m_aiTLayerQPOffset[MAX_TLAYER];                   ///< QP offset corresponding to temporal layer depth
    110112  char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
    111113  Int*      m_aidQP;                                          ///< array of slice QP values
     114  Int*      m_aidQPdepth;                                     ///< array of depth slice QP values
    112115  Int       m_iMaxDeltaQP;                                    ///< max. |delta QP|
    113116  UInt      m_uiDeltaQpRD;                                    ///< dQP range for multi-pass slice QP optimization
     117  Int       m_iMaxCuDQPDepth;                                 ///< Max. depth for a minimum CuDQPSize (0:default)
     118
     119  Int       m_iChromaQpOffset;                                 ///< ChromaQpOffset    (0:default)
     120  Int       m_iChromaQpOffset2nd;                              ///< ChromaQpOffset2nd (0:default)
     121
     122#if ADAPTIVE_QP_SELECTION
     123  Bool      m_bUseAdaptQpSelect;
     124#endif
     125
     126  Bool      m_bUseAdaptiveQP;                                 ///< Flag for enabling QP adaptation based on a psycho-visual model
     127  Int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
     128 
     129#if H0566_TLA
     130  Int       m_maxTempLayer[MAX_VIEW_NUM];                     ///< Max temporal layer
     131#else
     132  Bool      m_bTLayering;                                     ///< indicates whether temporal IDs are set based on the hierarchical coding structure
     133  Bool      m_abTLayerSwitchingFlag[MAX_TLAYER];              ///< temporal layer switching flags corresponding to each temporal layer
     134#endif
    114135
    115136  // coding unit (CU) definition
     
    117138  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
    118139  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth
    119 
     140 
    120141  // transfom unit (TU) definition
    121142  UInt      m_uiQuadtreeTULog2MaxSize;
    122143  UInt      m_uiQuadtreeTULog2MinSize;
    123 
     144 
    124145  UInt      m_uiQuadtreeTUMaxDepthInter;
    125146  UInt      m_uiQuadtreeTUMaxDepthIntra;
    126 
     147 
    127148  // coding tools (bit-depth)
    128149  UInt      m_uiInputBitDepth;                                ///< bit-depth of input file
    129150  UInt      m_uiOutputBitDepth;                               ///< bit-depth of output file
    130 #ifdef ENABLE_IBDI
    131   UInt      m_uiBitIncrement;                                 ///< bit-depth increment
    132 #endif
    133151  UInt      m_uiInternalBitDepth;                             ///< Internal bit-depth (BitDepth+BitIncrement)
    134152
    135 #if MTK_SAO
     153  // coding tools (PCM bit-depth)
     154  Bool      m_bPCMInputBitDepthFlag;                          ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
     155  UInt      m_uiPCMBitDepthLuma;                              ///< PCM bit-depth for luma
     156
     157  // coding tool (lossless)
     158#if LOSSLESS_CODING
     159  Bool      m_useLossless;                                    ///< flag for using lossless coding
     160#endif
    136161  vector<Bool> m_abUseSAO;
    137 #endif
    138 
     162#if SAO_UNIT_INTERLEAVING
     163  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
     164  Bool      m_saoInterleavingFlag;                            ///< SAO interleaving flag
     165#endif
    139166  // coding tools (loop filter)
    140167  vector<Bool> m_abUseALF;                                    ///< flag for using adaptive loop filter [0] - video, [1] - depth
    141 #ifdef MQT_ALF_NPASS
    142   Int       m_iALFEncodePassReduction;                        ///< ALF encoding pass, 0 = original 16-pass, 1 = 1-pass, 2 = 2-pass
     168  Int       m_iALFEncodePassReduction;                        //!< ALF encoding pass, 0 = original 16-pass, 1 = 1-pass, 2 = 2-pass
     169 
     170  Int       m_iALFMaxNumberFilters;                           ///< ALF Max Number Filters in one picture
     171#if LCU_SYNTAX_ALF
     172  Bool      m_bALFParamInSlice;
     173  Bool      m_bALFPicBasedEncode;
    143174#endif
    144175
    145176  vector<Bool> m_abLoopFilterDisable;                         ///< flag for using deblocking filter filter [0] - video, [1] - depth
    146   Int       m_iLoopFilterAlphaC0Offset;                       ///< alpha offset for deblocking filter
    147   Int       m_iLoopFilterBetaOffset;                          ///< beta offset for deblocking filter
    148 
    149   // coding tools (entropy coder)
    150   Int       m_iSymbolMode;                                    ///< entropy coder mode, 0 = VLC, 1 = CABAC
    151 
    152   // coding tools (inter - merge motion partitions)
    153   Bool      m_bUseMRG;                                        ///< SOPH: flag for using motion partition Merge Mode
    154 
    155 #if LM_CHROMA
     177  Bool      m_loopFilterOffsetInAPS;                         ///< offset for deblocking filter in 0 = slice header, 1 = APS
     178  Int       m_loopFilterBetaOffsetDiv2;                     ///< beta offset for deblocking filter
     179  Int       m_loopFilterTcOffsetDiv2;                       ///< tc offset for deblocking filter
     180#if DBL_CONTROL
     181  Bool      m_DeblockingFilterControlPresent;                 ///< deblocking filter control present flag in PPS
     182#endif
     183 
    156184  Bool      m_bUseLMChroma;                                  ///< JL: Chroma intra prediction based on luma signal
    157 #endif
    158 
    159 #if HHI_RMP_SWITCH
    160   Bool      m_bUseRMP;
    161 #endif
     185
     186  // coding tools (PCM)
     187  Bool      m_usePCM;                                         ///< flag for using IPCM
     188  UInt      m_pcmLog2MaxSize;                                 ///< log2 of maximum PCM block size
     189  UInt      m_uiPCMLog2MinSize;                               ///< log2 of minimum PCM block size
     190  Bool      m_bPCMFilterDisableFlag;                          ///< PCM filter disable flag
    162191
    163192  // coding tools (encoder-only parameters)
     
    165194  Bool      m_bUseASR;                                        ///< flag for using adaptive motion search range
    166195  Bool      m_bUseHADME;                                      ///< flag for using HAD in sub-pel ME
    167   vector<Bool> m_abUseRDOQ;                                   ///< flag for using RD optimized quantization [0]-video, [1]-depth
     196vector<Bool> m_abUseRDOQ;                                   ///< flag for using RD optimized quantization [0]-video, [1]-depth
    168197  Int       m_iFastSearch;                                    ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST
    169198  Int       m_iSearchRange;                                   ///< ME search range
    170199  Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
    171200  Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
     201#if HHI_INTERVIEW_SKIP
     202  Bool      m_bInterViewSkip;                            ///< usage of interview skip mode ( do not transmit residual)
     203#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
     204  Double    m_dInterViewSkipLambdaScale;                 ///< lambda scale for interview skip
     205#endif
     206#endif
     207  Bool      m_bUseEarlyCU;                                    ///< flag for using Early CU setting
    172208
    173209#if DEPTH_MAP_GENERATION
     
    183219#endif
    184220
    185 #if HHI_INTERVIEW_SKIP
    186   UInt      m_uiInterViewSkip;                            ///< usage of interview skip mode ( do not transmit residual)
    187 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
    188   Double    m_dInterViewSkipLambdaScale;                 ///< lambda scale for interview skip
    189 #endif
    190 #endif
     221#if FAST_DECISION_FOR_MRG_RD_COST
     222  Bool      m_useFastDecisionForMerge;                        ///< flag for using Fast Decision Merge RD-Cost
     223#endif
     224  Bool      m_bUseCbfFastMode;                              ///< flag for using Cbf Fast PU Mode Decision
     225  Int       m_iSliceMode;           ///< 0: Disable all Recon slice limits, 1 : Maximum number of largest coding units per slice, 2: Maximum number of bytes in a slice
     226  Int       m_iSliceArgument;       ///< If m_iSliceMode==1, m_iSliceArgument=max. # of largest coding units. If m_iSliceMode==2, m_iSliceArgument=max. # of bytes.
     227  Int       m_iEntropySliceMode;    ///< 0: Disable all entropy slice limits, 1 : Maximum number of largest coding units per slice, 2: Constraint based entropy slice
     228  Int       m_iEntropySliceArgument;///< If m_iEntropySliceMode==1, m_iEntropySliceArgument=max. # of largest coding units. If m_iEntropySliceMode==2, m_iEntropySliceArgument=max. # of bins.
     229
     230  Int       m_iSliceGranularity;///< 0: Slices always end at LCU borders. 1-3: slices may end at a depth of 1-3 below LCU level.
     231  Bool m_bLFCrossSliceBoundaryFlag;  ///< 0: Cross-slice-boundary in-loop filtering 1: non-cross-slice-boundary in-loop filtering
     232  Int  m_iTileBehaviorControlPresentFlag; //!< 1: tile behavior control parameters are in PPS 0: tile behavior control parameters are not in PPS
     233  Bool m_bLFCrossTileBoundaryFlag;  //!< 1: Cross-tile-boundary in-loop filtering 0: non-cross-tile-boundary in-loop filtering
     234  Int       m_iColumnRowInfoPresent;
     235  Int       m_iUniformSpacingIdr;
     236#if !REMOVE_TILE_DEPENDENCE
     237  Int       m_iTileBoundaryIndependenceIdr;
     238#endif
     239  Int       m_iNumColumnsMinus1;
     240  char*     m_pchColumnWidth;
     241  Int       m_iNumRowsMinus1;
     242  char*     m_pchRowHeight;
     243  Int       m_iTileLocationInSliceHeaderFlag; //< enable(1)/disable(0) transmitssion of tile location in slice header
     244  Int       m_iTileMarkerFlag;              //< enable(1)/disable(0) transmitssion of light weight tile marker
     245  Int       m_iMaxTileMarkerEntryPoints;    //< maximum number of tile markers allowed in a slice (controls degree of parallelism)
     246  Double    m_dMaxTileMarkerOffset;         //< Calculated offset. Light weight tile markers will be transmitted for TileIdx= Offset, 2*Offset, 3*Offset ...
     247
     248  Int       m_iWaveFrontSynchro; //< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current.
     249  Int       m_iWaveFrontFlush; //< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs.
     250  Int       m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles).
     251
     252  Bool      m_bUseConstrainedIntraPred;                       ///< flag for using constrained intra prediction
     253 
     254  bool m_pictureDigestEnabled; ///< enable(1)/disable(0) md5 computation and SEI signalling
     255
     256  // weighted prediction
     257  Bool      m_bUseWeightPred;                                 ///< Use of explicit Weighting Prediction for P_SLICE
     258  UInt      m_uiBiPredIdc;                                    ///< Use of Bi-Directional Weighting Prediction (B_SLICE): explicit(1) or implicit(2)
     259
     260  Bool      m_enableTMVP;
     261#if MULTIBITS_DATA_HIDING
     262  Int       m_signHideFlag;
     263  Int       m_signHidingThreshold;
     264#endif
     265#if HHI_MPI
     266  Bool      m_bUseMVI;  ///< flag for using Motion Vector Inheritance for depth map coding
     267#endif
     268
     269  Int       m_useScalingListId;                               ///< using quantization matrix
     270  char*     m_scalingListFile;                                ///< quantization matrix file name
    191271
    192272  // camera parameter
     
    196276
    197277  Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
    198 
    199 #if HHI_INTERVIEW_SKIP
    200   TRenTop  m_cUsedPelsRenderer;                               ///< renderer for used pels map
    201 #endif
    202278
    203279#if HHI_VSO
     
    211287  Bool      m_bAllowNegDist;                              ///< Allow negative distortion in VSO
    212288#endif
    213   UInt      m_uiVSOMode;                                  ///< Number of VSO Mode, 1 = , 2 = simple, org vs. ren, 3 = simple, ren vs. ren, 4 = full
    214   Int       m_iNumberOfExternalRefs;                      ///< number Virtual External Reference Views
    215   std::vector< std::vector<Int> > m_aaiBaseViewRefInd;    ///< View numbers of Base View References
    216   std::vector< std::vector<Int> > m_aaiERViewRefInd;      ///< View numbers of External ViewReferences
    217   std::vector< std::vector<Int> > m_aaiERViewRefLutInd;   ///< Indices of LUTs used for External View References
    218 #endif
    219 
    220   Int       m_iSliceMode;           ///< 0: Disable all Recon slice limits, 1 : Maximum number of largest coding units per slice, 2: Maximum number of bytes in a slice
    221   Int       m_iSliceArgument;       ///< If m_iSliceMode==1, m_iSliceArgument=max. # of largest coding units. If m_iSliceMode==2, m_iSliceArgument=max. # of bytes.
    222   Int       m_iEntropySliceMode;    ///< 0: Disable all entropy slice limits, 1 : Maximum number of largest coding units per slice, 2: Constraint based entropy slice
    223   Int       m_iEntropySliceArgument;///< If m_iEntropySliceMode==1, m_iEntropySliceArgument=max. # of largest coding units. If m_iEntropySliceMode==2, m_iEntropySliceArgument=max. # of bins.
    224 
    225 #if MTK_NONCROSS_INLOOP_FILTER
    226   Bool m_bLFCrossSliceBoundaryFlag;  ///< 0: Cross-slice-boundary in-loop filtering 1: non-cross-slice-boundary in-loop filtering
    227 #endif
    228 #ifdef ROUNDING_CONTROL_BIPRED
    229   Bool m_useRoundingControlBipred;
    230 #endif
    231 #if CONSTRAINED_INTRA_PRED
    232   Bool      m_bUseConstrainedIntraPred;                       ///< flag for using constrained intra prediction
    233 #endif
     289  UInt      m_uiVSOMode;                                  ///< Number of VSO Mode, 1 = , 2 = simple, org vs. ren, 3 = simple, ren vs. ren, 4 = full 
     290#endif
     291
     292  // coding tools (depth intra modes)
    234293#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    235   Bool      m_bUseDMM;
    236 #endif
    237 #if HHI_MPI
    238   Bool      m_bUseMVI;  ///< flag for using Motion Vector Inheritance for depth map coding
    239 #endif
    240 
    241   PicOrderCnt m_iQpChangeFrame;
    242   Int         m_iQpChangeOffsetVideo;
    243   Int         m_iQpChangeOffsetDepth;
    244 
    245   bool m_pictureDigestEnabled; ///< enable(1)/disable(0) md5 computation and SEI signalling
    246 
    247   //====== Weighted Prediction ========
    248 #ifdef WEIGHT_PRED
    249   Bool                    m_bUseWeightPred;                   ///< Use of explicit Weighting Prediction for P_SLICE
    250   UInt                    m_uiBiPredIdc;                      ///< Use of Bi-Directional Weighting Prediction (B_SLICE): explicit(1) or implicit(2)
     294  Bool      m_bUseDMM;                                        ///< flag for using DMM
    251295#endif
    252296
     
    256300  Void  xPrintParameter ();                                   ///< print configuration values
    257301  Void  xPrintUsage     ();                                   ///< print usage
    258 
     302 
    259303  Void  xCleanUpVectors ();                                   ///< clean up vector sizes
    260304  Void  xInitCameraPars ();                                   ///< init camera parameters
     
    265309  Void xGetShiftParameter( UInt uiSourceView, UInt uiTargetView, bool bExternal, double& rdScale, double& rdOffset ); ///< Get one Shift Parameters
    266310
    267   // util
    268311  Void  xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char* & rpchOutputFileName);
    269   Bool  xConfirmParameter(Bool bflag, const char* message);
    270 
     312
     313  Void  xCheckCodingStructureMvc();                           ///< validate and configure inter-view coding structure
    271314
    272315  template <class T> Void xCleanUpVector( std::vector<T>& rcVec, const T& rcInvalid );
    273 
    274316#if HHI_VSO
    275317  // Ren Model String
     
    277319#endif
    278320public:
    279 
    280321  TAppEncCfg();
    281322  virtual ~TAppEncCfg();
    282 
     323 
    283324public:
    284325  Void  create    ();                                         ///< create option handling class
    285326  Void  destroy   ();                                         ///< destroy option handling class
    286327  Bool  parseCfg  ( Int argc, Char* argv[] );                 ///< parse configuration file to fill member variables
    287 
     328 
    288329};// END CLASS DEFINITION TAppEncCfg
    289330
     331//! \}
     332
    290333#endif // __TAPPENCCFG__
    291334
Note: See TracChangeset for help on using the changeset viewer.