Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- 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.cpp
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 * … … 46 46 #include "TAppCommon/program_options_lite.h" 47 47 #include "TLibEncoder/TEncRateCtrl.h" 48 #if NH_MV 49 #include <set> 50 #endif 51 48 52 #ifdef WIN32 49 53 #define strdup _strdup … … 57 61 58 62 59 60 enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations63 #if !NH_MV 64 enum UIProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations 61 65 { 62 NONE = 0, 63 MAIN = 1, 64 MAIN10 = 2, 65 MAINSTILLPICTURE = 3, 66 MAINREXT = 4, 67 HIGHTHROUGHPUTREXT = 5, // Placeholder profile for development 66 UI_NONE = 0, 67 UI_MAIN = 1, 68 UI_MAIN10 = 2, 69 UI_MAIN10_STILL_PICTURE=10002, 70 UI_MAINSTILLPICTURE = 3, 71 UI_MAINREXT = 4, 72 UI_HIGHTHROUGHPUTREXT = 5, 68 73 // The following are RExt profiles, which would map to the MAINREXT profile idc. 69 74 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 70 75 // the chroma format in the next digit 71 // the intra constraint in the next digit76 // the intra constraint in the next digit (1 for no intra constraint, 2 for intra constraint) 72 77 // If it is a RExt still picture, there is a '1' for the top digit. 73 78 #if NH_MV 74 MULTIVIEWMAIN= 6,79 UI_MULTIVIEWMAIN = 6, 75 80 #if NH_3D 76 MAIN3D = 8, 77 #endif 78 #endif 79 MONOCHROME_8 = 1008, 80 MONOCHROME_12 = 1012, 81 MONOCHROME_16 = 1016, 82 MAIN_12 = 1112, 83 MAIN_422_10 = 1210, 84 MAIN_422_12 = 1212, 85 MAIN_444 = 1308, 86 MAIN_444_10 = 1310, 87 MAIN_444_12 = 1312, 88 MAIN_444_16 = 1316, // non-standard profile definition, used for development purposes 89 MAIN_INTRA = 2108, 90 MAIN_10_INTRA = 2110, 91 MAIN_12_INTRA = 2112, 92 MAIN_422_10_INTRA = 2210, 93 MAIN_422_12_INTRA = 2212, 94 MAIN_444_INTRA = 2308, 95 MAIN_444_10_INTRA = 2310, 96 MAIN_444_12_INTRA = 2312, 97 MAIN_444_16_INTRA = 2316, 98 MAIN_444_STILL_PICTURE = 11308, 99 MAIN_444_16_STILL_PICTURE = 12316 81 UI_MAIN3D = 8, 82 #endif 83 #endif 84 UI_MONOCHROME_8 = 1008, 85 UI_MONOCHROME_12 = 1012, 86 UI_MONOCHROME_16 = 1016, 87 UI_MAIN_12 = 1112, 88 UI_MAIN_422_10 = 1210, 89 UI_MAIN_422_12 = 1212, 90 UI_MAIN_444 = 1308, 91 UI_MAIN_444_10 = 1310, 92 UI_MAIN_444_12 = 1312, 93 UI_MAIN_444_16 = 1316, // non-standard profile definition, used for development purposes 94 UI_MAIN_INTRA = 2108, 95 UI_MAIN_10_INTRA = 2110, 96 UI_MAIN_12_INTRA = 2112, 97 UI_MAIN_422_10_INTRA = 2210, 98 UI_MAIN_422_12_INTRA = 2212, 99 UI_MAIN_444_INTRA = 2308, 100 UI_MAIN_444_10_INTRA = 2310, 101 UI_MAIN_444_12_INTRA = 2312, 102 UI_MAIN_444_16_INTRA = 2316, 103 UI_MAIN_444_STILL_PICTURE = 11308, 104 UI_MAIN_444_16_STILL_PICTURE = 12316, 105 // The following are high throughput profiles, which would map to the HIGHTHROUGHPUTREXT profile idc. 106 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 107 // the chroma format in the next digit 108 // the intra constraint in the next digit 109 // There is a '2' for the top digit to indicate it is high throughput profile 110 111 UI_HIGHTHROUGHPUT_444 = 21308, 112 UI_HIGHTHROUGHPUT_444_10 = 21310, 113 UI_HIGHTHROUGHPUT_444_14 = 21314, 114 UI_HIGHTHROUGHPUT_444_16_INTRA = 22316 100 115 }; 101 116 #endif 102 117 103 118 //! \ingroup TAppEncoder … … 112 127 , m_snrInternalColourSpace(false) 113 128 , m_outputInternalColourSpace(false) 129 #if EXTENSION_360_VIDEO 130 , m_ext360(*this) 131 #endif 114 132 { 115 133 #if !NH_MV … … 208 226 209 227 #if NH_MV 228 229 GOPEntry* TAppEncCfg::xGetGopEntries(Int layerIdInVps) 230 { 231 return m_GOPListMvc[ m_layerIdxInVpsToGopDefIdx[ layerIdInVps ] ]; 232 } 233 234 GOPEntry* TAppEncCfg::xGetGopEntry(Int layerIdInVps, Int poc) 235 { 236 GOPEntry* geFound = NULL; 237 for( Int i = 0; i < ( getGOPSize() + 1) && geFound == NULL ; i++ ) 238 { 239 GOPEntry* ge = &(xGetGopEntries( layerIdInVps)[ ( i < getGOPSize() ? i : MAX_GOP ) ]); 240 if ( ge->m_POC == poc ) 241 { 242 geFound = ge; 243 } 244 } 245 assert( geFound != NULL ); 246 return geFound; 247 } 248 210 249 Void TAppEncCfg::xParseSeiCfg() 211 250 { … … 239 278 in>>entry.m_POC; 240 279 in>>entry.m_QPOffset; 241 #if W0038_CQP_ADJ 280 #if X0038_LAMBDA_FROM_QP_CAPABILITY 281 in>>entry.m_QPOffsetModelOffset; 282 in>>entry.m_QPOffsetModelScale; 283 #endif 242 284 in>>entry.m_CbQPoffset; 243 285 in>>entry.m_CrQPoffset; 244 #endif245 286 in>>entry.m_QPFactor; 246 287 in>>entry.m_tcOffsetDiv2; … … 302 343 } 303 344 } 345 346 #if NH_MV 347 static inline std::vector<ChromaFormat> numberToChromaFormat(const IntAry1d val) 348 { 349 std::vector<ChromaFormat> chromaFormats; 350 for( Int i = 0; i < val.size(); i++) 351 { 352 chromaFormats.push_back( numberToChromaFormat( val[i] ) ); 353 } 354 return chromaFormats; 355 } 356 #endif 357 304 358 305 359 static const struct MapStrToProfile … … 314 368 {"main10", Profile::MAIN10 }, 315 369 {"main-still-picture", Profile::MAINSTILLPICTURE }, 370 {"main10-still-picture", Profile::MAIN10 }, 316 371 {"main-RExt", Profile::MAINREXT }, 317 372 {"high-throughput-RExt", Profile::HIGHTHROUGHPUTREXT } 318 373 #if NH_MV 319 ,{"multiview-main" , Profile::MULTIVIEWMAIN }, 374 ,{"multiview-main" , Profile::MULTIVIEWMAIN } 375 #if NH_MV_ALLOW_NON_CONFORMING 376 ,{"multiview-main_NONCONFORMING", Profile::MULTIVIEWMAIN_NONCONFORMING } 320 377 #if NH_3D 321 {"3d-main" , Profile::MAIN3D } 378 ,{"3d-main_NONCONFORMING" , Profile::MAIN3D_NONCONFORMING } 379 #endif 380 #endif 381 #if NH_3D 382 ,{"3d-main" , Profile::MAIN3D } 322 383 #endif 323 384 #endif … … 325 386 }; 326 387 327 static const struct MapStrTo ExtendedProfile388 static const struct MapStrToUIProfileName 328 389 { 329 390 const TChar* str; 330 ExtendedProfileName value;391 UIProfileName value; 331 392 } 332 strTo ExtendedProfile[] =393 strToUIProfileName[] = 333 394 { 334 {"none", NONE }, 335 {"main", MAIN }, 336 {"main10", MAIN10 }, 337 {"main_still_picture", MAINSTILLPICTURE }, 338 {"main-still-picture", MAINSTILLPICTURE }, 339 {"main_RExt", MAINREXT }, 340 {"main-RExt", MAINREXT }, 341 {"main_rext", MAINREXT }, 342 {"main-rext", MAINREXT }, 343 {"high_throughput_RExt", HIGHTHROUGHPUTREXT }, 344 {"high-throughput-RExt", HIGHTHROUGHPUTREXT }, 345 {"high_throughput_rext", HIGHTHROUGHPUTREXT }, 346 {"high-throughput-rext", HIGHTHROUGHPUTREXT }, 347 #if NH_MV 348 {"multiview-main" , MULTIVIEWMAIN }, 395 {"none", UI_NONE }, 396 {"main", UI_MAIN }, 397 {"main10", UI_MAIN10 }, 398 {"main10_still_picture", UI_MAIN10_STILL_PICTURE }, 399 {"main10-still-picture", UI_MAIN10_STILL_PICTURE }, 400 {"main_still_picture", UI_MAINSTILLPICTURE }, 401 {"main-still-picture", UI_MAINSTILLPICTURE }, 402 {"main_RExt", UI_MAINREXT }, 403 {"main-RExt", UI_MAINREXT }, 404 {"main_rext", UI_MAINREXT }, 405 {"main-rext", UI_MAINREXT }, 406 {"high_throughput_RExt", UI_HIGHTHROUGHPUTREXT }, 407 {"high-throughput-RExt", UI_HIGHTHROUGHPUTREXT }, 408 {"high_throughput_rext", UI_HIGHTHROUGHPUTREXT }, 409 {"high-throughput-rext", UI_HIGHTHROUGHPUTREXT }, 410 #if NH_MV 411 {"multiview-main" , UI_MULTIVIEWMAIN }, 349 412 #if NH_3D 350 {"3d-main" , MAIN3D }, 351 #endif 352 #endif 353 {"monochrome", MONOCHROME_8 }, 354 {"monochrome12", MONOCHROME_12 }, 355 {"monochrome16", MONOCHROME_16 }, 356 {"main12", MAIN_12 }, 357 {"main_422_10", MAIN_422_10 }, 358 {"main_422_12", MAIN_422_12 }, 359 {"main_444", MAIN_444 }, 360 {"main_444_10", MAIN_444_10 }, 361 {"main_444_12", MAIN_444_12 }, 362 {"main_444_16", MAIN_444_16 }, 363 {"main_intra", MAIN_INTRA }, 364 {"main_10_intra", MAIN_10_INTRA }, 365 {"main_12_intra", MAIN_12_INTRA }, 366 {"main_422_10_intra", MAIN_422_10_INTRA}, 367 {"main_422_12_intra", MAIN_422_12_INTRA}, 368 {"main_444_intra", MAIN_444_INTRA }, 369 {"main_444_still_picture", MAIN_444_STILL_PICTURE }, 370 {"main_444_10_intra", MAIN_444_10_INTRA}, 371 {"main_444_12_intra", MAIN_444_12_INTRA}, 372 {"main_444_16_intra", MAIN_444_16_INTRA}, 373 {"main_444_16_still_picture", MAIN_444_16_STILL_PICTURE } 413 {"3d-main" , UI_MAIN3D }, 414 #endif 415 #if NH_MV_ALLOW_NON_CONFORMING 416 {"multiview-main_NONCONFORMING" , UI_MULTIVIEWMAIN_NONCONF }, 417 #if NH_3D 418 {"3d-main_NONCONFORMING" , UI_MAIN3D_NONCONF }, 419 #endif 420 #endif 421 #endif 422 {"monochrome", UI_MONOCHROME_8 }, 423 {"monochrome12", UI_MONOCHROME_12 }, 424 {"monochrome16", UI_MONOCHROME_16 }, 425 {"main12", UI_MAIN_12 }, 426 {"main_422_10", UI_MAIN_422_10 }, 427 {"main_422_12", UI_MAIN_422_12 }, 428 {"main_444", UI_MAIN_444 }, 429 {"main_444_10", UI_MAIN_444_10 }, 430 {"main_444_12", UI_MAIN_444_12 }, 431 {"main_444_16", UI_MAIN_444_16 }, 432 {"main_intra", UI_MAIN_INTRA }, 433 {"main_10_intra", UI_MAIN_10_INTRA }, 434 {"main_12_intra", UI_MAIN_12_INTRA }, 435 {"main_422_10_intra", UI_MAIN_422_10_INTRA}, 436 {"main_422_12_intra", UI_MAIN_422_12_INTRA}, 437 {"main_444_intra", UI_MAIN_444_INTRA }, 438 {"main_444_still_picture", UI_MAIN_444_STILL_PICTURE }, 439 {"main_444_10_intra", UI_MAIN_444_10_INTRA}, 440 {"main_444_12_intra", UI_MAIN_444_12_INTRA}, 441 {"main_444_16_intra", UI_MAIN_444_16_INTRA}, 442 {"main_444_16_still_picture", UI_MAIN_444_16_STILL_PICTURE }, 443 {"high_throughput_444", UI_HIGHTHROUGHPUT_444 }, 444 {"high_throughput_444_10", UI_HIGHTHROUGHPUT_444_10 }, 445 {"high_throughput_444_14", UI_HIGHTHROUGHPUT_444_14 }, 446 {"high_throughput_444_16_intra", UI_HIGHTHROUGHPUT_444_16_INTRA } 374 447 }; 375 448 376 static const ExtendedProfileName validRExtProfileNames[2/* intraConstraintFlag*/][4/* bit depth constraint 8=0, 10=1, 12=2, 16=3*/][4/*chroma format*/]=449 static const UIProfileName validRExtHighThroughPutProfileNames[2/* intraConstraintFlag*/][4/* bit depth constraint 8=0, 10=1, 12=2, 16=3*/]= 377 450 { 378 { 379 { MONOCHROME_8, NONE, NONE, MAIN_444 }, // 8-bit inter for 400, 420, 422 and 444 380 { NONE, NONE, MAIN_422_10, MAIN_444_10 }, // 10-bit inter for 400, 420, 422 and 444 381 { MONOCHROME_12, MAIN_12, MAIN_422_12, MAIN_444_12 }, // 12-bit inter for 400, 420, 422 and 444 382 { MONOCHROME_16, NONE, NONE, MAIN_444_16 } // 16-bit inter for 400, 420, 422 and 444 (the latter is non standard used for development) 451 { UI_HIGHTHROUGHPUT_444, UI_HIGHTHROUGHPUT_444_10, UI_HIGHTHROUGHPUT_444_14, UI_NONE }, // intraConstraintFlag 0 - 8-bit,10-bit,14-bit and 16-bit 452 { UI_NONE, UI_NONE, UI_NONE, UI_HIGHTHROUGHPUT_444_16_INTRA } // intraConstraintFlag 1 - 8-bit,10-bit,14-bit and 16-bit 453 }; 454 455 static const UIProfileName validRExtProfileNames[2/* intraConstraintFlag*/][4/* bit depth constraint 8=0, 10=1, 12=2, 16=3*/][4/*chroma format*/]= 456 { 457 { 458 { UI_MONOCHROME_8, UI_NONE, UI_NONE, UI_MAIN_444 }, // 8-bit inter for 400, 420, 422 and 444 459 { UI_NONE, UI_NONE, UI_MAIN_422_10, UI_MAIN_444_10 }, // 10-bit inter for 400, 420, 422 and 444 460 { UI_MONOCHROME_12, UI_MAIN_12, UI_MAIN_422_12, UI_MAIN_444_12 }, // 12-bit inter for 400, 420, 422 and 444 461 { UI_MONOCHROME_16, UI_NONE, UI_NONE, UI_MAIN_444_16 } // 16-bit inter for 400, 420, 422 and 444 (the latter is non standard used for development) 383 462 }, 384 463 { 385 { NONE, MAIN_INTRA, NONE,MAIN_444_INTRA }, // 8-bit intra for 400, 420, 422 and 444386 { NONE, MAIN_10_INTRA, MAIN_422_10_INTRA,MAIN_444_10_INTRA }, // 10-bit intra for 400, 420, 422 and 444387 { NONE, MAIN_12_INTRA, MAIN_422_12_INTRA,MAIN_444_12_INTRA }, // 12-bit intra for 400, 420, 422 and 444388 { NONE, NONE, NONE,MAIN_444_16_INTRA } // 16-bit intra for 400, 420, 422 and 444464 { UI_NONE, UI_MAIN_INTRA, UI_NONE, UI_MAIN_444_INTRA }, // 8-bit intra for 400, 420, 422 and 444 465 { UI_NONE, UI_MAIN_10_INTRA, UI_MAIN_422_10_INTRA, UI_MAIN_444_10_INTRA }, // 10-bit intra for 400, 420, 422 and 444 466 { UI_NONE, UI_MAIN_12_INTRA, UI_MAIN_422_12_INTRA, UI_MAIN_444_12_INTRA }, // 12-bit intra for 400, 420, 422 and 444 467 { UI_NONE, UI_NONE, UI_NONE, UI_MAIN_444_16_INTRA } // 16-bit intra for 400, 420, 422 and 444 389 468 } 390 469 }; … … 425 504 }; 426 505 427 #if U0132_TARGET_BITS_SATURATION428 506 UInt g_uiMaxCpbSize[2][21] = 429 507 { … … 432 510 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 100000000, 160000000, 240000000, 240000000, 480000000, 800000000 } 433 511 }; 434 #endif435 512 436 513 static const struct MapStrToCostMode … … 481 558 in >> str; 482 559 483 for (UInt i = 0; i < mapLen; i++) 484 { 485 if (str == map[i].str) 560 UInt i=0; 561 for (; i < mapLen && str!=map[i].str; i++); 562 563 if (i < mapLen) 486 564 { 487 565 val = map[i].value; 488 goto found; 489 } 490 } 491 /* not found */ 566 } 567 else 568 { 492 569 in.setstate(ios::failbit); 493 found: 570 } 494 571 return in; 495 572 } … … 497 574 //inline to prevent compiler warnings for "unused static function" 498 575 499 static inline istream& operator >> (istream &in, ExtendedProfileName &profile)576 static inline istream& operator >> (istream &in, UIProfileName &profile) 500 577 { 501 return readStrToEnum(strTo ExtendedProfile, sizeof(strToExtendedProfile)/sizeof(*strToExtendedProfile), in, profile);578 return readStrToEnum(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), in, profile); 502 579 } 503 580 … … 640 717 } 641 718 719 #if JVET_E0059_FLOATING_POINT_QP_FIX 720 template <class T> 721 static inline istream& operator >> (std::istream &in, TAppEncCfg::OptionalValue<T> &value) 722 { 723 in >> std::ws; 724 if (in.eof()) 725 { 726 value.bPresent=false; 727 } 728 else 729 { 730 in >> value.value; 731 value.bPresent=true; 732 } 733 return in; 734 } 735 #endif 736 642 737 static Void 643 738 automaticallySelectRExtProfile(const Bool bUsingGeneralRExtTools, … … 740 835 #endif 741 836 837 #if NH_MV 838 IntAry1d tmpInputChromaFormat; 839 IntAry1d tmpChromaFormat; 840 #if NH_3D 841 IntAry1d tmpChromaFormatInit; 842 tmpChromaFormatInit.push_back(420); 843 tmpChromaFormatInit.push_back(400); 844 #endif 845 IntAry2d tmpPad(2); 846 847 IntAry2d tmpInputBitDepth (2); 848 IntAry2d tmpOutputBitDepth (2); 849 IntAry2d tmpMSBExtendedBitDepth(2); 850 IntAry2d tmpInternalBitDepth (2); 851 852 #else 853 Int tmpInputChromaFormat; 742 854 Int tmpChromaFormat; 743 Int tmpInputChromaFormat;744 855 Int tmpConstraintChromaFormat; 856 #endif 745 857 Int tmpWeightedPredictionMethod; 746 858 Int tmpFastInterSearchMode; … … 751 863 string inputColourSpaceConvert; 752 864 #if NH_MV 753 std::vector< ExtendedProfileName> extendedProfiles;754 #else 755 ExtendedProfileName extendedProfile;865 std::vector<UIProfileName> UIProfiles; 866 #else 867 UIProfileName UIProfile; 756 868 #endif 757 869 Int saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE]; … … 766 878 SMultiValueInput<Double> cfg_adIntraLambdaModifier (0, std::numeric_limits<Double>::max(), 0, MAX_TLAYER); ///< 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. 767 879 880 const Int defaultLumaLevelTodQp_QpChangePoints[] = {-3, -2, -1, 0, 1, 2, 3, 4, 5, 6}; 881 const Int defaultLumaLevelTodQp_LumaChangePoints[] = { 0, 301, 367, 434, 501, 567, 634, 701, 767, 834}; 882 SMultiValueInput<Int> cfg_lumaLeveltoDQPMappingQP (-MAX_QP, MAX_QP, 0, LUMA_LEVEL_TO_DQP_LUT_MAXSIZE, defaultLumaLevelTodQp_QpChangePoints, sizeof(defaultLumaLevelTodQp_QpChangePoints )/sizeof(Int)); 883 SMultiValueInput<Int> cfg_lumaLeveltoDQPMappingLuma (0, std::numeric_limits<Int>::max(), 0, LUMA_LEVEL_TO_DQP_LUT_MAXSIZE, defaultLumaLevelTodQp_LumaChangePoints, sizeof(defaultLumaLevelTodQp_LumaChangePoints)/sizeof(Int)); 884 UInt lumaLevelToDeltaQPMode; 768 885 769 886 const UInt defaultInputKneeCodes[3] = { 600, 800, 900 }; … … 842 959 ("ProfileTierLevelIdx_%d" , m_profileTierLevelIdx , IntAry1d(0) , MAX_NUM_LAYERS, "Indices to profile level tier for ols") 843 960 // Layer dependencies 844 ("DirectRefLayers_%d" , m_directRefLayers , IntAry1d(0,0), MAX_NUM_LAYERS, "LayerIdx in VPS of direct reference layers") 845 ("DependencyTypes_%d" , m_dependencyTypes , IntAry1d(0,0), MAX_NUM_LAYERS, "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion") 846 #endif 961 ("DirectRefLayers_%d" , m_directRefLayers , IntAry1d(0,0), MAX_NUM_LAYERS, "LayerIdx in VPS of direct reference layers") 962 ("DependencyTypes_%d" , m_dependencyTypes , IntAry1d(0,0), MAX_NUM_LAYERS, "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion") 963 ("ShareParameterSets" , m_shareParameterSets , false , "Signal parameter sets only in the base layer.") 964 ("LayerIdxInVpsToGopDefIdx" , m_layerIdxInVpsToGopDefIdx , IntAry1d(0,0), "Maps the layers to the GOP definitions in the cfg-file.") 965 ("LayerIdxInVpsToRepFormatIdx" , m_layerIdxInVpsToRepFormatIdx , IntAry1d(0,0), "Maps the layers to the vps representation formats, i.e. values of SourceWidth, SourceHeight, InternalBitDepth, ChromaFormatIDC, InputBitDepth, OutputBitDepth, MSBExtendedBitDepth, InputChromaFormat, ConfWinBottom, ConfWinTop, ConfWinRight, ConfWinLeft, VerticalPadding, HorizontalPadding." ) 966 #endif 967 #if NH_MV 968 ("SourceWidth,-wdt", m_iSourceWidths, IntAry1d(1,0), "Source picture width") 969 ("SourceHeight,-hgt", m_iSourceHeights, IntAry1d(1,0), "Source picture height") 970 ("InputBitDepth", tmpInputBitDepth [CHANNEL_TYPE_LUMA ], IntAry1d(1,8), "Bit-depth of input file") 971 ("OutputBitDepth", tmpOutputBitDepth [CHANNEL_TYPE_LUMA ], IntAry1d(1,0), "Bit-depth of output file (default:InternalBitDepth)") 972 ("MSBExtendedBitDepth", tmpMSBExtendedBitDepth[CHANNEL_TYPE_LUMA ], IntAry1d(1,0), "bit depth of luma component after addition of MSBs of value 0 (used for synthesising High Dynamic Range source material). (default:InputBitDepth)") 973 ("InternalBitDepth", tmpInternalBitDepth [CHANNEL_TYPE_LUMA ], IntAry1d(1,0), "Bit-depth the codec operates at. (default:MSBExtendedBitDepth). If different to MSBExtendedBitDepth, source data will be converted") 974 ("InputBitDepthC", tmpInputBitDepth [CHANNEL_TYPE_CHROMA], IntAry1d(1,0), "As per InputBitDepth but for chroma component. (default:InputBitDepth)") 975 ("OutputBitDepthC", tmpOutputBitDepth [CHANNEL_TYPE_CHROMA], IntAry1d(1,0), "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 976 ("MSBExtendedBitDepthC", tmpMSBExtendedBitDepth[CHANNEL_TYPE_CHROMA], IntAry1d(1,0), "As per MSBExtendedBitDepth but for chroma component. (default:MSBExtendedBitDepth)") 977 ("InternalBitDepthC", tmpInternalBitDepth [CHANNEL_TYPE_CHROMA], IntAry1d(1,0), "As per InternalBitDepth but for chroma component. (default:InternalBitDepth)") 978 #else 847 979 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") 848 980 ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") … … 855 987 ("MSBExtendedBitDepthC", m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA], 0, "As per MSBExtendedBitDepth but for chroma component. (default:MSBExtendedBitDepth)") 856 988 ("InternalBitDepthC", m_internalBitDepth[CHANNEL_TYPE_CHROMA], 0, "As per InternalBitDepth but for chroma component. (default:InternalBitDepth)") 989 #endif 857 990 ("ExtendedPrecision", m_extendedPrecisionProcessingFlag, false, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)") 858 991 ("HighPrecisionPredictionWeighting", m_highPrecisionOffsetsEnabledFlag, false, "Use high precision option for weighted prediction (not valid in V1 profiles)") … … 860 993 ("SNRInternalColourSpace", m_snrInternalColourSpace, false, "If true, then no colour space conversion is applied prior to SNR, otherwise inverse of input is applied.") 861 994 ("OutputInternalColourSpace", m_outputInternalColourSpace, false, "If true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied.") 995 #if NH_MV 996 ("InputChromaFormat", tmpInputChromaFormat, IntAry1d(1,420), "InputChromaFormatIDC") 997 #else 862 998 ("InputChromaFormat", tmpInputChromaFormat, 420, "InputChromaFormatIDC") 999 #endif 863 1000 ("MSEBasedSequencePSNR", m_printMSEBasedSequencePSNR, false, "0 (default) emit sequence PSNR only as a linear average of the frame PSNRs, 1 = also emit a sequence PSNR based on an average of the frame MSEs") 864 1001 ("PrintFrameMSE", m_printFrameMSE, false, "0 (default) emit only bit count and PSNRs for each frame, 1 = also emit MSE values") 865 1002 ("PrintSequenceMSE", m_printSequenceMSE, false, "0 (default) emit only bit rate and PSNRs for the whole sequence, 1 = also emit MSE values") 1003 #if JVET_F0064_MSSSIM 1004 ("PrintMSSSIM", m_printMSSSIM, false, "0 (default) do not print MS-SSIM scores, 1 = print MS-SSIM scores for each frame and for the whole sequence") 1005 #endif 866 1006 ("CabacZeroWordPaddingEnabled", m_cabacZeroWordPaddingEnabled, true, "0 do not add conforming cabac-zero-words to bit streams, 1 (default) = add cabac-zero-words as required") 1007 #if NH_MV 1008 #if NH_3D 1009 ("ChromaFormatIDC,-cf", tmpChromaFormat, tmpChromaFormatInit, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 1010 #else 1011 ("ChromaFormatIDC,-cf", tmpChromaFormat, IntAry1d(1,0), "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 1012 #endif 1013 #else 867 1014 ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 1015 #endif 868 1016 ("ConformanceMode", m_conformanceWindowMode, 0, "Deprecated alias of ConformanceWindowMode") 869 1017 ("ConformanceWindowMode", m_conformanceWindowMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") 1018 #if NH_MV 1019 ("HorizontalPadding,-pdx", tmpPad[0] , IntAry1d(1,0), "Horizontal source padding for conformance window mode 2") 1020 ("VerticalPadding,-pdy", tmpPad[1] , IntAry1d(1,0), "Vertical source padding for conformance window mode 2") 1021 #else 870 1022 ("HorizontalPadding,-pdx", m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") 871 1023 ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") 1024 #endif 1025 1026 #if NH_MV 1027 ("ConfWinLeft", m_confWinLefts, IntAry1d(1, 0) , "Left offset for window conformance mode 3") 1028 ("ConfWinRight", m_confWinRights, IntAry1d(1, 0) , "Right offset for window conformance mode 3") 1029 ("ConfWinTop", m_confWinTops, IntAry1d(1, 0) , "Top offset for window conformance mode 3") 1030 ("ConfWinBottom", m_confWinBottoms, IntAry1d(1, 0) , "Bottom offset for window conformance mode 3") 1031 #else 872 1032 ("ConfLeft", m_confWinLeft, 0, "Deprecated alias of ConfWinLeft") 873 1033 ("ConfRight", m_confWinRight, 0, "Deprecated alias of ConfWinRight") 874 1034 ("ConfTop", m_confWinTop, 0, "Deprecated alias of ConfWinTop") 875 1035 ("ConfBottom", m_confWinBottom, 0, "Deprecated alias of ConfWinBottom") 1036 876 1037 ("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3") 877 1038 ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3") 878 1039 ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") 879 1040 ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") 1041 #endif 1042 880 1043 ("AccessUnitDelimiter", m_AccessUnitDelimiter, false, "Enable Access Unit Delimiter NALUs") 881 1044 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") … … 901 1064 ("Tier" , cfg_tiers , string(""), "Tier indication in VpsProfileTierLevel (Indication only)") 902 1065 ("InblFlag", m_inblFlag , std::vector<Bool>(0), "InblFlags in VpsProfileTierLevel (Indication only)" ) 903 #else 904 ("Profile", extendedProfile, NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none") 1066 1067 ("MaxBitDepthConstraint", m_bitDepthConstraints, std::vector<Int>( 1,0u) , "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1068 ("MaxChromaFormatConstraint", m_tmpConstraintChromaFormats, IntAry1d(1, 0) , "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1069 ("IntraConstraintFlag", m_intraConstraintFlags, BoolAry1d(1,false) , "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1070 ("OnePictureOnlyConstraintFlag", m_onePictureOnlyConstraintFlags, BoolAry1d(1,false) , "Value of general_one_picture_only_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1071 ("LowerBitRateConstraintFlag", m_lowerBitRateConstraintFlags, BoolAry1d(1,true) , "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles") 1072 ("ProgressiveSource", m_progressiveSourceFlags, BoolAry1d(1,false) , "Indicate that source is progressive") 1073 ("InterlacedSource", m_interlacedSourceFlags, BoolAry1d(1,false) , "Indicate that source is interlaced") 1074 ("NonPackedSource", m_nonPackedConstraintFlags, BoolAry1d(1,false) , "Indicate that source does not contain frame packing") 1075 ("FrameOnly", m_frameOnlyConstraintFlags, BoolAry1d(1,false) , "Indicate that the bitstream contains only frames") 1076 1077 #else 1078 ("Profile", UIProfile, UI_NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none") 905 1079 ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1, or none") 906 1080 ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)") 907 #endif908 1081 ("MaxBitDepthConstraint", m_bitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 909 1082 ("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") … … 911 1084 ("OnePictureOnlyConstraintFlag", m_onePictureOnlyConstraintFlag, false, "Value of general_one_picture_only_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 912 1085 ("LowerBitRateConstraintFlag", m_lowerBitRateConstraintFlag, true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles") 913 914 1086 ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") 915 1087 ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced") 916 1088 ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing") 917 1089 ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") 1090 1091 #endif 1092 918 1093 919 1094 // Unit definition parameters … … 939 1114 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)") 940 1115 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 1116 #if JCTVC_Y0038_PARAMS 1117 #if NH_MV 1118 // To keep compatibility to legacy bit streams. 1119 ("ReWriteParamSetsFlag", m_bReWriteParamSetsFlag, false, "Enable rewriting of Parameter sets before every (intra) random access point") 1120 #else 1121 ("ReWriteParamSetsFlag", m_bReWriteParamSetsFlag, true, "Enable rewriting of Parameter sets before every (intra) random access point") 1122 #endif 1123 #endif 941 1124 942 1125 // motion search options … … 967 1150 ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6. If LambdaModifierI is used, this will not affect intra pictures") 968 1151 ("LambdaModifierI,-LMI", cfg_adIntraLambdaModifier, cfg_adIntraLambdaModifier, "Lambda modifiers for Intra pictures, comma separated, up to one the number of temporal layer. If entry for temporalLayer exists, then use it, else if some are specified, use the last, else use the standard LambdaModifiers.") 969 ("IQPFactor,-IQF", m_dIntraQpFactor, -1.0, "Intra QP Factor for Lambda Computation. If negative, use the default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) ))")1152 ("IQPFactor,-IQF", m_dIntraQpFactor, -1.0, "Intra QP Factor for Lambda Computation. If negative, the default will scale lambda based on GOP size (unless LambdaFromQpEnable then IntraQPOffset is used instead)") 970 1153 971 1154 /* Quantization parameters */ 972 1155 #if NH_MV 1156 #if JVET_E0059_FLOATING_POINT_QP_FIX 1157 ("QP,q", m_iQP, std::vector<Int>(1,30) , "Qp value") 1158 ("QPIncrementFrame,-qpif", m_qpIncrementAtSourceFrame, std::vector<Int>( 0 ), "If a source file frame number is specified, the internal QP will be incremented for all POCs associated with source frames >= frame number. If empty, do not increment.") 1159 #else 973 1160 ("QP,q", m_fQP, std::vector<double>(1,30.0), "Qp values for each layer, if value is float, QP is switched once during encoding") 1161 #endif 1162 #else 1163 #if JVET_E0059_FLOATING_POINT_QP_FIX 1164 ("QP,q", m_iQP, 30, "Qp value") 1165 ("QPIncrementFrame,-qpif", m_qpIncrementAtSourceFrame, OptionalValue<UInt>(), "If a source file frame number is specified, the internal QP will be incremented for all POCs associated with source frames >= frame number. If empty, do not increment.") 974 1166 #else 975 1167 ("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding") 1168 #endif 1169 #endif 1170 #if X0038_LAMBDA_FROM_QP_CAPABILITY 1171 ("IntraQPOffset", m_intraQPOffset, 0, "Qp offset value for intra slice, typically determined based on GOP size") 1172 ("LambdaFromQpEnable", m_lambdaFromQPEnable, false, "Enable flag for derivation of lambda from QP") 976 1173 #endif 977 1174 ("DeltaQpRD,-dqr", m_uiDeltaQpRD, 0u, "max dQp offset for slice") … … 981 1178 ("FastDeltaQP", m_bFastDeltaQP, false, "Fast Delta QP Algorithm") 982 1179 1180 ("LumaLevelToDeltaQPMode", lumaLevelToDeltaQPMode, 0u, "Luma based Delta QP 0(default): not used. 1: Based on CTU average, 2: Based on Max luma in CTU") 1181 ("LumaLevelToDeltaQPMaxValWeight", m_lumaLevelToDeltaQPMapping.maxMethodWeight, 1.0, "Weight of block max luma val when LumaLevelToDeltaQPMode = 2") 1182 ("LumaLevelToDeltaQPMappingLuma", cfg_lumaLeveltoDQPMappingLuma, cfg_lumaLeveltoDQPMappingLuma, "Luma to Delta QP Mapping - luma thresholds") 1183 ("LumaLevelToDeltaQPMappingDQP", cfg_lumaLeveltoDQPMappingQP, cfg_lumaLeveltoDQPMappingQP, "Luma to Delta QP Mapping - DQP values") 983 1184 ("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset") 984 1185 ("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset") 985 986 #if W0038_CQP_ADJ 987 ("SliceChromaQPOffsetPeriodicity", m_sliceChromaQpOffsetPeriodicity, 0u, "Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.") 1186 ("WCGPPSEnable", m_wcgChromaQpControl.enabled, false, "1: Enable the WCG PPS chroma modulation scheme. 0 (default) disabled") 1187 ("WCGPPSCbQpScale", m_wcgChromaQpControl.chromaCbQpScale, 1.0, "WCG PPS Chroma Cb QP Scale") 1188 ("WCGPPSCrQpScale", m_wcgChromaQpControl.chromaCrQpScale, 1.0, "WCG PPS Chroma Cr QP Scale") 1189 ("WCGPPSChromaQpScale", m_wcgChromaQpControl.chromaQpScale, 0.0, "WCG PPS Chroma QP Scale") 1190 ("WCGPPSChromaQpOffset", m_wcgChromaQpControl.chromaQpOffset, 0.0, "WCG PPS Chroma QP Offset") 1191 ("SliceChromaQPOffsetPeriodicity", m_sliceChromaQpOffsetPeriodicity, 0u, "Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.") 988 1192 ("SliceCbQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[0], 0, "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.") 989 1193 ("SliceCrQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[1], 0, "Chroma Cr QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.") 990 #endif991 1194 #if ADAPTIVE_QP_SELECTION 992 1195 ("AdaptiveQpSelection,-aqps", m_bUseAdaptQpSelect, false, "AdaptiveQpSelection") … … 998 1201 ("RDOQ", m_useRDOQ, true) 999 1202 ("RDOQTS", m_useRDOQTS, true) 1000 #if T0196_SELECTIVE_RDOQ1001 1203 ("SelectiveRDOQ", m_useSelectiveRDOQ, false, "Enable selective RDOQ") 1002 #endif1003 1204 ("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disabled 1:RD-penalty 2:maximum RD-penalty") 1004 1205 … … 1012 1213 ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0) 1013 1214 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0) 1014 #if W0038_DB_OPT1015 1215 ("DeblockingFilterMetric", m_deblockingFilterMetric, 0) 1016 #else1017 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false)1018 #endif1019 1216 // Coding tools 1020 1217 ("AMP", m_enableAMP, true, "Enable asymmetric motion partitions") … … 1042 1239 ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") 1043 1240 ("SAOLcuBoundary", m_saoCtuBoundary, false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas") 1044 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP1045 1241 ("SAOResetEncoderStateAfterIRAP", m_saoResetEncoderStateAfterIRAP, false, "When true, resets the encoder's SAO state after an IRAP (POC order). Disabled by default.") 1046 #endif1047 1242 ("SliceMode", tmpSliceMode, Int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice") 1048 1243 ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:" … … 1086 1281 ("ScalingList", m_useScalingListId, SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile") 1087 1282 ("ScalingListFile", m_scalingListFileName, string(""), "Scaling list file name. Use an empty string to produce help.") 1088 ("SignHideFlag,-SBH", m_sign HideFlag, true)1283 ("SignHideFlag,-SBH", m_signDataHidingEnabledFlag, true) 1089 1284 ("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates") 1090 1285 /* Misc. */ … … 1107 1302 ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) 1108 1303 ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) 1109 1110 #if U0132_TARGET_BITS_SATURATION1111 1304 ( "RCCpbSaturation", m_RCCpbSaturationEnabled, false, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" ) 1112 1305 ( "RCCpbSize", m_RCCpbSize, 0u, "Rate control: CPB size" ) 1113 1306 ( "RCInitialCpbFullness", m_RCInitialCpbFullness, 0.9, "Rate control: initial CPB fullness" ) 1114 #endif1115 1116 1307 #if KWU_RC_VIEWRC_E0227 1117 1308 ("ViewWiseTargetBits, -vtbr" , m_viewTargetBits, std::vector<Int>(1, 32), "View-wise target bit-rate setting") … … 1150 1341 #endif 1151 1342 1152 ("TransquantBypassEnableFlag", m_TransquantBypassEnableFlag, false, "transquant_bypass_enable_flag indicator in PPS") 1153 ("CUTransquantBypassFlagForce", m_CUTransquantBypassFlagForce, false, "Force transquant bypass mode, when transquant_bypass_enable_flag is enabled") 1343 ("TransquantBypassEnable", m_TransquantBypassEnabledFlag, false, "transquant_bypass_enabled_flag indicator in PPS") 1344 ("TransquantBypassEnableFlag", m_TransquantBypassEnabledFlag, false, "deprecated alias for TransquantBypassEnable") 1345 ("CUTransquantBypassFlagForce", m_CUTransquantBypassFlagForce, false, "Force transquant bypass mode, when transquant_bypass_enabled_flag is enabled") 1154 1346 ("CostMode", m_costMode, COST_STANDARD_LOSSY, "Use alternative cost functions: choose between 'lossy', 'sequence_level_lossless', 'lossless' (which forces QP to " MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP) ") and 'mixed_lossless_lossy' (which used QP'=" MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME) " for pre-estimates of transquant-bypass blocks).") 1155 1347 ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case") … … 1263 1455 ("SEIScalableNesting", m_scalableNestingSEIEnabled, false, "Control generation of scalable nesting SEI messages") 1264 1456 ("SEITempMotionConstrainedTileSets", m_tmctsSEIEnabled, false, "Control generation of temporal motion constrained tile sets SEI message") 1457 #if MCTS_ENC_CHECK 1458 ("SEITMCTSTileConstraint", m_tmctsSEITileConstraint, false, "Constrain motion vectors at tile boundaries") 1459 #endif 1265 1460 ("SEITimeCodeEnabled", m_timeCodeSEIEnabled, false, "Control generation of time code information SEI message") 1266 1461 ("SEITimeCodeNumClockTs", m_timeCodeSEINumTs, 0, "Number of clock time sets [0..3]") … … 1296 1491 ("SEIMasteringDisplayPrimaries", cfg_DisplayPrimariesCode, cfg_DisplayPrimariesCode, "Mastering display primaries for all three colour planes in CIE xy coordinates in increments of 1/50000 (results in the ranges 0 to 50000 inclusive)") 1297 1492 ("SEIMasteringDisplayWhitePoint", cfg_DisplayWhitePointCode, cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)") 1298 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI1299 1493 ("SEIPreferredTransferCharacterisics", m_preferredTransferCharacteristics, -1, "Value for the preferred_transfer_characteristics field of the Alternative transfer characteristics SEI which will override the corresponding entry in the VUI. If negative, do not produce the respective SEI message") 1300 #endif 1494 ("SEIGreenMetadataType", m_greenMetadataType, 0u, "Value for the green_metadata_type specifies the type of metadata that is present in the SEI message. If green_metadata_type is 1, then metadata enabling quality recovery after low-power encoding is present") 1495 ("SEIXSDMetricType", m_xsdMetricType, 0u, "Value for the xsd_metric_type indicates the type of the objective quality metric. PSNR is the only type currently supported") 1496 1301 1497 #if NH_MV 1302 1498 ("SeiCfgFileName_%d", m_seiCfgFileNames, (TChar *) 0 ,MAX_NUM_SEIS , "SEI cfg file name %d") … … 1331 1527 ("DWeight", m_iDWeight , 1 ,"Depth Distortion weight" ) 1332 1528 #endif //HHI_VSO 1529 1530 #if NH_3D 1333 1531 /* 3D- HEVC Tools */ 1334 #if NH_3D_QTL1335 1532 ("QTL" , m_bUseQTL , true , "Use depth quad tree limitation (encoder only)" ) 1336 #endif1337 #if NH_3D1338 1533 1339 1534 ("IvMvPredFlag" , m_ivMvPredFlag , BoolAry1d(2,true) , "Inter-view motion prediction" ) … … 1355 1550 ("IlluCompEnable" , m_abUseIC , true , "Enable illumination compensation" ) 1356 1551 ("IlluCompLowLatencyEnc" , m_bUseLowLatencyICEnc , false , "Enable low-latency illumination compensation encoding") 1357 #endif //NH_3D 1358 1552 #endif //NH_3D 1359 1553 ; 1360 1554 1361 #if NH_MV 1362 // parse coding structure 1555 #if EXTENSION_360_VIDEO 1556 TExt360AppEncCfg::TExt360AppEncCfgContext ext360CfgContext; 1557 m_ext360.addOptions(opts, ext360CfgContext); 1558 #endif 1559 1560 1561 #if NH_MV 1363 1562 for( Int k = 0; k < MAX_NUM_LAYERS; k++ ) 1364 1563 { … … 1414 1613 const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err); 1415 1614 1615 1416 1616 for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 1417 1617 { … … 1435 1635 } 1436 1636 1637 #if NH_MV 1638 if ( m_layerIdxInVpsToRepFormatIdx.size() == 0 ) 1639 { 1640 m_layerIdxInVpsToRepFormatIdx.push_back( 0 ); 1641 #if NH_3D 1642 m_layerIdxInVpsToRepFormatIdx.push_back( 1 ); 1643 #endif 1644 } 1645 1646 xResizeVector( m_layerIdxInVpsToRepFormatIdx ); 1647 1648 // parse coding structure 1649 if ( m_layerIdxInVpsToGopDefIdx.size() == 0 ) 1650 { 1651 for( Int k = 0; k < m_numberOfLayers; k++ ) 1652 { 1653 m_layerIdxInVpsToGopDefIdx.push_back( k ); 1654 } 1655 } 1656 1657 xConvertRepFormatParameters( 1658 tmpPad , 1659 tmpInputBitDepth , 1660 tmpOutputBitDepth , 1661 tmpMSBExtendedBitDepth , 1662 tmpInternalBitDepth , 1663 tmpInputChromaFormat , 1664 tmpChromaFormat 1665 ); 1666 #endif 1437 1667 /* 1438 1668 * Set any derived parameters 1439 1669 */ 1670 #if NH_MV 1671 m_inputFileWidths = m_iSourceWidths; 1672 m_inputFileHeights = m_iSourceHeights; 1673 #else 1674 m_inputFileWidth = m_iSourceWidth; 1675 m_inputFileHeight = m_iSourceHeight; 1676 #endif 1440 1677 1441 1678 m_framesToBeEncoded = ( m_framesToBeEncoded + m_temporalSubsampleRatio - 1 ) / m_temporalSubsampleRatio; 1442 1679 m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values; 1680 1681 #if NH_MV 1682 m_iSourceHeightOrgs = m_iSourceHeights; 1683 #endif 1443 1684 if(m_isField) 1444 1685 { 1686 #if NH_MV 1687 //Frame height 1688 m_iSourceHeightOrgs = m_iSourceHeights; 1689 //Field height 1690 for (Int i = 0; i < m_iSourceHeights.size(); i++ ) 1691 { 1692 m_iSourceHeights[i] = m_iSourceHeights[i] >> 1; 1693 } 1694 #else 1445 1695 //Frame height 1446 1696 m_iSourceHeightOrg = m_iSourceHeight; 1447 1697 //Field height 1448 1698 m_iSourceHeight = m_iSourceHeight >> 1; 1699 #endif 1449 1700 //number of fields to encode 1450 1701 m_framesToBeEncoded *= 2; … … 1503 1754 } 1504 1755 1756 #if NH_MV 1757 for (Int i = 0; i < m_numRepFormats; i++ ) 1758 { 1759 Int* m_MSBExtendedBitDepth = &m_MSBExtendedBitDepths[i][0]; 1760 Int* m_internalBitDepth = &m_internalBitDepths [i][0]; 1761 Int* m_outputBitDepth = &m_outputBitDepths [i][0]; 1762 Int* m_inputBitDepth = &m_inputBitDepths [i][0]; 1763 #endif 1505 1764 /* rules for input, output and internal bitdepths as per help text */ 1506 1765 if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] == 0) … … 1533 1792 } 1534 1793 1794 1795 #if NH_MV 1796 } 1535 1797 m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat); 1798 #endif 1799 1800 1801 #if NH_MV 1802 std::vector<ChromaFormat> tempChromaFormatIdc = numberToChromaFormat(tmpChromaFormat); 1803 for(Int i = 0 ; i < m_InputChromaFormatIDC.size(); i++) 1804 { 1805 m_chromaFormatIDCs.push_back( ((tmpChromaFormat[i] == 0) ? (m_InputChromaFormatIDC[i]) : tempChromaFormatIdc[i] ) ); 1806 } 1807 #else 1536 1808 m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat))); 1537 1809 #endif 1810 1811 #if EXTENSION_360_VIDEO 1812 m_ext360.processOptions(ext360CfgContext); 1813 #endif 1538 1814 1539 1815 assert(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION); … … 1558 1834 m_motionEstimationSearchMethod=MESearchMethod(tmpMotionEstimationSearchMethod); 1559 1835 1560 #if NH_MV 1561 // parse PTL 1836 #if NH_MV 1837 1562 1838 Bool anyEmpty = false; 1563 1839 if( cfg_profiles.empty() ) … … 1602 1878 } 1603 1879 1604 xReadStrToEnum( cfg_profiles, extendedProfiles );1880 xReadStrToEnum( cfg_profiles, m_uiProfiles ); 1605 1881 xReadStrToEnum( cfg_levels, m_level ); 1606 1882 xReadStrToEnum( cfg_tiers , m_levelTier ); 1607 1608 1609 #if NH_MV 1610 m_profiles.resize( extendedProfiles.size()); 1611 1612 for (Int i = 0; i < m_profiles.size(); i++) 1613 { 1614 Profile::Name& m_profile = m_profiles [i]; 1615 ExtendedProfileName& extendedProfile = extendedProfiles[i]; 1616 #endif 1617 #endif 1618 1619 if (extendedProfile >= 1000 && extendedProfile <= 12316) 1620 { 1883 1884 #else 1885 switch (UIProfile) 1886 { 1887 case UI_NONE: 1888 m_profile = Profile::NONE; 1889 m_onePictureOnlyConstraintFlag = false; 1890 break; 1891 case UI_MAIN: 1892 m_profile = Profile::MAIN; 1893 m_onePictureOnlyConstraintFlag = false; 1894 break; 1895 case UI_MAIN10: 1896 m_profile = Profile::MAIN10; 1897 m_onePictureOnlyConstraintFlag = false; 1898 break; 1899 case UI_MAINSTILLPICTURE: 1900 m_profile = Profile::MAINSTILLPICTURE; 1901 m_onePictureOnlyConstraintFlag = false; 1902 break; 1903 case UI_MAIN10_STILL_PICTURE: 1904 m_profile = Profile::MAIN10; 1905 m_onePictureOnlyConstraintFlag = true; 1906 break; 1907 case UI_MAINREXT: 1621 1908 m_profile = Profile::MAINREXT; 1622 if (m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0) 1623 { 1624 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); 1625 exit(EXIT_FAILURE); 1626 } 1627 m_bitDepthConstraint = (extendedProfile%100); 1628 m_intraConstraintFlag = ((extendedProfile%10000)>=2000); 1629 m_onePictureOnlyConstraintFlag = (extendedProfile >= 10000); 1630 switch ((extendedProfile/100)%10) 1631 { 1632 case 0: tmpConstraintChromaFormat=400; break; 1633 case 1: tmpConstraintChromaFormat=420; break; 1634 case 2: tmpConstraintChromaFormat=422; break; 1635 default: tmpConstraintChromaFormat=444; break; 1636 } 1637 } 1638 else 1639 { 1640 m_profile = Profile::Name(extendedProfile); 1641 } 1642 1643 if (m_profile == Profile::HIGHTHROUGHPUTREXT ) 1644 { 1645 if (m_bitDepthConstraint == 0) 1646 { 1647 m_bitDepthConstraint = 16; 1648 } 1649 m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat); 1650 } 1651 else if (m_profile == Profile::MAINREXT) 1652 { 1653 if (m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0) 1654 { 1655 // produce a valid combination, if possible. 1656 const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag || 1657 m_transformSkipContextEnabledFlag || 1658 m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] || 1659 m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] || 1660 !m_enableIntraReferenceSmoothing || 1661 m_persistentRiceAdaptationEnabledFlag || 1662 m_log2MaxTransformSkipBlockSize!=2; 1663 const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0; 1664 const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag; 1665 if (m_onePictureOnlyConstraintFlag) 1666 { 1667 m_chromaFormatConstraint = CHROMA_444; 1668 if (m_intraConstraintFlag != true) 1909 m_onePictureOnlyConstraintFlag = false; 1910 break; 1911 case UI_HIGHTHROUGHPUTREXT: 1912 m_profile = Profile::HIGHTHROUGHPUTREXT; 1913 m_onePictureOnlyConstraintFlag = false; 1914 break; 1915 default: 1916 if (UIProfile >= 1000 && UIProfile <= 12316) 1917 { 1918 m_profile = Profile::MAINREXT; 1919 if (m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0) 1669 1920 { 1670 fprintf(stderr, "Error: Intra constraint flag must be true when one_picture_only_constraint_flag is true\n");1921 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); 1671 1922 exit(EXIT_FAILURE); 1672 1923 } 1673 const Int maxBitDepth = m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 1674 m_bitDepthConstraint = maxBitDepth>8 ? 16:8; 1924 m_bitDepthConstraint = (UIProfile%100); 1925 m_intraConstraintFlag = ((UIProfile%10000)>=2000); 1926 m_onePictureOnlyConstraintFlag = (UIProfile >= 10000); 1927 switch ((UIProfile/100)%10) 1928 { 1929 case 0: tmpConstraintChromaFormat=400; break; 1930 case 1: tmpConstraintChromaFormat=420; break; 1931 case 2: tmpConstraintChromaFormat=422; break; 1932 default: tmpConstraintChromaFormat=444; break; 1933 } 1934 } 1935 else if (UIProfile >= 21308 && UIProfile <= 22316) 1936 { 1937 m_profile = Profile::HIGHTHROUGHPUTREXT; 1938 if (m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0) 1939 { 1940 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); 1941 exit(EXIT_FAILURE); 1942 } 1943 m_bitDepthConstraint = (UIProfile%100); 1944 m_intraConstraintFlag = ((UIProfile%10000)>=2000); 1945 m_onePictureOnlyConstraintFlag = 0; 1946 if((UIProfile == UI_HIGHTHROUGHPUT_444) || (UIProfile == UI_HIGHTHROUGHPUT_444_10) ) 1947 { 1948 assert(m_cabacBypassAlignmentEnabledFlag==0); 1949 } 1950 switch ((UIProfile/100)%10) 1951 { 1952 case 0: tmpConstraintChromaFormat=400; break; 1953 case 1: tmpConstraintChromaFormat=420; break; 1954 case 2: tmpConstraintChromaFormat=422; break; 1955 default: tmpConstraintChromaFormat=444; break; 1956 } 1675 1957 } 1676 1958 else 1677 1959 { 1678 m_chromaFormatConstraint = NUM_CHROMA_FORMAT; 1679 automaticallySelectRExtProfile(bUsingGeneralRExtTools, 1680 bUsingChromaQPAdjustment, 1681 bUsingExtendedPrecision, 1682 m_intraConstraintFlag, 1683 m_bitDepthConstraint, 1684 m_chromaFormatConstraint, 1685 m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]), 1686 m_chromaFormatIDC); 1687 } 1688 } 1689 else if (m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0) 1690 { 1691 fprintf(stderr, "Error: The bit depth and chroma format constraints must either both be specified or both be configured automatically\n"); 1960 fprintf(stderr, "Error: Unprocessed UI profile\n"); 1961 assert(0); 1692 1962 exit(EXIT_FAILURE); 1693 1963 } 1694 else 1695 { 1696 m_chromaFormatConstraint = numberToChromaFormat(tmpConstraintChromaFormat); 1697 } 1698 } 1699 else 1700 { 1964 break; 1965 } 1966 1967 switch (m_profile) 1968 { 1969 case Profile::HIGHTHROUGHPUTREXT: 1970 { 1971 if (m_bitDepthConstraint == 0) 1972 { 1973 m_bitDepthConstraint = 16; 1974 } 1975 m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat); 1976 } 1977 break; 1978 case Profile::MAINREXT: 1979 1980 { 1981 if (m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0) 1982 { 1983 // produce a valid combination, if possible. 1984 const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag || 1985 m_transformSkipContextEnabledFlag || 1986 m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] || 1987 m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] || 1988 !m_enableIntraReferenceSmoothing || 1989 m_persistentRiceAdaptationEnabledFlag || 1990 m_log2MaxTransformSkipBlockSize!=2; 1991 const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0; 1992 const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag; 1993 if (m_onePictureOnlyConstraintFlag) 1994 { 1995 m_chromaFormatConstraint = CHROMA_444; 1996 if (m_intraConstraintFlag != true) 1997 { 1998 fprintf(stderr, "Error: Intra constraint flag must be true when one_picture_only_constraint_flag is true\n"); 1999 exit(EXIT_FAILURE); 2000 } 2001 const Int maxBitDepth = m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 2002 m_bitDepthConstraint = maxBitDepth>8 ? 16:8; 2003 } 2004 else 2005 { 2006 m_chromaFormatConstraint = NUM_CHROMA_FORMAT; 2007 automaticallySelectRExtProfile(bUsingGeneralRExtTools, 2008 bUsingChromaQPAdjustment, 2009 bUsingExtendedPrecision, 2010 m_intraConstraintFlag, 2011 m_bitDepthConstraint, 2012 m_chromaFormatConstraint, 2013 m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]), 2014 m_chromaFormatIDC); 2015 } 2016 } 2017 else if (m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0) 2018 { 2019 fprintf(stderr, "Error: The bit depth and chroma format constraints must either both be specified or both be configured automatically\n"); 2020 exit(EXIT_FAILURE); 2021 } 2022 else 2023 { 2024 m_chromaFormatConstraint = numberToChromaFormat(tmpConstraintChromaFormat); 2025 } 2026 } 2027 break; 2028 case Profile::MAIN: 2029 case Profile::MAIN10: 2030 case Profile::MAINSTILLPICTURE: 1701 2031 m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? m_chromaFormatIDC : numberToChromaFormat(tmpConstraintChromaFormat); 1702 2032 m_bitDepthConstraint = (m_profile == Profile::MAIN10?10:8); 1703 }1704 #if NH_MV 1705 }1706 1707 if ( m_numberOfLayers != 0 && ( m_profiles[0] != Profile::MAIN || m_profiles[1] != Profile::MAIN ) )1708 {1709 fprintf(stderr, "Error: The base layer must conform to the Main profile for Multilayer coding.\n");1710 exit(EXIT_FAILURE);1711 }1712 #endif 1713 2033 break; 2034 case Profile::NONE: 2035 m_chromaFormatConstraint = m_chromaFormatIDC; 2036 m_bitDepthConstraint = m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 2037 break; 2038 default: 2039 fprintf(stderr, "Unknown profile selected\n"); 2040 exit(EXIT_FAILURE); 2041 break; 2042 } 2043 #endif 1714 2044 1715 2045 m_inputColourSpaceConvert = stringToInputColourSpaceConvert(inputColourSpaceConvert, true); 1716 2046 2047 2048 #if NH_MV 2049 for (Int i = 0; i < m_numRepFormats; i++ ) 2050 { 2051 Int* m_aiPad = &m_aiPads[i][0]; 2052 ChromaFormat &m_chromaFormatIDC = m_chromaFormatIDCs [i]; 2053 Int &m_confWinRight = m_confWinRights [i]; 2054 Int &m_confWinBottom = m_confWinBottoms [i]; 2055 Int &m_confWinLeft = m_confWinLefts [i]; 2056 Int &m_confWinTop = m_confWinTops [i]; 2057 Int &m_iSourceHeight = m_iSourceHeights [i]; 2058 Int &m_iSourceWidth = m_iSourceWidths [i]; 2059 Int &m_iSourceHeightOrg = m_iSourceHeightOrgs[i]; 2060 #endif 1717 2061 switch (m_conformanceWindowMode) 1718 2062 { … … 1779 2123 } 1780 2124 } 2125 #if NH_MV 2126 } 2127 #endif 1781 2128 1782 2129 if (tmpSliceMode<0 || tmpSliceMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES)) … … 1837 2184 xResizeVector( m_depthFlag ); 1838 2185 #endif 2186 2187 #if JVET_E0059_FLOATING_POINT_QP_FIX 2188 if ( !m_qpIncrementAtSourceFrame.empty() ) 2189 { 2190 xResizeVector( m_qpIncrementAtSourceFrame ); 2191 } 2192 xResizeVector( m_iQP ); 2193 #else 1839 2194 xResizeVector( m_fQP ); 2195 #endif 1840 2196 1841 2197 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) … … 1844 2200 ::memset( m_aidQP[layer], 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) ); 1845 2201 2202 #if JVET_E0059_FLOATING_POINT_QP_FIX 2203 if ( !m_qpIncrementAtSourceFrame.empty() ) 2204 { 2205 UInt switchingPOC=0; 2206 if (m_qpIncrementAtSourceFrame[layer] > m_FrameSkip) 2207 { 2208 // if switch source frame (ssf) = 10, and frame skip (fs)=2 and temporal subsample ratio (tsr) =1, then 2209 // for this simulation switch at POC 8 (=10-2). 2210 // if ssf=10, fs=2, tsr=2, then for this simulation, switch at POC 4 (=(10-2)/2): POC0=Src2, POC1=Src4, POC2=Src6, POC3=Src8, POC4=Src10 2211 switchingPOC = (m_qpIncrementAtSourceFrame[layer] - m_FrameSkip) / m_temporalSubsampleRatio; 2212 } 2213 for(UInt i=switchingPOC; i<( m_framesToBeEncoded + m_iGOPSize + 1 ); i++) 2214 { 2215 m_aidQP[layer][i]=1; 2216 } 2217 } 2218 #else 1846 2219 // handling of floating-point QP values 1847 2220 // if QP is not integer, sequence is split into two sections having QP and QP+1 … … 1857 2230 } 1858 2231 } 2232 #endif 1859 2233 1860 2234 for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) … … 1862 2236 if (saoOffsetBitShift[ch]<0) 1863 2237 { 2238 #if NH_MV 2239 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[ layer ]; 2240 if (m_internalBitDepths[repFormatIdx][ch]>10) 2241 #else 1864 2242 if (m_internalBitDepth[ch]>10) 2243 #endif 1865 2244 { 1866 m_log2SaoOffsetScale[layer][ch]=UInt(Clip3<Int>(0, m_internalBitDepth [ch]-10, Int(m_internalBitDepth[ch]-10 + 0.165*m_iQP[layer] - 3.22 + 0.5) ) );2245 m_log2SaoOffsetScale[layer][ch]=UInt(Clip3<Int>(0, m_internalBitDepths[repFormatIdx][ch]-10, Int(m_internalBitDepths[repFormatIdx][ch]-10 + 0.165*m_iQP[layer] - 3.22 + 0.5) ) ); 1867 2246 } 1868 2247 else … … 1893 2272 ::memset( m_aidQP, 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) ); 1894 2273 2274 #if JVET_E0059_FLOATING_POINT_QP_FIX 2275 if (m_qpIncrementAtSourceFrame.bPresent) 2276 { 2277 UInt switchingPOC=0; 2278 if (m_qpIncrementAtSourceFrame.value > m_FrameSkip) 2279 { 2280 // if switch source frame (ssf) = 10, and frame skip (fs)=2 and temporal subsample ratio (tsr) =1, then 2281 // for this simulation switch at POC 8 (=10-2). 2282 // if ssf=10, fs=2, tsr=2, then for this simulation, switch at POC 4 (=(10-2)/2): POC0=Src2, POC1=Src4, POC2=Src6, POC3=Src8, POC4=Src10 2283 switchingPOC = (m_qpIncrementAtSourceFrame.value - m_FrameSkip) / m_temporalSubsampleRatio; 2284 } 2285 for(UInt i=switchingPOC; i<( m_framesToBeEncoded + m_iGOPSize + 1 ); i++) 2286 { 2287 m_aidQP[i]=1; 2288 } 2289 } 2290 #else 1895 2291 // handling of floating-point QP values 1896 2292 // if QP is not integer, sequence is split into two sections having QP and QP+1 … … 1906 2302 } 1907 2303 } 2304 #endif 1908 2305 1909 2306 for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) … … 1927 2324 1928 2325 #endif 2326 2327 assert(lumaLevelToDeltaQPMode<LUMALVL_TO_DQP_NUM_MODES); 2328 if (lumaLevelToDeltaQPMode>=LUMALVL_TO_DQP_NUM_MODES) 2329 { 2330 exit(EXIT_FAILURE); 2331 } 2332 m_lumaLevelToDeltaQPMapping.mode=LumaLevelToDQPMode(lumaLevelToDeltaQPMode); 2333 2334 if (m_lumaLevelToDeltaQPMapping.mode) 2335 { 2336 assert( cfg_lumaLeveltoDQPMappingLuma.values.size() == cfg_lumaLeveltoDQPMappingQP.values.size() ); 2337 m_lumaLevelToDeltaQPMapping.mapping.resize(cfg_lumaLeveltoDQPMappingLuma.values.size()); 2338 for(UInt i=0; i<cfg_lumaLeveltoDQPMappingLuma.values.size(); i++) 2339 { 2340 m_lumaLevelToDeltaQPMapping.mapping[i]=std::pair<Int,Int>(cfg_lumaLeveltoDQPMappingLuma.values[i], cfg_lumaLeveltoDQPMappingQP.values[i]); 2341 } 2342 } 1929 2343 1930 2344 // reading external dQP description from file … … 2070 2484 m_dLambdaScaleVSO *= adLambdaScaleTable[m_iQP[firstDepthLayer]]; 2071 2485 } 2486 2072 2487 if ( m_bUseVSO && m_uiVSOMode == 4) 2073 2488 { 2074 2489 m_cRenModStrParser.setString( m_iNumberOfViews, m_pchVSOConfig ); 2075 2490 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 2076 m_internalBitDepth [ CHANNEL_TYPE_LUMA],2491 m_internalBitDepths[0][ CHANNEL_TYPE_LUMA], 2077 2492 (UInt)m_iCodedCamParPrecision, 2078 2493 m_FrameSkip, … … 2087 2502 { 2088 2503 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 2089 m_internalBitDepth [ CHANNEL_TYPE_LUMA],2504 m_internalBitDepths[0][ CHANNEL_TYPE_LUMA], 2090 2505 (UInt)m_iCodedCamParPrecision, 2091 2506 m_FrameSkip, … … 2102 2517 { 2103 2518 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 2104 m_internalBitDepth [ CHANNEL_TYPE_LUMA],2519 m_internalBitDepths[0][ CHANNEL_TYPE_LUMA], 2105 2520 (UInt) m_iCodedCamParPrecision, 2106 2521 m_FrameSkip, … … 2125 2540 } 2126 2541 2127 m_uiMaxTotalCUDepth = m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs. 2542 2543 #if NH_MV 2544 for (Int i = 0; i < m_numRepFormats; i++ ) 2545 { 2546 m_uiMaxTotalCUDepth .push_back( m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_chromaFormatIDCs[i], m_uiQuadtreeTULog2MinSize) ); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs. 2547 } 2548 #else 2549 m_uiMaxTotalCUDepth = m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs. 2550 #endif 2551 2128 2552 m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1; 2129 2553 … … 2134 2558 } 2135 2559 2560 #if NH_MV 2561 Void TAppEncCfg::xDeriveProfAndConstrFlags( const TComVPS& vps ) 2562 { 2563 2564 UInt numPtl = (Int) m_uiProfiles.size(); 2565 m_profiles.resize( numPtl ); 2566 m_chromaFormatConstraints.resize( m_uiProfiles.size() ); 2567 2568 xResizeVector( m_onePictureOnlyConstraintFlags , numPtl ); 2569 xResizeVector( m_bitDepthConstraints , numPtl ); 2570 xResizeVector( m_frameOnlyConstraintFlags , numPtl ); 2571 xResizeVector( m_nonPackedConstraintFlags , numPtl ); 2572 xResizeVector( m_intraConstraintFlags , numPtl ); 2573 xResizeVector( m_interlacedSourceFlags , numPtl ); 2574 xResizeVector( m_progressiveSourceFlags , numPtl ); 2575 xResizeVector( m_lowerBitRateConstraintFlags , numPtl ); 2576 xResizeVector( m_tmpConstraintChromaFormats , numPtl ); 2577 2578 for (Int i = 0; i < m_profiles.size(); i++) 2579 { 2580 UIProfileName UIProfile = m_uiProfiles[i]; 2581 2582 ChromaFormat maxChromaFormatIdc ; 2583 Int maxInternalBitDepthLuma ; 2584 Int maxInternalBitDepthChroma; 2585 Int maxNumRefLayers ; 2586 2587 xGetMaxValuesOfApplicableLayers(vps, i, maxInternalBitDepthLuma,maxInternalBitDepthChroma, maxChromaFormatIdc, maxNumRefLayers ); 2588 2589 switch ( UIProfile ) 2590 { 2591 case UI_MULTIVIEWMAIN: 2592 m_profiles[i] = Profile::MULTIVIEWMAIN; 2593 m_onePictureOnlyConstraintFlags[i] = false; 2594 break; 2595 #if NH_3D 2596 case UI_MAIN3D: 2597 m_profiles[i] = Profile::MAIN3D; 2598 m_onePictureOnlyConstraintFlags[i] = false; 2599 break; 2600 #endif 2601 case UI_NONE: 2602 m_profiles[i] = Profile::NONE; 2603 m_onePictureOnlyConstraintFlags[i] = false; 2604 break; 2605 case UI_MAIN: 2606 m_profiles[i] = Profile::MAIN; 2607 m_onePictureOnlyConstraintFlags[i] = false; 2608 break; 2609 case UI_MAIN10: 2610 m_profiles[i] = Profile::MAIN10; 2611 m_onePictureOnlyConstraintFlags[i] = false; 2612 break; 2613 case UI_MAINSTILLPICTURE: 2614 m_profiles[i] = Profile::MAINSTILLPICTURE; 2615 m_onePictureOnlyConstraintFlags[i] = false; 2616 break; 2617 case UI_MAIN10_STILL_PICTURE: 2618 m_profiles[i] = Profile::MAIN10; 2619 m_onePictureOnlyConstraintFlags[i] = true; 2620 break; 2621 case UI_MAINREXT: 2622 m_profiles[i] = Profile::MAINREXT; 2623 m_onePictureOnlyConstraintFlags[i] = false; 2624 break; 2625 case UI_HIGHTHROUGHPUTREXT: 2626 m_profiles[i] = Profile::HIGHTHROUGHPUTREXT; 2627 m_onePictureOnlyConstraintFlags[i] = false; 2628 break; 2629 #if NH_MV_ALLOW_NON_CONFORMING 2630 case UI_MULTIVIEWMAIN_NONCONF: 2631 m_profiles[i] = Profile::MULTIVIEWMAIN_NONCONFORMING; 2632 m_onePictureOnlyConstraintFlags[i] = false; 2633 break; 2634 #if NH_3D 2635 case UI_MAIN3D_NONCONF: 2636 m_profiles[i] = Profile::MAIN3D_NONCONFORMING; 2637 m_onePictureOnlyConstraintFlags[i] = false; 2638 break; 2639 #endif 2640 #endif 2641 2642 default: 2643 if (UIProfile >= 1000 && UIProfile <= 12316) 2644 { 2645 m_profiles[i] = Profile::MAINREXT; 2646 if (m_bitDepthConstraints[i] != 0 || m_tmpConstraintChromaFormats[i] != 0) 2647 { 2648 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); 2649 exit(EXIT_FAILURE); 2650 } 2651 m_bitDepthConstraints[i] = (UIProfile%100); 2652 m_intraConstraintFlags[i] = ((UIProfile%10000)>=2000); 2653 m_onePictureOnlyConstraintFlags[i] = (UIProfile >= 10000); 2654 switch ((UIProfile/100)%10) 2655 { 2656 case 0: m_tmpConstraintChromaFormats[i]=400; break; 2657 case 1: m_tmpConstraintChromaFormats[i]=420; break; 2658 case 2: m_tmpConstraintChromaFormats[i]=422; break; 2659 default: m_tmpConstraintChromaFormats[i]=444; break; 2660 } 2661 } 2662 else if (UIProfile >= 21308 && UIProfile <= 22316) 2663 { 2664 m_profiles[i] = Profile::HIGHTHROUGHPUTREXT; 2665 if (m_bitDepthConstraints[i] != 0 || m_tmpConstraintChromaFormats[i] != 0) 2666 { 2667 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); 2668 exit(EXIT_FAILURE); 2669 } 2670 m_bitDepthConstraints[i] = (UIProfile%100); 2671 m_intraConstraintFlags[i] = ((UIProfile%10000)>=2000); 2672 m_onePictureOnlyConstraintFlags[i] = 0; 2673 if((UIProfile == UI_HIGHTHROUGHPUT_444) || (UIProfile == UI_HIGHTHROUGHPUT_444_10) ) 2674 { 2675 assert(m_cabacBypassAlignmentEnabledFlag==0); 2676 } 2677 switch ((UIProfile/100)%10) 2678 { 2679 case 0: m_tmpConstraintChromaFormats[i]=400; break; 2680 case 1: m_tmpConstraintChromaFormats[i]=420; break; 2681 case 2: m_tmpConstraintChromaFormats[i]=422; break; 2682 default: m_tmpConstraintChromaFormats[i]=444; break; 2683 } 2684 } 2685 else 2686 { 2687 fprintf(stderr, "Error: Unprocessed UI profile\n"); 2688 assert(0); 2689 exit(EXIT_FAILURE); 2690 } 2691 break; 2692 } 2693 2694 switch (m_profiles[i]) 2695 { 2696 case Profile::HIGHTHROUGHPUTREXT: 2697 { 2698 if (m_bitDepthConstraints[i] == 0) 2699 { 2700 m_bitDepthConstraints[i] = 16; 2701 } 2702 m_chromaFormatConstraints[i] = (m_tmpConstraintChromaFormats[i] == 0) ? CHROMA_444 : numberToChromaFormat(m_tmpConstraintChromaFormats[i]); 2703 } 2704 break; 2705 case Profile::MAINREXT: 2706 2707 { 2708 if (m_bitDepthConstraints[i] == 0 && m_tmpConstraintChromaFormats[i] == 0) 2709 { 2710 // produce a valid combination, if possible. 2711 const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag || 2712 m_transformSkipContextEnabledFlag || 2713 m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] || 2714 m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] || 2715 !m_enableIntraReferenceSmoothing || 2716 m_persistentRiceAdaptationEnabledFlag || 2717 m_log2MaxTransformSkipBlockSize!=2; 2718 const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0; 2719 const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag; 2720 if (m_onePictureOnlyConstraintFlags[i]) 2721 { 2722 m_chromaFormatConstraints[i] = CHROMA_444; 2723 if (m_intraConstraintFlags[i] != true) 2724 { 2725 fprintf(stderr, "Error: Intra constraint flag must be true when one_picture_only_constraint_flag is true\n"); 2726 exit(EXIT_FAILURE); 2727 } 2728 const Int maxBitDepth = maxChromaFormatIdc==CHROMA_400 ? maxInternalBitDepthLuma : std::max( maxInternalBitDepthLuma, maxInternalBitDepthChroma); 2729 m_bitDepthConstraints[i] = maxBitDepth>8 ? 16:8; 2730 } 2731 else 2732 { 2733 m_chromaFormatConstraints[i] = NUM_CHROMA_FORMAT; 2734 2735 UInt tempBitDepthConstraint = (UInt) m_bitDepthConstraints[i]; 2736 2737 automaticallySelectRExtProfile(bUsingGeneralRExtTools, 2738 bUsingChromaQPAdjustment, 2739 bUsingExtendedPrecision, 2740 m_intraConstraintFlags[i], 2741 tempBitDepthConstraint, 2742 m_chromaFormatConstraints[i], 2743 maxChromaFormatIdc==CHROMA_400 ? maxInternalBitDepthLuma : std::max(maxInternalBitDepthLuma, maxInternalBitDepthChroma), 2744 maxChromaFormatIdc); 2745 2746 m_bitDepthConstraints[i] = (Int) tempBitDepthConstraint; 2747 } 2748 } 2749 else if (m_bitDepthConstraints[i] == 0 || m_tmpConstraintChromaFormats[i] == 0) 2750 { 2751 fprintf(stderr, "Error: The bit depth and chroma format constraints must either both be specified or both be configured automatically\n"); 2752 exit(EXIT_FAILURE); 2753 } 2754 else 2755 { 2756 m_chromaFormatConstraints[i] = numberToChromaFormat(m_tmpConstraintChromaFormats[i]); 2757 } 2758 } 2759 break; 2760 case Profile::MAIN: 2761 case Profile::MAIN10: 2762 case Profile::MAINSTILLPICTURE: 2763 m_chromaFormatConstraints[i] = (m_tmpConstraintChromaFormats[i] == 0) ? maxChromaFormatIdc : numberToChromaFormat(m_tmpConstraintChromaFormats[i]); 2764 m_bitDepthConstraints[i] = (m_profiles[i] == Profile::MAIN10?10:8); 2765 break; 2766 #if NH_MV_ALLOW_NON_CONFORMING 2767 case Profile::MULTIVIEWMAIN_NONCONFORMING: 2768 #if NH_3D 2769 case Profile::MAIN3D_NONCONFORMING: 2770 #endif 2771 #endif 2772 case Profile::NONE: 2773 2774 m_chromaFormatConstraints[i] = maxChromaFormatIdc; 2775 m_bitDepthConstraints[i] = maxChromaFormatIdc==CHROMA_400 ? maxInternalBitDepthLuma : std::max(maxInternalBitDepthLuma, maxInternalBitDepthChroma); 2776 break; 2777 case Profile::MULTIVIEWMAIN: 2778 m_chromaFormatConstraints[i] = CHROMA_420; 2779 m_bitDepthConstraints[i] = 8; 2780 break; 2781 2782 #if NH_3D 2783 case Profile::MAIN3D: 2784 // Here depth layers could use a different ptl struct. 2785 // For simplicity, depth and texture share currently the same. 2786 m_chromaFormatConstraints[i] = CHROMA_420; 2787 m_bitDepthConstraints[i] = 8; 2788 break; 2789 #endif 2790 default: 2791 fprintf(stderr, "Unknown profile selected\n"); 2792 exit(EXIT_FAILURE); 2793 break; 2794 } 2795 } 2796 } 2797 #endif 2136 2798 2137 2799 // ==================================================================================================================== 2138 2800 // Private member functions 2139 2801 // ==================================================================================================================== 2802 2803 #if NH_MV 2804 Void TAppEncCfg::xCheckProfiles( const TComVPS& vps ) 2805 { 2806 Bool check_failed = false; 2807 2808 2809 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) 2810 2811 // TBD: disallow 3D tools when 3D Main profile is not used. 2812 2813 for (Int i = 0; i < m_profiles.size(); i++ ) 2814 { 2815 ChromaFormat maxChromaFormatIdc; 2816 Int maxBitDepthLuma ; 2817 Int maxBitDepthChroma ; 2818 Int maxNumRefLayers ; 2819 2820 xGetMaxValuesOfApplicableLayers(vps, i, maxBitDepthLuma, maxBitDepthChroma , maxChromaFormatIdc, maxNumRefLayers ); 2821 2822 const UInt maxBitDepth=(maxChromaFormatIdc==CHROMA_400) ? maxBitDepthLuma : std::max(maxBitDepthLuma, maxBitDepthChroma); 2823 2824 xConfirmPara(m_bitDepthConstraints [i] < maxBitDepth , "The internalBitDepth must not be greater than the bitDepthConstraint value" ); 2825 xConfirmPara(m_chromaFormatConstraints[i] < maxChromaFormatIdc, "The chroma format used must not be greater than the chromaFormatConstraint value"); 2826 2827 switch (m_profiles[i] ) 2828 { 2829 case Profile::MAINREXT: 2830 case Profile::HIGHTHROUGHPUTREXT: 2831 2832 { 2833 xConfirmPara(m_lowerBitRateConstraintFlags[i] == false && m_intraConstraintFlags[i] == false , "The lowerBitRateConstraint flag cannot be false when intraConstraintFlag is false"); 2834 xConfirmPara(m_cabacBypassAlignmentEnabledFlag && m_profiles[i] != Profile::HIGHTHROUGHPUTREXT , "AlignCABACBeforeBypass must not be enabled unless the high throughput profile is being used."); 2835 2836 if (m_profiles[i] == Profile::MAINREXT) 2837 { 2838 const UInt intraIdx = m_intraConstraintFlags[i] ? 1:0; 2839 const UInt bitDepthIdx = (m_bitDepthConstraints[i] == 8 ? 0 : (m_bitDepthConstraints[i] ==10 ? 1 : (m_bitDepthConstraints[i] == 12 ? 2 : (m_bitDepthConstraints[i] == 16 ? 3 : 4 )))); 2840 const UInt chromaFormatIdx = UInt(m_chromaFormatConstraints[i]); 2841 const Bool bValidProfile = (bitDepthIdx > 3 || chromaFormatIdx>3) ? false : (validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx] != UI_NONE); 2842 2843 xConfirmPara(!bValidProfile, "Invalid intra constraint flag, bit depth constraint flag and chroma format constraint flag combination for a RExt profile"); 2844 const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag || 2845 m_transformSkipContextEnabledFlag || 2846 m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] || 2847 m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] || 2848 !m_enableIntraReferenceSmoothing || 2849 m_persistentRiceAdaptationEnabledFlag || 2850 m_log2MaxTransformSkipBlockSize!=2; 2851 const Bool bUsingChromaQPTool = m_diffCuChromaQpOffsetDepth >= 0; 2852 const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag; 2853 2854 xConfirmPara((m_chromaFormatConstraints[i]==CHROMA_420 || m_chromaFormatConstraints[i]==CHROMA_400) && bUsingChromaQPTool, "CU Chroma QP adjustment cannot be used for 4:0:0 or 4:2:0 RExt profiles"); 2855 xConfirmPara(m_bitDepthConstraints[i] != 16 && bUsingExtendedPrecision, "Extended precision can only be used in 16-bit RExt profiles"); 2856 if (!(m_chromaFormatConstraints[i] == CHROMA_400 && m_bitDepthConstraints[i] == 16) && m_chromaFormatConstraints[i]!=CHROMA_444) 2857 { 2858 xConfirmPara(bUsingGeneralRExtTools, "Combination of tools and profiles are not possible in the specified RExt profile."); 2859 } 2860 xConfirmPara( m_onePictureOnlyConstraintFlags[i] && m_chromaFormatConstraints[i]!=CHROMA_444, "chroma format constraint must be 4:4:4 when one-picture-only constraint flag is 1"); 2861 xConfirmPara( m_onePictureOnlyConstraintFlags[i] && m_bitDepthConstraints[i] != 8 && m_bitDepthConstraints[i] != 16, "bit depth constraint must be 8 or 16 when one-picture-only constraint flag is 1"); 2862 xConfirmPara( m_onePictureOnlyConstraintFlags[i] && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when one-picture-only constraint flag is 1."); 2863 2864 if (!m_intraConstraintFlags[i] && m_bitDepthConstraints[i]==16 && m_chromaFormatConstraints[i]==CHROMA_444) 2865 { 2866 fprintf(stderr, "********************************************************************************************************\n"); 2867 fprintf(stderr, "** WARNING: The RExt constraint flags describe a non standard combination (used for development only) **\n"); 2868 fprintf(stderr, "********************************************************************************************************\n"); 2869 } 2870 } 2871 else 2872 { 2873 xConfirmPara( m_chromaFormatConstraints[i] != CHROMA_444, "chroma format constraint must be 4:4:4 in the High Throughput 4:4:4 16-bit Intra profile."); 2874 const UInt intraIdx = m_intraConstraintFlags[i] ? 1 : 0; 2875 const UInt bitDepthIdx = ( m_bitDepthConstraints[i] == 8 ? 0 : (m_bitDepthConstraints[i] == 10 ? 1 : (m_bitDepthConstraints[i] == 14 ? 2 : (m_bitDepthConstraints[i] == 16 ? 3 : 4 )))); 2876 const Bool bValidProfile = ( bitDepthIdx > 3) ? false : (validRExtHighThroughPutProfileNames[intraIdx][bitDepthIdx] != UI_NONE); 2877 xConfirmPara(!bValidProfile, "Invalid intra constraint flag and bit depth constraint flag combination for a RExt high profile throughput profile"); 2878 if(bitDepthIdx < 2) 2879 { 2880 xConfirmPara((m_extendedPrecisionProcessingFlag || m_cabacBypassAlignmentEnabledFlag), "Invalid configuration for a RExt high throughput 8 and 10 bit profile"); 2881 } 2882 if(bitDepthIdx == 3) 2883 { 2884 xConfirmPara(!m_cabacBypassAlignmentEnabledFlag, "Cabac Bypass Alignment flag must be 1 in the High Throughput 4:4:4 16-bit Intra profile"); 2885 } 2886 else if(bitDepthIdx < 3) 2887 { 2888 xConfirmPara(!m_entropyCodingSyncEnabledFlag, "WPP flag must be 1 in the High Throughput 4:4:4 non 16-bit Intra profile"); 2889 } 2890 } 2891 } 2892 break; 2893 case Profile::MAIN: 2894 case Profile::MAIN10: 2895 case Profile::MAINSTILLPICTURE: 2896 case Profile::MULTIVIEWMAIN: 2897 #if NH_3D 2898 case Profile::MAIN3D: 2899 #endif 2900 { 2901 xConfirmPara(m_bitDepthConstraints [i] != ((m_profiles[i]==Profile::MAIN10)?10:8), "BitDepthConstraint must be 8 for MAIN profile, Multiview main profile, and 3D Main profile and 10 for MAIN10 profile."); 2902 #if NH_3D 2903 if (m_profiles[i] == Profile::MAIN3D ) 2904 { 2905 xConfirmPara(m_chromaFormatConstraints [i] != CHROMA_420 && m_chromaFormatConstraints [i] != CHROMA_400 , "ChromaFormatConstraint must be 420 or 400 for the 3D main profile."); 2906 } 2907 else 2908 #endif 2909 { 2910 xConfirmPara(m_chromaFormatConstraints [i] != CHROMA_420 , "ChromaFormatConstraint must be 420 for non main-RExt profiles."); 2911 } 2912 2913 xConfirmPara(m_intraConstraintFlags [i] == true , "IntraConstraintFlag must be false for non main_RExt profiles."); 2914 xConfirmPara(m_lowerBitRateConstraintFlags[i] == false , "LowerBitrateConstraintFlag must be true for non main-RExt profiles."); 2915 xConfirmPara(m_profiles[i] == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used."); 2916 2917 xConfirmPara(m_crossComponentPredictionEnabledFlag == true , "CrossComponentPrediction must not be used for non main-RExt profiles."); 2918 xConfirmPara(m_log2MaxTransformSkipBlockSize != 2 , "Transform Skip Log2 Max Size must be 2 for V1 profiles."); 2919 xConfirmPara(m_transformSkipRotationEnabledFlag == true , "UseResidualRotation must not be enabled for non main-RExt profiles."); 2920 xConfirmPara(m_transformSkipContextEnabledFlag == true , "UseSingleSignificanceMapContext must not be enabled for non main-RExt profiles."); 2921 xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]== true , "ImplicitResidualDPCM must not be enabled for non main-RExt profiles."); 2922 xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT]== true , "ExplicitResidualDPCM must not be enabled for non main-RExt profiles."); 2923 xConfirmPara(m_persistentRiceAdaptationEnabledFlag == true , "GolombRiceParameterAdaption must not be enabled for non main-RExt profiles."); 2924 xConfirmPara(m_extendedPrecisionProcessingFlag == true , "UseExtendedPrecision must not be enabled for non main-RExt profiles."); 2925 xConfirmPara(m_highPrecisionOffsetsEnabledFlag == true , "UseHighPrecisionPredictionWeighting must not be enabled for non main-RExt profiles."); 2926 xConfirmPara(m_enableIntraReferenceSmoothing == false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt profiles."); 2927 xConfirmPara(m_cabacBypassAlignmentEnabledFlag , "AlignCABACBeforeBypass cannot be enabled for non main-RExt profiles."); 2928 2929 if ( m_profiles[i] == Profile::MULTIVIEWMAIN ) 2930 { 2931 xConfirmPara( maxNumRefLayers > 4, "When using the MV-Main profile, NumRefLayers must be less than or equal to 4 for all layers in the subBitstream" ); 2932 // - For a layer with nuh_layer_id iNuhLId equal to any value included in layerIdListTarget that was used to derive subBitstream, 2933 // the value of NumRefLayers[ iNuhLId ], which specifies the total number of direct and indirect reference layers and is derived as 2934 // specified in F.7.4.3.1, shall be less than or equal to 4. 2935 } 2936 2937 #if NH_3D 2938 if ( m_profiles[i] == Profile::MAIN3D ) 2939 { 2940 xConfirmPara( maxNumRefLayers > 9, "When using the 3D-Main profile, NumRefLayers must be less than or equal to 9 for all layers in the subBitstream." ); 2941 // - For a layer with nuh_layer_id iNuhLId equal to any value included in layerIdListTarget that was used to derive subBitstream, 2942 // the value of NumRefLayers[ iNuhLId ], which specifies the total number of direct and indirect reference layers and is derived as 2943 // specified in F.7.4.3.1, shall be less than or equal to 9. 2944 } 2945 #endif 2946 2947 2948 } 2949 break; 2950 #if NH_MV_ALLOW_NON_CONFORMING 2951 case Profile::MULTIVIEWMAIN_NONCONFORMING: 2952 #if NH_3D 2953 case Profile::MAIN3D_NONCONFORMING: 2954 #endif 2955 #endif 2956 case Profile::NONE: 2957 // Non-conforming configuration, so all settings are valid. 2958 break; 2959 default: 2960 xConfirmPara( 1, "Unknown profile selected."); 2961 break; 2962 } 2963 2964 if ( check_failed ) 2965 { 2966 printf("Error: Checking VpsProfileTierLevel[%d]. \n", i ); 2967 exit(EXIT_FAILURE); 2968 } 2969 2970 } 2971 #undef xConfirmPara 2972 2973 Bool anyMultiLayerProfile = false; 2974 2975 for (Int i = 0; i < m_profiles.size(); i++ ) 2976 { 2977 anyMultiLayerProfile = ( anyMultiLayerProfile 2978 2979 || (m_profiles[i] == Profile::MULTIVIEWMAIN) 2980 #if NH_3D 2981 || ( m_profiles[i] == Profile::MAIN3D ) 2982 #endif 2983 ) ; 2984 } 2985 2986 if ( anyMultiLayerProfile && ( m_profiles[0] != Profile::MAIN || m_profiles[1] != Profile::MAIN ) ) 2987 { 2988 fprintf(stderr, "Error: The base layer must conform to the Main profile for Multilayer coding.\n"); 2989 exit(EXIT_FAILURE); 2990 } 2991 2992 } 2993 2994 #endif 2140 2995 2141 2996 Void TAppEncCfg::xCheckParameter() … … 2168 3023 Bool check_failed = false; /* abort if there is a fatal configuration problem */ 2169 3024 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) 2170 3025 2171 3026 xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)"); 3027 #if !NH_MV 2172 3028 const UInt maxBitDepth=(m_chromaFormatIDC==CHROMA_400) ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 3029 2173 3030 xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value"); 2174 3031 xConfirmPara(m_chromaFormatConstraint<m_chromaFormatIDC, "The chroma format used must not be greater than the chromaFormatConstraint value"); 2175 #if NH_MV 2176 Profile::Name & m_profile = m_profiles[0]; 2177 #endif 2178 2179 if (m_profile==Profile::MAINREXT || m_profile==Profile::HIGHTHROUGHPUTREXT) 3032 3033 switch (m_profile) 3034 { 3035 case Profile::MAINREXT: 3036 case Profile::HIGHTHROUGHPUTREXT: 3037 2180 3038 { 2181 3039 xConfirmPara(m_lowerBitRateConstraintFlag==false && m_intraConstraintFlag==false, "The lowerBitRateConstraint flag cannot be false when intraConstraintFlag is false"); … … 2186 3044 const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 )))); 2187 3045 const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint); 2188 const Bool bValidProfile = (bitDepthIdx > 3 || chromaFormatIdx>3) ? false : (validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx] !=NONE);3046 const Bool bValidProfile = (bitDepthIdx > 3 || chromaFormatIdx>3) ? false : (validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx] != UI_NONE); 2189 3047 xConfirmPara(!bValidProfile, "Invalid intra constraint flag, bit depth constraint flag and chroma format constraint flag combination for a RExt profile"); 2190 3048 const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag || … … 2218 3076 { 2219 3077 xConfirmPara( m_chromaFormatConstraint != CHROMA_444, "chroma format constraint must be 4:4:4 in the High Throughput 4:4:4 16-bit Intra profile."); 2220 xConfirmPara( m_bitDepthConstraint != 16, "bit depth constraint must be 4:4:4 in the High Throughput 4:4:4 16-bit Intra profile."); 2221 xConfirmPara( m_intraConstraintFlag != 1, "intra constraint flag must be 1 in the High Throughput 4:4:4 16-bit Intra profile."); 2222 } 2223 } 2224 else 3078 const UInt intraIdx = m_intraConstraintFlag ? 1:0; 3079 const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 14 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 )))); 3080 const Bool bValidProfile = (bitDepthIdx > 3) ? false : (validRExtHighThroughPutProfileNames[intraIdx][bitDepthIdx] != UI_NONE); 3081 xConfirmPara(!bValidProfile, "Invalid intra constraint flag and bit depth constraint flag combination for a RExt high profile throughput profile"); 3082 if(bitDepthIdx < 2) 3083 { 3084 xConfirmPara((m_extendedPrecisionProcessingFlag || m_cabacBypassAlignmentEnabledFlag), "Invalid configuration for a RExt high throughput 8 and 10 bit profile"); 3085 } 3086 if(bitDepthIdx == 3) 3087 { 3088 xConfirmPara(!m_cabacBypassAlignmentEnabledFlag, "Cabac Bypass Alignment flag must be 1 in the High Throughput 4:4:4 16-bit Intra profile"); 3089 } 3090 else if(bitDepthIdx < 3) 3091 { 3092 xConfirmPara(!m_entropyCodingSyncEnabledFlag, "WPP flag must be 1 in the High Throughput 4:4:4 non 16-bit Intra profile"); 3093 } 3094 } 3095 } 3096 break; 3097 case Profile::MAIN: 3098 case Profile::MAIN10: 3099 case Profile::MAINSTILLPICTURE: 2225 3100 { 2226 3101 xConfirmPara(m_bitDepthConstraint!=((m_profile==Profile::MAIN10)?10:8), "BitDepthConstraint must be 8 for MAIN profile and 10 for MAIN10 profile."); … … 2242 3117 xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt profiles."); 2243 3118 } 2244 3119 break; 3120 case Profile::NONE: 3121 // Non-conforming configuration, so all settings are valid. 3122 break; 3123 default: 3124 xConfirmPara( 1, "Unknown profile selected."); 3125 break; 3126 } 3127 #endif 3128 3129 #if NH_MV 3130 for (Int i = 0; i < m_numRepFormats; i++ ) 3131 { 3132 Int* m_internalBitDepth = &m_internalBitDepths [i][0]; 3133 Int* m_inputBitDepth = &m_inputBitDepths [i][0]; 3134 Int* m_MSBExtendedBitDepth = &m_MSBExtendedBitDepths[i][0]; 3135 #endif 2245 3136 // check range of parameters 2246 3137 xConfirmPara( m_inputBitDepth[CHANNEL_TYPE_LUMA ] < 8, "InputBitDepth must be at least 8" ); … … 2263 3154 } 2264 3155 #endif 2265 2266 3156 xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] < m_inputBitDepth[CHANNEL_TYPE_LUMA ]), "MSB-extended bit depth for luma channel (--MSBExtendedBitDepth) must be greater than or equal to input bit depth for luma channel (--InputBitDepth)" ); 2267 3157 xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] < m_inputBitDepth[CHANNEL_TYPE_CHROMA]), "MSB-extended bit depth for chroma channel (--MSBExtendedBitDepthC) must be greater than or equal to input bit depth for chroma channel (--InputBitDepthC)" ); 2268 3158 2269 3159 #if NH_MV 3160 } 2270 3161 for (Int i = 0; i < m_numberOfLayers; i++) 2271 3162 { 2272 xConfirmPara( m_log2SaoOffsetScale[i][CHANNEL_TYPE_LUMA] > (m_internalBitDepth[CHANNEL_TYPE_LUMA ]<10?0:(m_internalBitDepth[CHANNEL_TYPE_LUMA ]-10)), "SaoLumaOffsetBitShift must be in the range of 0 to InternalBitDepth-10, inclusive"); 2273 xConfirmPara( m_log2SaoOffsetScale[i][CHANNEL_TYPE_CHROMA] > (m_internalBitDepth[CHANNEL_TYPE_CHROMA]<10?0:(m_internalBitDepth[CHANNEL_TYPE_CHROMA]-10)), "SaoChromaOffsetBitShift must be in the range of 0 to InternalBitDepthC-10, inclusive"); 3163 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[i]; 3164 xConfirmPara( m_log2SaoOffsetScale[i][CHANNEL_TYPE_LUMA] > (m_internalBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA ]<10?0:(m_internalBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA ]-10)), "SaoLumaOffsetBitShift must be in the range of 0 to InternalBitDepth-10, inclusive"); 3165 xConfirmPara( m_log2SaoOffsetScale[i][CHANNEL_TYPE_CHROMA] > (m_internalBitDepths[repFormatIdx][CHANNEL_TYPE_CHROMA]<10?0:(m_internalBitDepths[repFormatIdx][CHANNEL_TYPE_CHROMA]-10)), "SaoChromaOffsetBitShift must be in the range of 0 to InternalBitDepthC-10, inclusive"); 3166 } 3167 3168 for (Int i = 0; i < m_numRepFormats; i++) 3169 { 3170 xConfirmPara( m_chromaFormatIDCs[i] >= NUM_CHROMA_FORMAT, "ChromaFormatIDC must be either 400, 420, 422 or 444" ); 2274 3171 } 2275 3172 #else 2276 3173 xConfirmPara( m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] > (m_internalBitDepth[CHANNEL_TYPE_LUMA ]<10?0:(m_internalBitDepth[CHANNEL_TYPE_LUMA ]-10)), "SaoLumaOffsetBitShift must be in the range of 0 to InternalBitDepth-10, inclusive"); 2277 3174 xConfirmPara( m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] > (m_internalBitDepth[CHANNEL_TYPE_CHROMA]<10?0:(m_internalBitDepth[CHANNEL_TYPE_CHROMA]-10)), "SaoChromaOffsetBitShift must be in the range of 0 to InternalBitDepthC-10, inclusive"); 2278 #endif2279 2280 3175 xConfirmPara( m_chromaFormatIDC >= NUM_CHROMA_FORMAT, "ChromaFormatIDC must be either 400, 420, 422 or 444" ); 3176 #endif 3177 2281 3178 std::string sTempIPCSC="InputColourSpaceConvert must be empty, "+getListOfColourSpaceConverts(true); 2282 3179 xConfirmPara( m_inputColourSpaceConvert >= NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS, sTempIPCSC.c_str() ); 3180 #if NH_MV 3181 for (Int i = 0 ; i < m_InputChromaFormatIDC.size(); i++ ) 3182 { 3183 xConfirmPara( m_InputChromaFormatIDC[i] >= NUM_CHROMA_FORMAT, "InputChromaFormatIDC must be either 400, 420, 422 or 444" ); 3184 } 3185 #else 2283 3186 xConfirmPara( m_InputChromaFormatIDC >= NUM_CHROMA_FORMAT, "InputChromaFormatIDC must be either 400, 420, 422 or 444" ); 3187 #endif 2284 3188 xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); 2285 3189 xConfirmPara( m_temporalSubsampleRatio < 1, "Temporal subsample rate must be no less than 1" ); … … 2291 3195 xConfirmPara( m_layerIdInNuh[0] != 0 , "LayerIdInNuh must be 0 for the first layer. "); 2292 3196 xConfirmPara( (m_layerIdInNuh.size()!=1) && (m_layerIdInNuh.size() < m_numberOfLayers) , "LayerIdInNuh must be given for all layers. "); 3197 3198 #if NH_MV 3199 xConfirmPara( !m_shareParameterSets && (m_numberOfLayers > 16) , "When NumberOfLayers is greater than 16, ShareParameterSets must be 1."); 3200 xConfirmPara( ! (m_layerIdxInVpsToGopDefIdx.size() == 0 || m_layerIdxInVpsToGopDefIdx.size() == m_numberOfLayers), "The number of entries in LayerIdxInVpsToGopDefIdx must zero or equal to NumberOfLayers."); 3201 xConfirmPara( ! (m_layerIdxInVpsToRepFormatIdx.size() == 0 || m_layerIdxInVpsToRepFormatIdx.size() == m_numberOfLayers), "The number of entries in LayerIdxInVpsToRepFormatIdx must zero or equal to NumberOfLayers."); 3202 3203 #endif 2293 3204 2294 3205 #if NH_3D … … 2370 3281 xConfirmPara( allEqual , "Each layer shall have a different position in scalability space." ); 2371 3282 2372 #if !H_3D_FCO2373 3283 if ( numDiff == 1 ) 2374 3284 { … … 2381 3291 xConfirmPara( shallBeButIsNotIncreasing, "DimensionIds shall be increasing within one dimension. " ); 2382 3292 } 2383 #endif2384 3293 } 2385 3294 } … … 2447 3356 2448 3357 // PTL 2449 xConfirmPara( ( m_ profiles.size() != m_inblFlag.size() || m_profiles.size() != m_level.size() || m_profiles.size() != m_levelTier.size() ), "The number of Profiles, Levels, Tiers and InblFlags must be equal." );3358 xConfirmPara( ( m_uiProfiles.size() != m_inblFlag.size() || m_uiProfiles.size() != m_level.size() || m_uiProfiles.size() != m_levelTier.size() ), "The number of Profiles, Levels, Tiers and InblFlags must be equal." ); 2450 3359 2451 3360 if ( m_numberOfLayers > 1) 2452 3361 { 2453 xConfirmPara( m_ profiles.size() <= 1, "The number of profiles, tiers, levels, and inblFlags must be greater than 1.");3362 xConfirmPara( m_uiProfiles.size() <= 1, "The number of profiles, tiers, levels, and inblFlags must be greater than 1."); 2454 3363 xConfirmPara( m_inblFlag[0], "VpsProfileTierLevel[0] must have inblFlag equal to 0"); 2455 if (m_ profiles.size() > 1 )2456 { 2457 xConfirmPara( m_ profiles[0] != m_profiles[1], "The profile in VpsProfileTierLevel[1] must be equal to the profile in VpsProfileTierLevel[0].");3364 if (m_uiProfiles.size() > 1 ) 3365 { 3366 xConfirmPara( m_uiProfiles[0] != m_uiProfiles[1], "The profile in VpsProfileTierLevel[1] must be equal to the profile in VpsProfileTierLevel[0]."); 2458 3367 xConfirmPara( m_inblFlag[0] != m_inblFlag[1], "inblFlag in VpsProfileTierLevel[1] must be equal to the inblFlag in VpsProfileTierLevel[0]."); 2459 3368 } … … 2467 3376 for (Int j = 0; j < m_directRefLayers[i].size(); j++) 2468 3377 { 2469 xConfirmPara( m_directRefLayers[i][j] < 0 || m_directRefLayers[i][j] >= i , "Reference layer id shall be greater than or equal to 0 and less than dependent layer id"); 3378 if ( m_directRefLayers[i][j] < 0 || m_directRefLayers[i][j] >= i ) 3379 { 3380 printf( "Error: Reference layer id (%d) shall be greater than or equal to 0 and less than dependent layer id (%d). ", m_directRefLayers[i][j], i ); 3381 check_failed = true; 3382 } 3383 2470 3384 xConfirmPara( m_dependencyTypes[i][j] < 0 || m_dependencyTypes[i][j] > 6 , "Dependency type shall be greater than or equal to 0 and less than 7"); 2471 3385 } … … 2499 3413 } 2500 3414 3415 #if NH_MV 3416 for (Int i = 0; i < m_numRepFormats; i++) 3417 { 3418 if(m_crossComponentPredictionEnabledFlag && (m_chromaFormatIDCs[i] != CHROMA_444)) 3419 #else 2501 3420 if(m_crossComponentPredictionEnabledFlag && (m_chromaFormatIDC != CHROMA_444)) 3421 #endif 2502 3422 { 2503 3423 fprintf(stderr, "****************************************************************************\n"); … … 2507 3427 m_crossComponentPredictionEnabledFlag = false; 2508 3428 } 3429 #if NH_MV 3430 } 3431 #endif 2509 3432 2510 3433 if ( m_CUTransquantBypassFlagForce && m_bUseHADME ) … … 2531 3454 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 2532 3455 { 2533 xConfirmPara( m_iQP[layer] < -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP[layer] > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 3456 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layer]; 3457 xConfirmPara( m_iQP[layer] < -6 * (m_internalBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA] - 8) || m_iQP[layer] > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 2534 3458 xConfirmPara( m_deblockingFilterMetric!=0 && (m_bLoopFilterDisable[layer] || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is true then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0"); 2535 3459 } 2536 3460 #else 2537 3461 xConfirmPara( m_iQP < -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 2538 #if W0038_DB_OPT2539 3462 xConfirmPara( m_deblockingFilterMetric!=0 && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is non-zero then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0"); 2540 #else2541 xConfirmPara( m_DeblockingFilterMetric && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is true then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0");2542 #endif2543 3463 #endif 2544 3464 … … 2552 3472 #endif 2553 3473 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); 3474 xConfirmPara(m_lumaLevelToDeltaQPMapping.mode && m_uiDeltaQpRD > 0, "Luma-level-based Delta QP cannot be used together with slice level multiple-QP optimization\n" ); 2554 3475 xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 2555 3476 … … 2560 3481 2561 3482 xConfirmPara( m_iQPAdaptationRange <= 0, "QP Adaptation Range must be more than 0" ); 3483 #if NH_MV 3484 for (Int i = 0; i < m_numberOfLayers; i++ ) 3485 { 3486 if (m_iDecodingRefreshType == 2 || m_saoResetEncoderStateAfterIRAP) 3487 { 3488 xConfirmPara( m_iIntraPeriod[i] > 0 && m_iIntraPeriod[i] <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 3489 } 3490 } 3491 #else 2562 3492 if (m_iDecodingRefreshType == 2) 2563 3493 { 2564 #if NH_MV 2565 for (Int i = 0; i < m_numberOfLayers; i++ ) 2566 { 2567 xConfirmPara( m_iIntraPeriod[i] > 0 && m_iIntraPeriod[i] <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 2568 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 3494 xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 3495 } 2569 3496 if (m_saoResetEncoderStateAfterIRAP) 2570 3497 { 2571 xConfirmPara( m_iIntraPeriod[i] > 0 && m_iIntraPeriod[i] <= m_iGOPSize , "Intra period must be larger than GOP size when SAOResetEncoderStateAfterIRAP is enabled");2572 }2573 #endif2574 2575 }2576 #else2577 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP2578 if (m_saoResetEncoderStateAfterIRAP)2579 {2580 3498 xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size when SAOResetEncoderStateAfterIRAP is enabled"); 2581 3499 } 2582 3500 #endif 2583 2584 xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 2585 #endif 2586 } 3501 2587 3502 xConfirmPara( m_uiMaxCUDepth < 1, "MaxPartitionDepth must be greater than zero"); 2588 3503 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); … … 2590 3505 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 2591 3506 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 3507 #if NH_MV 3508 for (Int i = 0; i < m_numRepFormats; i++ ) 3509 { 3510 xConfirmPara( (m_iSourceWidths[i] % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); 3511 xConfirmPara( (m_iSourceHeights[i] % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame height must be a multiple of the minimum CU size"); 3512 } 3513 #else 2592 3514 xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); 2593 3515 xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame height must be a multiple of the minimum CU size"); 3516 #endif 2594 3517 2595 3518 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); … … 2631 3554 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 2632 3555 { 3556 #if NH_MV 3557 for (Int i = 0; i < m_numRepFormats; i++) 3558 { 3559 xConfirmPara(((m_MSBExtendedBitDepths[i][channelType] > m_internalBitDepths[i][channelType]) && m_bPCMInputBitDepthFlag), "PCM bit depth cannot be greater than internal bit depth (PCMInputBitDepthFlag cannot be used when InputBitDepth or MSBExtendedBitDepth > InternalBitDepth)"); 3560 } 3561 #else 2633 3562 xConfirmPara(((m_MSBExtendedBitDepth[channelType] > m_internalBitDepth[channelType]) && m_bPCMInputBitDepthFlag), "PCM bit depth cannot be greater than internal bit depth (PCMInputBitDepthFlag cannot be used when InputBitDepth or MSBExtendedBitDepth > InternalBitDepth)"); 3563 #endif 2634 3564 } 2635 3565 xConfirmPara( m_uiPCMLog2MinSize < 3, "PCMLog2MinSize must be 3 or greater."); … … 2649 3579 2650 3580 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); 3581 3582 #if !NH_MV 2651 3583 if (m_profile!=Profile::HIGHTHROUGHPUTREXT) 2652 3584 { 2653 3585 xConfirmPara( tileFlag && m_entropyCodingSyncEnabledFlag, "Tiles and entropy-coding-sync (Wavefronts) can not be applied together, except in the High Throughput Intra 4:4:4 16 profile"); 2654 3586 } 3587 #else 3588 for (Int i = 0; i < m_numRepFormats; i++) 3589 { 3590 ChromaFormat m_chromaFormatIDC = m_chromaFormatIDCs[i]; 3591 Int* m_aiPad = &m_aiPads [i][0]; 3592 Int m_confWinLeft = m_confWinLefts [i]; 3593 Int m_confWinRight = m_confWinRights [i]; 3594 Int m_confWinTop = m_confWinTops [i]; 3595 Int m_confWinBottom = m_confWinBottoms [i]; 3596 Int m_iSourceWidth = m_iSourceWidths [i]; 3597 Int m_iSourceHeight = m_iSourceHeights [i]; 3598 #endif 2655 3599 2656 3600 xConfirmPara( m_iSourceWidth % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Picture width must be an integer multiple of the specified chroma subsampling"); … … 2674 3618 xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling"); 2675 3619 } 3620 3621 #if NH_MV 3622 } 3623 #endif 2676 3624 2677 3625 #if NH_3D_VSO || NH_3D … … 2717 3665 for( Int i = 0; i < MAX_GOP; i++ ) 2718 3666 { 2719 if( m_GOPListMvc[k][i].m_POC != m_GOPListMvc[0][i].m_POC )3667 if( xGetGopEntries(k)[i].m_POC != xGetGopEntries(0)[i].m_POC ) 2720 3668 { 2721 printf( "\nError: Frame%d_l%d POC %d is not identical to Frame%d POC\n", i, k, m_GOPListMvc[k][i].m_POC, i );3669 printf( "\nError: Frame%d_l%d POC %d is not identical to Frame%d POC\n", i, k, xGetGopEntries(k)[i].m_POC, i ); 2722 3670 bErrorMvePoc = true; 2723 3671 } … … 2731 3679 for( Int i = 0; i < MAX_GOP; i++ ) 2732 3680 { 2733 if( m_GOPListMvc[0][i].m_numActiveRefLayerPics != 0 )3681 if( xGetGopEntries(0)[i].m_numActiveRefLayerPics != 0 ) 2734 3682 { 2735 3683 printf( "\nError: Frame%d inter_layer refs not available in layer 0\n", i ); … … 2747 3695 for( Int i = 0; i < MAX_GOP+1; i++ ) 2748 3696 { 2749 GOPEntry gopEntry = m_GOPListMvc[layer][i];3697 GOPEntry gopEntry = xGetGopEntries(layer)[i]; 2750 3698 for( Int j = 0; j < gopEntry.m_numActiveRefLayerPics; j++ ) 2751 3699 { … … 2790 3738 { 2791 3739 printf( "\nWarning: temporal references not possible for FrameI_l%d\n", layer ); 2792 for( Int j = 0; j < m_GOPListMvc[layer][MAX_GOP].m_numRefPics; j++ )3740 for( Int j = 0; j < xGetGopEntries(layer)[MAX_GOP].m_numRefPics; j++ ) 2793 3741 { 2794 3742 gopEntry.m_referencePics[j] = 0; … … 2850 3798 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 2851 3799 { 2852 GOPEntry* m_GOPList = m_GOPListMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!!3800 GOPEntry* m_GOPList = xGetGopEntries (layer); // It is not a member, but this name helps avoiding code duplication !!! 2853 3801 Int& m_extraRPSs = m_extraRPSsMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!! 2854 3802 Int& m_maxTempLayer = m_maxTempLayerMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!! 2855 3803 Int* m_maxDecPicBuffering = m_maxDecPicBufferingMvc[layer]; // It is not a member, but this name helps avoiding code duplication !!! 2856 Int* m_numReorderPics = m_numReorderPicsMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!! 3804 Int* m_numReorderPics = m_numReorderPicsMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!! 2857 3805 #endif 2858 3806 … … 2874 3822 else 2875 3823 { 3824 #if !NH_MV 2876 3825 xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences"); 3826 #endif 2877 3827 } 2878 3828 … … 2920 3870 } 2921 3871 2922 #if W0038_CQP_ADJ2923 3872 for(Int i=0; i<m_iGOPSize; i++) 2924 3873 { … … 2928 3877 xConfirmPara( abs(m_GOPList[i].m_CrQPoffset + m_crQpOffset) > 12, "Cr QP Offset for one of the GOP entries, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" ); 2929 3878 } 2930 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] > 12), "Intra/periodic Cb QP Offset exceeds supported range (-12 to 12)" ); 2931 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] + m_cbQpOffset > 12), "Intra/periodic Cb QP Offset, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" ); 2932 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] > 12), "Intra/periodic Cr QP Offset exceeds supported range (-12 to 12)" ); 2933 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] + m_crQpOffset > 12), "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" ); 2934 #endif 3879 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] ) > 12, "Intra/periodic Cb QP Offset exceeds supported range (-12 to 12)" ); 3880 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] + m_cbQpOffset ) > 12, "Intra/periodic Cb QP Offset, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" ); 3881 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] ) > 12, "Intra/periodic Cr QP Offset exceeds supported range (-12 to 12)" ); 3882 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] + m_crQpOffset ) > 12, "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" ); 2935 3883 2936 3884 m_extraRPSs=0; … … 3206 4154 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) 3207 4155 { 4156 #if NH_MV 4157 4158 if( m_numRepFormats > 1 ) 4159 { 4160 AOT( true ); //TBD 4161 } 4162 4163 Int m_iSourceWidth = m_iSourceWidths [0]; 4164 Int m_iSourceHeight = m_iSourceHeights[0]; 4165 #endif 3208 4166 Int PicSizeInSamplesY = m_iSourceWidth * m_iSourceHeight; 3209 4167 if(tileFlag) … … 3307 4265 if (m_chromaResamplingFilterSEIenabled) 3308 4266 { 4267 #if NH_MV 4268 for (Int i = 0 ; i < m_numRepFormats; i++ ) 4269 { 4270 xConfirmPara( (m_chromaFormatIDCs[i] == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" ); 4271 } 4272 #else 3309 4273 xConfirmPara( (m_chromaFormatIDC == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" ); 4274 #endif 3310 4275 xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" ); 3311 4276 } … … 3322 4287 } 3323 4288 xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); 3324 #if U0132_TARGET_BITS_SATURATION 3325 #if NH_MV 3326 if ((m_RCCpbSaturationEnabled) && (m_level[0]!=Level::NONE) && (m_profile!=Profile::NONE)) 3327 { 3328 UInt uiLevelIdx = (m_level[0] / 10) + (UInt)((m_level[0] % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3); 3329 xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier[0]][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level"); 3330 xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1"); 3331 } 3332 #else 4289 #if !NH_MV 3333 4290 if ((m_RCCpbSaturationEnabled) && (m_level!=Level::NONE) && (m_profile!=Profile::NONE)) 3334 4291 { … … 3338 4295 } 3339 4296 #endif 3340 #endif 3341 } 3342 #if U0132_TARGET_BITS_SATURATION 4297 } 3343 4298 else 3344 4299 { 3345 4300 xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" ); 3346 4301 } 3347 #endif 4302 4303 if (m_vuiParametersPresentFlag) 4304 { 4305 xConfirmPara(m_RCTargetBitrate == 0, "A target bit rate is required to be set for VUI/HRD parameters."); 4306 if (m_RCCpbSize == 0) 4307 { 4308 printf ("Warning: CPB size is set equal to zero. Adjusting value to be equal to TargetBitrate!\n"); 4309 m_RCCpbSize = m_RCTargetBitrate; 4310 } 4311 } 3348 4312 3349 4313 #if NH_MV … … 3370 4334 #endif 3371 4335 3372 xConfirmPara(!m_TransquantBypassEnable Flag && m_CUTransquantBypassFlagForce, "CUTransquantBypassFlagForce cannot be 1 when TransquantBypassEnableFlag is 0");4336 xConfirmPara(!m_TransquantBypassEnabledFlag && m_CUTransquantBypassFlagForce, "CUTransquantBypassFlagForce cannot be 1 when TransquantBypassEnableFlag is 0"); 3373 4337 3374 4338 xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2"); … … 3394 4358 } 3395 4359 4360 #if MCTS_ENC_CHECK 4361 if ((m_tmctsSEIEnabled) && (m_tmctsSEITileConstraint) && (m_bLFCrossTileBoundaryFlag) ) 4362 { 4363 printf("Warning: Constrained Encoding for Temporal Motion Constrained Tile Sets is enabled. Disabling filtering across tile boundaries!\n"); 4364 m_bLFCrossTileBoundaryFlag = false; 4365 } 4366 #endif 4367 3396 4368 if(m_timeCodeSEIEnabled) 3397 4369 { … … 3399 4371 } 3400 4372 3401 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI3402 4373 xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255."); 4374 4375 #if EXTENSION_360_VIDEO 4376 check_failed |= m_ext360.verifyParameters(); 3403 4377 #endif 3404 4378 … … 3429 4403 } 3430 4404 4405 #if NH_MV 4406 Void TAppEncCfg::xPrintProfiles() 4407 { 4408 printf("Profiles :"); 4409 for (Int i = 0; i < m_profiles.size(); i++) 4410 { 4411 if (m_profiles[i] == Profile::MAINREXT) 4412 { 4413 UIProfileName validProfileName; 4414 if (m_onePictureOnlyConstraintFlags[i]) 4415 { 4416 validProfileName = m_bitDepthConstraints[i] == 8 ? UI_MAIN_444_STILL_PICTURE : (m_bitDepthConstraints[i] == 16 ? UI_MAIN_444_16_STILL_PICTURE : UI_NONE); 4417 } 4418 else 4419 { 4420 const UInt intraIdx = m_intraConstraintFlags[i] ? 1:0; 4421 const UInt bitDepthIdx = (m_bitDepthConstraints[i] == 8 ? 0 : (m_bitDepthConstraints[i] ==10 ? 1 : (m_bitDepthConstraints[i] == 12 ? 2 : (m_bitDepthConstraints[i] == 16 ? 3 : 4 )))); 4422 const UInt chromaFormatIdx = UInt(m_chromaFormatConstraints[i]); 4423 validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? UI_NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx]; 4424 } 4425 std::string rextSubProfile; 4426 if (validProfileName!=UI_NONE) 4427 { 4428 rextSubProfile=enumToString(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), validProfileName); 4429 } 4430 if (rextSubProfile == "main_444_16") 4431 { 4432 rextSubProfile="main_444_16 [NON STANDARD]"; 4433 } 4434 printf(" %s (%s) ", profileToString(m_profiles[i]), (rextSubProfile.empty())?"INVALID REXT PROFILE":rextSubProfile.c_str() ); 4435 4436 } 4437 else if (m_profiles[i] == Profile::HIGHTHROUGHPUTREXT) 4438 { 4439 UIProfileName validProfileName; 4440 const UInt intraIdx = m_intraConstraintFlags[i] ? 1 : 0; 4441 const UInt bitDepthIdx = (m_bitDepthConstraints[i] == 8 ? 0 : (m_bitDepthConstraints[i] ==10 ? 1 : (m_bitDepthConstraints[i] == 12 ? 2 : (m_bitDepthConstraints[i] == 16 ? 3 : 4 )))); 4442 validProfileName = (bitDepthIdx > 3) ? UI_NONE : validRExtHighThroughPutProfileNames[intraIdx][bitDepthIdx]; 4443 std::string subProfile; 4444 if (validProfileName!=UI_NONE) 4445 { 4446 subProfile=enumToString(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), validProfileName); 4447 } 4448 printf(" : %s (%s)\n", profileToString(m_profiles[i]), (subProfile.empty())?"INVALID HIGH THROUGHPUT REXT PROFILE":subProfile.c_str() ); 4449 } 4450 else if (m_profiles[i] == Profile::MAIN10 && m_onePictureOnlyConstraintFlags[i]) 4451 { 4452 printf(" : %s (main10-still-picture)\n", profileToString(m_profiles[i]) ); 4453 } 4454 else 4455 { 4456 printf(" %s ", profileToString(m_profiles[i]) ); 4457 } 4458 } 4459 printf("\n\n"); 4460 4461 } 4462 #endif 4463 3431 4464 Void TAppEncCfg::xPrintParameter() 3432 4465 { … … 3435 4468 for( Int layer = 0; layer < m_numberOfLayers; layer++) 3436 4469 { 3437 printf("Input File %i : %s\n", layer, m_pchInputFileList[layer]);4470 printf("Input File %i : %s\n", layer, m_pchInputFileList[layer]); 3438 4471 } 3439 4472 #else 3440 4473 printf("Input File : %s\n", m_inputFileName.c_str() ); 3441 4474 #endif 3442 printf("Bitstream File 4475 printf("Bitstream File : %s\n", m_bitstreamFileName.c_str() ); 3443 4476 #if NH_MV 3444 4477 for( Int layer = 0; layer < m_numberOfLayers; layer++) 3445 { 3446 printf("Reconstruction File %i : %s\n", layer, m_pchReconFileList[layer]);4478 { 4479 printf("Reconstruction File %i : %s\n", layer, m_pchReconFileList[layer]); 3447 4480 } 3448 4481 #else … … 3464 4497 #endif 3465 4498 #if NH_MV 4499 #if !JVET_E0059_FLOATING_POINT_QP_FIX 3466 4500 xPrintParaVector( "QP" , m_fQP ); 4501 #endif 3467 4502 xPrintParaVector( "LoopFilterDisable", m_bLoopFilterDisable ); 3468 4503 xPrintParaVector( "SAO" , m_bUseSAO ); 3469 #endif 3470 4504 printf("ShareParameterSets : %d\n", m_shareParameterSets ? 1 : 0 ); 4505 #endif 4506 4507 #if NH_MV 4508 printf("Real Format :"); 4509 for(Int i = 0; i < m_numRepFormats; i++ ) 4510 { 4511 printf(" (%dx%d %gHz)", m_iSourceWidths[i] - m_confWinLefts[i] - m_confWinRights[i], m_iSourceHeights[i] - m_confWinTops[i] - m_confWinBottoms[i], (Double)m_iFrameRate/m_temporalSubsampleRatio ); 4512 } 4513 4514 printf("\nInternal Format :" ); 4515 for(Int i = 0; i < m_numRepFormats; i++ ) 4516 { 4517 4518 printf(" (%dx%d %gHz)", m_iSourceWidths[i], m_iSourceHeights[i], (Double)m_iFrameRate/m_temporalSubsampleRatio ); 4519 } 4520 printf("\n"); 4521 #else 3471 4522 printf("Real Format : %dx%d %gHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, (Double)m_iFrameRate/m_temporalSubsampleRatio ); 3472 4523 printf("Internal Format : %dx%d %gHz\n", m_iSourceWidth, m_iSourceHeight, (Double)m_iFrameRate/m_temporalSubsampleRatio ); 4524 4525 #endif 3473 4526 printf("Sequence PSNR output : %s\n", (m_printMSEBasedSequencePSNR ? "Linear average, MSE-based" : "Linear average only") ); 3474 4527 printf("Sequence MSE output : %s\n", (m_printSequenceMSE ? "Enabled" : "Disabled") ); 3475 4528 printf("Frame MSE output : %s\n", (m_printFrameMSE ? "Enabled" : "Disabled") ); 4529 #if JVET_F0064_MSSSIM 4530 printf("MS-SSIM output : %s\n", (m_printMSSSIM ? "Enabled" : "Disabled") ); 4531 #endif 3476 4532 printf("Cabac-zero-word-padding : %s\n", (m_cabacZeroWordPaddingEnabled? "Enabled" : "Disabled") ); 3477 4533 if (m_isField) … … 3487 4543 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 3488 4544 } 3489 #if NH_MV 3490 printf("Profile :"); 3491 for (Int i = 0; i < m_profiles.size(); i++) 3492 { 3493 Profile::Name m_profile = m_profiles[i]; 3494 3495 #endif 4545 #if !NH_MV 3496 4546 if (m_profile == Profile::MAINREXT) 3497 4547 { 3498 ExtendedProfileName validProfileName;4548 UIProfileName validProfileName; 3499 4549 if (m_onePictureOnlyConstraintFlag) 3500 4550 { 3501 validProfileName = m_bitDepthConstraint == 8 ? MAIN_444_STILL_PICTURE : (m_bitDepthConstraint == 16 ? MAIN_444_16_STILL_PICTURE :NONE);4551 validProfileName = m_bitDepthConstraint == 8 ? UI_MAIN_444_STILL_PICTURE : (m_bitDepthConstraint == 16 ? UI_MAIN_444_16_STILL_PICTURE : UI_NONE); 3502 4552 } 3503 4553 else … … 3506 4556 const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 )))); 3507 4557 const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint); 3508 validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx];4558 validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? UI_NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx]; 3509 4559 } 3510 4560 std::string rextSubProfile; 3511 if (validProfileName!=NONE)3512 { 3513 rextSubProfile=enumToString(strToExtendedProfile, sizeof(strToExtendedProfile)/sizeof(*strToExtendedProfile), validProfileName);4561 if (validProfileName!=UI_NONE) 4562 { 4563 rextSubProfile=enumToString(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), validProfileName); 3514 4564 } 3515 4565 if (rextSubProfile == "main_444_16") … … 3517 4567 rextSubProfile="main_444_16 [NON STANDARD]"; 3518 4568 } 3519 #if NH_MV3520 printf(" %s (%s) ", profileToString(m_profile), (rextSubProfile.empty())?"INVALID REXT PROFILE":rextSubProfile.c_str() );3521 #else3522 4569 printf("Profile : %s (%s)\n", profileToString(m_profile), (rextSubProfile.empty())?"INVALID REXT PROFILE":rextSubProfile.c_str() ); 3523 #endif 3524 } 3525 else 3526 { 3527 #if NH_MV 3528 printf(" %s ", profileToString(m_profile) ); 3529 #else 4570 } 4571 else if (m_profile == Profile::HIGHTHROUGHPUTREXT) 4572 { 4573 UIProfileName validProfileName; 4574 const UInt intraIdx = m_intraConstraintFlag ? 1:0; 4575 const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 )))); 4576 validProfileName = (bitDepthIdx > 3) ? UI_NONE : validRExtHighThroughPutProfileNames[intraIdx][bitDepthIdx]; 4577 std::string subProfile; 4578 if (validProfileName!=UI_NONE) 4579 { 4580 subProfile=enumToString(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), validProfileName); 4581 } 4582 printf("Profile : %s (%s)\n", profileToString(m_profile), (subProfile.empty())?"INVALID HIGH THROUGHPUT REXT PROFILE":subProfile.c_str() ); 4583 } 4584 else if (m_profile == Profile::MAIN10 && m_onePictureOnlyConstraintFlag) 4585 { 4586 printf("Profile : %s (main10-still-picture)\n", profileToString(m_profile) ); 4587 } 4588 else 4589 { 3530 4590 printf("Profile : %s\n", profileToString(m_profile) ); 3531 #endif 3532 } 3533 #if NH_MV 3534 } 3535 printf("\n"); 3536 #endif 3537 4591 } 4592 #endif 4593 4594 #if NH_MV 4595 printf("CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth[0] ); 4596 #else 3538 4597 printf("CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth ); 4598 #endif 3539 4599 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 3540 4600 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); … … 3552 4612 #endif 3553 4613 printf("Decoding refresh type : %d\n", m_iDecodingRefreshType ); 3554 #if !NH_MV 4614 #if JVET_E0059_FLOATING_POINT_QP_FIX 4615 4616 #if NH_MV 4617 if ( !m_qpIncrementAtSourceFrame.empty() ) 4618 { 4619 xPrintParaVector( "QPIncrementFrame", m_qpIncrementAtSourceFrame ); 4620 } 4621 #else 4622 if (m_qpIncrementAtSourceFrame.bPresent) 4623 { 4624 printf("QP : %d (incrementing internal QP at source frame %d)\n", m_iQP, m_qpIncrementAtSourceFrame.value ); 4625 } 4626 #endif 4627 else 4628 { 4629 #if NH_MV 4630 xPrintParaVector( "QP", m_iQP ); 4631 #else 4632 printf("QP : %d\n", m_iQP ); 4633 #endif 4634 } 4635 #else 3555 4636 printf("QP : %5.2f\n", m_fQP ); 3556 4637 #endif … … 3561 4642 printf("QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) ); 3562 4643 printf("GOP size : %d\n", m_iGOPSize ); 4644 4645 #if NH_MV 4646 printf("Input bit depth :"); 4647 for (Int i = 0; i < m_numRepFormats; i++ ) 4648 { 4649 printf(" (Y:%d, C:%d)", m_inputBitDepths[i][CHANNEL_TYPE_LUMA], m_inputBitDepths[i][CHANNEL_TYPE_CHROMA] ); 4650 } 4651 4652 printf("\nMSB-extended bit depth :"); 4653 for (Int i = 0; i < m_numRepFormats; i++ ) 4654 { 4655 printf(" (Y:%d, C:%d)", m_MSBExtendedBitDepths[i][CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepths[i][CHANNEL_TYPE_CHROMA] ); 4656 } 4657 4658 printf("\nInternal bit depth :"); 4659 for (Int i = 0; i < m_numRepFormats; i++ ) 4660 { 4661 printf(" (Y:%d, C:%d)", m_internalBitDepths[i][CHANNEL_TYPE_LUMA], m_internalBitDepths[i][CHANNEL_TYPE_CHROMA] ); 4662 } 4663 4664 printf("\nPCM sample bit depth :"); 4665 for (Int i = 0; i < m_numRepFormats; i++ ) 4666 { 4667 printf(" (Y:%d, C:%d)", m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepths[i][CHANNEL_TYPE_LUMA] : m_internalBitDepths[i][CHANNEL_TYPE_LUMA], 4668 m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepths[i][CHANNEL_TYPE_CHROMA] : m_internalBitDepths[i][CHANNEL_TYPE_CHROMA] ); 4669 } 4670 printf("\n" ); 4671 #else 3563 4672 printf("Input bit depth : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] ); 3564 4673 printf("MSB-extended bit depth : (Y:%d, C:%d)\n", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] ); … … 3566 4675 printf("PCM sample bit depth : (Y:%d, C:%d)\n", m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA] : m_internalBitDepth[CHANNEL_TYPE_LUMA], 3567 4676 m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] : m_internalBitDepth[CHANNEL_TYPE_CHROMA] ); 4677 #endif 3568 4678 printf("Intra reference smoothing : %s\n", (m_enableIntraReferenceSmoothing ? "Enabled" : "Disabled") ); 3569 4679 printf("diff_cu_chroma_qp_offset_depth : %d\n", m_diffCuChromaQpOffsetDepth); … … 3629 4739 printf("InitialQP : %d\n", m_RCInitialQP ); 3630 4740 printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); 3631 3632 #if U0132_TARGET_BITS_SATURATION3633 4741 printf("CpbSaturation : %d\n", m_RCCpbSaturationEnabled ); 3634 4742 if (m_RCCpbSaturationEnabled) … … 3637 4745 printf("InitalCpbFullness : %.2f\n", m_RCInitialCpbFullness); 3638 4746 } 3639 #endif3640 4747 3641 4748 #if KWU_RC_MADPRED_E0227 … … 3686 4793 #if NH_MV 3687 4794 printf("TOOL CFG General: "); 4795 4796 for( Int i = 0; i < m_numRepFormats; i++) 4797 { 4798 printf("IBD(%d):%d ", i, ((m_internalBitDepths[i][CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepths[i][CHANNEL_TYPE_LUMA]) || (m_internalBitDepths[i][CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepths[i][CHANNEL_TYPE_CHROMA]))); 4799 } 3688 4800 #else 3689 4801 printf("TOOL CFG: "); 3690 #endif 3691 printf("IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]))); 4802 printf("IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]))); 4803 #endif 4804 3692 4805 printf("HAD:%d ", m_bUseHADME ); 3693 4806 printf("RDQ:%d ", m_useRDOQ ); 3694 4807 printf("RDQTS:%d ", m_useRDOQTS ); 3695 4808 printf("RDpenalty:%d ", m_rdPenalty ); 4809 printf("LQP:%d ", m_lumaLevelToDeltaQPMapping.mode ); 3696 4810 printf("SQP:%d ", m_uiDeltaQpRD ); 3697 4811 printf("ASR:%d ", m_bUseASR ); … … 3723 4837 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 3724 4838 3725 if (m_TransquantBypassEnable Flag && m_CUTransquantBypassFlagForce)4839 if (m_TransquantBypassEnabledFlag && m_CUTransquantBypassFlagForce) 3726 4840 { 3727 4841 printf("TransQuantBypassEnabled: =1"); … … 3729 4843 else 3730 4844 { 3731 printf("TransQuantBypassEnabled:%d ", (m_TransquantBypassEnable Flag)? 1:0 );4845 printf("TransQuantBypassEnabled:%d ", (m_TransquantBypassEnabledFlag)? 1:0 ); 3732 4846 } 3733 4847 … … 3735 4849 printf("WPB:%d ", (Int)m_useWeightedBiPred); 3736 4850 printf("PME:%d ", m_log2ParallelMergeLevel); 4851 #if NH_MV 4852 for( Int i = 0; i < m_numRepFormats; i++ ) 4853 { 4854 const Int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeights[i] + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 4855 printf(" WaveFrontSynchro(%d):%d WaveFrontSubstreams(%d):%d", i, m_entropyCodingSyncEnabledFlag?1:0, i, iWaveFrontSubstreams ); 4856 } 4857 #else 3737 4858 const Int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 3738 4859 printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams); 4860 #endif 3739 4861 printf(" ScalingList:%d ", m_useScalingListId ); 3740 4862 printf("TMVPMode:%d ", m_TMVPModeId ); … … 3743 4865 #endif 3744 4866 3745 printf(" SignBitHidingFlag:%d ", m_sign HideFlag);4867 printf(" SignBitHidingFlag:%d ", m_signDataHidingEnabledFlag); 3746 4868 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 4869 #if EXTENSION_360_VIDEO 4870 m_ext360.outputConfigurationSummary(); 4871 #endif 3747 4872 #if NH_3D_VSO 3748 4873 printf(" VSO:%d ", m_bUseVSO ); 3749 4874 printf("WVSO:%d ", m_bUseWVSO ); 3750 4875 #endif 3751 #if NH_3D _QTL4876 #if NH_3D 3752 4877 printf( "QTL:%d " , m_bUseQTL); 3753 #endif3754 #if NH_3D3755 4878 printf( "IlluCompEnable:%d " , m_abUseIC); 3756 4879 printf( "IlluCompLowLatencyEnc:%d ", m_bUseLowLatencyICEnc); … … 3780 4903 fflush(stdout); 3781 4904 } 4905 #if NH_MV 4906 4907 Void TAppEncCfg::xConfirmRepFormat(const TComVPS& vps ) 4908 { 4909 Bool checkFailed = false; 4910 4911 // This might not cover all disallowed cases. To be further tested. 4912 #if NH_3D 4913 Bool allDepthSameBitDepth = true; 4914 Bool allSameSize = true; 4915 Bool allTextureChroma420 = true; 4916 4917 Int lastBitDepth = -1; 4918 Int lastWidth = -1; 4919 Int lastHeight = -1; 4920 4921 Int lastChromaFormat = (Int) CHROMA_420; 4922 4923 for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) 4924 { 4925 Int curLayerIdInNuh = vps.getLayerIdInNuh( i ); 4926 4927 const TComRepFormat* repFormat = vps.getRepFormat( vps.getVpsRepFormatIdx( i ) ); 4928 4929 Int curWidth = repFormat->getPicWidthVpsInLumaSamples(); 4930 allSameSize = allSameSize && ( lastWidth == -1 || lastWidth == curWidth ); 4931 lastWidth = curWidth; 4932 4933 Int curHeight = repFormat->getPicHeightVpsInLumaSamples(); 4934 allSameSize = allSameSize && ( lastHeight == -1 || lastHeight == curHeight ); 4935 lastHeight = curHeight; 4936 4937 if ( vps.getVpsDepthFlag( curLayerIdInNuh )) 4938 { 4939 Int curBitDepth = repFormat->getBitDepthVpsLumaMinus8(); 4940 allDepthSameBitDepth = allDepthSameBitDepth && ( lastBitDepth == -1 || lastBitDepth == curBitDepth ); 4941 lastBitDepth = curBitDepth; 4942 } 4943 else 4944 { 4945 Int curChromaFormat = repFormat->getChromaFormatVpsIdc(); 4946 allTextureChroma420 = allTextureChroma420 && ( lastChromaFormat == curChromaFormat ); 4947 lastChromaFormat = curChromaFormat; 4948 } 4949 } 4950 4951 checkFailed |= confirmPara( !allDepthSameBitDepth , "The HTM implementation requires that InternalBitDepth of all depth layers must be equal." ); 4952 checkFailed |= confirmPara( !allSameSize && ( m_bUseVSO || m_bUseEstimatedVSD ) , "When VSO or VSD are enabled, the HTM implementation requires that SourceHeight and SourceWidth of all layers must be equal." ); 4953 checkFailed |= confirmPara( !allTextureChroma420 && m_bUseVSO , "When VSO is enabled, the HTM implementation requires that all textures have ChromaFormat 420." ); 4954 #endif 4955 4956 // Check reference layers 4957 for (Int curLayerId = 0; curLayerId <= vps.getMaxLayersMinus1(); curLayerId++ ) 4958 { 4959 4960 const TComRepFormat* curRepFormat = vps.getRepFormat( vps.getVpsRepFormatIdx( curLayerId ) ); 4961 4962 Int curLayerIdInNuh = vps.getLayerIdInNuh( curLayerId ); 4963 4964 for( Int i = 0; i < vps.getNumDirectRefLayers( curLayerIdInNuh ); i++ ) 4965 { 4966 Int refLayerId = vps.getLayerIdInVps( vps.getIdDirectRefLayer( curLayerIdInNuh, i ));// refLayers[i]; 4967 const TComRepFormat* refRepFormat = vps.getRepFormat( vps.getVpsRepFormatIdx( refLayerId ) ); 4968 4969 // Require equal size 4970 xConfirmSingleRepFormat( checkFailed, "SourceHeight",curLayerId, refLayerId, curRepFormat->getPicHeightVpsInLumaSamples(), refRepFormat->getPicHeightVpsInLumaSamples() ); 4971 xConfirmSingleRepFormat( checkFailed, "SourceWidth" ,curLayerId, refLayerId, curRepFormat->getPicWidthVpsInLumaSamples() , refRepFormat->getPicWidthVpsInLumaSamples () ); 4972 #if NH_3D 4973 4974 // For 3D-HEVC, dependencies can be e.g. from texture 4:2:0 to depth 4:0:0, so check only layers that might be inserted to the reference lists. 4975 } 4976 4977 for( Int i = 0; i < vps.getNumRefListLayers( curLayerIdInNuh ); i++ ) 4978 { 4979 Int refLayerId = vps.getLayerIdInVps( vps.getIdRefListLayer( curLayerIdInNuh, i ) );// refLayers[i]; 4980 const TComRepFormat* refRepFormat = vps.getRepFormat( vps.getVpsRepFormatIdx( refLayerId ) ); 4981 #endif 4982 // Sample dependency -> require same bit depth and chroma format 4983 xConfirmSingleRepFormat( checkFailed, "ChromaFormatIDC" , curLayerId, refLayerId, curRepFormat->getChromaFormatVpsIdc() , refRepFormat->getChromaFormatVpsIdc() ); 4984 xConfirmSingleRepFormat( checkFailed, "InternalBitDepth (Luma)" , curLayerId, refLayerId, curRepFormat->getBitDepthVpsLumaMinus8() , refRepFormat->getBitDepthVpsLumaMinus8()); 4985 xConfirmSingleRepFormat( checkFailed, "InternalBitDepth (Chroma)", curLayerId, refLayerId, curRepFormat->getBitDepthVpsChromaMinus8(), refRepFormat->getBitDepthVpsChromaMinus8()); 4986 } 4987 // TBD: add 3D-HEVC constraints e.g. for VSP, QTL 4988 } 4989 4990 if( checkFailed ) 4991 { 4992 exit(0); 4993 } 4994 } 4995 4996 Void TAppEncCfg::xConvertRepFormatParameters( 4997 IntAry2d& tmpPad , 4998 IntAry2d& tmpInputBitDepth , 4999 IntAry2d& tmpOutputBitDepth , 5000 IntAry2d& tmpMSBExtendedBitDepth , 5001 IntAry2d& tmpInternalBitDepth , 5002 IntAry1d& tmpInputChromaFormat , 5003 IntAry1d& tmpChromaFormat 5004 ) 5005 { 5006 typedef std::pair< IntAry2d*, IntAry2d* > ParamMapPair; 5007 std::vector< ParamMapPair > paramTwoElem; 5008 paramTwoElem.push_back( ParamMapPair( &tmpPad , &m_aiPads ) ); 5009 paramTwoElem.push_back( ParamMapPair( &tmpInputBitDepth , &m_inputBitDepths ) ); 5010 paramTwoElem.push_back( ParamMapPair( &tmpOutputBitDepth , &m_outputBitDepths ) ); 5011 paramTwoElem.push_back( ParamMapPair( &tmpMSBExtendedBitDepth, &m_MSBExtendedBitDepths ) ); 5012 paramTwoElem.push_back( ParamMapPair( &tmpInternalBitDepth , &m_internalBitDepths ) ); 5013 5014 std::vector< IntAry1d* > paramOneElem; 5015 paramOneElem.push_back( &m_confWinLefts ); 5016 paramOneElem.push_back( &m_confWinRights ); 5017 paramOneElem.push_back( &m_confWinTops ); 5018 paramOneElem.push_back( &m_confWinBottoms); 5019 paramOneElem.push_back( &m_iSourceWidths ); 5020 paramOneElem.push_back( &m_iSourceHeights); 5021 paramOneElem.push_back( &tmpInputChromaFormat ); 5022 paramOneElem.push_back( &tmpChromaFormat ); 5023 5024 5025 // Get maximum number of representation formats 5026 size_t maxSize = 0; 5027 5028 for (Int i = 0; i < paramTwoElem.size(); i++) 5029 { 5030 for (Int j = 0; j < 2; j++ ) 5031 { 5032 IntAry1d& curElems = (* (paramTwoElem[i].first) )[j]; 5033 maxSize = std::max<size_t>( maxSize, curElems.size() ); 5034 } 5035 } 5036 5037 for (Int i = 0; i < paramOneElem.size(); i++) 5038 { 5039 maxSize = std::max<size_t>( maxSize, (paramOneElem[i]->size() ) ); 5040 } 5041 5042 // Resize to maximum 5043 for (Int i = 0; i < paramTwoElem.size(); i++) 5044 { 5045 IntAry2d& curElems = (* (paramTwoElem[i].first) ); 5046 for (Int j = 0; j < 2; j++ ) 5047 { 5048 xResizeVector( curElems[j], (UInt) maxSize ); 5049 } 5050 } 5051 5052 for (Int i = 0; i < paramOneElem.size(); i++) 5053 { 5054 xResizeVector( (*paramOneElem[i]), (UInt) maxSize ); 5055 } 5056 5057 // Transpose 5058 for (Int i = 0; i < paramTwoElem.size(); i++) 5059 { 5060 IntAry2d& curElem = (* (paramTwoElem[i].first ) ); 5061 IntAry2d& curElemT = (* (paramTwoElem[i].second ) ); 5062 5063 curElemT.resize(maxSize); 5064 for (Int k = 0; k < maxSize; k++ ) 5065 { 5066 curElemT[k].resize(2); 5067 for (Int j = 0; j < 2; j++ ) 5068 { 5069 curElemT[k][j] = curElem[j][k]; 5070 } 5071 } 5072 } 5073 5074 m_numRepFormats = (Int) maxSize; 5075 } 5076 5077 5078 5079 Void TAppEncCfg::xGetMaxValuesOfApplicableLayers(const TComVPS& vps, Int vpsPtlIdx, Int& maxBitDepthLuma, Int& maxBitDepthChroma, ChromaFormat& maxChromaFormatIdc, Int& maxNumRefLayers ) 5080 { 5081 maxChromaFormatIdc = CHROMA_400; 5082 maxBitDepthLuma = -1; 5083 maxBitDepthChroma = -1; 5084 maxNumRefLayers = 0; 5085 5086 IntAry1d applicableLayerIdsInVps = vps.getLayersOfVpsPtl( vpsPtlIdx ); 5087 5088 for (Int i = 0; i < applicableLayerIdsInVps.size(); i++ ) 5089 { 5090 Int curLayerIdInVps = applicableLayerIdsInVps[ i ]; 5091 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[ curLayerIdInVps ]; 5092 maxChromaFormatIdc = std::max<ChromaFormat> ( m_chromaFormatIDCs[ repFormatIdx], maxChromaFormatIdc ); 5093 maxBitDepthLuma = std::max<Int> ( m_internalBitDepths[ repFormatIdx ][CHANNEL_TYPE_LUMA ], maxBitDepthLuma ); 5094 maxBitDepthChroma = std::max<Int> ( m_internalBitDepths[ repFormatIdx ][CHANNEL_TYPE_CHROMA], maxBitDepthChroma ); 5095 maxNumRefLayers = std::max<Int> ( vps.getNumRefLayers( vps.getLayerIdInNuh( curLayerIdInVps ) ), maxNumRefLayers ) ; 5096 } 5097 } 5098 5099 #endif 3782 5100 3783 5101 Bool confirmPara(Bool bflag, const TChar* message)
Note: See TracChangeset for help on using the changeset viewer.