source: 3DVCSoftware/trunk/source/Lib/TLibEncoder/TEncCfg.h @ 443

Last change on this file since 443 was 443, checked in by tech, 11 years ago
  • Reintegrated branch 6.2-dev0 rev. 442.
  • Changed version number.
  • Added coding results.
  • Property svn:eol-style set to native
File size: 38.7 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license. 
5 *
6 * Copyright (c) 2010-2012, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     TEncCfg.h
35    \brief    encoder configuration class (header)
36*/
37
38#ifndef __TENCCFG__
39#define __TENCCFG__
40
41#if _MSC_VER > 1000
42#pragma once
43#endif // _MSC_VER > 1000
44
45#include "TLibCommon/CommonDef.h"
46#include <assert.h>
47
48struct GOPEntryMvc
49{
50  Int m_POC;
51  Int m_QPOffset;
52  Double m_QPFactor;
53  Int m_temporalId;
54  Bool m_refPic;
55  Int m_numRefPicsActive;
56  Char m_sliceType;
57  Int m_numRefPics;
58  Int m_referencePics[MAX_NUM_REF_PICS];
59  Int m_usedByCurrPic[MAX_NUM_REF_PICS];
60  Bool m_interRPSPrediction;
61  Int m_deltaRIdxMinus1;
62  Int m_deltaRPS;
63  Int m_numRefIdc;
64  Int m_refIdc[MAX_NUM_REF_PICS+1];
65  Int m_numInterViewRefPics;
66  Int m_interViewRefs[MAX_NUM_REF_PICS];
67  Int m_interViewRefPosL0[MAX_NUM_REF_PICS];
68  Int m_interViewRefPosL1[MAX_NUM_REF_PICS];
69 GOPEntryMvc()
70  : m_POC(-1)
71  , m_QPOffset()
72  , m_QPFactor()
73  , m_temporalId()
74  , m_refPic()
75  , m_numRefPicsActive()
76  , m_sliceType()
77  , m_numRefPics()
78  , m_interRPSPrediction()
79  , m_deltaRIdxMinus1()
80  , m_deltaRPS()
81  , m_numRefIdc()
82  , m_numInterViewRefPics()
83  {
84    ::memset( m_referencePics, 0, sizeof(m_referencePics) );
85    ::memset( m_usedByCurrPic, 0, sizeof(m_usedByCurrPic) );
86    ::memset( m_refIdc,        0, sizeof(m_refIdc) );
87    ::memset( m_interViewRefs,   0, sizeof(m_interViewRefs) );
88    ::memset( m_interViewRefPosL0, 0, sizeof(m_interViewRefPosL0) );
89    ::memset( m_interViewRefPosL1, 0, sizeof(m_interViewRefPosL1) );
90  }
91};
92
93std::istringstream &operator>>(std::istringstream &in, GOPEntryMvc &entry);
94
95//! \ingroup TLibEncoder
96//! \{
97
98// ====================================================================================================================
99// Class definition
100// ====================================================================================================================
101
102/// encoder configuration class
103class TEncCfg
104{
105protected:
106  //==== File I/O ========
107  Int       m_iFrameRate;
108  Int       m_FrameSkip;
109  Int       m_iSourceWidth;
110  Int       m_iSourceHeight;
111  Int       m_croppingMode;
112  Int       m_cropLeft;
113  Int       m_cropRight;
114  Int       m_cropTop;
115  Int       m_cropBottom;
116  Int       m_iFrameToBeEncoded;
117  Double    m_adLambdaModifier[ MAX_TLAYER ];
118
119  //====== Coding Structure ========
120  UInt      m_uiIntraPeriod;
121  UInt      m_uiDecodingRefreshType;            ///< the type of decoding refresh employed for the random access.
122  Int       m_iGOPSize;
123  GOPEntryMvc m_GOPList[MAX_GOP+1];
124  Int       m_extraRPSs;
125  Int       m_maxDecPicBuffering[MAX_TLAYER];
126  Int       m_numReorderPics[MAX_TLAYER];
127 
128  Int       m_iQP;                              //  if (AdaptiveQP == OFF)
129 
130  Int       m_aiTLayerQPOffset[MAX_TLAYER];
131  Int       m_aiPad[2];
132 
133
134  Int       m_iMaxRefPicNum;                     ///< this is used to mimic the sliding mechanism used by the decoder
135                                                 // TODO: We need to have a common sliding mechanism used by both the encoder and decoder
136
137  Int       m_maxTempLayer;                      ///< Max temporal layer
138  Bool      m_bDisInter4x4;
139  Bool m_useAMP;
140  //======= Transform =============
141  UInt      m_uiQuadtreeTULog2MaxSize;
142  UInt      m_uiQuadtreeTULog2MinSize;
143  UInt      m_uiQuadtreeTUMaxDepthInter;
144  UInt      m_uiQuadtreeTUMaxDepthIntra;
145 
146  Bool      m_useNSQT;
147 
148  //====== Loop/Deblock Filter ========
149  Bool      m_bLoopFilterDisable;
150  Bool      m_loopFilterOffsetInAPS;
151  Int       m_loopFilterBetaOffsetDiv2;
152  Int       m_loopFilterTcOffsetDiv2;
153  Bool      m_DeblockingFilterControlPresent;
154  Bool      m_bUseSAO;
155#if LGE_ILLUCOMP_B0045
156  Bool      m_bUseIC;
157#endif
158#if INTER_VIEW_VECTOR_SCALING_C0115
159  Bool      m_bUseIVS;
160#endif
161  Int       m_maxNumOffsetsPerPic;
162#if LGE_SAO_MIGRATION_D0091
163  Bool      m_saoLcuBoundary;
164  Bool      m_saoLcuBasedOptimization;
165#else
166  Bool      m_saoInterleavingFlag;
167#endif
168
169  //====== Lossless ========
170#if LOSSLESS_CODING
171  Bool      m_useLossless;
172#endif
173  //====== Motion search ========
174  Int       m_iFastSearch;                      //  0:Full search  1:Diamond  2:PMVFAST
175  Int       m_iSearchRange;                     //  0:Full frame
176  Int       m_bipredSearchRange;
177#if DV_V_RESTRICTION_B0037
178  Bool      m_bUseDisparitySearchRangeRestriction;
179  Int       m_iVerticalDisparitySearchRange;
180#endif
181  //====== Quality control ========
182  Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
183  Int       m_iMaxCuDQPDepth;                   //  Max. depth for a minimum CuDQP (0:default)
184
185  Int       m_iChromaQpOffset  ;                //  ChromaQpOffset    (0:default)
186  Int       m_iChromaQpOffset2nd;               //  ChromaQpOffset2nd (0:default)
187
188#if ADAPTIVE_QP_SELECTION
189  Bool      m_bUseAdaptQpSelect;
190#endif
191
192  Bool      m_bUseAdaptiveQP;
193  Int       m_iQPAdaptationRange;
194 
195#if HHI_VSO
196  //====== View Synthesis Optimization ======
197  Bool      m_bUseVSO;
198  Bool      m_bForceLambdaScale;
199#if HHI_VSO_DIST_INT
200  Bool      m_bAllowNegDist;
201#endif
202  Double    m_dLambdaScaleVSO;
203  UInt      m_uiVSOMode;
204#if LGE_WVSO_A0119
205  Bool      m_bUseWVSO;
206  Int       m_iVSOWeight;
207  Int       m_iVSDWeight;
208  Int       m_iDWeight;
209#endif
210#endif
211#if SAIT_VSO_EST_A0033
212  Bool      m_bUseEstimatedVSD; 
213  Double    m_dDispCoeff;
214#endif
215
216
217  //====== Tool list ========
218  Bool      m_bUseSBACRD;
219  Bool      m_bUseALF;
220  Int       m_iALFEncodePassReduction;
221
222  Int       m_iALFMaxNumberFilters;
223  Bool      m_bALFParamInSlice;
224  Bool      m_bALFPicBasedEncode;
225
226  Bool      m_bUseASR;
227  Bool      m_bUseHADME;
228  Bool      m_bUseLComb;
229  Bool      m_bLCMod;
230  Bool      m_bUseRDOQ;
231  Bool      m_bUseFastEnc;
232  Bool      m_bUseEarlyCU;
233
234  Bool      m_useFastDecisionForMerge;
235  Bool      m_bUseCbfFastMode;
236  Bool      m_bUseLMChroma; 
237#if HHI_MPI
238  Bool      m_bUseMVI;
239#endif
240#if RWTH_SDC_DLT_B0036
241  Bool      m_bUseDLT;
242  Bool      m_bUseSDC;
243#endif
244
245  Int*      m_aidQP;
246  UInt      m_uiDeltaQpRD;
247 
248  Bool      m_bUseConstrainedIntraPred;
249  Bool      m_usePCM;
250  UInt      m_pcmLog2MaxSize;
251  UInt      m_uiPCMLog2MinSize;
252  //====== Slice ========
253  Int       m_iSliceMode;
254  Int       m_iSliceArgument; 
255  //====== Entropy Slice ========
256  Int       m_iEntropySliceMode;
257  Int       m_iEntropySliceArgument;
258  Int       m_iSliceGranularity;
259  Bool      m_bLFCrossSliceBoundaryFlag;
260
261  Bool      m_bPCMInputBitDepthFlag;
262  UInt      m_uiPCMBitDepthLuma;
263  UInt      m_uiPCMBitDepthChroma;
264  Bool      m_bPCMFilterDisableFlag;
265  Int       m_iTileBehaviorControlPresentFlag;
266  Bool      m_bLFCrossTileBoundaryFlag;
267  Int       m_iColumnRowInfoPresent;
268  Int       m_iUniformSpacingIdr;
269  Int       m_iNumColumnsMinus1;
270  UInt*     m_puiColumnWidth;
271  Int       m_iNumRowsMinus1;
272  UInt*     m_puiRowHeight;
273  Int       m_iTileLocationInSliceHeaderFlag; //< enable(1)/disable(0) transmitssion of tile location in slice header
274
275  Int       m_iTileMarkerFlag;              //< enable(1)/disable(0) transmitssion of light weight tile marker
276  Int       m_iMaxTileMarkerEntryPoints;    //< maximum number of tile markers allowed in a slice (controls degree of parallelism)
277  Double    m_dMaxTileMarkerOffset;         //< Calculated offset. Light weight tile markers will be transmitted for TileIdx= Offset, 2*Offset, 3*Offset ...
278
279  Int       m_iWaveFrontSynchro;
280  Int       m_iWaveFrontFlush;
281  Int       m_iWaveFrontSubstreams;
282
283  Bool      m_pictureDigestEnabled; ///< enable(1)/disable(0) md5 computation and SEI signalling
284
285  //====== Weighted Prediction ========
286  Bool      m_bUseWeightPred;       //< Use of Weighting Prediction (P_SLICE)
287  UInt      m_uiBiPredIdc;          //< Use of Bi-Directional Weighting Prediction (B_SLICE)
288  Int       m_useScalingListId;            ///< Using quantization matrix i.e. 0=off, 1=default, 2=file.
289  char*     m_scalingListFile;          ///< quantization matrix file name
290
291  Bool      m_bEnableTMVP;
292  Int       m_signHideFlag;
293  Int       m_signHidingThreshold;
294
295#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
296  UInt     m_layerId;
297#endif
298 
299  Int      m_viewId;
300  Bool     m_isDepth;
301
302#if HHI_INTERVIEW_SKIP
303  Bool        m_bInterViewSkip;
304#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
305  Double      m_dInterViewSkipLambdaScale;
306#endif
307#endif
308#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
309  Bool     m_bUseDMM;
310#endif
311
312#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
313  Bool m_bUseDMM34;
314#endif
315
316#if H3D_QTL
317  Bool     m_bUseQTLPC;
318#endif
319
320  Int      m_iViewOrderIdx;
321
322  UInt     m_uiCamParPrecision;
323  Bool     m_bCamParInSliceHeader;
324  Int**    m_aaiCodedScale;
325  Int**    m_aaiCodedOffset;
326
327#if DEPTH_MAP_GENERATION
328  UInt     m_uiPredDepthMapGeneration;
329  UInt     m_uiPdmPrecision;
330  Int**    m_aaiPdmScaleNomDelta;
331  Int**    m_aaiPdmOffset;
332#endif
333
334#if H3D_IVMP
335  UInt        m_uiMultiviewMvPredMode;
336  UInt        m_uiMultiviewMvRegMode;
337  Double      m_dMultiviewMvRegLambdaScale;
338#endif
339#if H3D_IVRP
340#if QC_ARP_D0177
341  UInt      m_nUseAdvResPred;
342  UInt      m_nARPStepNum;
343#else
344  UInt        m_uiMultiviewResPredMode;
345#endif
346#endif
347
348#if MTK_D0156
349#if MERL_VSP_COMPENSATION_C0152
350  Bool      m_bUseVSPCompensation;
351#endif
352  Bool      m_bUseDVPRefine;
353#endif
354
355public:
356  TEncCfg()          {}
357  virtual ~TEncCfg()
358  {
359    if( m_iUniformSpacingIdr == 0 )
360    {
361      if( m_iNumColumnsMinus1 )
362      { 
363        delete[] m_puiColumnWidth; 
364        m_puiColumnWidth = NULL;
365      }
366      if( m_iNumRowsMinus1 )
367      {
368        delete[] m_puiRowHeight;
369        m_puiRowHeight = NULL;
370      }
371    }
372    m_iTileLocationInSliceHeaderFlag = 0;
373    m_iTileMarkerFlag              = 0;
374  }
375 
376  Void      setFrameRate                    ( Int   i )      { m_iFrameRate = i; }
377  Void      setFrameSkip                    ( unsigned int i ) { m_FrameSkip = i; }
378  Void      setSourceWidth                  ( Int   i )      { m_iSourceWidth = i; }
379  Void      setSourceHeight                 ( Int   i )      { m_iSourceHeight = i; }
380  Void      setCroppingMode                 ( Int   i )      { m_croppingMode = i; }
381  Void      setCropLeft                     ( Int   i )      { m_cropLeft = i; }
382  Void      setCropRight                    ( Int   i )      { m_cropRight = i; }
383  Void      setCropTop                      ( Int   i )      { m_cropTop = i; }
384  Void      setCropBottom                   ( Int   i )      { m_cropBottom = i; }
385  Void      setFrameToBeEncoded             ( Int   i )      { m_iFrameToBeEncoded = i; }
386 
387  //====== Coding Structure ========
388  Void      setIntraPeriod                  ( Int   i )      { m_uiIntraPeriod = (UInt)i; }
389  Void      setDecodingRefreshType          ( Int   i )      { m_uiDecodingRefreshType = (UInt)i; }
390  Void      setGOPSize                      ( Int   i )      { m_iGOPSize = i; }
391  Void      setGopList                      ( GOPEntryMvc* GOPList ) { for( Int i = 0; i < MAX_GOP+1; i++ ) m_GOPList[i] = GOPList[i]; }
392  Void      setExtraRPSs                    ( Int   i )      { m_extraRPSs = i; }
393  GOPEntryMvc getGOPEntry                   ( Int   i )      { return m_GOPList[i]; }
394  Void      setMaxDecPicBuffering           ( UInt u, UInt tlayer ) { m_maxDecPicBuffering[tlayer] = u;    }
395  Void      setNumReorderPics               ( Int  i, UInt tlayer ) { m_numReorderPics[tlayer] = i;    }
396 
397#if HHI_INTERVIEW_SKIP
398  Void      setInterViewSkip            ( UInt  u )       { m_bInterViewSkip         = u; }
399  Bool      getInterViewSkip            ( )       { return m_bInterViewSkip  ;}
400#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
401  Void      setInterViewSkipLambdaScale ( UInt  u )       { m_dInterViewSkipLambdaScale = u; }
402  Double      getInterViewSkipLambdaScale ()                { return m_dInterViewSkipLambdaScale; }
403#endif
404#endif
405  Void      setQP                           ( Int   i )      { m_iQP = i; }
406 
407  Void      setTemporalLayerQPOffset        ( Int*  piTemporalLayerQPOffset )      { for ( Int i = 0; i < MAX_TLAYER; i++ ) m_aiTLayerQPOffset[i] = piTemporalLayerQPOffset[i]; }
408  Void      setPad                          ( Int*  iPad                   )      { for ( Int i = 0; i < 2; i++ ) m_aiPad[i] = iPad[i]; }
409 
410  Int       getMaxRefPicNum                 ()                              { return m_iMaxRefPicNum;           }
411  Void      setMaxRefPicNum                 ( Int iMaxRefPicNum )           { m_iMaxRefPicNum = iMaxRefPicNum;  }
412
413  Bool      getMaxTempLayer                 ()                              { return m_maxTempLayer;              } 
414  Void      setMaxTempLayer                 ( Int maxTempLayer )            { m_maxTempLayer = maxTempLayer;      }
415
416  Bool      getDisInter4x4                  ()              { return m_bDisInter4x4;        }
417  Void      setDisInter4x4                  ( Bool b )      { m_bDisInter4x4  = b;          }
418  Bool      isDepthCoder                    ()               { return m_isDepth; }
419 
420#if DEPTH_MAP_GENERATION
421  Void      setPredDepthMapGeneration       ( UInt  u )      { m_uiPredDepthMapGeneration   = u; }
422  Void      setPdmPrecision                 ( UInt  u )      { m_uiPdmPrecision             = u; }
423  Void      setPdmScaleNomDelta             ( Int** p )      { m_aaiPdmScaleNomDelta        = p; }
424  Void      setPdmOffset                    ( Int** p )      { m_aaiPdmOffset               = p; }
425#endif
426
427#if H3D_IVMP
428  Void      setMultiviewMvPredMode          ( UInt  u )      { m_uiMultiviewMvPredMode      = u; }
429  Void      setMultiviewMvRegMode           ( UInt  u )      { m_uiMultiviewMvRegMode       = u; }
430  Void      setMultiviewMvRegLambdaScale    ( Double d)      { m_dMultiviewMvRegLambdaScale = d; }
431#endif
432#if H3D_IVRP
433#if QC_ARP_D0177
434  UInt       getUseAdvRP                    ()                  { return m_nUseAdvResPred; }
435  Void       setUseAdvRP                    ( UInt  u )         { m_nUseAdvResPred = u;    }
436  UInt       getARPStepNum                  ()                  { return m_nARPStepNum;    }
437  Void       setARPStepNum                  ( UInt  u )         { m_nARPStepNum = u;       }
438#else
439  Void      setMultiviewResPredMode         ( UInt  u )      { m_uiMultiviewResPredMode     = u; }
440#endif
441#endif
442 
443  //======== Transform =============
444  Void      setQuadtreeTULog2MaxSize        ( UInt  u )      { m_uiQuadtreeTULog2MaxSize = u; }
445  Void      setQuadtreeTULog2MinSize        ( UInt  u )      { m_uiQuadtreeTULog2MinSize = u; }
446  Void      setQuadtreeTUMaxDepthInter      ( UInt  u )      { m_uiQuadtreeTUMaxDepthInter = u; }
447  Void      setQuadtreeTUMaxDepthIntra      ( UInt  u )      { m_uiQuadtreeTUMaxDepthIntra = u; }
448 
449  Void setUseNSQT( Bool b ) { m_useNSQT = b; }
450  Void setUseAMP( Bool b ) { m_useAMP = b; }
451 
452  //====== Loop/Deblock Filter ========
453  Void      setLoopFilterDisable            ( Bool  b )      { m_bLoopFilterDisable       = b; }
454  Void      setLoopFilterOffsetInAPS        ( Bool  b )      { m_loopFilterOffsetInAPS      = b; }
455  Void      setLoopFilterBetaOffset         ( Int   i )      { m_loopFilterBetaOffsetDiv2  = i; }
456  Void      setLoopFilterTcOffset           ( Int   i )      { m_loopFilterTcOffsetDiv2    = i; }
457  Void      setDeblockingFilterControlPresent ( Bool b ) { m_DeblockingFilterControlPresent = b; }
458
459  //====== Motion search ========
460  Void      setFastSearch                   ( Int   i )      { m_iFastSearch = i; }
461  Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
462  Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
463#if DV_V_RESTRICTION_B0037
464  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
465  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
466#endif
467#if H3D_IVMP
468  UInt      getMultiviewMvRegMode           ()      { return  m_uiMultiviewMvRegMode; }
469  Double    getMultiviewMvRegLambdaScale    ()      { return  m_dMultiviewMvRegLambdaScale; }
470#endif
471
472#if HHI_VSO
473 //==== VSO  ==========
474  Void      setVSOMode                      ( UInt  ui )    { m_uiVSOMode   = ui; }
475  Void      setForceLambdaScaleVSO          ( Bool  b )     { m_bForceLambdaScale = b; };
476  Void      setLambdaScaleVSO               ( Double d )    { m_dLambdaScaleVSO   = d; };
477#if HHI_VSO_DIST_INT
478  Void      setAllowNegDist                 ( Bool b  )     { m_bAllowNegDist     = b; };
479#endif
480#if LGE_WVSO_A0119
481  Void      setUseWVSO                      ( Bool  b )     { m_bUseWVSO   = b; }
482  Void      setVSOWeight                    ( Int   i )     { m_iVSOWeight = i; }
483  Void      setVSDWeight                    ( Int   i )     { m_iVSDWeight = i; }
484  Void      setDWeight                      ( Int   i )     { m_iDWeight   = i; }
485#endif
486#endif
487
488  //====== Quality control ========
489  Void      setMaxDeltaQP                   ( Int   i )      { m_iMaxDeltaQP = i; }
490  Void      setMaxCuDQPDepth                ( Int   i )      { m_iMaxCuDQPDepth = i; }
491
492  Void      setChromaQpOffset               ( Int   i ) { m_iChromaQpOffset    = i; }
493  Void      setChromaQpOffset2nd            ( Int   i ) { m_iChromaQpOffset2nd = i; }
494
495#if ADAPTIVE_QP_SELECTION
496  Void      setUseAdaptQpSelect             ( Bool   i ) { m_bUseAdaptQpSelect    = i; }
497  Bool      getUseAdaptQpSelect             ()           { return   m_bUseAdaptQpSelect; }
498#endif
499
500  Void      setUseAdaptiveQP                ( Bool  b )      { m_bUseAdaptiveQP = b; }
501  Void      setQPAdaptationRange            ( Int   i )      { m_iQPAdaptationRange = i; }
502 
503  //====== Lossless ========
504#if LOSSLESS_CODING
505  Void      setUseLossless                  (Bool    b  )        { m_useLossless = b;  }
506#endif
507  //====== Sequence ========
508  Int       getFrameRate                    ()      { return  m_iFrameRate; }
509  unsigned int getFrameSkip                 ()      { return  m_FrameSkip; }
510  Int       getSourceWidth                  ()      { return  m_iSourceWidth; }
511  Int       getSourceHeight                 ()      { return  m_iSourceHeight; }
512  Int       getCroppingMode                 ()      { return  m_croppingMode; }
513  Int       getCropLeft                     ()      { return  m_cropLeft; }
514  Int       getCropRight                    ()      { return  m_cropRight; }
515  Int       getCropTop                      ()      { return  m_cropTop; }
516  Int       getCropBottom                   ()      { return  m_cropBottom; }
517  Int       getFrameToBeEncoded             ()      { return  m_iFrameToBeEncoded; }
518  void setLambdaModifier                    ( UInt uiIndex, Double dValue ) { m_adLambdaModifier[ uiIndex ] = dValue; }
519  Double getLambdaModifier                  ( UInt uiIndex ) const { return m_adLambdaModifier[ uiIndex ]; }
520
521  //==== Coding Structure ========
522  UInt      getIntraPeriod                  ()      { return  m_uiIntraPeriod; }
523  UInt      getDecodingRefreshType          ()      { return  m_uiDecodingRefreshType; }
524  Int       getGOPSize                      ()      { return  m_iGOPSize; }
525  Int       getMaxDecPicBuffering           (UInt tlayer) { return m_maxDecPicBuffering[tlayer]; }
526  Int       getNumReorderPics               (UInt tlayer) { return m_numReorderPics[tlayer]; }
527  Int       getQP                           ()      { return  m_iQP; }
528 
529  Int       getTemporalLayerQPOffset        ( Int i )      { assert (i < MAX_TLAYER ); return  m_aiTLayerQPOffset[i]; }
530  Int       getPad                          ( Int i )      { assert (i < 2 );                      return  m_aiPad[i]; }
531 
532  //======== Transform =============
533  UInt      getQuadtreeTULog2MaxSize        ()      const { return m_uiQuadtreeTULog2MaxSize; }
534  UInt      getQuadtreeTULog2MinSize        ()      const { return m_uiQuadtreeTULog2MinSize; }
535  UInt      getQuadtreeTUMaxDepthInter      ()      const { return m_uiQuadtreeTUMaxDepthInter; }
536  UInt      getQuadtreeTUMaxDepthIntra      ()      const { return m_uiQuadtreeTUMaxDepthIntra; }
537 
538  //==== Loop/Deblock Filter ========
539  Bool      getLoopFilterDisable            ()      { return  m_bLoopFilterDisable;       }
540  Bool      getLoopFilterOffsetInAPS        ()      { return m_loopFilterOffsetInAPS; }
541  Int       getLoopFilterBetaOffset         ()      { return m_loopFilterBetaOffsetDiv2; }
542  Int       getLoopFilterTcOffset           ()      { return m_loopFilterTcOffsetDiv2; }
543  Bool      getDeblockingFilterControlPresent()  { return  m_DeblockingFilterControlPresent; }
544
545  //==== Motion search ========
546  Int       getFastSearch                   ()      { return  m_iFastSearch; }
547  Int       getSearchRange                  ()      { return  m_iSearchRange; }
548#if DV_V_RESTRICTION_B0037
549  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
550  Int       getVerticalDisparitySearchRange ()      { return  m_iVerticalDisparitySearchRange; }
551#endif
552#if HHI_VSO
553  //==== VSO  ==========
554  UInt      getVSOMode                      ()      { return m_uiVSOMode; }
555  Bool      getForceLambdaScaleVSO          ()      { return m_bForceLambdaScale; }
556  Double    getLambdaScaleVSO               ()      { return m_dLambdaScaleVSO;   }
557#if HHI_VSO_DIST_INT
558  Bool      getAllowNegDist                 ()      { return m_bAllowNegDist;     }
559#endif
560#if LGE_WVSO_A0119
561  Bool      getUseWVSO                      ()      { return m_bUseWVSO;     }
562  Int       getVSOWeight                    ()      { return m_iVSOWeight;    }
563  Int       getVSDWeight                    ()      { return m_iVSDWeight;    }
564  Int       getDWeight                      ()      { return m_iDWeight;    }
565#endif
566#endif
567
568  //==== Quality control ========
569  Int       getMaxDeltaQP                   ()      { return  m_iMaxDeltaQP; }
570  Int       getMaxCuDQPDepth                ()      { return  m_iMaxCuDQPDepth; }
571  Bool      getUseAdaptiveQP                ()      { return  m_bUseAdaptiveQP; }
572  Int       getQPAdaptationRange            ()      { return  m_iQPAdaptationRange; }
573  //====== Lossless ========
574#if LOSSLESS_CODING
575  Bool      getUseLossless                  ()      { return  m_useLossless;  }
576#endif
577 
578  //==== Tool list ========
579  Void      setUseSBACRD                    ( Bool  b )     { m_bUseSBACRD  = b; }
580  Void      setUseASR                       ( Bool  b )     { m_bUseASR     = b; }
581  Void      setUseHADME                     ( Bool  b )     { m_bUseHADME   = b; }
582  Void      setUseALF                       ( Bool  b )     { m_bUseALF   = b; }
583  Void      setUseLComb                     ( Bool  b )     { m_bUseLComb   = b; }
584  Void      setLCMod                        ( Bool  b )     { m_bLCMod   = b;    }
585  Void      setUseRDOQ                      ( Bool  b )     { m_bUseRDOQ    = b; }
586#if HHI_VSO
587  Void      setUseVSO                       ( Bool  b )     { m_bUseVSO     = b; }
588#endif
589
590#if SAIT_VSO_EST_A0033
591  Void      setUseEstimatedVSD              ( Bool  b )     { m_bUseEstimatedVSD = b; }
592  Void      setDispCoeff                    ( Double  d )   { m_dDispCoeff  = d; }
593#endif
594
595  Void      setUseFastEnc                   ( Bool  b )     { m_bUseFastEnc = b; }
596  Void      setUseEarlyCU                   ( Bool  b )     { m_bUseEarlyCU = b; }
597  Void      setUseFastDecisionForMerge      ( Bool  b )     { m_useFastDecisionForMerge = b; }
598  Void      setUseCbfFastMode            ( Bool  b )     { m_bUseCbfFastMode = b; }
599  Void      setUseConstrainedIntraPred      ( Bool  b )     { m_bUseConstrainedIntraPred = b; }
600  Void      setPCMInputBitDepthFlag         ( Bool  b )     { m_bPCMInputBitDepthFlag = b; }
601  Void      setPCMFilterDisableFlag         ( Bool  b )     {  m_bPCMFilterDisableFlag = b; }
602  Void      setUsePCM                       ( Bool  b )     {  m_usePCM = b;               }
603  Void      setPCMLog2MaxSize               ( UInt u )      { m_pcmLog2MaxSize = u;      }
604  Void      setPCMLog2MinSize               ( UInt u )     { m_uiPCMLog2MinSize = u;      }
605  Void      setdQPs                         ( Int*  p )     { m_aidQP       = p; }
606  Void      setDeltaQpRD                    ( UInt  u )     {m_uiDeltaQpRD  = u; }
607  Bool      getUseSBACRD                    ()      { return m_bUseSBACRD;  }
608  Bool      getUseASR                       ()      { return m_bUseASR;     }
609  Bool      getUseHADME                     ()      { return m_bUseHADME;   }
610  Bool      getUseALF                       ()      { return m_bUseALF;     }
611  Void      setALFEncodePassReduction       (Int i)  { m_iALFEncodePassReduction = i; }
612  Int       getALFEncodePassReduction       ()       { return m_iALFEncodePassReduction; }
613
614  Void      setALFMaxNumberFilters          (Int i)  { m_iALFMaxNumberFilters = i; } 
615  Int       getALFMaxNumberFilters          ()       { return m_iALFMaxNumberFilters; } 
616  Void      setALFParamInSlice              (Bool b) {m_bALFParamInSlice = b;}
617  Bool      getALFParamInSlice              ()       {return m_bALFParamInSlice;}
618  Void      setALFPicBasedEncode            (Bool b) {m_bALFPicBasedEncode = b;}
619  Bool      getALFPicBasedEncode            ()       {return m_bALFPicBasedEncode;}
620
621  Bool      getUseLComb                     ()      { return m_bUseLComb;   }
622  Bool      getLCMod                        ()      { return m_bLCMod; }
623  Bool      getUseRDOQ                      ()      { return m_bUseRDOQ;    }
624
625#if HHI_VSO
626  Bool      getUseVSO                       ()      { return m_bUseVSO;     }
627#endif
628#if SAIT_VSO_EST_A0033
629  Bool      getUseEstimatedVSD              ()      { return m_bUseEstimatedVSD; }
630  Double    getDispCoeff                    ()      { return m_dDispCoeff;    }
631#endif
632
633  Bool      getUseFastEnc                   ()      { return m_bUseFastEnc; }
634  Bool      getUseEarlyCU                   ()      { return m_bUseEarlyCU; }
635  Bool      getUseFastDecisionForMerge      ()      { return m_useFastDecisionForMerge; }
636  Bool      getUseCbfFastMode           ()      { return m_bUseCbfFastMode; }
637  Bool      getUseConstrainedIntraPred      ()      { return m_bUseConstrainedIntraPred; }
638#if NS_HAD
639  Bool      getUseNSQT                      ()      { return m_useNSQT; }
640#endif
641  Bool      getPCMInputBitDepthFlag         ()      { return m_bPCMInputBitDepthFlag;   } 
642  Bool      getPCMFilterDisableFlag         ()      { return m_bPCMFilterDisableFlag;   } 
643  Bool      getUsePCM                       ()      { return m_usePCM;                 }
644  UInt      getPCMLog2MaxSize               ()      { return m_pcmLog2MaxSize;  }
645  UInt      getPCMLog2MinSize               ()      { return  m_uiPCMLog2MinSize;  }
646
647  Bool getUseLMChroma                       ()      { return m_bUseLMChroma;        }
648  Void setUseLMChroma                       ( Bool b ) { m_bUseLMChroma  = b;       }
649
650  Int*      getdQPs                         ()      { return m_aidQP;       }
651  UInt      getDeltaQpRD                    ()      { return m_uiDeltaQpRD; }
652
653  //====== Slice ========
654  Void  setSliceMode                   ( Int  i )       { m_iSliceMode = i;              }
655  Void  setSliceArgument               ( Int  i )       { m_iSliceArgument = i;          }
656  Int   getSliceMode                   ()              { return m_iSliceMode;           }
657  Int   getSliceArgument               ()              { return m_iSliceArgument;       }
658  //====== Entropy Slice ========
659  Void  setEntropySliceMode            ( Int  i )      { m_iEntropySliceMode = i;       }
660  Void  setEntropySliceArgument        ( Int  i )      { m_iEntropySliceArgument = i;   }
661  Int   getEntropySliceMode            ()              { return m_iEntropySliceMode;    }
662  Int   getEntropySliceArgument        ()              { return m_iEntropySliceArgument;}
663  Void  setSliceGranularity            ( Int  i )      { m_iSliceGranularity = i;       }
664  Int   getSliceGranularity            ()              { return m_iSliceGranularity;    }
665  Void  setLFCrossSliceBoundaryFlag    ( Bool   bValue  )    { m_bLFCrossSliceBoundaryFlag = bValue; }
666  Bool  getLFCrossSliceBoundaryFlag    ()                    { return m_bLFCrossSliceBoundaryFlag;   }
667
668#if HHI_MPI
669  Void  setUseMVI                      ( Bool bVal )   {m_bUseMVI = bVal;}
670#endif
671#if RWTH_SDC_DLT_B0036
672  Void  setUseDLT                       ( Bool  b )     { m_bUseDLT   = b; }
673  Void  setUseSDC                       ( Bool  b )     { m_bUseSDC   = b; }
674#endif
675  Void  setUseSAO                      ( Bool bVal )   {m_bUseSAO = bVal;}
676  Bool  getUseSAO                      ()              {return m_bUseSAO;}
677#if LGE_ILLUCOMP_B0045
678  Void  setUseIC                       ( Bool bVal )   {m_bUseIC = bVal;}
679  Bool  getUseIC                       ()              {return m_bUseIC;}
680#endif
681#if INTER_VIEW_VECTOR_SCALING_C0115
682  Void  setUseIVS                       ( Bool bVal )   {m_bUseIVS = bVal;}
683  Bool  getUseIVS                       ()              {return m_bUseIVS;}
684#endif
685  Void  setMaxNumOffsetsPerPic                   (Int iVal)            { m_maxNumOffsetsPerPic = iVal; }
686  Int   getMaxNumOffsetsPerPic                   ()                    { return m_maxNumOffsetsPerPic; }
687#if LGE_SAO_MIGRATION_D0091
688  Void  setSaoLcuBoundary              (Bool val)      { m_saoLcuBoundary = val; }
689  Bool  getSaoLcuBoundary              ()              { return m_saoLcuBoundary; }
690  Void  setSaoLcuBasedOptimization               (Bool val)            { m_saoLcuBasedOptimization = val; }
691  Bool  getSaoLcuBasedOptimization               ()                    { return m_saoLcuBasedOptimization; }
692#else
693  Void  setSaoInterleavingFlag                   (bool bVal)           { m_saoInterleavingFlag = bVal; }
694  Bool  getSaoInterleavingFlag                   ()                    { return m_saoInterleavingFlag; }
695#endif
696  Void  setTileBehaviorControlPresentFlag        ( Int i )             { m_iTileBehaviorControlPresentFlag = i;    }
697  Int   getTileBehaviorControlPresentFlag        ()                    { return m_iTileBehaviorControlPresentFlag; }
698  Void  setLFCrossTileBoundaryFlag               ( Bool   bValue  )    { m_bLFCrossTileBoundaryFlag = bValue; }
699  Bool  getLFCrossTileBoundaryFlag               ()                    { return m_bLFCrossTileBoundaryFlag;   }
700  Void  setColumnRowInfoPresent        ( Int i )           { m_iColumnRowInfoPresent = i; }
701  Int   getColumnRowInfoPresent        ()                  { return m_iColumnRowInfoPresent; }
702  Void  setUniformSpacingIdr           ( Int i )           { m_iUniformSpacingIdr = i; }
703  Int   getUniformSpacingIdr           ()                  { return m_iUniformSpacingIdr; }
704  Void  setNumColumnsMinus1            ( Int i )           { m_iNumColumnsMinus1 = i; }
705  Int   getNumColumnsMinus1            ()                  { return m_iNumColumnsMinus1; }
706  Void  setColumnWidth ( char* str )
707  {
708    char *columnWidth;
709    int  i=0;
710    Int  m_iWidthInCU = ( m_iSourceWidth%g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth;
711
712    if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
713    {
714      m_puiColumnWidth = new UInt[m_iNumColumnsMinus1];
715
716      columnWidth = strtok(str, " ,-");
717      while(columnWidth!=NULL)
718      {
719        if( i>=m_iNumColumnsMinus1 )
720        {
721          printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" );
722          exit( EXIT_FAILURE );
723        }
724        *( m_puiColumnWidth + i ) = atoi( columnWidth );
725        printf("col: m_iWidthInCU= %4d i=%4d width= %4d\n",m_iWidthInCU,i,m_puiColumnWidth[i]); //AFU
726        columnWidth = strtok(NULL, " ,-");
727        i++;
728      }
729      if( i<m_iNumColumnsMinus1 )
730      {
731        printf( "The width of some columns is not defined.\n" );
732        exit( EXIT_FAILURE );
733      }
734    }
735  }
736  UInt  getColumnWidth                 ( UInt columnidx )  { return *( m_puiColumnWidth + columnidx ); }
737  Void  setNumRowsMinus1               ( Int i )           { m_iNumRowsMinus1 = i; }
738  Int   getNumRowsMinus1               ()                  { return m_iNumRowsMinus1; }
739  Void  setRowHeight (char* str)
740  {
741    char *rowHeight;
742    int  i=0;
743    Int  m_iHeightInCU = ( m_iSourceHeight%g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight;
744
745    if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
746    {
747      m_puiRowHeight = new UInt[m_iNumRowsMinus1];
748
749      rowHeight = strtok(str, " ,-");
750      while(rowHeight!=NULL)
751      {
752        if( i>=m_iNumRowsMinus1 )
753        {
754          printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" );
755          exit( EXIT_FAILURE );
756        }
757        *( m_puiRowHeight + i ) = atoi( rowHeight );
758        printf("row: m_iHeightInCU=%4d i=%4d height=%4d\n",m_iHeightInCU,i,m_puiRowHeight[i]); //AFU
759        rowHeight = strtok(NULL, " ,-");
760        i++;
761      }
762      if( i<m_iNumRowsMinus1 )
763      {
764        printf( "The height of some rows is not defined.\n" );
765        exit( EXIT_FAILURE );
766     }
767    }
768  }
769  UInt  getRowHeight                   ( UInt rowIdx )     { return *( m_puiRowHeight + rowIdx ); }
770  Void  xCheckGSParameters();
771  Int  getTileLocationInSliceHeaderFlag ()                 { return m_iTileLocationInSliceHeaderFlag; }
772  Void setTileLocationInSliceHeaderFlag ( Int iFlag )      { m_iTileLocationInSliceHeaderFlag = iFlag;}
773  Int  getTileMarkerFlag              ()                 { return m_iTileMarkerFlag;              }
774  Void setTileMarkerFlag              ( Int iFlag )      { m_iTileMarkerFlag = iFlag;             }
775  Int  getMaxTileMarkerEntryPoints    ()                 { return m_iMaxTileMarkerEntryPoints;    }
776  Void setMaxTileMarkerEntryPoints    ( Int iCount )     { m_iMaxTileMarkerEntryPoints = iCount;  }
777  Double getMaxTileMarkerOffset       ()                 { return m_dMaxTileMarkerOffset;         }
778  Void setMaxTileMarkerOffset         ( Double dCount )  { m_dMaxTileMarkerOffset = dCount;       }
779  Void  setWaveFrontSynchro(Int iWaveFrontSynchro)       { m_iWaveFrontSynchro = iWaveFrontSynchro; }
780  Int   getWaveFrontsynchro()                            { return m_iWaveFrontSynchro; }
781  Void  setWaveFrontFlush(Int iWaveFrontFlush)           { m_iWaveFrontFlush = iWaveFrontFlush; }
782  Int   getWaveFrontFlush()                              { return m_iWaveFrontFlush; }
783  Void  setWaveFrontSubstreams(Int iWaveFrontSubstreams) { m_iWaveFrontSubstreams = iWaveFrontSubstreams; }
784  Int   getWaveFrontSubstreams()                         { return m_iWaveFrontSubstreams; }
785  void setPictureDigestEnabled(bool b) { m_pictureDigestEnabled = b; }
786  bool getPictureDigestEnabled() { return m_pictureDigestEnabled; }
787
788  Void      setUseWP               ( Bool  b )   { m_bUseWeightPred    = b;    }
789  Void      setWPBiPredIdc         ( UInt u )    { m_uiBiPredIdc       = u;    }
790  Bool      getUseWP               ()            { return m_bUseWeightPred;    }
791  UInt      getWPBiPredIdc         ()            { return m_uiBiPredIdc;       }
792  Void      setUseScalingListId    ( Int  u )    { m_useScalingListId       = u;   }
793  Int       getUseScalingListId    ()            { return m_useScalingListId;      }
794  Void      setScalingListFile     ( char*  pch ){ m_scalingListFile     = pch; }
795  char*     getScalingListFile     ()            { return m_scalingListFile;    }
796
797  Void      setEnableTMVP          ( Bool b )    { m_bEnableTMVP = b;    }
798  Bool      getEnableTMVP          ()            { return m_bEnableTMVP; }
799  Void      setSignHideFlag( Int signHideFlag )  { m_signHideFlag = signHideFlag; }
800  Void      setTSIG( Int tsig )                  { m_signHidingThreshold = tsig; }
801  Int       getSignHideFlag()                    { return m_signHideFlag; }
802  Int       getTSIG()                            { return m_signHidingThreshold; }
803#if VIDYO_VPS_INTEGRATION |QC_MVHEVC_B0046
804  Void      setLayerId             ( UInt layerId )   { m_layerId = layerId; }
805  UInt      getLayerId             ()               { return m_layerId; }
806#endif
807
808  Void      setViewId             ( Int viewId )   { m_viewId = viewId; }
809  Int       getViewId             ()               { return m_viewId; }
810  Void      setIsDepth            ( Bool isDepth ) { m_isDepth = isDepth; }
811  Bool      getIsDepth            ()               { return m_isDepth; }
812
813#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
814  Void      setUseDMM( Bool b) { m_bUseDMM = b;    }
815  Bool      getUseDMM()        { return m_bUseDMM; }
816#endif
817
818#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
819  Void setUseDMM34( Bool b) { m_bUseDMM34 = b;    }
820  Bool getUseDMM34()        { return m_bUseDMM34; }
821#endif
822
823#if H3D_QTL
824  Void      setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
825  Bool      getUseQTLPC()         { return m_bUseQTLPC; }
826#endif
827 
828#if RWTH_SDC_DLT_B0036
829  Bool      getUseDLT()      { return m_bUseDLT;     }
830  Bool      getUseSDC()      { return m_bUseSDC;     }
831#endif
832
833  Void      setViewOrderIdx       ( Int   i )      { m_iViewOrderIdx          = i; }
834  Void      setCamParPrecision              ( UInt  u )      { m_uiCamParPrecision      = u; }
835  Void      setCamParInSliceHeader          ( Bool  b )      { m_bCamParInSliceHeader   = b; }
836  Void      setCodedScale                   ( Int** p )      { m_aaiCodedScale          = p; }
837  Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
838
839#if INTER_VIEW_VECTOR_SCALING_C0115
840  Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }    // will be changed to view_id
841#endif
842
843#if MTK_D0156
844
845#if MERL_VSP_COMPENSATION_C0152
846  Bool    getUseVSPCompensation( ){  return m_bUseVSPCompensation;}
847  Void    setUseVSPCompensation( Bool bValue ){ m_bUseVSPCompensation = bValue;}
848#endif
849
850
851  Bool    getUseDVPRefine( ){  return m_bUseDVPRefine;}
852  Void    setUseDVPRefine( Bool bValue ){ m_bUseDVPRefine = bValue;}
853#endif
854
855};
856
857//! \}
858
859#endif // !defined(AFX_TENCCFG_H__6B99B797_F4DA_4E46_8E78_7656339A6C41__INCLUDED_)
Note: See TracBrowser for help on using the repository browser.