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

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

port rev 4600, remove macro Q0074_COLOUR_REMAPPING_SEI

  • Property svn:eol-style set to native
File size: 34.2 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  Bool      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  std::string m_inputFileName;                                ///< source file name
85#endif
86  std::string m_bitstreamFileName;                            ///< output bitstream file
87#if !SVC_EXTENSION
88  std::string m_reconFileName;                                ///< 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;                                      ///< extra RPSs added to handle CRA
174  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
175#endif
176  Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
177  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
178  Bool      m_crossComponentPredictionEnabledFlag;            ///< flag enabling the use of cross-component prediction
179  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
180  UInt      m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE];       ///< number of bits for the upward bit shift operation on the decoded SAO offsets
181  Bool      m_useTransformSkip;                               ///< flag for enabling intra transform skipping
182  Bool      m_useTransformSkipFast;                           ///< flag for enabling fast intra transform skipping
183  UInt      m_log2MaxTransformSkipBlockSize;                  ///< transform-skip maximum size (minimum of 2)
184  Bool      m_transformSkipRotationEnabledFlag;               ///< control flag for transform-skip/transquant-bypass residual rotation
185  Bool      m_transformSkipContextEnabledFlag;                ///< control flag for transform-skip/transquant-bypass single significance map context
186  Bool      m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES];///< control flags for residual DPCM
187  Bool      m_enableAMP;
188  Bool      m_persistentRiceAdaptationEnabledFlag;            ///< control flag for Golomb-Rice parameter adaptation over each slice
189  Bool      m_cabacBypassAlignmentEnabledFlag;
190
191  // coding quality
192#if !SVC_EXTENSION
193  Double    m_fQP;                                            ///< QP value of key-picture (floating point)
194  Int       m_iQP;                                            ///< QP value of key-picture (integer)
195  std::string m_dQPFileName;                                  ///< QP offset for each slice (initialized from external file)
196  Int*      m_aidQP;                                          ///< array of slice QP values
197#endif
198  Int       m_iMaxDeltaQP;                                    ///< max. |delta QP|
199  UInt      m_uiDeltaQpRD;                                    ///< dQP range for multi-pass slice QP optimization
200#if !SVC_EXTENSION
201  Int       m_iMaxCuDQPDepth;                                 ///< Max. depth for a minimum CuDQPSize (0:default)
202#endif
203  Int       m_diffCuChromaQpOffsetDepth;                      ///< If negative, then do not apply chroma qp offsets.
204  Bool      m_bFastDeltaQP;                                   ///< Fast Delta QP (false:default)
205
206  Int       m_cbQpOffset;                                     ///< Chroma Cb QP Offset (0:default)
207  Int       m_crQpOffset;                                     ///< Chroma Cr QP Offset (0:default)
208
209#if ADAPTIVE_QP_SELECTION
210  Bool      m_bUseAdaptQpSelect;
211#endif
212  TComSEIMasteringDisplay m_masteringDisplay;
213
214  Bool      m_bUseAdaptiveQP;                                 ///< Flag for enabling QP adaptation based on a psycho-visual model
215  Int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
216
217#if !SVC_EXTENSION
218  Int       m_maxTempLayer;                                  ///< Max temporal layer
219#endif
220
221  // coding unit (CU) definition
222  // TODO: Remove MaxCUWidth/MaxCUHeight and replace with MaxCUSize.
223#if !SVC_EXTENSION
224  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
225  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
226  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth (as specified by command line)
227  UInt      m_uiMaxTotalCUDepth;                              ///< max. total CU depth - includes depth of transform-block structure
228  UInt      m_uiLog2DiffMaxMinCodingBlockSize;                ///< difference between largest and smallest CU depth
229
230  // transfom unit (TU) definition
231  UInt      m_uiQuadtreeTULog2MaxSize;
232  UInt      m_uiQuadtreeTULog2MinSize;
233
234  UInt      m_uiQuadtreeTUMaxDepthInter;
235  UInt      m_uiQuadtreeTUMaxDepthIntra;
236#endif
237
238  // coding tools (bit-depth)
239#if !SVC_EXTENSION
240  Int       m_inputBitDepth   [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of input file
241  Int       m_outputBitDepth  [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of output file
242  Int       m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE];      ///< bit-depth of input samples after MSB extension
243  Int       m_internalBitDepth[MAX_NUM_CHANNEL_TYPE];         ///< bit-depth codec operates at (input/output files will be converted)
244#endif
245  Bool      m_extendedPrecisionProcessingFlag;
246  Bool      m_highPrecisionOffsetsEnabledFlag;
247
248  //coding tools (chroma format)
249#if !SVC_EXTENSION
250  ChromaFormat m_chromaFormatIDC;
251#endif
252
253  // coding tools (PCM bit-depth)
254  Bool      m_bPCMInputBitDepthFlag;                          ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
255
256  // coding tool (SAO)
257#if !SVC_EXTENSION
258  Bool      m_bUseSAO;
259#endif
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  SliceConstraint m_sliceMode;
302  Int             m_sliceArgument;                            ///< argument according to selected slice mode
303  SliceConstraint m_sliceSegmentMode;
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  Bool      m_entropyCodingSyncEnabledFlag;
316#endif
317
318  Bool      m_bUseConstrainedIntraPred;                       ///< flag for using constrained intra prediction
319  Bool      m_bFastUDIUseMPMEnabled;
320  Bool      m_bFastMEForGenBLowDelayEnabled;
321  Bool      m_bUseBLambdaForNonKeyLowDelayPictures;
322
323  HashType  m_decodedPictureHashSEIType;                      ///< Checksum mode for decoded picture hash SEI message
324  Bool      m_recoveryPointSEIEnabled;
325  Bool      m_bufferingPeriodSEIEnabled;
326  Bool      m_pictureTimingSEIEnabled;
327  Bool      m_toneMappingInfoSEIEnabled;
328  Bool      m_chromaResamplingFilterSEIenabled;
329  Int       m_chromaResamplingHorFilterIdc;
330  Int       m_chromaResamplingVerFilterIdc;
331  Int       m_toneMapId;
332  Bool      m_toneMapCancelFlag;
333  Bool      m_toneMapPersistenceFlag;
334  Int       m_toneMapCodedDataBitDepth;
335  Int       m_toneMapTargetBitDepth;
336  Int       m_toneMapModelId;
337  Int       m_toneMapMinValue;
338  Int       m_toneMapMaxValue;
339  Int       m_sigmoidMidpoint;
340  Int       m_sigmoidWidth;
341  Int       m_numPivots;
342  Int       m_cameraIsoSpeedIdc;
343  Int       m_cameraIsoSpeedValue;
344  Int       m_exposureIndexIdc;
345  Int       m_exposureIndexValue;
346  Bool      m_exposureCompensationValueSignFlag;
347  Int       m_exposureCompensationValueNumerator;
348  Int       m_exposureCompensationValueDenomIdc;
349  Int       m_refScreenLuminanceWhite;
350  Int       m_extendedRangeWhiteLevel;
351  Int       m_nominalBlackLevelLumaCodeValue;
352  Int       m_nominalWhiteLevelLumaCodeValue;
353  Int       m_extendedWhiteLevelLumaCodeValue;
354  Int*      m_startOfCodedInterval;
355  Int*      m_codedPivotValue;
356  Int*      m_targetPivotValue;
357  Bool      m_framePackingSEIEnabled;
358  Int       m_framePackingSEIType;
359  Int       m_framePackingSEIId;
360  Int       m_framePackingSEIQuincunx;
361  Int       m_framePackingSEIInterpretation;
362  Bool      m_segmentedRectFramePackingSEIEnabled;
363  Bool      m_segmentedRectFramePackingSEICancel;
364  Int       m_segmentedRectFramePackingSEIType;
365  Bool      m_segmentedRectFramePackingSEIPersistence;
366  Int       m_displayOrientationSEIAngle;
367  Bool      m_temporalLevel0IndexSEIEnabled;
368  Bool      m_gradualDecodingRefreshInfoEnabled;
369  Int       m_noDisplaySEITLayer;
370  Bool      m_decodingUnitInfoSEIEnabled;
371  Bool      m_SOPDescriptionSEIEnabled;
372  Bool      m_scalableNestingSEIEnabled;
373  Bool      m_tmctsSEIEnabled;
374  Bool      m_timeCodeSEIEnabled;
375  Int       m_timeCodeSEINumTs;
376  TComSEITimeSet m_timeSetArray[MAX_TIMECODE_SEI_SETS];
377  Bool      m_kneeSEIEnabled;
378  Int       m_kneeSEIId;
379  Bool      m_kneeSEICancelFlag;
380  Bool      m_kneeSEIPersistenceFlag;
381  Int       m_kneeSEIInputDrange;
382  Int       m_kneeSEIInputDispLuminance;
383  Int       m_kneeSEIOutputDrange;
384  Int       m_kneeSEIOutputDispLuminance;
385  Int       m_kneeSEINumKneePointsMinus1;
386  Int*      m_kneeSEIInputKneePoint;
387  Int*      m_kneeSEIOutputKneePoint;
388  // weighted prediction
389  Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
390  Bool      m_useWeightedBiPred;                  ///< Use of bi-directional weighted prediction in B slices
391  WeightedPredictionMethod m_weightedPredictionMethod;
392
393  UInt      m_log2ParallelMergeLevel;                         ///< Parallel merge estimation region
394  UInt      m_maxNumMergeCand;                                ///< Max number of merge candidates
395
396  Int       m_TMVPModeId;
397  Bool      m_signHideFlag;
398#if !RC_SHVC_HARMONIZATION
399  Bool      m_RCEnableRateControl;                ///< enable rate control or not
400  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
401  Int       m_RCKeepHierarchicalBit;              ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
402  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control NOTE: code-tidy - rename to m_RCCtuLevelRC
403  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level                        NOTE: code-tidy - rename to m_RCUseCtuSeparateModel
404  Int       m_RCInitialQP;                        ///< inital QP for rate control
405  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
406#if U0132_TARGET_BITS_SATURATION
407  Bool      m_RCCpbSaturationEnabled;             ///< enable target bits saturation to avoid CPB overflow and underflow
408  UInt      m_RCCpbSize;                          ///< CPB size
409  Double    m_RCInitialCpbFullness;               ///< initial CPB fullness
410#endif
411#endif
412#if !SVC_EXTENSION
413  ScalingListMode m_useScalingListId;                         ///< using quantization matrix
414  std::string m_scalingListFileName;                          ///< quantization matrix file name
415#endif
416
417  Bool      m_TransquantBypassEnableFlag;                     ///< transquant_bypass_enable_flag setting in PPS.
418  Bool      m_CUTransquantBypassFlagForce;                    ///< if transquant_bypass_enable_flag, then, if true, all CU transquant bypass flags will be set to true.
419  CostMode  m_costMode;                                       ///< Cost mode to use
420
421  Bool      m_recalculateQPAccordingToLambda;                 ///< recalculate QP value according to the lambda value
422  Bool      m_useStrongIntraSmoothing;                        ///< enable strong intra smoothing for 32x32 blocks where the reference samples are flat
423  Int       m_activeParameterSetsSEIEnabled;
424
425  Bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
426  Bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
427  Int       m_aspectRatioIdc;                                 ///< aspect_ratio_idc
428  Int       m_sarWidth;                                       ///< horizontal size of the sample aspect ratio
429  Int       m_sarHeight;                                      ///< vertical size of the sample aspect ratio
430  Bool      m_overscanInfoPresentFlag;                        ///< Signals whether overscan_appropriate_flag is present
431  Bool      m_overscanAppropriateFlag;                        ///< Indicates whether conformant decoded pictures are suitable for display using overscan
432  Bool      m_videoSignalTypePresentFlag;                     ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
433  Int       m_videoFormat;                                    ///< Indicates representation of pictures
434  Bool      m_videoFullRangeFlag;                             ///< Indicates the black level and range of luma and chroma signals
435  Bool      m_colourDescriptionPresentFlag;                   ///< Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present
436  Int       m_colourPrimaries;                                ///< Indicates chromaticity coordinates of the source primaries
437  Int       m_transferCharacteristics;                        ///< Indicates the opto-electronic transfer characteristics of the source
438  Int       m_matrixCoefficients;                             ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries
439  Bool      m_chromaLocInfoPresentFlag;                       ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present
440  Int       m_chromaSampleLocTypeTopField;                    ///< Specifies the location of chroma samples for top field
441  Int       m_chromaSampleLocTypeBottomField;                 ///< Specifies the location of chroma samples for bottom field
442  Bool      m_neutralChromaIndicationFlag;                    ///< Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)
443  Bool      m_defaultDisplayWindowFlag;                       ///< Indicates the presence of the default window parameters
444  Int       m_defDispWinLeftOffset;                           ///< Specifies the left offset from the conformance window of the default window
445  Int       m_defDispWinRightOffset;                          ///< Specifies the right offset from the conformance window of the default window
446  Int       m_defDispWinTopOffset;                            ///< Specifies the top offset from the conformance window of the default window
447  Int       m_defDispWinBottomOffset;                         ///< Specifies the bottom offset from the conformance window of the default window
448  Bool      m_frameFieldInfoPresentFlag;                      ///< Indicates that pic_struct values are present in picture timing SEI messages
449  Bool      m_pocProportionalToTimingFlag;                    ///< Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS
450  Int       m_numTicksPocDiffOneMinus1;                       ///< Number of ticks minus 1 that for a POC difference of one
451  Bool      m_bitstreamRestrictionFlag;                       ///< Signals whether bitstream restriction parameters are present
452  Bool      m_tilesFixedStructureFlag;                        ///< Indicates that each active picture parameter set has the same values of the syntax elements related to tiles
453  Bool      m_motionVectorsOverPicBoundariesFlag;             ///< Indicates that no samples outside the picture boundaries are used for inter prediction
454  Int       m_minSpatialSegmentationIdc;                      ///< Indicates the maximum size of the spatial segments in the pictures in the coded video sequence
455  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
456  Int       m_maxBitsPerMinCuDenom;                           ///< Indicates an upper bound for the number of bits of coding_unit() data
457  Int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
458  Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
459#if !SVC_EXTENSION
460  std::string m_colourRemapSEIFileRoot;
461#endif
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
492  // internal member functions
493#if SVC_EXTENSION
494  Void  xSetGlobal      (UInt layerId);                       ///< set global variables
495  Void  xCheckParameter (UInt layerIdx);                       ///< check validity of configuration values per layer
496#else
497  Void  xSetGlobal      ();                                   ///< set global variables
498  Void  xCheckParameter ();                                   ///< check validity of configuration values
499#endif
500  Void  xPrintParameter ();                                   ///< print configuration values
501  Void  xPrintUsage     ();                                   ///< print usage
502#if SVC_EXTENSION
503  Int       m_adaptiveResolutionChange;                       ///< Indicate adaptive resolution change frame
504  Bool      m_skipPictureAtArcSwitch;                         ///< Indicates that when ARC up-switching is performed the higher layer picture is a skip picture
505
506  RepFormatCfg m_repFormatCfg[16];                            ///< Rep_format structures
507#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
508  Bool      m_interLayerConstrainedTileSetsSEIEnabled;
509  UInt      m_ilNumSetsInMessage;
510  Bool      m_skippedTileSetPresentFlag;
511  UInt      m_topLeftTileIndex[1024];
512  UInt      m_bottomRightTileIndex[1024];
513  UInt      m_ilcIdc[1024];
514#endif
515  Bool      m_crossLayerPictureTypeAlignFlag;
516  Bool      m_crossLayerIrapAlignFlag;
517#if Q0096_OVERLAY_SEI
518  Bool                                m_overlaySEIEnabled;
519  Bool                                m_overlayInfoCancelFlag;
520  UInt                                m_overlayContentAuxIdMinus128;
521  UInt                                m_overlayLabelAuxIdMinus128;
522  UInt                                m_overlayAlphaAuxIdMinus128;
523  UInt                                m_overlayElementLabelValueLengthMinus8;
524  UInt                                m_numOverlaysMinus1;
525  std::vector<UInt>                   m_overlayIdx; 
526  std::vector<Bool>                   m_overlayLanguagePresentFlag;
527  std::vector<UInt>                   m_overlayContentLayerId;
528  std::vector<Bool>                   m_overlayLabelPresentFlag;
529  std::vector<UInt>                   m_overlayLabelLayerId;
530  std::vector<Bool>                   m_overlayAlphaPresentFlag;
531  std::vector<UInt>                   m_overlayAlphaLayerId;
532  std::vector<UInt>                   m_numOverlayElementsMinus1;
533  std::vector< std::vector<UInt> >    m_overlayElementLabelMin;
534  std::vector< std::vector<UInt> >    m_overlayElementLabelMax;
535  std::vector<string>                 m_overlayLanguage; 
536  std::vector<string>                 m_overlayName; 
537  std::vector< std::vector<string> >  m_overlayElementName; 
538  Bool                                m_overlayInfoPersistenceFlag;
539#endif
540  Bool      m_crossLayerAlignedIdrOnlyFlag;
541  Bool      m_crossLayerBLAFlag;
542  Bool      m_useInterLayerWeightedPred;
543#if CGS_3D_ASYMLUT
544  Int       m_nCGSFlag;
545  Int       m_nCGSMaxOctantDepth;
546  Int       m_nCGSMaxYPartNumLog2;
547  Int       m_nCGSLUTBit;
548  Int       m_nCGSAdaptiveChroma;
549#if R0179_ENC_OPT_3DLUT_SIZE
550  Int       m_nCGSLutSizeRDO;
551#endif
552#endif
553#endif //SVC_EXTENSION
554public:
555  TAppEncCfg();
556  virtual ~TAppEncCfg();
557
558public:
559  Void  create    ();                                         ///< create option handling class
560  Void  destroy   ();                                         ///< destroy option handling class
561  Bool  parseCfg  ( Int argc, TChar* argv[] );                ///< parse configuration file to fill member variables
562
563#if SVC_EXTENSION
564  Bool parseCfgNumLayersAndInit( Int argc, TChar* argv[] );   ///< parse configuration file to to get number of layers and allocate memory
565  Int  getNumFrameToBeEncoded()                               { return m_framesToBeEncoded;                          }
566  Int  getNumLayer()                                          { return m_numLayers;                                  }
567  Int  getGOPSize()                                           { return m_iGOPSize;                                   }
568
569  RepFormatCfg* getRepFormatCfg(Int i)                        { return &m_repFormatCfg[i];                           }
570  Bool getUsePCM()                                            { return m_usePCM;                                     }
571  UInt getPCMLog2MinSize  ()                                  { return  m_uiPCMLog2MinSize;                          }
572
573  UInt getInternalBitDepth(Int layer, ChannelType type)       { return m_apcLayerCfg[layer]->m_internalBitDepth[type];}
574  Bool getPCMInputBitDepthFlag()                              { return m_bPCMInputBitDepthFlag;                       }
575
576  Int  getDecodingRefreshType()                               { return m_iDecodingRefreshType;                       }
577  Void getDirFilename(string& filename, string& dir, const string path);
578
579  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray);
580  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> &  returnVector);
581  Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString);
582  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, Int * const returnArray);
583  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> &  returnVector);
584  Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString);
585#endif
586};// END CLASS DEFINITION TAppEncCfg
587
588//! \}
589
590#endif // __TAPPENCCFG__
591
Note: See TracBrowser for help on using the repository browser.