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

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

add chroma format IDC output

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