Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/App/TAppEncoder/TAppEncCfg.h
- Timestamp:
- 12 Apr 2018, 11:12:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.2-dev/source/App/TAppEncoder/TAppEncCfg.h
r1405 r1412 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 42 42 43 43 #include "TLibEncoder/TEncCfg.h" 44 #if EXTENSION_360_VIDEO 45 #include "TAppEncHelper360/TExt360AppEncCfg.h" 46 #endif 44 47 #include <sstream> 45 48 #include <vector> … … 56 59 // ==================================================================================================================== 57 60 61 #if NH_MV 62 enum UIProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations 63 { 64 UI_NONE = 0, 65 UI_MAIN = 1, 66 UI_MAIN10 = 2, 67 UI_MAIN10_STILL_PICTURE=10002, 68 UI_MAINSTILLPICTURE = 3, 69 UI_MAINREXT = 4, 70 UI_HIGHTHROUGHPUTREXT = 5, 71 // The following are RExt profiles, which would map to the MAINREXT profile idc. 72 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 73 // the chroma format in the next digit 74 // the intra constraint in the next digit (1 for no intra constraint, 2 for intra constraint) 75 // If it is a RExt still picture, there is a '1' for the top digit. 76 #if NH_MV 77 UI_MULTIVIEWMAIN = 6, 78 #if NH_3D 79 UI_MAIN3D = 8, 80 #endif 81 #endif 82 UI_MONOCHROME_8 = 1008, 83 UI_MONOCHROME_12 = 1012, 84 UI_MONOCHROME_16 = 1016, 85 UI_MAIN_12 = 1112, 86 UI_MAIN_422_10 = 1210, 87 UI_MAIN_422_12 = 1212, 88 UI_MAIN_444 = 1308, 89 UI_MAIN_444_10 = 1310, 90 UI_MAIN_444_12 = 1312, 91 UI_MAIN_444_16 = 1316, // non-standard profile definition, used for development purposes 92 UI_MAIN_INTRA = 2108, 93 UI_MAIN_10_INTRA = 2110, 94 UI_MAIN_12_INTRA = 2112, 95 UI_MAIN_422_10_INTRA = 2210, 96 UI_MAIN_422_12_INTRA = 2212, 97 UI_MAIN_444_INTRA = 2308, 98 UI_MAIN_444_10_INTRA = 2310, 99 UI_MAIN_444_12_INTRA = 2312, 100 UI_MAIN_444_16_INTRA = 2316, 101 UI_MAIN_444_STILL_PICTURE = 11308, 102 UI_MAIN_444_16_STILL_PICTURE = 12316, 103 // The following are high throughput profiles, which would map to the HIGHTHROUGHPUTREXT profile idc. 104 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 105 // the chroma format in the next digit 106 // the intra constraint in the next digit 107 // There is a '2' for the top digit to indicate it is high throughput profile 108 109 UI_HIGHTHROUGHPUT_444 = 21308, 110 UI_HIGHTHROUGHPUT_444_10 = 21310, 111 UI_HIGHTHROUGHPUT_444_14 = 21314, 112 UI_HIGHTHROUGHPUT_444_16_INTRA = 22316 113 #if NH_MV_ALLOW_NON_CONFORMING 114 , 115 UI_MULTIVIEWMAIN_NONCONF = 10000006, 116 #if NH_3D 117 UI_MAIN3D_NONCONF = 10000008, 118 #endif 119 #endif 120 }; 121 #endif 122 58 123 /// encoder configuration class 59 124 class TAppEncCfg 60 125 { 126 #if JVET_E0059_FLOATING_POINT_QP_FIX 127 public: 128 template <class T> 129 struct OptionalValue 130 { 131 Bool bPresent; 132 T value; 133 OptionalValue() : bPresent(false), value() { } 134 }; 135 #endif 136 61 137 protected: 62 138 // file I/O … … 71 147 Int m_numberOfLayers; ///< number of Layers to Encode 72 148 Int m_iNumberOfViews; ///< number of Layers that are views 149 #if NH_MV 150 Bool m_shareParameterSets; 151 IntAry1d m_layerIdxInVpsToGopDefIdx; 152 IntAry1d m_layerIdxInVpsToRepFormatIdx; 153 Int m_numRepFormats; 154 Int m_numInputOutputRepFormats; 155 #endif 73 156 #else 74 157 std::string m_reconFileName; ///< output reconstruction file … … 91 174 // layer sets 92 175 Int m_vpsNumLayerSets; ///< Number of layer sets 93 IntAry2d m_layerIdxInVpsInSets;///< LayerIds in vps of layer set94 Int m_numAddLayerSets; 95 IntAry2d m_highestLayerIdxPlus1;///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored)176 IntAry2d m_layerIdxInVpsInSets; ///< LayerIds in vps of layer set 177 Int m_numAddLayerSets; ///< Number of additional layer sets 178 IntAry2d m_highestLayerIdxPlus1; ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored) 96 179 Int m_defaultOutputLayerIdc; ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet 97 180 IntAry1d m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 98 IntAry2d m_layerIdsInAddOutputLayerSet;///< LayerIds in vps of additional output layers99 IntAry2d m_layerIdsInDefOutputLayerSet;///< Indices in vps of output layers in layer sets100 IntAry2d m_profileTierLevelIdx; ///< Indices of of profile, per layer in layer set181 IntAry2d m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers 182 IntAry2d m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets 183 IntAry2d m_profileTierLevelIdx; ///< Indices of of profile, per layer in layer set 101 184 BoolAry1d m_altOutputLayerFlag; ///< Alt output layer flag 102 185 … … 145 228 UInt m_FrameSkip; ///< number of skipped frames from the beginning 146 229 UInt m_temporalSubsampleRatio; ///< temporal subsample ratio, 2 means code every two frames 147 Int m_iSourceWidth; ///< source width in pixel 148 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 230 231 #if NH_MV 232 IntAry1d m_iSourceWidths ; ///< source width in pixel 233 IntAry1d m_iSourceHeights ; ///< source height in pixel (when interlaced = field height) 234 IntAry1d m_inputFileWidths ; ///< width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently altered due to padding) 235 IntAry1d m_inputFileHeights; ///< height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequently altered due to padding) 236 237 IntAry1d m_iSourceHeightOrgs; ///< original source height in pixel (when interlaced = frame height) 238 #else 239 Int m_iSourceWidth ; ///< source width in pixel 240 Int m_iSourceHeight ; ///< source height in pixel (when interlaced = field height) 241 Int m_inputFileWidth ; ///< width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently altered due to padding) 242 Int m_inputFileHeight; ///< height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequently altered due to padding) 149 243 150 244 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 245 #endif 151 246 152 247 Bool m_isField; ///< enable field coding … … 156 251 157 252 Int m_conformanceWindowMode; 253 #if NH_MV 254 IntAry1d m_confWinLefts ; 255 IntAry1d m_confWinRights ; 256 IntAry1d m_confWinTops ; 257 IntAry1d m_confWinBottoms; 258 #else 158 259 Int m_confWinLeft; 159 260 Int m_confWinRight; 160 261 Int m_confWinTop; 161 262 Int m_confWinBottom; 263 #endif 162 264 Int m_framesToBeEncoded; ///< number of encoded frames 265 #if NH_MV 266 IntAry2d m_aiPads; ///< number of padded pixels for width and height 267 #else 163 268 Int m_aiPad[2]; ///< number of padded pixels for width and height 269 #endif 164 270 Bool m_AccessUnitDelimiter; ///< add Access Unit Delimiter NAL units 165 271 InputColourSpaceConversion m_inputColourSpaceConvert; ///< colour space conversion to apply to input video 166 272 Bool m_snrInternalColourSpace; ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied. 167 273 Bool m_outputInternalColourSpace; ///< if true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied. 274 #if NH_MV 275 std::vector<ChromaFormat> m_InputChromaFormatIDC; 276 #else 168 277 ChromaFormat m_InputChromaFormatIDC; 278 #endif 169 279 170 280 Bool m_printMSEBasedSequencePSNR; 171 281 Bool m_printFrameMSE; 172 282 Bool m_printSequenceMSE; 283 #if JVET_F0064_MSSSIM 284 Bool m_printMSSSIM; 285 #endif 173 286 Bool m_cabacZeroWordPaddingEnabled; 174 287 Bool m_bClipInputVideoToRec709Range; … … 178 291 #if NH_MV 179 292 std::vector< Profile::Name > m_profiles; 293 294 std::vector<UIProfileName> m_uiProfiles; 295 180 296 std::vector< Level::Tier > m_levelTier; 181 297 std::vector< Level::Name > m_level; 182 298 std::vector< Bool > m_inblFlag; 299 300 IntAry1d m_bitDepthConstraints ; 301 IntAry1d m_tmpConstraintChromaFormats ; 302 std::vector< ChromaFormat > m_chromaFormatConstraints ; 303 BoolAry1d m_intraConstraintFlags ; 304 BoolAry1d m_onePictureOnlyConstraintFlags; 305 BoolAry1d m_lowerBitRateConstraintFlags ; 306 BoolAry1d m_progressiveSourceFlags ; 307 BoolAry1d m_interlacedSourceFlags ; 308 BoolAry1d m_nonPackedConstraintFlags ; 309 BoolAry1d m_frameOnlyConstraintFlags ; 310 183 311 #else 184 312 Profile::Name m_profile; 185 313 Level::Tier m_levelTier; 186 314 Level::Name m_level; 187 #endif188 315 UInt m_bitDepthConstraint; 189 316 ChromaFormat m_chromaFormatConstraint; … … 191 318 Bool m_onePictureOnlyConstraintFlag; 192 319 Bool m_lowerBitRateConstraintFlag; 193 Bool m_progressiveSourceFlag; 194 Bool m_interlacedSourceFlag; 195 Bool m_nonPackedConstraintFlag; 196 Bool m_frameOnlyConstraintFlag; 320 Bool m_progressiveSourceFlag; 321 Bool m_interlacedSourceFlag; 322 Bool m_nonPackedConstraintFlag; 323 Bool m_frameOnlyConstraintFlag; 324 #endif 197 325 198 326 // coding structure … … 204 332 Int m_iDecodingRefreshType; ///< random access type 205 333 Int m_iGOPSize; ///< GOP size of hierarchical structure 334 #if JCTVC_Y0038_PARAMS 335 Bool m_bReWriteParamSetsFlag; ///< Flag to enable rewriting of parameter sets at random access points 336 #endif 206 337 #if NH_MV 207 338 Int m_extraRPSsMvc[MAX_NUM_LAYERS]; ///< extra RPSs added to handle CRA for each layer … … 234 365 // coding quality 235 366 #if NH_MV 367 #if JVET_E0059_FLOATING_POINT_QP_FIX 368 std::vector<Int> m_qpIncrementAtSourceFrame; ///< Optional source frame number at which all subsequent frames are to use an increased internal QP. 369 #else 236 370 std::vector<Double> m_fQP; ///< QP value of key-picture (floating point) for each layer 371 #endif 237 372 std::vector<Int> m_iQP; ///< QP value of key-picture (integer) for each layer 238 373 #else 374 #if JVET_E0059_FLOATING_POINT_QP_FIX 375 OptionalValue<UInt> m_qpIncrementAtSourceFrame; ///< Optional source frame number at which all subsequent frames are to use an increased internal QP. 376 #else 239 377 Double m_fQP; ///< QP value of key-picture (floating point) 378 #endif 240 379 Int m_iQP; ///< QP value of key-picture (integer) 380 #endif 381 #if X0038_LAMBDA_FROM_QP_CAPABILITY 382 Int m_intraQPOffset; ///< QP offset for intra slice (integer) 383 Bool m_lambdaFromQPEnable; ///< enable flag for QP:lambda fix 241 384 #endif 242 385 std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) … … 254 397 Int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default) 255 398 Int m_crQpOffset; ///< Chroma Cr QP Offset (0:default) 256 257 #if W0038_CQP_ADJ 399 WCGChromaQPControl m_wcgChromaQpControl; ///< Wide-colour-gamut chroma QP control. 258 400 UInt m_sliceChromaQpOffsetPeriodicity; ///< Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature. 259 401 Int m_sliceChromaQpOffsetIntraOrPeriodic[2/*Cb,Cr*/]; ///< Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table. 260 #endif 402 LumaLevelToDeltaQPMapping m_lumaLevelToDeltaQPMapping; ///< mapping from luma level to Delta QP. 261 403 #if ADAPTIVE_QP_SELECTION 262 404 Bool m_bUseAdaptQpSelect; … … 282 424 UInt m_uiMaxCUHeight; ///< max. CU height in pixel 283 425 UInt m_uiMaxCUDepth; ///< max. CU depth (as specified by command line) 284 UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 426 #if NH_MV 427 IntAry1d m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 428 #else 429 UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 430 #endif 285 431 UInt m_uiLog2DiffMaxMinCodingBlockSize; ///< difference between largest and smallest CU depth 286 432 … … 293 439 294 440 // coding tools (bit-depth) 441 #if NH_MV 442 IntAry2d m_inputBitDepths ; ///< bit-depth of input file 443 IntAry2d m_outputBitDepths ; ///< bit-depth of output file 444 IntAry2d m_MSBExtendedBitDepths; ///< bit-depth of input samples after MSB extension 445 IntAry2d m_internalBitDepths ; ///< bit-depth codec operates at (input/output files will be converted) 446 #else 295 447 Int m_inputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file 296 448 Int m_outputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file 297 449 Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension 298 450 Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) 451 #endif 452 299 453 Bool m_extendedPrecisionProcessingFlag; 300 454 Bool m_highPrecisionOffsetsEnabledFlag; 301 455 302 456 //coding tools (chroma format) 457 #if NH_MV 458 std::vector<ChromaFormat> m_chromaFormatIDCs; 459 #else 303 460 ChromaFormat m_chromaFormatIDC; 461 #endif 304 462 305 463 // coding tools (PCM bit-depth) … … 317 475 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture 318 476 Bool m_saoCtuBoundary; ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas 319 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP320 477 Bool m_saoResetEncoderStateAfterIRAP; ///< When true, SAO encoder state will be reset following an IRAP. 321 #endif322 478 // coding tools (loop filter) 323 479 #if NH_MV … … 329 485 Int m_loopFilterBetaOffsetDiv2; ///< beta offset for deblocking filter 330 486 Int m_loopFilterTcOffsetDiv2; ///< tc offset for deblocking filter 331 #if W0038_DB_OPT332 487 Int m_deblockingFilterMetric; ///< blockiness metric in encoder 333 #else334 Bool m_DeblockingFilterMetric; ///< blockiness metric in encoder335 #endif336 488 // coding tools (PCM) 337 489 Bool m_usePCM; ///< flag for using IPCM … … 346 498 Bool m_useRDOQ; ///< flag for using RD optimized quantization 347 499 Bool m_useRDOQTS; ///< flag for using RD optimized quantization for transform skip 348 #if T0196_SELECTIVE_RDOQ349 500 Bool m_useSelectiveRDOQ; ///< flag for using selective RDOQ 350 #endif351 501 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) 352 502 Bool m_bDisableIntraPUsInInterSlices; ///< Flag for disabling intra predicted PUs in inter slices. … … 437 587 Bool m_scalableNestingSEIEnabled; 438 588 Bool m_tmctsSEIEnabled; 589 #if MCTS_ENC_CHECK 590 Bool m_tmctsSEITileConstraint; 591 #endif 439 592 Bool m_timeCodeSEIEnabled; 440 593 Int m_timeCodeSEINumTs; … … 451 604 Int* m_kneeSEIInputKneePoint; 452 605 Int* m_kneeSEIOutputKneePoint; 453 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI454 606 Int m_preferredTransferCharacteristics; 455 #endif 607 UInt m_greenMetadataType; 608 UInt m_xsdMetricType; 456 609 457 610 // weighted prediction … … 464 617 465 618 Int m_TMVPModeId; 466 Bool m_sign HideFlag;619 Bool m_signDataHidingEnabledFlag; 467 620 Bool m_RCEnableRateControl; ///< enable rate control or not 468 621 Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled … … 472 625 Int m_RCInitialQP; ///< inital QP for rate control 473 626 Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not 474 475 #if U0132_TARGET_BITS_SATURATION476 627 Bool m_RCCpbSaturationEnabled; ///< enable target bits saturation to avoid CPB overflow and underflow 477 628 UInt m_RCCpbSize; ///< CPB size 478 629 Double m_RCInitialCpbFullness; ///< initial CPB fullness 479 #endif480 630 481 631 #if KWU_RC_VIEWRC_E0227 … … 490 640 std::string m_scalingListFileName; ///< quantization matrix file name 491 641 492 Bool m_TransquantBypassEnable Flag; ///< transquant_bypass_enable_flag setting in PPS.493 Bool m_CUTransquantBypassFlagForce; ///< if transquant_bypass_enable _flag, then, if true, all CU transquant bypass flags will be set to true.642 Bool m_TransquantBypassEnabledFlag; ///< transquant_bypass_enabled_flag setting in PPS. 643 Bool m_CUTransquantBypassFlagForce; ///< if transquant_bypass_enabled_flag, then, if true, all CU transquant bypass flags will be set to true. 494 644 CostMode m_costMode; ///< Cost mode to use 495 645 … … 537 687 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. 538 688 UInt m_summaryVerboseness; ///< Specifies the level of the verboseness of the text output. 689 690 #if EXTENSION_360_VIDEO 691 TExt360AppEncCfg m_ext360; 692 friend class TExt360AppEncCfg; 693 friend class TExt360AppEncTop; 694 #endif 695 539 696 #if NH_MV 540 697 Bool m_outputVpsInfo; … … 546 703 Bool m_depth420OutputFlag; ///< Output depth layers in 4:2:0 format 547 704 #endif 705 706 #if NH_3D || NH_3D_VSO 548 707 // Camera parameters 549 #if NH_3D || NH_3D_VSO550 708 TChar* m_pchCameraParameterFile; ///< camera parameter file 551 709 TAppComCamPara m_cCameraData; … … 578 736 #if NH_3D 579 737 Bool m_useDLT; ///< flag for using DLT 580 #endif581 #if NH_3D_QTL582 738 Bool m_bUseQTL; ///< flag for using depth QuadTree Limitation 583 #endif 584 #if NH_3D 739 585 740 BoolAry1d m_ivMvPredFlag; 586 741 BoolAry1d m_ivMvScalingFlag; … … 601 756 // internal member functions 602 757 Void xCheckParameter (); ///< check validity of configuration values 603 Void xPrintParameter (); ///< print configuration values 758 Void xPrintParameter (); ///< print configuration values 759 604 760 Void xPrintUsage (); ///< print usage 605 761 #if NH_MV 762 Void xConfirmRepFormat( const TComVPS& vps); 763 Void xDeriveProfAndConstrFlags( const TComVPS& vps ); 764 Void xCheckProfiles ( const TComVPS& vps ); 765 766 Void xPrintProfiles(); 767 768 template< typename T > 769 Void xConfirmSingleRepFormat(Bool& checkFailed, std::string name, Int curLayer, Int refLayer, T valCur, T valRef ) 770 { 771 if ( valCur != valRef ) 772 { 773 printf("Error: %s of layer %d and its reference layer %d must be equal. \n", name.c_str(), curLayer, refLayer ); 774 checkFailed = true; 775 } 776 } 777 778 GOPEntry* xGetGopEntries( Int layerIdInVps ); 779 GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc ); 606 780 607 781 template<typename T> … … 697 871 Bool parseCfg ( Int argc, TChar* argv[] ); ///< parse configuration file to fill member variables 698 872 873 private: 874 Void xConvertRepFormatParameters( 875 IntAry2d& tmpPad , 876 IntAry2d& tmpInputBitDepth , 877 IntAry2d& tmpOutputBitDepth , 878 IntAry2d& tmpMSBExtendedBitDepth , 879 IntAry2d& tmpInternalBitDepth , 880 IntAry1d& tmpInputChromaFormat , 881 IntAry1d& tmpChromaFormat 882 ); 883 884 Void xGetMaxValuesOfApplicableLayers(const TComVPS& vps, Int vpsPtlIdx, Int& maxBitDepthLuma, Int& maxBitDepthChroma, ChromaFormat& maxChromaFormatIdc, Int& maxNumRefLayers); 699 885 };// END CLASS DEFINITION TAppEncCfg 700 886
Note: See TracChangeset for help on using the changeset viewer.