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

Last change on this file since 1338 was 1334, checked in by seregin, 10 years ago

port rev 4412

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