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

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

port rev 4555

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