source: SHVCSoftware/branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h @ 1434

Last change on this file since 1434 was 1434, checked in by seregin, 9 years ago

port rev 4588

  • Property svn:eol-style set to native
File size: 35.4 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-2015, 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     TAppEncCfg.h
35    \brief    Handle encoder configuration parameters (header)
36*/
37
38#ifndef __TAPPENCCFG__
39#define __TAPPENCCFG__
40
41#include "TLibCommon/CommonDef.h"
42
43#include "TLibEncoder/TEncCfg.h"
44#if SVC_EXTENSION
45#include "TAppEncLayerCfg.h"
46#endif
47#include <sstream>
48#include <vector>
49//! \ingroup TAppEncoder
50//! \{
51
52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56/// encoder configuration class
57class TAppEncCfg
58{
59protected:
60  // file I/O
61#if SVC_EXTENSION
62  TAppEncLayerCfg* m_apcLayerCfg[MAX_LAYERS];
63  Int       m_layerId;
64  Int       m_numLayers;                                      ///< number of layers
65  Int       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask
66#if AVC_BASE
67  Int       m_nonHEVCBaseLayerFlag;                           ///< non HEVC BL
68#endif
69  Bool      m_maxTidRefPresentFlag; 
70
71  Int       m_numLayerSets;
72  Int       m_numAddLayerSets;
73  Int       m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
74  Int       m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
75  Int       m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
76  Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
77
78  Int       m_defaultTargetOutputLayerIdc;
79  Int       m_numOutputLayerSets;
80  std::vector<Int>                m_outputLayerSetIdx;
81  std::vector<Int>                m_numOutputLayersInOutputLayerSet;
82  std::vector< std::vector<Int> > m_listOfOutputLayers;
83#else
84  Char*     m_pchInputFile;                                   ///< source file name
85#endif
86  Char*     m_pchBitstreamFile;                               ///< output bitstream file
87#if !SVC_EXTENSION
88  Char*     m_pchReconFile;                                   ///< output reconstruction file
89#endif
90  // Lambda modifiers
91  Double    m_adLambdaModifier[ MAX_TLAYER ];                 ///< Lambda modifier array for each temporal layer
92  std::vector<Double> m_adIntraLambdaModifier;                ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier.
93  Double    m_dIntraQpFactor;                                 ///< Intra Q Factor. If negative, use a default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) ))
94
95  // source specification
96#if !SVC_EXTENSION
97  Int       m_iFrameRate;                                     ///< source frame-rates (Hz)
98#endif
99  UInt      m_FrameSkip;                                   ///< number of skipped frames from the beginning
100#if !SVC_EXTENSION
101  Int       m_iSourceWidth;                                   ///< source width in pixel
102  Int       m_iSourceHeight;                                  ///< source height in pixel (when interlaced = field height)
103
104  Int       m_iSourceHeightOrg;                               ///< original source height in pixel (when interlaced = frame height)
105#endif
106  Bool      m_isField;                                        ///< enable field coding
107  Bool      m_isTopFieldFirst;
108  Bool      m_bEfficientFieldIRAPEnabled;                     ///< enable an efficient field IRAP structure.
109  Bool      m_bHarmonizeGopFirstFieldCoupleEnabled;
110
111#if !SVC_EXTENSION
112  Int       m_conformanceWindowMode;
113  Int       m_confWinLeft;
114  Int       m_confWinRight;
115  Int       m_confWinTop;
116  Int       m_confWinBottom;
117#endif
118  Int       m_framesToBeEncoded;                              ///< number of encoded frames
119#if !SVC_EXTENSION
120  Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
121#endif
122  Bool      m_AccessUnitDelimiter;                            ///< add Access Unit Delimiter NAL units
123  InputColourSpaceConversion m_inputColourSpaceConvert;       ///< colour space conversion to apply to input video
124  Bool      m_snrInternalColourSpace;                       ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied.
125  Bool      m_outputInternalColourSpace;                    ///< if true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied.
126#if !SVC_EXTENSION
127  ChromaFormat m_InputChromaFormatIDC;
128#endif
129
130  Bool      m_printMSEBasedSequencePSNR;
131  Bool      m_printFrameMSE;
132  Bool      m_printSequenceMSE;
133  Bool      m_cabacZeroWordPaddingEnabled;
134  Bool      m_bClipInputVideoToRec709Range;
135  Bool      m_bClipOutputVideoToRec709Range;
136
137#if SVC_EXTENSION
138  Int           m_numPTLInfo;
139  Profile::Name m_profileList[MAX_NUM_LAYER_IDS + 1];
140  Level::Tier   m_levelTierList[MAX_NUM_LAYER_IDS + 1];
141  Level::Name   m_levelList[MAX_NUM_LAYER_IDS + 1];
142  Profile::Name m_profileCompatibility[MAX_NUM_LAYER_IDS + 1];
143  Bool          m_progressiveSourceFlagList[MAX_NUM_LAYER_IDS + 1];
144  Bool          m_interlacedSourceFlagList[MAX_NUM_LAYER_IDS + 1];
145  Bool          m_nonPackedConstraintFlagList[MAX_NUM_LAYER_IDS + 1];
146  Bool          m_frameOnlyConstraintFlagList[MAX_NUM_LAYER_IDS + 1];
147
148  std::vector< std::vector<Int> > m_listOfLayerPTLofOlss;
149#else
150  // profile/level
151  Profile::Name m_profile;
152  Level::Tier   m_levelTier;
153  Level::Name   m_level;
154  UInt          m_bitDepthConstraint;
155  ChromaFormat  m_chromaFormatConstraint;
156  Bool          m_intraConstraintFlag;
157  Bool          m_onePictureOnlyConstraintFlag;
158  Bool          m_lowerBitRateConstraintFlag;
159  Bool m_progressiveSourceFlag;
160  Bool m_interlacedSourceFlag;
161  Bool m_nonPackedConstraintFlag;
162  Bool m_frameOnlyConstraintFlag;
163#endif
164
165  // coding structure
166#if !SVC_EXTENSION
167  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
168#endif
169  Int       m_iDecodingRefreshType;                           ///< random access type
170  Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
171
172#if SVC_EXTENSION
173  Int       m_extraRPSs[MAX_LAYERS];                          ///< extra RPSs added to handle CRA
174  GOPEntry  m_EhGOPList[MAX_LAYERS][MAX_GOP];                 ///< the enhancement layer coding structure entries from the config file
175  Int       m_inheritCodingStruct[MAX_LAYERS];
176  Int       m_EhMaxTempLayer[MAX_LAYERS];                    ///< Max temporal layer
177#else
178  Int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
179#endif
180
181  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
182  Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
183  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
184  Bool      m_crossComponentPredictionEnabledFlag;            ///< flag enabling the use of cross-component prediction
185  Bool      m_reconBasedCrossCPredictionEstimate;             ///< causes the alpha calculation in encoder search to be based on the decoded residual rather than the pre-transform encoder-side residual
186  UInt      m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE];       ///< number of bits for the upward bit shift operation on the decoded SAO offsets
187  Bool      m_useTransformSkip;                               ///< flag for enabling intra transform skipping
188  Bool      m_useTransformSkipFast;                           ///< flag for enabling fast intra transform skipping
189  UInt      m_log2MaxTransformSkipBlockSize;                  ///< transform-skip maximum size (minimum of 2)
190  Bool      m_transformSkipRotationEnabledFlag;               ///< control flag for transform-skip/transquant-bypass residual rotation
191  Bool      m_transformSkipContextEnabledFlag;                ///< control flag for transform-skip/transquant-bypass single significance map context
192  Bool      m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES];///< control flags for residual DPCM
193  Bool      m_enableAMP;
194  Bool      m_persistentRiceAdaptationEnabledFlag;            ///< control flag for Golomb-Rice parameter adaptation over each slice
195  Bool      m_cabacBypassAlignmentEnabledFlag;
196
197  // coding quality
198#if !SVC_EXTENSION
199  Double    m_fQP;                                            ///< QP value of key-picture (floating point)
200  Int       m_iQP;                                            ///< QP value of key-picture (integer)
201  Char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
202  Int*      m_aidQP;                                          ///< array of slice QP values
203#endif
204  Int       m_iMaxDeltaQP;                                    ///< max. |delta QP|
205  UInt      m_uiDeltaQpRD;                                    ///< dQP range for multi-pass slice QP optimization
206#if !SVC_EXTENSION
207  Int       m_iMaxCuDQPDepth;                                 ///< Max. depth for a minimum CuDQPSize (0:default)
208#endif
209  Int       m_diffCuChromaQpOffsetDepth;                      ///< If negative, then do not apply chroma qp offsets.
210  Bool      m_bFastDeltaQP;                                   ///< Fast Delta QP (false:default)
211
212  Int       m_cbQpOffset;                                     ///< Chroma Cb QP Offset (0:default)
213  Int       m_crQpOffset;                                     ///< Chroma Cr QP Offset (0:default)
214
215#if ADAPTIVE_QP_SELECTION
216  Bool      m_bUseAdaptQpSelect;
217#endif
218  TComSEIMasteringDisplay m_masteringDisplay;
219
220  Bool      m_bUseAdaptiveQP;                                 ///< Flag for enabling QP adaptation based on a psycho-visual model
221  Int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
222
223  Int       m_maxTempLayer;                                  ///< Max temporal layer
224
225  // coding unit (CU) definition
226  // TODO: Remove MaxCUWidth/MaxCUHeight and replace with MaxCUSize.
227#if !SVC_EXTENSION
228  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
229  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
230  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth (as specified by command line)
231  UInt      m_uiMaxTotalCUDepth;                              ///< max. total CU depth - includes depth of transform-block structure
232  UInt      m_uiLog2DiffMaxMinCodingBlockSize;                ///< difference between largest and smallest CU depth
233
234  // transfom unit (TU) definition
235  UInt      m_uiQuadtreeTULog2MaxSize;
236  UInt      m_uiQuadtreeTULog2MinSize;
237
238  UInt      m_uiQuadtreeTUMaxDepthInter;
239  UInt      m_uiQuadtreeTUMaxDepthIntra;
240#endif
241 
242  // coding tools (bit-depth)
243#if !SVC_EXTENSION
244  Int       m_inputBitDepth   [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of input file
245  Int       m_outputBitDepth  [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of output file
246  Int       m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE];      ///< bit-depth of input samples after MSB extension
247  Int       m_internalBitDepth[MAX_NUM_CHANNEL_TYPE];         ///< bit-depth codec operates at (input/output files will be converted)
248  Bool      m_extendedPrecisionProcessingFlag;
249  Bool      m_highPrecisionOffsetsEnabledFlag;
250
251  //coding tools (chroma format)
252  ChromaFormat m_chromaFormatIDC;
253#endif
254
255  // coding tools (PCM bit-depth)
256  Bool      m_bPCMInputBitDepthFlag;                          ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
257
258  // coding tool (SAO)
259  Bool      m_bUseSAO;
260  Bool      m_bTestSAODisableAtPictureLevel;
261  Double    m_saoEncodingRate;                                ///< When >0 SAO early picture termination is enabled for luma and chroma
262  Double    m_saoEncodingRateChroma;                          ///< The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma.
263  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
264  Bool      m_saoCtuBoundary;                                 ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas
265  // coding tools (loop filter)
266  Bool      m_bLoopFilterDisable;                             ///< flag for using deblocking filter
267  Bool      m_loopFilterOffsetInPPS;                         ///< offset for deblocking filter in 0 = slice header, 1 = PPS
268  Int       m_loopFilterBetaOffsetDiv2;                     ///< beta offset for deblocking filter
269  Int       m_loopFilterTcOffsetDiv2;                       ///< tc offset for deblocking filter
270  Bool      m_DeblockingFilterMetric;                         ///< blockiness metric in encoder
271
272  // coding tools (PCM)
273  Bool      m_usePCM;                                         ///< flag for using IPCM
274  UInt      m_pcmLog2MaxSize;                                 ///< log2 of maximum PCM block size
275  UInt      m_uiPCMLog2MinSize;                               ///< log2 of minimum PCM block size
276  Bool      m_bPCMFilterDisableFlag;                          ///< PCM filter disable flag
277  Bool      m_enableIntraReferenceSmoothing;                  ///< flag for enabling(default)/disabling intra reference smoothing/filtering
278
279  // coding tools (encoder-only parameters)
280  Bool      m_bUseASR;                                        ///< flag for using adaptive motion search range
281  Bool      m_bUseHADME;                                      ///< flag for using HAD in sub-pel ME
282  Bool      m_useRDOQ;                                       ///< flag for using RD optimized quantization
283  Bool      m_useRDOQTS;                                     ///< flag for using RD optimized quantization for transform skip
284#if T0196_SELECTIVE_RDOQ
285  Bool      m_useSelectiveRDOQ;                               ///< flag for using selective RDOQ
286#endif
287  Int       m_rdPenalty;                                      ///< RD-penalty for 32x32 TU for intra in non-intra slices (0: no RD-penalty, 1: RD-penalty, 2: maximum RD-penalty)
288  Bool      m_bDisableIntraPUsInInterSlices;                  ///< Flag for disabling intra predicted PUs in inter slices.
289  MESearchMethod m_motionEstimationSearchMethod;
290  Bool      m_bRestrictMESampling;                            ///< Restrict sampling for the Selective ME
291  Int       m_iSearchRange;                                   ///< ME search range
292  Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
293  Int       m_minSearchWindow;                                ///< ME minimum search window size for the Adaptive Window ME
294  Bool      m_bClipForBiPredMeEnabled;                        ///< Enables clipping for Bi-Pred ME.
295  Bool      m_bFastMEAssumingSmootherMVEnabled;               ///< Enables fast ME assuming a smoother MV.
296  FastInterSearchMode m_fastInterSearchMode;                  ///< Parameter that controls fast encoder settings
297  Bool      m_bUseEarlyCU;                                    ///< flag for using Early CU setting
298  Bool      m_useFastDecisionForMerge;                        ///< flag for using Fast Decision Merge RD-Cost
299  Bool      m_bUseCbfFastMode;                                ///< flag for using Cbf Fast PU Mode Decision
300  Bool      m_useEarlySkipDetection;                          ///< flag for using Early SKIP Detection
301  Int       m_sliceMode;                                      ///< 0: no slice limits, 1 : max number of CTBs per slice, 2: max number of bytes per slice,
302                                                              ///< 3: max number of tiles per slice
303  Int       m_sliceArgument;                                  ///< argument according to selected slice mode
304  Int       m_sliceSegmentMode;                               ///< 0: no slice segment limits, 1 : max number of CTBs per slice segment, 2: max number of bytes per slice segment,
305                                                              ///< 3: max number of tiles per slice segment
306  Int       m_sliceSegmentArgument;                           ///< argument according to selected slice segment mode
307
308  Bool      m_bLFCrossSliceBoundaryFlag;  ///< 1: filter across slice boundaries 0: do not filter across slice boundaries
309  Bool      m_bLFCrossTileBoundaryFlag;   ///< 1: filter across tile boundaries  0: do not filter across tile boundaries
310  Bool      m_tileUniformSpacingFlag;
311  Int       m_numTileColumnsMinus1;
312  Int       m_numTileRowsMinus1;
313  std::vector<Int> m_tileColumnWidth;
314  std::vector<Int> m_tileRowHeight;
315
316#if !SVC_EXTENSION
317  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.
318  Int       m_iWaveFrontFlush; //< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs.
319#endif
320
321  Bool      m_bUseConstrainedIntraPred;                       ///< flag for using constrained intra prediction
322  Bool      m_bFastUDIUseMPMEnabled;
323  Bool      m_bFastMEForGenBLowDelayEnabled;
324  Bool      m_bUseBLambdaForNonKeyLowDelayPictures;
325
326  Int       m_decodedPictureHashSEIEnabled;                    ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
327  Int       m_recoveryPointSEIEnabled;
328  Int       m_bufferingPeriodSEIEnabled;
329  Int       m_pictureTimingSEIEnabled;
330  Bool      m_toneMappingInfoSEIEnabled;
331  Bool      m_chromaResamplingFilterSEIenabled;
332  Int       m_chromaResamplingHorFilterIdc;
333  Int       m_chromaResamplingVerFilterIdc;
334  Int       m_toneMapId;
335  Bool      m_toneMapCancelFlag;
336  Bool      m_toneMapPersistenceFlag;
337  Int       m_toneMapCodedDataBitDepth;
338  Int       m_toneMapTargetBitDepth;
339  Int       m_toneMapModelId;
340  Int       m_toneMapMinValue;
341  Int       m_toneMapMaxValue;
342  Int       m_sigmoidMidpoint;
343  Int       m_sigmoidWidth;
344  Int       m_numPivots;
345  Int       m_cameraIsoSpeedIdc;
346  Int       m_cameraIsoSpeedValue;
347  Int       m_exposureIndexIdc;
348  Int       m_exposureIndexValue;
349  Bool      m_exposureCompensationValueSignFlag;
350  Int       m_exposureCompensationValueNumerator;
351  Int       m_exposureCompensationValueDenomIdc;
352  Int       m_refScreenLuminanceWhite;
353  Int       m_extendedRangeWhiteLevel;
354  Int       m_nominalBlackLevelLumaCodeValue;
355  Int       m_nominalWhiteLevelLumaCodeValue;
356  Int       m_extendedWhiteLevelLumaCodeValue;
357  Int*      m_startOfCodedInterval;
358  Int*      m_codedPivotValue;
359  Int*      m_targetPivotValue;
360  Int       m_framePackingSEIEnabled;
361  Int       m_framePackingSEIType;
362  Int       m_framePackingSEIId;
363  Int       m_framePackingSEIQuincunx;
364  Int       m_framePackingSEIInterpretation;
365  Int       m_segmentedRectFramePackingSEIEnabled;
366  Bool      m_segmentedRectFramePackingSEICancel;
367  Int       m_segmentedRectFramePackingSEIType;
368  Bool      m_segmentedRectFramePackingSEIPersistence;
369  Int       m_displayOrientationSEIAngle;
370  Int       m_temporalLevel0IndexSEIEnabled;
371  Int       m_gradualDecodingRefreshInfoEnabled;
372  Int       m_noDisplaySEITLayer;
373  Int       m_decodingUnitInfoSEIEnabled;
374  Int       m_SOPDescriptionSEIEnabled;
375  Int       m_scalableNestingSEIEnabled;
376  Bool      m_tmctsSEIEnabled;
377  Bool      m_timeCodeSEIEnabled;
378  Int       m_timeCodeSEINumTs;
379  TComSEITimeSet m_timeSetArray[MAX_TIMECODE_SEI_SETS];
380  Bool      m_kneeSEIEnabled;
381  Int       m_kneeSEIId;
382  Bool      m_kneeSEICancelFlag;
383  Bool      m_kneeSEIPersistenceFlag;
384  Int       m_kneeSEIInputDrange;
385  Int       m_kneeSEIInputDispLuminance;
386  Int       m_kneeSEIOutputDrange;
387  Int       m_kneeSEIOutputDispLuminance;
388  Int       m_kneeSEINumKneePointsMinus1;
389  Int*      m_kneeSEIInputKneePoint;
390  Int*      m_kneeSEIOutputKneePoint;
391  // weighted prediction
392  Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
393  Bool      m_useWeightedBiPred;                  ///< Use of bi-directional weighted prediction in B slices
394  WeightedPredictionMethod m_weightedPredictionMethod;
395
396  UInt      m_log2ParallelMergeLevel;                         ///< Parallel merge estimation region
397  UInt      m_maxNumMergeCand;                                ///< Max number of merge candidates
398
399  Int       m_TMVPModeId;
400  Bool      m_signHideFlag;
401#if !RC_SHVC_HARMONIZATION
402  Bool      m_RCEnableRateControl;                ///< enable rate control or not
403  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
404  Int       m_RCKeepHierarchicalBit;              ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
405  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control NOTE: code-tidy - rename to m_RCCtuLevelRC
406  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level                        NOTE: code-tidy - rename to m_RCUseCtuSeparateModel
407  Int       m_RCInitialQP;                        ///< inital QP for rate control
408  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
409#if U0132_TARGET_BITS_SATURATION
410  Bool      m_RCCpbSaturationEnabled;             ///< enable target bits saturation to avoid CPB overflow and underflow
411  UInt      m_RCCpbSize;                          ///< CPB size
412  Double    m_RCInitialCpbFullness;               ///< initial CPB fullness
413#endif
414#endif
415#if !SVC_EXTENSION
416  ScalingListMode m_useScalingListId;                         ///< using quantization matrix
417  Char*     m_scalingListFile;                                ///< quantization matrix file name
418#endif
419
420  Bool      m_TransquantBypassEnableFlag;                     ///< transquant_bypass_enable_flag setting in PPS.
421  Bool      m_CUTransquantBypassFlagForce;                    ///< if transquant_bypass_enable_flag, then, if true, all CU transquant bypass flags will be set to true.
422  CostMode  m_costMode;                                       ///< Cost mode to use
423
424  Bool      m_recalculateQPAccordingToLambda;                 ///< recalculate QP value according to the lambda value
425  Bool      m_useStrongIntraSmoothing;                        ///< enable strong intra smoothing for 32x32 blocks where the reference samples are flat
426  Int       m_activeParameterSetsSEIEnabled;
427
428  Bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
429  Bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
430  Int       m_aspectRatioIdc;                                 ///< aspect_ratio_idc
431  Int       m_sarWidth;                                       ///< horizontal size of the sample aspect ratio
432  Int       m_sarHeight;                                      ///< vertical size of the sample aspect ratio
433  Bool      m_overscanInfoPresentFlag;                        ///< Signals whether overscan_appropriate_flag is present
434  Bool      m_overscanAppropriateFlag;                        ///< Indicates whether conformant decoded pictures are suitable for display using overscan
435  Bool      m_videoSignalTypePresentFlag;                     ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
436  Int       m_videoFormat;                                    ///< Indicates representation of pictures
437  Bool      m_videoFullRangeFlag;                             ///< Indicates the black level and range of luma and chroma signals
438  Bool      m_colourDescriptionPresentFlag;                   ///< Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present
439  Int       m_colourPrimaries;                                ///< Indicates chromaticity coordinates of the source primaries
440  Int       m_transferCharacteristics;                        ///< Indicates the opto-electronic transfer characteristics of the source
441  Int       m_matrixCoefficients;                             ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries
442  Bool      m_chromaLocInfoPresentFlag;                       ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present
443  Int       m_chromaSampleLocTypeTopField;                    ///< Specifies the location of chroma samples for top field
444  Int       m_chromaSampleLocTypeBottomField;                 ///< Specifies the location of chroma samples for bottom field
445  Bool      m_neutralChromaIndicationFlag;                    ///< Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)
446  Bool      m_defaultDisplayWindowFlag;                       ///< Indicates the presence of the default window parameters
447  Int       m_defDispWinLeftOffset;                           ///< Specifies the left offset from the conformance window of the default window
448  Int       m_defDispWinRightOffset;                          ///< Specifies the right offset from the conformance window of the default window
449  Int       m_defDispWinTopOffset;                            ///< Specifies the top offset from the conformance window of the default window
450  Int       m_defDispWinBottomOffset;                         ///< Specifies the bottom offset from the conformance window of the default window
451  Bool      m_frameFieldInfoPresentFlag;                      ///< Indicates that pic_struct values are present in picture timing SEI messages
452  Bool      m_pocProportionalToTimingFlag;                    ///< Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS
453  Int       m_numTicksPocDiffOneMinus1;                       ///< Number of ticks minus 1 that for a POC difference of one
454  Bool      m_bitstreamRestrictionFlag;                       ///< Signals whether bitstream restriction parameters are present
455  Bool      m_tilesFixedStructureFlag;                        ///< Indicates that each active picture parameter set has the same values of the syntax elements related to tiles
456  Bool      m_motionVectorsOverPicBoundariesFlag;             ///< Indicates that no samples outside the picture boundaries are used for inter prediction
457  Int       m_minSpatialSegmentationIdc;                      ///< Indicates the maximum size of the spatial segments in the pictures in the coded video sequence
458  Int       m_maxBytesPerPicDenom;                            ///< Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with any coded picture
459  Int       m_maxBitsPerMinCuDenom;                           ///< Indicates an upper bound for the number of bits of coding_unit() data
460  Int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
461  Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
462
463  std::string m_summaryOutFilename;                           ///< filename to use for producing summary output file.
464  std::string m_summaryPicFilenameBase;                       ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended.
465  UInt        m_summaryVerboseness;                           ///< Specifies the level of the verboseness of the text output.
466
467#if LAYERS_NOT_PRESENT_SEI
468  Int       m_layersNotPresentSEIEnabled;
469#endif
470#if P0123_ALPHA_CHANNEL_SEI
471  Bool      m_alphaSEIEnabled;
472  Bool      m_alphaCancelFlag;
473  Int       m_alphaUseIdc;
474  Int       m_alphaBitDepthMinus8;
475  Int       m_alphaTransparentValue;
476  Int       m_alphaOpaqueValue;
477  Bool      m_alphaIncrementFlag;
478  Bool      m_alphaClipFlag;
479  Bool      m_alphaClipTypeFlag;
480#endif
481#if SVC_EXTENSION
482#if FAST_INTRA_SHVC
483  Bool      m_useFastIntraScalable;                          ///< flag for using Fast Intra Decision for Scalable HEVC
484#endif
485#if Q0189_TMVP_CONSTRAINTS
486  Int       m_TMVPConstraintsSEIEnabled;
487#endif
488  Bool      m_altOutputLayerFlag;                             ///< Specifies the value of alt_output_laye_flag in VPS extension
489  Bool      m_elRapSliceBEnabled;
490#endif
491#if Q0074_COLOUR_REMAPPING_SEI
492#if !SVC_EXTENSION
493  string    m_colourRemapSEIFileRoot;
494#endif
495#endif
496  // internal member functions
497#if SVC_EXTENSION
498  Void  xSetGlobal      (UInt layerId);                       ///< set global variables
499  Void  xCheckParameter (UInt layerIdx);                       ///< check validity of configuration values per layer
500#else
501  Void  xSetGlobal      ();                                   ///< set global variables
502  Void  xCheckParameter ();                                   ///< check validity of configuration values
503#endif
504  Void  xPrintParameter ();                                   ///< print configuration values
505  Void  xPrintUsage     ();                                   ///< print usage
506#if SVC_EXTENSION
507  Int       m_adaptiveResolutionChange;                       ///< Indicate adaptive resolution change frame
508  Bool      m_skipPictureAtArcSwitch;                         ///< Indicates that when ARC up-switching is performed the higher layer picture is a skip picture
509
510  RepFormatCfg m_repFormatCfg[16];                            ///< Rep_format structures
511#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
512  Bool      m_interLayerConstrainedTileSetsSEIEnabled;
513  UInt      m_ilNumSetsInMessage;
514  Bool      m_skippedTileSetPresentFlag;
515  UInt      m_topLeftTileIndex[1024];
516  UInt      m_bottomRightTileIndex[1024];
517  UInt      m_ilcIdc[1024];
518#endif
519  Bool      m_crossLayerPictureTypeAlignFlag;
520  Bool      m_crossLayerIrapAlignFlag;
521#if Q0096_OVERLAY_SEI
522  Bool                                m_overlaySEIEnabled;
523  Bool                                m_overlayInfoCancelFlag;
524  UInt                                m_overlayContentAuxIdMinus128;
525  UInt                                m_overlayLabelAuxIdMinus128;
526  UInt                                m_overlayAlphaAuxIdMinus128;
527  UInt                                m_overlayElementLabelValueLengthMinus8;
528  UInt                                m_numOverlaysMinus1;
529  std::vector<UInt>                   m_overlayIdx; 
530  std::vector<Bool>                   m_overlayLanguagePresentFlag;
531  std::vector<UInt>                   m_overlayContentLayerId;
532  std::vector<Bool>                   m_overlayLabelPresentFlag;
533  std::vector<UInt>                   m_overlayLabelLayerId;
534  std::vector<Bool>                   m_overlayAlphaPresentFlag;
535  std::vector<UInt>                   m_overlayAlphaLayerId;
536  std::vector<UInt>                   m_numOverlayElementsMinus1;
537  std::vector< std::vector<UInt> >    m_overlayElementLabelMin;
538  std::vector< std::vector<UInt> >    m_overlayElementLabelMax;
539  std::vector<string>                 m_overlayLanguage; 
540  std::vector<string>                 m_overlayName; 
541  std::vector< std::vector<string> >  m_overlayElementName; 
542  Bool                                m_overlayInfoPersistenceFlag;
543#endif
544  Bool      m_crossLayerAlignedIdrOnlyFlag;
545  Bool      m_crossLayerBLAFlag;
546  Bool      m_useInterLayerWeightedPred;
547#if CGS_3D_ASYMLUT
548  Int       m_nCGSFlag;
549  Int       m_nCGSMaxOctantDepth;
550  Int       m_nCGSMaxYPartNumLog2;
551  Int       m_nCGSLUTBit;
552  Int       m_nCGSAdaptiveChroma;
553#if R0179_ENC_OPT_3DLUT_SIZE
554  Int       m_nCGSLutSizeRDO;
555#endif
556#endif
557#endif //SVC_EXTENSION
558public:
559  TAppEncCfg();
560  virtual ~TAppEncCfg();
561
562public:
563  Void  create    ();                                         ///< create option handling class
564  Void  destroy   ();                                         ///< destroy option handling class
565  Bool  parseCfg  ( Int argc, Char* argv[] );                 ///< parse configuration file to fill member variables
566 
567#if SVC_EXTENSION
568  Bool parseCfgNumLayersAndInit( Int argc, Char* argv[] );    ///< parse configuration file to to get number of layers and allocate memory
569  Int  getNumFrameToBeEncoded()                               { return m_framesToBeEncoded;                          }
570  Int  getNumLayer()                                          { return m_numLayers;                                  }
571  Int  getGOPSize()                                           { return m_iGOPSize;                                   }
572
573  RepFormatCfg* getRepFormatCfg(Int i)                        { return &m_repFormatCfg[i];                           }
574  Bool getUsePCM()                                            { return m_usePCM;                                     }
575  UInt getPCMLog2MinSize  ()                                  { return  m_uiPCMLog2MinSize;                          }
576
577  UInt getInternalBitDepth(Int layer, ChannelType type)       { return m_apcLayerCfg[layer]->m_internalBitDepth[type];}
578  Bool getPCMInputBitDepthFlag()                              { return m_bPCMInputBitDepthFlag;                       }
579
580  Int  getDecodingRefreshType()                               { return m_iDecodingRefreshType;                       }
581  Int  getWaveFrontSynchro(Int layerIdx)                      { return m_apcLayerCfg[layerIdx]->m_waveFrontSynchro;  }
582  Void getDirFilename(string& filename, string& dir, const string path);
583
584  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray);
585  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> &  returnVector);
586  Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString);
587  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, Int * const returnArray);
588  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> &  returnVector);
589  Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString);
590#endif
591};// END CLASS DEFINITION TAppEncCfg
592
593//! \}
594
595#endif // __TAPPENCCFG__
596
Note: See TracBrowser for help on using the repository browser.