Changeset 1413 in 3DVCSoftware for trunk/source/App
- Timestamp:
- 11 Jul 2018, 15:19:49 (7 years ago)
- Location:
- trunk/source/App
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r1405 r1413 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 * … … 115 115 #endif 116 116 ("ClipOutputVideoToRec709Range", m_bClipOutputVideoToRec709Range, false, "If true then clip output video to the Rec. 709 Range on saving") 117 #if MCTS_ENC_CHECK 118 ("TMCTSCheck", m_tmctsCheck, false, "If enabled, the decoder checks for violations of mc_exact_sample_value_match_flag in Temporal MCTS ") 119 #endif 117 120 ; 118 121 -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r1405 r1413 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 * … … 78 78 std::string m_outputDecodedSEIMessagesFilename; ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details. 79 79 Bool m_bClipOutputVideoToRec709Range; ///< If true, clip the output video to the Rec 709 range on saving. 80 #if MCTS_ENC_CHECK 81 Bool m_tmctsCheck; 82 #endif 83 80 84 #if NH_MV 81 85 std::vector<TChar*> m_pchReconFiles; ///< array of output reconstruction file name create from output reconstruction file name … … 122 126 , m_outputDecodedSEIMessagesFilename() 123 127 , m_bClipOutputVideoToRec709Range(false) 128 #if MCTS_ENC_CHECK 129 , m_tmctsCheck(false) 130 #endif 124 131 #if NH_MV 125 132 , m_highestTid(-1) 126 133 , m_targetDecLayerIdSetFileEmpty(true) 127 134 #endif 128 129 135 { 130 136 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r1405 r1413 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 * … … 405 405 // initialize global variables 406 406 initROM(); 407 #if NH_3D _DMM407 #if NH_3D 408 408 initWedgeLists(); 409 409 #endif … … 474 474 m_cTDecTop.init(); 475 475 m_cTDecTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 476 #if MCTS_ENC_CHECK 477 m_cTDecTop.setTMctsCheckEnabled(m_tmctsCheck); 478 #endif 476 479 #if O0043_BEST_EFFORT_DECODING 477 480 m_cTDecTop.setForceDecodeBitDepth(m_forceDecodeBitDepth); … … 1262 1265 m_vps->printLayerSets(); 1263 1266 m_vps->printPTL(); 1267 m_vps->printRepFormat(); 1264 1268 } 1265 1269 } … … 2223 2227 //////////////////////////////////////////////////////////////////////////////// 2224 2228 2225 const TComDpbSize* dpbSize = m_vps->getDpbSize(); 2226 m_maxNumReorderPics = dpbSize->getMaxVpsNumReorderPics ( m_targetOptLayerSetIdx, m_highestTid ); 2227 m_maxLatencyIncreasePlus1 = dpbSize->getMaxVpsLatencyIncreasePlus1( m_targetOptLayerSetIdx, m_highestTid ); 2228 m_maxLatencyValue = dpbSize->getVpsMaxLatencyPictures ( m_targetOptLayerSetIdx, m_highestTid ); 2229 2230 for(Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 2231 { 2232 m_maxDecPicBufferingMinus1[ i ] = MIN_INT; 2233 } 2234 for( Int i = 0; i <= m_vps->getMaxLayersMinus1(); i++ ) 2235 { 2236 Int currLayerId = m_vps->getLayerIdInNuh( i ); 2237 for(Int layerIdx = 0 ; layerIdx < m_vps->getNumLayersInIdList( m_targetDecLayerSetIdx); layerIdx++ ) 2238 { 2239 if( m_vps->getLayerSetLayerIdList( m_targetDecLayerSetIdx, layerIdx ) == currLayerId ) 2240 { 2241 m_maxDecPicBufferingMinus1[currLayerId] = dpbSize->getMaxVpsDecPicBufferingMinus1( m_targetDecLayerSetIdx, layerIdx, m_highestTid ); 2229 // According to spec, no dbpSize values are given for OLS 0, however they are used in F.13.5.2.1. 2230 // This might be an issue of the spec. As workaround use sps for OLS 0 here. 2231 2232 if ( m_targetOptLayerSetIdx == 0 ) 2233 { 2234 m_maxNumReorderPics = m_sps->getSpsMaxNumReorderPics ( m_highestTid ); 2235 m_maxLatencyIncreasePlus1 = m_sps->getSpsMaxLatencyIncreasePlus1( m_highestTid ); 2236 m_maxLatencyValue = m_sps->getSpsMaxLatencyPictures ( m_highestTid ); 2237 m_maxDecPicBufferingMinus1[0] = m_sps->getMaxDecPicBuffering ( m_highestTid ); 2238 } 2239 else 2240 { 2241 const TComDpbSize* dpbSize = m_vps->getDpbSize(); 2242 m_maxNumReorderPics = dpbSize->getMaxVpsNumReorderPics ( m_targetOptLayerSetIdx, m_highestTid ); 2243 m_maxLatencyIncreasePlus1 = dpbSize->getMaxVpsLatencyIncreasePlus1( m_targetOptLayerSetIdx, m_highestTid ); 2244 m_maxLatencyValue = dpbSize->getVpsMaxLatencyPictures ( m_targetOptLayerSetIdx, m_highestTid ); 2245 2246 for(Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 2247 { 2248 m_maxDecPicBufferingMinus1[ i ] = MIN_INT; 2249 } 2250 for( Int i = 0; i <= m_vps->getMaxLayersMinus1(); i++ ) 2251 { 2252 Int currLayerId = m_vps->getLayerIdInNuh( i ); 2253 for(Int layerIdx = 0 ; layerIdx < m_vps->getNumLayersInIdList( m_targetDecLayerSetIdx); layerIdx++ ) 2254 { 2255 if( m_vps->getLayerSetLayerIdList( m_targetDecLayerSetIdx, layerIdx ) == currLayerId ) 2256 { 2257 m_maxDecPicBufferingMinus1[currLayerId] = dpbSize->getMaxVpsDecPicBufferingMinus1( m_targetDecLayerSetIdx, layerIdx, m_highestTid ); 2258 } 2242 2259 } 2243 2260 } … … 2673 2690 m_tDecTop[ decIdx ]->setLayerId( layerId ); 2674 2691 m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 2692 #if MCTS_ENC_CHECK 2693 m_tDecTop[ decIdx ]->setTMctsCheckEnabled( m_tmctsCheck ); 2694 #endif 2675 2695 m_tDecTop[ decIdx ]->setDpb( &m_dpb ); 2676 2696 m_tDecTop[ decIdx ]->setTargetOlsIdx( m_targetOptLayerSetIdx ); … … 2678 2698 m_tDecTop[ decIdx ]->setPocDecrementedInDPBFlag ( m_pocDecrementedInDpbFlag ); 2679 2699 m_tDecTop[ decIdx ]->setLastPresentPocResetIdc ( m_lastPresentPocResetIdc ); 2680 2681 2682 2700 #if O0043_BEST_EFFORT_DECODING 2683 2701 m_cTDecTop[ decIdx ]->setForceDecodeBitDepth(m_forceDecodeBitDepth); -
trunk/source/App/TAppDecoder/TAppDecTop.h
r1405 r1413 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 * -
trunk/source/App/TAppDecoder/decmain.cpp
r1405 r1413 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 * … … 70 70 Int curDecoding = 0; 71 71 Double dResult = 0; 72 do { 72 do 73 { 73 74 TAppDecTop cTAppDecTop; 74 75 #endif -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r1405 r1413 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) -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r1405 r1413 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 42 42 43 43 #include "TLibEncoder/TEncCfg.h" 44 #if EXTENSION_360_VIDEO 45 #include "TAppEncHelper360/TExt360AppEncCfg.h" 46 #endif 44 47 #include <sstream> 45 48 #include <vector> … … 56 59 // ==================================================================================================================== 57 60 61 #if NH_MV 62 enum UIProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations 63 { 64 UI_NONE = 0, 65 UI_MAIN = 1, 66 UI_MAIN10 = 2, 67 UI_MAIN10_STILL_PICTURE=10002, 68 UI_MAINSTILLPICTURE = 3, 69 UI_MAINREXT = 4, 70 UI_HIGHTHROUGHPUTREXT = 5, 71 // The following are RExt profiles, which would map to the MAINREXT profile idc. 72 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 73 // the chroma format in the next digit 74 // the intra constraint in the next digit (1 for no intra constraint, 2 for intra constraint) 75 // If it is a RExt still picture, there is a '1' for the top digit. 76 #if NH_MV 77 UI_MULTIVIEWMAIN = 6, 78 #if NH_3D 79 UI_MAIN3D = 8, 80 #endif 81 #endif 82 UI_MONOCHROME_8 = 1008, 83 UI_MONOCHROME_12 = 1012, 84 UI_MONOCHROME_16 = 1016, 85 UI_MAIN_12 = 1112, 86 UI_MAIN_422_10 = 1210, 87 UI_MAIN_422_12 = 1212, 88 UI_MAIN_444 = 1308, 89 UI_MAIN_444_10 = 1310, 90 UI_MAIN_444_12 = 1312, 91 UI_MAIN_444_16 = 1316, // non-standard profile definition, used for development purposes 92 UI_MAIN_INTRA = 2108, 93 UI_MAIN_10_INTRA = 2110, 94 UI_MAIN_12_INTRA = 2112, 95 UI_MAIN_422_10_INTRA = 2210, 96 UI_MAIN_422_12_INTRA = 2212, 97 UI_MAIN_444_INTRA = 2308, 98 UI_MAIN_444_10_INTRA = 2310, 99 UI_MAIN_444_12_INTRA = 2312, 100 UI_MAIN_444_16_INTRA = 2316, 101 UI_MAIN_444_STILL_PICTURE = 11308, 102 UI_MAIN_444_16_STILL_PICTURE = 12316, 103 // The following are high throughput profiles, which would map to the HIGHTHROUGHPUTREXT profile idc. 104 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 105 // the chroma format in the next digit 106 // the intra constraint in the next digit 107 // There is a '2' for the top digit to indicate it is high throughput profile 108 109 UI_HIGHTHROUGHPUT_444 = 21308, 110 UI_HIGHTHROUGHPUT_444_10 = 21310, 111 UI_HIGHTHROUGHPUT_444_14 = 21314, 112 UI_HIGHTHROUGHPUT_444_16_INTRA = 22316 113 #if NH_MV_ALLOW_NON_CONFORMING 114 , 115 UI_MULTIVIEWMAIN_NONCONF = 10000006, 116 #if NH_3D 117 UI_MAIN3D_NONCONF = 10000008, 118 #endif 119 #endif 120 }; 121 #endif 122 58 123 /// encoder configuration class 59 124 class TAppEncCfg 60 125 { 126 #if JVET_E0059_FLOATING_POINT_QP_FIX 127 public: 128 template <class T> 129 struct OptionalValue 130 { 131 Bool bPresent; 132 T value; 133 OptionalValue() : bPresent(false), value() { } 134 }; 135 #endif 136 61 137 protected: 62 138 // file I/O … … 71 147 Int m_numberOfLayers; ///< number of Layers to Encode 72 148 Int m_iNumberOfViews; ///< number of Layers that are views 149 #if NH_MV 150 Bool m_shareParameterSets; 151 IntAry1d m_layerIdxInVpsToGopDefIdx; 152 IntAry1d m_layerIdxInVpsToRepFormatIdx; 153 Int m_numRepFormats; 154 Int m_numInputOutputRepFormats; 155 #endif 73 156 #else 74 157 std::string m_reconFileName; ///< output reconstruction file … … 91 174 // layer sets 92 175 Int m_vpsNumLayerSets; ///< Number of layer sets 93 IntAry2d m_layerIdxInVpsInSets;///< LayerIds in vps of layer set94 Int m_numAddLayerSets; 95 IntAry2d m_highestLayerIdxPlus1;///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored)176 IntAry2d m_layerIdxInVpsInSets; ///< LayerIds in vps of layer set 177 Int m_numAddLayerSets; ///< Number of additional layer sets 178 IntAry2d m_highestLayerIdxPlus1; ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored) 96 179 Int m_defaultOutputLayerIdc; ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet 97 180 IntAry1d m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 98 IntAry2d m_layerIdsInAddOutputLayerSet;///< LayerIds in vps of additional output layers99 IntAry2d m_layerIdsInDefOutputLayerSet;///< Indices in vps of output layers in layer sets100 IntAry2d m_profileTierLevelIdx; ///< Indices of of profile, per layer in layer set181 IntAry2d m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers 182 IntAry2d m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets 183 IntAry2d m_profileTierLevelIdx; ///< Indices of of profile, per layer in layer set 101 184 BoolAry1d m_altOutputLayerFlag; ///< Alt output layer flag 102 185 … … 145 228 UInt m_FrameSkip; ///< number of skipped frames from the beginning 146 229 UInt m_temporalSubsampleRatio; ///< temporal subsample ratio, 2 means code every two frames 147 Int m_iSourceWidth; ///< source width in pixel 148 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 230 231 #if NH_MV 232 IntAry1d m_iSourceWidths ; ///< source width in pixel 233 IntAry1d m_iSourceHeights ; ///< source height in pixel (when interlaced = field height) 234 IntAry1d m_inputFileWidths ; ///< width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently altered due to padding) 235 IntAry1d m_inputFileHeights; ///< height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequently altered due to padding) 236 237 IntAry1d m_iSourceHeightOrgs; ///< original source height in pixel (when interlaced = frame height) 238 #else 239 Int m_iSourceWidth ; ///< source width in pixel 240 Int m_iSourceHeight ; ///< source height in pixel (when interlaced = field height) 241 Int m_inputFileWidth ; ///< width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently altered due to padding) 242 Int m_inputFileHeight; ///< height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequently altered due to padding) 149 243 150 244 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 245 #endif 151 246 152 247 Bool m_isField; ///< enable field coding … … 156 251 157 252 Int m_conformanceWindowMode; 253 #if NH_MV 254 IntAry1d m_confWinLefts ; 255 IntAry1d m_confWinRights ; 256 IntAry1d m_confWinTops ; 257 IntAry1d m_confWinBottoms; 258 #else 158 259 Int m_confWinLeft; 159 260 Int m_confWinRight; 160 261 Int m_confWinTop; 161 262 Int m_confWinBottom; 263 #endif 162 264 Int m_framesToBeEncoded; ///< number of encoded frames 265 #if NH_MV 266 IntAry2d m_aiPads; ///< number of padded pixels for width and height 267 #else 163 268 Int m_aiPad[2]; ///< number of padded pixels for width and height 269 #endif 164 270 Bool m_AccessUnitDelimiter; ///< add Access Unit Delimiter NAL units 165 271 InputColourSpaceConversion m_inputColourSpaceConvert; ///< colour space conversion to apply to input video 166 272 Bool m_snrInternalColourSpace; ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied. 167 273 Bool m_outputInternalColourSpace; ///< if true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied. 274 #if NH_MV 275 std::vector<ChromaFormat> m_InputChromaFormatIDC; 276 #else 168 277 ChromaFormat m_InputChromaFormatIDC; 278 #endif 169 279 170 280 Bool m_printMSEBasedSequencePSNR; 171 281 Bool m_printFrameMSE; 172 282 Bool m_printSequenceMSE; 283 #if JVET_F0064_MSSSIM 284 Bool m_printMSSSIM; 285 #endif 173 286 Bool m_cabacZeroWordPaddingEnabled; 174 287 Bool m_bClipInputVideoToRec709Range; … … 178 291 #if NH_MV 179 292 std::vector< Profile::Name > m_profiles; 293 294 std::vector<UIProfileName> m_uiProfiles; 295 180 296 std::vector< Level::Tier > m_levelTier; 181 297 std::vector< Level::Name > m_level; 182 298 std::vector< Bool > m_inblFlag; 299 300 IntAry1d m_bitDepthConstraints ; 301 IntAry1d m_tmpConstraintChromaFormats ; 302 std::vector< ChromaFormat > m_chromaFormatConstraints ; 303 BoolAry1d m_intraConstraintFlags ; 304 BoolAry1d m_onePictureOnlyConstraintFlags; 305 BoolAry1d m_lowerBitRateConstraintFlags ; 306 BoolAry1d m_progressiveSourceFlags ; 307 BoolAry1d m_interlacedSourceFlags ; 308 BoolAry1d m_nonPackedConstraintFlags ; 309 BoolAry1d m_frameOnlyConstraintFlags ; 310 183 311 #else 184 312 Profile::Name m_profile; 185 313 Level::Tier m_levelTier; 186 314 Level::Name m_level; 187 #endif188 315 UInt m_bitDepthConstraint; 189 316 ChromaFormat m_chromaFormatConstraint; … … 191 318 Bool m_onePictureOnlyConstraintFlag; 192 319 Bool m_lowerBitRateConstraintFlag; 193 Bool m_progressiveSourceFlag; 194 Bool m_interlacedSourceFlag; 195 Bool m_nonPackedConstraintFlag; 196 Bool m_frameOnlyConstraintFlag; 320 Bool m_progressiveSourceFlag; 321 Bool m_interlacedSourceFlag; 322 Bool m_nonPackedConstraintFlag; 323 Bool m_frameOnlyConstraintFlag; 324 #endif 197 325 198 326 // coding structure … … 204 332 Int m_iDecodingRefreshType; ///< random access type 205 333 Int m_iGOPSize; ///< GOP size of hierarchical structure 334 #if JCTVC_Y0038_PARAMS 335 Bool m_bReWriteParamSetsFlag; ///< Flag to enable rewriting of parameter sets at random access points 336 #endif 206 337 #if NH_MV 207 338 Int m_extraRPSsMvc[MAX_NUM_LAYERS]; ///< extra RPSs added to handle CRA for each layer … … 234 365 // coding quality 235 366 #if NH_MV 367 #if JVET_E0059_FLOATING_POINT_QP_FIX 368 std::vector<Int> m_qpIncrementAtSourceFrame; ///< Optional source frame number at which all subsequent frames are to use an increased internal QP. 369 #else 236 370 std::vector<Double> m_fQP; ///< QP value of key-picture (floating point) for each layer 371 #endif 237 372 std::vector<Int> m_iQP; ///< QP value of key-picture (integer) for each layer 238 373 #else 374 #if JVET_E0059_FLOATING_POINT_QP_FIX 375 OptionalValue<UInt> m_qpIncrementAtSourceFrame; ///< Optional source frame number at which all subsequent frames are to use an increased internal QP. 376 #else 239 377 Double m_fQP; ///< QP value of key-picture (floating point) 378 #endif 240 379 Int m_iQP; ///< QP value of key-picture (integer) 380 #endif 381 #if X0038_LAMBDA_FROM_QP_CAPABILITY 382 Int m_intraQPOffset; ///< QP offset for intra slice (integer) 383 Bool m_lambdaFromQPEnable; ///< enable flag for QP:lambda fix 241 384 #endif 242 385 std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) … … 254 397 Int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default) 255 398 Int m_crQpOffset; ///< Chroma Cr QP Offset (0:default) 256 257 #if W0038_CQP_ADJ 399 WCGChromaQPControl m_wcgChromaQpControl; ///< Wide-colour-gamut chroma QP control. 258 400 UInt m_sliceChromaQpOffsetPeriodicity; ///< Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature. 259 401 Int m_sliceChromaQpOffsetIntraOrPeriodic[2/*Cb,Cr*/]; ///< Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table. 260 #endif 402 LumaLevelToDeltaQPMapping m_lumaLevelToDeltaQPMapping; ///< mapping from luma level to Delta QP. 261 403 #if ADAPTIVE_QP_SELECTION 262 404 Bool m_bUseAdaptQpSelect; … … 282 424 UInt m_uiMaxCUHeight; ///< max. CU height in pixel 283 425 UInt m_uiMaxCUDepth; ///< max. CU depth (as specified by command line) 284 UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 426 #if NH_MV 427 IntAry1d m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 428 #else 429 UInt m_uiMaxTotalCUDepth; ///< max. total CU depth - includes depth of transform-block structure 430 #endif 285 431 UInt m_uiLog2DiffMaxMinCodingBlockSize; ///< difference between largest and smallest CU depth 286 432 … … 293 439 294 440 // coding tools (bit-depth) 441 #if NH_MV 442 IntAry2d m_inputBitDepths ; ///< bit-depth of input file 443 IntAry2d m_outputBitDepths ; ///< bit-depth of output file 444 IntAry2d m_MSBExtendedBitDepths; ///< bit-depth of input samples after MSB extension 445 IntAry2d m_internalBitDepths ; ///< bit-depth codec operates at (input/output files will be converted) 446 #else 295 447 Int m_inputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file 296 448 Int m_outputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file 297 449 Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension 298 450 Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) 451 #endif 452 299 453 Bool m_extendedPrecisionProcessingFlag; 300 454 Bool m_highPrecisionOffsetsEnabledFlag; 301 455 302 456 //coding tools (chroma format) 457 #if NH_MV 458 std::vector<ChromaFormat> m_chromaFormatIDCs; 459 #else 303 460 ChromaFormat m_chromaFormatIDC; 461 #endif 304 462 305 463 // coding tools (PCM bit-depth) … … 317 475 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture 318 476 Bool m_saoCtuBoundary; ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas 319 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP320 477 Bool m_saoResetEncoderStateAfterIRAP; ///< When true, SAO encoder state will be reset following an IRAP. 321 #endif322 478 // coding tools (loop filter) 323 479 #if NH_MV … … 329 485 Int m_loopFilterBetaOffsetDiv2; ///< beta offset for deblocking filter 330 486 Int m_loopFilterTcOffsetDiv2; ///< tc offset for deblocking filter 331 #if W0038_DB_OPT332 487 Int m_deblockingFilterMetric; ///< blockiness metric in encoder 333 #else334 Bool m_DeblockingFilterMetric; ///< blockiness metric in encoder335 #endif336 488 // coding tools (PCM) 337 489 Bool m_usePCM; ///< flag for using IPCM … … 346 498 Bool m_useRDOQ; ///< flag for using RD optimized quantization 347 499 Bool m_useRDOQTS; ///< flag for using RD optimized quantization for transform skip 348 #if T0196_SELECTIVE_RDOQ349 500 Bool m_useSelectiveRDOQ; ///< flag for using selective RDOQ 350 #endif351 501 Int m_rdPenalty; ///< RD-penalty for 32x32 TU for intra in non-intra slices (0: no RD-penalty, 1: RD-penalty, 2: maximum RD-penalty) 352 502 Bool m_bDisableIntraPUsInInterSlices; ///< Flag for disabling intra predicted PUs in inter slices. … … 437 587 Bool m_scalableNestingSEIEnabled; 438 588 Bool m_tmctsSEIEnabled; 589 #if MCTS_ENC_CHECK 590 Bool m_tmctsSEITileConstraint; 591 #endif 439 592 Bool m_timeCodeSEIEnabled; 440 593 Int m_timeCodeSEINumTs; … … 451 604 Int* m_kneeSEIInputKneePoint; 452 605 Int* m_kneeSEIOutputKneePoint; 453 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI454 606 Int m_preferredTransferCharacteristics; 455 #endif 607 UInt m_greenMetadataType; 608 UInt m_xsdMetricType; 456 609 457 610 // weighted prediction … … 464 617 465 618 Int m_TMVPModeId; 466 Bool m_sign HideFlag;619 Bool m_signDataHidingEnabledFlag; 467 620 Bool m_RCEnableRateControl; ///< enable rate control or not 468 621 Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled … … 472 625 Int m_RCInitialQP; ///< inital QP for rate control 473 626 Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not 474 475 #if U0132_TARGET_BITS_SATURATION476 627 Bool m_RCCpbSaturationEnabled; ///< enable target bits saturation to avoid CPB overflow and underflow 477 628 UInt m_RCCpbSize; ///< CPB size 478 629 Double m_RCInitialCpbFullness; ///< initial CPB fullness 479 #endif480 630 481 631 #if KWU_RC_VIEWRC_E0227 … … 490 640 std::string m_scalingListFileName; ///< quantization matrix file name 491 641 492 Bool m_TransquantBypassEnable Flag; ///< transquant_bypass_enable_flag setting in PPS.493 Bool m_CUTransquantBypassFlagForce; ///< if transquant_bypass_enable _flag, then, if true, all CU transquant bypass flags will be set to true.642 Bool m_TransquantBypassEnabledFlag; ///< transquant_bypass_enabled_flag setting in PPS. 643 Bool m_CUTransquantBypassFlagForce; ///< if transquant_bypass_enabled_flag, then, if true, all CU transquant bypass flags will be set to true. 494 644 CostMode m_costMode; ///< Cost mode to use 495 645 … … 537 687 std::string m_summaryPicFilenameBase; ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended. 538 688 UInt m_summaryVerboseness; ///< Specifies the level of the verboseness of the text output. 689 690 #if EXTENSION_360_VIDEO 691 TExt360AppEncCfg m_ext360; 692 friend class TExt360AppEncCfg; 693 friend class TExt360AppEncTop; 694 #endif 695 539 696 #if NH_MV 540 697 Bool m_outputVpsInfo; … … 546 703 Bool m_depth420OutputFlag; ///< Output depth layers in 4:2:0 format 547 704 #endif 705 706 #if NH_3D || NH_3D_VSO 548 707 // Camera parameters 549 #if NH_3D || NH_3D_VSO550 708 TChar* m_pchCameraParameterFile; ///< camera parameter file 551 709 TAppComCamPara m_cCameraData; … … 578 736 #if NH_3D 579 737 Bool m_useDLT; ///< flag for using DLT 580 #endif581 #if NH_3D_QTL582 738 Bool m_bUseQTL; ///< flag for using depth QuadTree Limitation 583 #endif 584 #if NH_3D 739 585 740 BoolAry1d m_ivMvPredFlag; 586 741 BoolAry1d m_ivMvScalingFlag; … … 601 756 // internal member functions 602 757 Void xCheckParameter (); ///< check validity of configuration values 603 Void xPrintParameter (); ///< print configuration values 758 Void xPrintParameter (); ///< print configuration values 759 604 760 Void xPrintUsage (); ///< print usage 605 761 #if NH_MV 762 Void xConfirmRepFormat( const TComVPS& vps); 763 Void xDeriveProfAndConstrFlags( const TComVPS& vps ); 764 Void xCheckProfiles ( const TComVPS& vps ); 765 766 Void xPrintProfiles(); 767 768 template< typename T > 769 Void xConfirmSingleRepFormat(Bool& checkFailed, std::string name, Int curLayer, Int refLayer, T valCur, T valRef ) 770 { 771 if ( valCur != valRef ) 772 { 773 printf("Error: %s of layer %d and its reference layer %d must be equal. \n", name.c_str(), curLayer, refLayer ); 774 checkFailed = true; 775 } 776 } 777 778 GOPEntry* xGetGopEntries( Int layerIdInVps ); 779 GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc ); 606 780 607 781 template<typename T> … … 697 871 Bool parseCfg ( Int argc, TChar* argv[] ); ///< parse configuration file to fill member variables 698 872 873 private: 874 Void xConvertRepFormatParameters( 875 IntAry2d& tmpPad , 876 IntAry2d& tmpInputBitDepth , 877 IntAry2d& tmpOutputBitDepth , 878 IntAry2d& tmpMSBExtendedBitDepth , 879 IntAry2d& tmpInternalBitDepth , 880 IntAry1d& tmpInputChromaFormat , 881 IntAry1d& tmpChromaFormat 882 ); 883 884 Void xGetMaxValuesOfApplicableLayers(const TComVPS& vps, Int vpsPtlIdx, Int& maxBitDepthLuma, Int& maxBitDepthChroma, ChromaFormat& maxChromaFormatIdc, Int& maxNumRefLayers); 699 885 };// END CLASS DEFINITION TAppEncCfg 700 886 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r1405 r1413 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 * … … 47 47 #include "TLibEncoder/AnnexBwrite.h" 48 48 49 #if EXTENSION_360_VIDEO 50 #include "TAppEncHelper360/TExt360AppEncTop.h" 51 #endif 52 49 53 using namespace std; 50 54 … … 57 61 58 62 TAppEncTop::TAppEncTop() 63 #if NH_MV 64 : m_spsMap( MAX_NUM_SPS ), 65 m_ppsMap( MAX_NUM_PPS ) 66 #endif 59 67 { 60 61 68 #if NH_MV 62 69 m_vps = new TComVPS; … … 88 95 89 96 #if NH_3D 90 vps.createCamPars(m_iNumberOfViews); 91 #endif 92 93 #if NH_3D_DLT 94 TComDLT dlt = TComDLT(); 97 vps.createCamPars(m_iNumberOfViews); 95 98 #endif 96 99 … … 140 143 xSetDimensionIdAndLength ( vps ); 141 144 xSetDependencies ( vps ); 142 xSetRepFormat ( vps ); 143 xSet ProfileTierLevel ( vps );144 xSet LayerSets ( vps );145 xSetRepFormat ( vps ); 146 xSetLayerSets ( vps ); 147 xSetProfileTierLevel ( vps ); 145 148 xSetDpbSize ( vps ); 146 149 xSetVPSVUI ( vps ); … … 151 154 m_ivPicLists.setVPS ( &vps ); 152 155 #endif 153 #if NH_3D_DLT 156 #if NH_3D 157 TComDLT dlt = TComDLT(); 154 158 xDeriveDltArray ( vps, &dlt ); 155 159 #endif 160 161 162 xDeriveParameterSetIds( vps ); 163 156 164 if ( m_targetEncLayerIdList.size() == 0 ) 157 165 { … … 182 190 vps.printLayerSets(); 183 191 vps.printPTL(); 192 vps.printRepFormat(); 184 193 } 185 194 … … 188 197 for (Int d = 0; d < 2; d++) 189 198 { 190 m_sps3dExtension.setIvDiMcEnabledFlag ( d, m_ivMvPredFlag[d] );191 m_sps3dExtension.setIvMvScalEnabledFlag ( d, m_ivMvScalingFlag[d] );199 m_sps3dExtension.setIvDiMcEnabledFlag ( d, m_ivMvPredFlag[d] ); 200 m_sps3dExtension.setIvMvScalEnabledFlag ( d, m_ivMvScalingFlag[d] ); 192 201 if (d == 0 ) 193 202 { 194 m_sps3dExtension.setLog2IvmcSubPbSizeMinus3 ( d, m_log2SubPbSizeMinus3 );195 m_sps3dExtension.setIvResPredEnabledFlag 196 m_sps3dExtension.setDepthRefEnabledFlag ( d, m_depthRefinementFlag );197 m_sps3dExtension.setVspMcEnabledFlag ( d, m_viewSynthesisPredFlag );198 m_sps3dExtension.setDbbpEnabledFlag ( d, m_depthBasedBlkPartFlag );203 m_sps3dExtension.setLog2IvmcSubPbSizeMinus3 ( d, m_log2SubPbSizeMinus3 ); 204 m_sps3dExtension.setIvResPredEnabledFlag ( d, m_ivResPredFlag ); 205 m_sps3dExtension.setDepthRefEnabledFlag ( d, m_depthRefinementFlag ); 206 m_sps3dExtension.setVspMcEnabledFlag ( d, m_viewSynthesisPredFlag ); 207 m_sps3dExtension.setDbbpEnabledFlag ( d, m_depthBasedBlkPartFlag ); 199 208 } 200 209 else 201 210 { 202 m_sps3dExtension.setTexMcEnabledFlag 203 m_sps3dExtension.setLog2TexmcSubPbSizeMinus3 ( d, m_log2MpiSubPbSizeMinus3);204 m_sps3dExtension.setIntraContourEnabledFlag 205 m_sps3dExtension.setIntraDcOnlyWedgeEnabledFlag 206 m_sps3dExtension.setCqtCuPartPredEnabledFlag 207 m_sps3dExtension.setInterDcOnlyEnabledFlag 208 m_sps3dExtension.setSkipIntraEnabledFlag ( d, m_depthIntraSkipFlag );211 m_sps3dExtension.setTexMcEnabledFlag ( d, m_mpiFlag ); 212 m_sps3dExtension.setLog2TexmcSubPbSizeMinus3 ( d, m_log2MpiSubPbSizeMinus3); 213 m_sps3dExtension.setIntraContourEnabledFlag ( d, m_intraContourFlag ); 214 m_sps3dExtension.setIntraDcOnlyWedgeEnabledFlag ( d, m_intraSdcFlag || m_intraWedgeFlag ); 215 m_sps3dExtension.setCqtCuPartPredEnabledFlag ( d, m_qtPredFlag ); 216 m_sps3dExtension.setInterDcOnlyEnabledFlag ( d, m_interSdcFlag ); 217 m_sps3dExtension.setSkipIntraEnabledFlag ( d, m_depthIntraSkipFlag ); 209 218 } 210 219 } … … 216 225 { 217 226 m_frameRcvd .push_back(0); 227 #if NH_MV 228 m_acTEncTopList .push_back(new TEncTop( m_spsMap, m_ppsMap ) ); 229 #else 218 230 m_acTEncTopList .push_back(new TEncTop); 231 #endif 219 232 m_acTVideoIOYuvInputFileList.push_back(new TVideoIOYuv); 220 233 m_acTVideoIOYuvReconFileList.push_back(new TVideoIOYuv); … … 261 274 for(Int layerIdInVps = 0; layerIdInVps < m_numberOfLayers; layerIdInVps++) 262 275 { 276 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layerIdInVps]; 263 277 m_cListPicYuvRec .push_back(new TComList<TComPicYuv*>) ; 264 265 #if !NH_MV266 m_ivPicLists.push_back( m_acTEncTopList[ layerIdInVps ]->getListPic() );267 #endif268 269 278 TEncTop& m_cTEncTop = *m_acTEncTopList[ layerIdInVps ]; // It is not a member, but this name helps avoiding code duplication !!! 270 279 271 280 Int layerId = vps.getLayerIdInNuh ( layerIdInVps ); 272 #if NH_MV273 281 m_ivPicLists.getSubDpb( layerId, true ); 274 #endif275 282 276 283 m_cTEncTop.setLayerIdInVps ( layerIdInVps ); … … 278 285 m_cTEncTop.setViewId ( vps.getViewId ( layerId ) ); 279 286 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layerId ) ); 287 m_cTEncTop.setSendParameterSets ( m_sendParameterSets[ layerIdInVps ] ); 288 m_cTEncTop.setParameterSetId ( m_parameterSetId [ layerIdInVps ] ); 280 289 #if NH_3D_VSO || NH_3D 281 290 Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; … … 305 314 #endif // H_3D_VSO 306 315 #if NH_3D 307 #if NH_3D_IC308 316 m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC ); 309 317 m_cTEncTop.setUseICLowLatencyEnc ( m_bUseLowLatencyICEnc ); 310 #endif 311 312 318 313 319 m_cTEncTop.setUseDMM ( isDepth ? m_intraWedgeFlag : false ); 314 320 m_cTEncTop.setUseSDC ( isDepth ? m_intraSdcFlag : false ); 315 321 m_cTEncTop.setUseDLT ( isDepth ? m_useDLT : false ); 316 #endif 317 #if NH_3D_QTL 322 318 323 m_cTEncTop.setUseQTL ( isDepth || isAuxDepth ? m_bUseQTL : false ); 319 #endif 320 #if NH_3D 324 321 325 m_cTEncTop.setSps3dExtension ( m_sps3dExtension ); 322 326 #endif // NH_3D … … 326 330 m_cTEncTop.setVPS(&vps); 327 331 328 #if NH_3D _DLT332 #if NH_3D 329 333 m_cTEncTop.setDLT(dlt); 330 334 #endif 331 335 332 336 #if NH_MV 333 m_cTEncTop.setProfile ( m_profiles[0]); 334 m_cTEncTop.setLevel ( m_levelTier[0], m_level[0] ); 337 // These values go to the SPS of the base layer only and should apply as follows: 338 // If the profile_tier_level( ) syntax structure is included in an active SPS for the base layer 339 // or is the profile_tier_level( ) syntax structure VpsProfileTierLevel[ 0 ], 340 // it applies to the OLS containing all layers in the bitstream but with only the base layer being the output layer. 341 // Otherwise, if the profile_tier_level( ) syntax structure is included in an active SPS 342 // for an independent non-base layer with nuh_layer_id equal to layerId, it applies to the output bitstream 343 // of the independent non-base layer rewriting process of clause F.10.2 with the input variables assignedBaseLayerId equal to layerId and tIdTarget equal to 6. 344 345 m_cTEncTop.setProfile ( m_profiles[0] ); 346 m_cTEncTop.setLevel ( m_levelTier[0], m_level[0] ); 347 m_cTEncTop.setProgressiveSourceFlag ( m_progressiveSourceFlags [0] ); 348 m_cTEncTop.setInterlacedSourceFlag ( m_interlacedSourceFlags [0] ); 349 m_cTEncTop.setNonPackedConstraintFlag ( m_nonPackedConstraintFlags [0] ); 350 m_cTEncTop.setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlags [0] ); 351 m_cTEncTop.setBitDepthConstraintValue ( m_bitDepthConstraints [0] ); 352 m_cTEncTop.setChromaFormatConstraintValue ( m_chromaFormatConstraints [0] ); 353 m_cTEncTop.setIntraConstraintFlag ( m_intraConstraintFlags [0] ); 354 m_cTEncTop.setOnePictureOnlyConstraintFlag ( m_onePictureOnlyConstraintFlags [0] ); 355 m_cTEncTop.setLowerBitRateConstraintFlag ( m_lowerBitRateConstraintFlags [0] ); 335 356 #else 336 357 m_cTEncTop.setProfile ( m_profile); 337 358 m_cTEncTop.setLevel ( m_levelTier, m_level); 338 #endif339 359 m_cTEncTop.setProgressiveSourceFlag ( m_progressiveSourceFlag); 340 360 m_cTEncTop.setInterlacedSourceFlag ( m_interlacedSourceFlag); … … 347 367 m_cTEncTop.setLowerBitRateConstraintFlag ( m_lowerBitRateConstraintFlag ); 348 368 369 #endif 370 349 371 m_cTEncTop.setPrintMSEBasedSequencePSNR ( m_printMSEBasedSequencePSNR); 350 372 m_cTEncTop.setPrintFrameMSE ( m_printFrameMSE); 351 373 m_cTEncTop.setPrintSequenceMSE ( m_printSequenceMSE); 374 #if JVET_F0064_MSSSIM 375 m_cTEncTop.setPrintMSSSIM ( m_printMSSSIM ); 376 #endif 352 377 m_cTEncTop.setCabacZeroWordPaddingEnabled ( m_cabacZeroWordPaddingEnabled ); 353 378 … … 355 380 m_cTEncTop.setFrameSkip ( m_FrameSkip ); 356 381 m_cTEncTop.setTemporalSubsampleRatio ( m_temporalSubsampleRatio ); 382 #if NH_MV 383 m_cTEncTop.setSourceWidth ( m_iSourceWidths [repFormatIdx] ); 384 m_cTEncTop.setSourceHeight ( m_iSourceHeights[repFormatIdx] ); 385 386 m_cTEncTop.setConformanceWindow ( m_confWinLefts[repFormatIdx], m_confWinRights[repFormatIdx], m_confWinTops[repFormatIdx], m_confWinBottoms[repFormatIdx] ); 387 #else 357 388 m_cTEncTop.setSourceWidth ( m_iSourceWidth ); 358 389 m_cTEncTop.setSourceHeight ( m_iSourceHeight ); 359 390 m_cTEncTop.setConformanceWindow ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 391 #endif 360 392 m_cTEncTop.setFramesToBeEncoded ( m_framesToBeEncoded ); 361 393 … … 368 400 m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType ); 369 401 m_cTEncTop.setGOPSize ( m_iGOPSize ); 370 #if NH_MV 371 m_cTEncTop.setGopList ( m_GOPListMvc[layerIdInVps] ); 402 #if JCTVC_Y0038_PARAMS 403 m_cTEncTop.setReWriteParamSetsFlag ( m_bReWriteParamSetsFlag ); 404 #endif 405 #if NH_MV 406 m_cTEncTop.setGopList ( xGetGopEntries(layerIdInVps) ); 372 407 m_cTEncTop.setExtraRPSs ( m_extraRPSsMvc[layerIdInVps] ); 373 408 for(Int i = 0; i < MAX_TLAYER; i++) … … 398 433 #endif 399 434 435 #if X0038_LAMBDA_FROM_QP_CAPABILITY 436 m_cTEncTop.setIntraQPOffset ( m_intraQPOffset ); 437 m_cTEncTop.setLambdaFromQPEnable ( m_lambdaFromQPEnable ); 438 #endif 439 #if NH_MV 440 m_cTEncTop.setPad ( &m_aiPads[ repFormatIdx ][0] ); 441 #else 400 442 m_cTEncTop.setPad ( m_aiPad ); 443 #endif 444 401 445 m_cTEncTop.setAccessUnitDelimiter ( m_AccessUnitDelimiter ); 402 446 #if NH_MV … … 418 462 m_cTEncTop.setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 ); 419 463 m_cTEncTop.setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); 420 #if W0038_DB_OPT421 464 m_cTEncTop.setDeblockingFilterMetric ( m_deblockingFilterMetric ); 422 #else423 m_cTEncTop.setDeblockingFilterMetric ( m_DeblockingFilterMetric );424 #endif425 465 426 466 //====== Motion search ======== … … 444 484 m_cTEncTop.setChromaCbQpOffset ( m_cbQpOffset ); 445 485 m_cTEncTop.setChromaCrQpOffset ( m_crQpOffset ); 446 #if W0038_CQP_ADJ 486 m_cTEncTop.setWCGChromaQpControl ( m_wcgChromaQpControl ); 447 487 m_cTEncTop.setSliceChromaOffsetQpIntraOrPeriodic ( m_sliceChromaQpOffsetPeriodicity, m_sliceChromaQpOffsetIntraOrPeriodic ); 448 #endif 449 450 #if NH_3D 451 m_cTEncTop.setChromaFormatIdc ( isDepth ? CHROMA_400 : m_chromaFormatIDC ); 488 489 #if NH_MV 490 m_cTEncTop.setChromaFormatIdc ( m_chromaFormatIDCs[ repFormatIdx ] ); 452 491 #else 453 492 m_cTEncTop.setChromaFormatIdc ( m_chromaFormatIDC ); … … 466 505 467 506 //====== Tool list ======== 507 m_cTEncTop.setLumaLevelToDeltaQPControls ( m_lumaLevelToDeltaQPMapping ); 508 #if X0038_LAMBDA_FROM_QP_CAPABILITY 509 m_cTEncTop.setDeltaQpRD( (m_costMode==COST_LOSSLESS_CODING) ? 0 : m_uiDeltaQpRD ); 510 #else 468 511 m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD ); 512 #endif 469 513 m_cTEncTop.setFastDeltaQp ( m_bFastDeltaQP ); 470 514 m_cTEncTop.setUseASR ( m_bUseASR ); … … 477 521 m_cTEncTop.setUseRDOQ ( m_useRDOQ ); 478 522 m_cTEncTop.setUseRDOQTS ( m_useRDOQTS ); 479 #if T0196_SELECTIVE_RDOQ480 523 m_cTEncTop.setUseSelectiveRDOQ ( m_useSelectiveRDOQ ); 481 #endif482 524 m_cTEncTop.setRDpenalty ( m_rdPenalty ); 483 525 m_cTEncTop.setMaxCUWidth ( m_uiMaxCUWidth ); 484 526 m_cTEncTop.setMaxCUHeight ( m_uiMaxCUHeight ); 527 #if NH_MV 528 m_cTEncTop.setMaxTotalCUDepth ( m_uiMaxTotalCUDepth[ repFormatIdx] ); 529 #else 485 530 m_cTEncTop.setMaxTotalCUDepth ( m_uiMaxTotalCUDepth ); 531 #endif 486 532 m_cTEncTop.setLog2DiffMaxMinCodingBlockSize ( m_uiLog2DiffMaxMinCodingBlockSize ); 487 533 m_cTEncTop.setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); … … 524 570 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 525 571 { 572 #if NH_MV 573 m_cTEncTop.setBitDepth((ChannelType)channelType, m_internalBitDepths[repFormatIdx][channelType]); 574 m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepths[repFormatIdx][channelType] : m_internalBitDepths[repFormatIdx][channelType]); 575 #else 526 576 m_cTEncTop.setBitDepth((ChannelType)channelType, m_internalBitDepth[channelType]); 527 577 m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[channelType] : m_internalBitDepth[channelType]); 578 #endif 528 579 } 529 580 … … 562 613 563 614 m_cTEncTop.setSaoCtuBoundary ( m_saoCtuBoundary); 564 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP565 615 m_cTEncTop.setSaoResetEncoderStateAfterIRAP ( m_saoResetEncoderStateAfterIRAP); 566 #endif567 616 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 568 617 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); … … 620 669 m_cTEncTop.setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled ); 621 670 m_cTEncTop.setTMCTSSEIEnabled ( m_tmctsSEIEnabled ); 671 #if MCTS_ENC_CHECK 672 m_cTEncTop.setTMCTSSEITileConstraint ( m_tmctsSEITileConstraint ); 673 #endif 622 674 m_cTEncTop.setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled ); 623 675 m_cTEncTop.setNumberOfTimeSets ( m_timeCodeSEINumTs ); … … 639 691 m_cTEncTop.setColourRemapInfoSEIFileRoot ( m_colourRemapSEIFileRoot ); 640 692 m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay ); 641 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI642 693 m_cTEncTop.setSEIAlternativeTransferCharacteristicsSEIEnable ( m_preferredTransferCharacteristics>=0 ); 643 694 m_cTEncTop.setSEIPreferredTransferCharacteristics ( UChar(m_preferredTransferCharacteristics) ); 644 #endif 645 695 m_cTEncTop.setSEIGreenMetadataInfoSEIEnable ( m_greenMetadataType > 0 ); 696 m_cTEncTop.setSEIGreenMetadataType ( UChar(m_greenMetadataType) ); 697 m_cTEncTop.setSEIXSDMetricType ( UChar(m_xsdMetricType) ); 646 698 #if NH_MV 647 699 m_cTEncTop.setSeiMessages ( &m_seiMessages ); … … 667 719 m_cTEncTop.setUseScalingListId ( m_useScalingListId ); 668 720 m_cTEncTop.setScalingListFileName ( m_scalingListFileName ); 669 m_cTEncTop.setSignHideFlag ( m_signHideFlag); 721 m_cTEncTop.setSignDataHidingEnabledFlag ( m_signDataHidingEnabledFlag); 722 670 723 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 671 724 if(!m_cTEncTop.getIsDepth()) //only for texture … … 688 741 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 689 742 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 690 #if U0132_TARGET_BITS_SATURATION691 743 m_cTEncTop.setCpbSaturationEnabled ( m_RCCpbSaturationEnabled ); 692 744 m_cTEncTop.setCpbSize ( m_RCCpbSize ); 693 745 m_cTEncTop.setInitialCpbFullness ( m_RCInitialCpbFullness ); 694 #endif695 746 696 747 #if KWU_RC_MADPRED_E0227 … … 761 812 } 762 813 #endif 763 m_cTEncTop.setTransquantBypassEnable Flag ( m_TransquantBypassEnableFlag );814 m_cTEncTop.setTransquantBypassEnabledFlag ( m_TransquantBypassEnabledFlag ); 764 815 m_cTEncTop.setCUTransquantBypassFlagForceValue ( m_CUTransquantBypassFlagForce ); 765 816 m_cTEncTop.setCostMode ( m_costMode ); … … 812 863 if ( m_uiVSOMode == 4 ) 813 864 { 865 866 for( Int i = 1; i < m_numRepFormats; i++) 867 { 868 if ( m_iSourceWidths[0] != m_iSourceWidths[i] || m_iSourceHeights[0] != m_iSourceHeights[i] ) 869 { 870 std::cout << "Enabling the RM requires equal size of all layers." << std::endl; 871 AOF( false ); 872 } 873 } 874 814 875 #if H_3D_VSO_EARLY_SKIP 815 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth , m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, true, m_bVSOEarlySkip );816 #else 817 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth , m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 , true);876 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidths[0], m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, true, m_bVSOEarlySkip ); 877 #else 878 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidths[0], m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 , true); 818 879 #endif 819 880 for ( Int layer = 0; layer < m_numberOfLayers ; layer++ ) … … 851 912 // initialize global variables 852 913 initROM(); 853 #if NH_3D _DMM914 #if NH_3D 854 915 initWedgeLists( true ); 855 916 #endif … … 857 918 for( Int layer=0; layer < m_numberOfLayers; layer++) 858 919 { 859 m_acTVideoIOYuvInputFileList[layer]->open( m_pchInputFileList[layer], false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 860 m_acTVideoIOYuvInputFileList[layer]->skipFrames( m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC); 920 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layer]; 921 m_acTVideoIOYuvInputFileList[layer]->open( m_pchInputFileList[layer], false, &m_inputBitDepths[repFormatIdx][0], &m_MSBExtendedBitDepths[repFormatIdx][0], &m_internalBitDepths[repFormatIdx][0] ); // read mode 922 m_acTVideoIOYuvInputFileList[layer]->skipFrames( m_FrameSkip, m_iSourceWidths[repFormatIdx] - m_aiPads[repFormatIdx][0], m_iSourceHeights[repFormatIdx] - m_aiPads[repFormatIdx][1], m_InputChromaFormatIDC[repFormatIdx]); 861 923 862 924 if (m_pchReconFileList[layer]) 863 925 { 864 m_acTVideoIOYuvReconFileList[layer]->open( m_pchReconFileList[layer], true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode926 m_acTVideoIOYuvReconFileList[layer]->open( m_pchReconFileList[layer], true, &m_outputBitDepths[repFormatIdx][0], &m_outputBitDepths[repFormatIdx][0], &m_internalBitDepths[repFormatIdx][0]); // write mode 865 927 } 866 928 m_acTEncTopList[layer]->create(); … … 869 931 // Video I/O 870 932 m_cTVideoIOYuvInputFile.open( m_inputFileName, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 871 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_i SourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);933 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_inputFileWidth, m_inputFileHeight, m_InputChromaFormatIDC); 872 934 873 935 if (!m_reconFileName.empty()) … … 949 1011 } 950 1012 951 #if !NH_ 3D1013 #if !NH_MV 952 1014 TComPicYuv* pcPicYuvOrg = new TComPicYuv; 953 1015 #endif … … 958 1020 xCreateLib(); 959 1021 xInitLib(m_isField); 960 1022 #if NH_MV 961 1023 printChromaFormat(); 1024 #endif 962 1025 963 1026 // main encoder loop … … 985 1048 list<AccessUnit> outputAccessUnits; ///< list of access units to write out. is populated by the encoding process 986 1049 987 #if NH_ 3D988 TComPicYuv* picYuvOrg[2];989 TComPicYuv picYuvTrueOrg[2];990 for (Int d = 0; d < 2; d++)991 { 1050 #if NH_MV 1051 std::vector<TComPicYuv*> picYuvOrg ( m_numRepFormats ); 1052 std::vector<TComPicYuv > picYuvTrueOrg( m_numRepFormats ); 1053 for (Int d = 0; d < m_numRepFormats ; d++) 1054 { 992 1055 picYuvOrg[d] = new TComPicYuv; 993 picYuvOrg[d] ->create( m_iSourceWidth , m_isField ? m_iSourceHeightOrg : m_iSourceHeight, ( d > 0 ) ? CHROMA_400 : m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );994 picYuvTrueOrg[d].create( m_iSourceWidth , m_isField ? m_iSourceHeightOrg : m_iSourceHeight, ( d > 0 ) ? CHROMA_400 : m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );1056 picYuvOrg[d] ->create( m_iSourceWidths[d], m_isField ? m_iSourceHeightOrgs[d] : m_iSourceHeights[d], m_chromaFormatIDCs[d], m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth[d], true ); 1057 picYuvTrueOrg[d].create( m_iSourceWidths[d], m_isField ? m_iSourceHeightOrgs[d] : m_iSourceHeights[d], m_chromaFormatIDCs[d], m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth[d], true ); 995 1058 } 996 1059 #else … … 1009 1072 } 1010 1073 #endif 1074 1075 1076 #if EXTENSION_360_VIDEO 1077 TExt360AppEncTop ext360(*this, m_cTEncTop.getGOPEncoder()->getExt360Data(), *(m_cTEncTop.getGOPEncoder()), *pcPicYuvOrg); 1078 #endif 1079 1011 1080 #if NH_MV 1012 1081 while ( (m_targetEncLayerIdList.size() != 0 ) && !allEos ) … … 1014 1083 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 1015 1084 { 1016 #if NH_3D 1017 TComPicYuv* pcPicYuvOrg = picYuvOrg [ m_depthFlag[layer] ]; 1018 TComPicYuv& cPicYuvTrueOrg = picYuvTrueOrg[ m_depthFlag[layer] ]; 1019 #endif 1085 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layer]; 1086 1087 TComPicYuv* pcPicYuvOrg = picYuvOrg [ repFormatIdx ]; 1088 TComPicYuv& cPicYuvTrueOrg = picYuvTrueOrg[ repFormatIdx ]; 1089 1020 1090 if (!xLayerIdInTargetEncLayerIdList( m_vps->getLayerIdInNuh( layer ) )) 1021 1091 { … … 1030 1100 1031 1101 // read input YUV file 1032 m_acTVideoIOYuvInputFileList[layer]->read ( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, m_aiPad, m_InputChromaFormatIDC);1102 m_acTVideoIOYuvInputFileList[layer]->read ( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, &m_aiPads[repFormatIdx][0], m_InputChromaFormatIDC[repFormatIdx] ); 1033 1103 m_acTEncTopList [layer]->initNewPic( pcPicYuvOrg ); 1034 1104 … … 1062 1132 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 1063 1133 { 1064 #if NH_3D 1065 TComPicYuv* pcPicYuvOrg = picYuvOrg [ m_depthFlag[layer] ]; 1066 TComPicYuv& cPicYuvTrueOrg = picYuvTrueOrg[ m_depthFlag[layer] ]; 1134 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layer]; 1135 #if NH_MV 1136 TComPicYuv* pcPicYuvOrg = picYuvOrg [ repFormatIdx ]; 1137 TComPicYuv& cPicYuvTrueOrg = picYuvTrueOrg[ repFormatIdx ]; 1067 1138 #endif 1068 1139 if (!xLayerIdInTargetEncLayerIdList( m_vps->getLayerIdInNuh( layer ) )) … … 1104 1175 // get buffers 1105 1176 xGetBuffer(pcPicYuvRec); 1106 1107 1177 // read input YUV file 1178 #if EXTENSION_360_VIDEO 1179 if (ext360.isEnabled()) 1180 { 1181 ext360.read(m_cTVideoIOYuvInputFile, *pcPicYuvOrg, cPicYuvTrueOrg, ipCSC); 1182 } 1183 else 1184 { 1185 m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range ); 1186 } 1187 #else 1108 1188 m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range ); 1189 #endif 1109 1190 1110 1191 // increase number of received frames … … 1142 1223 if( m_temporalSubsampleRatio > 1 ) 1143 1224 { 1144 m_cTVideoIOYuvInputFile.skipFrames(m_temporalSubsampleRatio-1, m_i SourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);1225 m_cTVideoIOYuvInputFile.skipFrames(m_temporalSubsampleRatio-1, m_inputFileWidth, m_inputFileHeight, m_InputChromaFormatIDC); 1145 1226 } 1146 1227 } … … 1149 1230 #endif 1150 1231 1151 #if NH_ 3D1232 #if NH_MV 1152 1233 // delete original YUV buffer 1153 for (Int d = 0; d < 2; d++)1234 for (Int d = 0; d < m_numRepFormats; d++) 1154 1235 { 1155 1236 picYuvOrg[d]->destroy(); … … 1169 1250 // delete used buffers in encoder class 1170 1251 m_cTEncTop.deletePicBuffer(); 1171 #endif1172 #if !NH_3D1173 1252 cPicYuvTrueOrg.destroy(); 1174 1253 #endif … … 1212 1291 // org. buffer 1213 1292 #if NH_MV 1293 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layer]; 1294 1214 1295 if ( m_cListPicYuvRec[layer]->size() == (UInt)m_iGOPSize ) 1215 1296 { … … 1224 1305 { 1225 1306 rpcPicYuvRec = new TComPicYuv; 1226 #if NH_ 3D1227 rpcPicYuvRec->create( m_iSourceWidth , m_iSourceHeight, m_depthFlag[layer] > 0 ? CHROMA_400 : m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );1307 #if NH_MV 1308 rpcPicYuvRec->create( m_iSourceWidths[ repFormatIdx ], m_iSourceHeights[ repFormatIdx ], m_chromaFormatIDCs[ repFormatIdx ], m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth[repFormatIdx], true ); 1228 1309 #else 1229 1310 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true ); … … 1306 1387 if (m_pchReconFileList[layerIdx]) 1307 1388 { 1389 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layerIdx]; 1308 1390 #if NH_3D 1309 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft , m_confWinRight, m_confWinTop, m_confWinBottom, m_depth420OutputFlag && m_depthFlag[layerIdx ] ? CHROMA_420 : NUM_CHROMA_FORMAT, m_isTopFieldFirst );1310 #else 1311 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft , m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst );1391 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLefts[repFormatIdx], m_confWinRights[repFormatIdx], m_confWinTops[repFormatIdx], m_confWinBottoms[repFormatIdx], m_depth420OutputFlag && m_depthFlag[layerIdx ] ? CHROMA_420 : NUM_CHROMA_FORMAT, m_isTopFieldFirst ); 1392 #else 1393 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLefts[repFormatIdx], m_confWinRights[repFormatIdx], m_confWinTops[repFormatIdx], m_confWinBottoms[repFormatIdx], NUM_CHROMA_FORMAT, m_isTopFieldFirst ); 1312 1394 #endif 1313 1395 } … … 1361 1443 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1362 1444 #if NH_MV 1445 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layerIdx]; 1363 1446 if (m_pchReconFileList[layerIdx]) 1364 1447 { 1365 1448 #if NH_3D 1366 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRec, ipCSC, m_confWinLeft , m_confWinRight, m_confWinTop, m_confWinBottom, m_depth420OutputFlag && m_depthFlag[layerIdx ] ? CHROMA_420 : NUM_CHROMA_FORMAT );1367 #else 1368 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRec, ipCSC, m_confWinLeft , m_confWinRight, m_confWinTop, m_confWinBottom);1449 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRec, ipCSC, m_confWinLefts[repFormatIdx], m_confWinRights[repFormatIdx], m_confWinTops[repFormatIdx], m_confWinBottoms[repFormatIdx], m_depth420OutputFlag && m_depthFlag[layerIdx ] ? CHROMA_420 : NUM_CHROMA_FORMAT ); 1450 #else 1451 m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRec, ipCSC, m_confWinLefts[repFormatIdx], m_confWinRights[repFormatIdx], m_confWinTops[repFormatIdx], m_confWinBottoms[repFormatIdx] ); 1369 1452 #endif 1370 1453 … … 1454 1537 Void TAppEncTop::printChromaFormat() 1455 1538 { 1539 1540 #if NH_MV 1541 std::cout << "Input ChromaFormatIDC : "; 1542 for (Int i = 0; i < m_numRepFormats; i++) 1543 { 1544 1545 1546 switch (m_InputChromaFormatIDC[i]) 1547 #else 1456 1548 std::cout << std::setw(43) << "Input ChromaFormatIDC = "; 1457 1549 switch (m_InputChromaFormatIDC) 1550 #endif 1458 1551 { 1459 1552 case CHROMA_400: std::cout << " 4:0:0"; break; … … 1465 1558 exit(1); 1466 1559 } 1560 #if NH_MV 1561 std::cout << " "; 1562 } 1563 #endif 1564 1467 1565 std::cout << std::endl; 1468 1566 1469 1567 #if NH_MV 1470 for (Int i = 0; i < m_numberOfLayers; i++) 1471 { 1472 std::cout << "Layer " << i << std::setw( 43 - (i > 9 ? 6 : 7) ) << "Internal ChromaFormatIDC = "; 1473 switch (m_acTEncTopList[i]->getChromaFormatIdc()) 1568 std::cout << "Output (internal) ChromaFormatIDC : "; 1569 for (Int i = 0; i < m_numRepFormats; i++) 1570 { 1571 1572 switch ( m_chromaFormatIDCs[i] ) 1474 1573 #else 1475 1574 std::cout << std::setw(43) << "Output (internal) ChromaFormatIDC = "; … … 1486 1585 } 1487 1586 #if NH_MV 1488 std::cout << std::endl;1587 std::cout << " "; 1489 1588 } 1490 1589 #endif … … 1492 1591 } 1493 1592 1494 #if NH_3D _DLT1593 #if NH_3D 1495 1594 Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt) 1496 1595 { 1596 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[layer]; 1597 1497 1598 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 1498 1599 TComPicYuv* pcDepthPicYuvTrueOrg = new TComPicYuv; 1499 1600 // allocate original YUV buffer 1500 pcDepthPicYuvOrg->create( m_iSourceWidth , m_iSourceHeight, CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, false );1501 pcDepthPicYuvTrueOrg->create( m_iSourceWidth , m_iSourceHeight, CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, false );1601 pcDepthPicYuvOrg->create( m_iSourceWidths[ repFormatIdx ], m_iSourceHeights[ repFormatIdx ], CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight , m_uiMaxTotalCUDepth[repFormatIdx], false ); 1602 pcDepthPicYuvTrueOrg->create( m_iSourceWidths[ repFormatIdx ], m_iSourceHeights[ repFormatIdx ], CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth[repFormatIdx], false ); 1502 1603 1503 1604 TVideoIOYuv* depthVideoFile = new TVideoIOYuv; 1504 1605 1505 UInt uiMaxDepthValue = ((1 << m_inputBitDepth [CHANNEL_TYPE_LUMA])-1);1606 UInt uiMaxDepthValue = ((1 << m_inputBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA])-1); 1506 1607 1507 1608 std::vector<Bool> abValidDepths(256, false); 1508 1609 1509 depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth);1610 depthVideoFile->open( m_pchInputFileList[layer], false, &m_inputBitDepths[repFormatIdx][0], &m_MSBExtendedBitDepths[repFormatIdx][0], &m_internalBitDepths[repFormatIdx][0] ); 1510 1611 1511 1612 Int iHeight = pcDepthPicYuvOrg->getHeight(COMPONENT_Y); … … 1515 1616 Pel* pInDM = pcDepthPicYuvOrg->getAddr(COMPONENT_Y); 1516 1617 1618 1517 1619 for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ ) 1518 1620 { 1519 depthVideoFile->read( pcDepthPicYuvOrg, pcDepthPicYuvTrueOrg, IPCOLOURSPACE_UNCHANGED, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range );1621 depthVideoFile->read( pcDepthPicYuvOrg, pcDepthPicYuvTrueOrg, IPCOLOURSPACE_UNCHANGED, &m_aiPads[repFormatIdx][0], m_InputChromaFormatIDC[repFormatIdx], m_bClipInputVideoToRec709Range ); 1520 1622 1521 1623 // check all pixel values … … 1551 1653 } 1552 1654 1553 if( uiNumFrames == 0 || gCeilLog2(iNumDepthValues) == m_inputBitDepth [CHANNEL_TYPE_LUMA] )1655 if( uiNumFrames == 0 || gCeilLog2(iNumDepthValues) == m_inputBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA] ) 1554 1656 { 1555 1657 dlt->setUseDLTFlag(layer, false); … … 1653 1755 for( Int i = 0; i < getGOPSize(); i++ ) 1654 1756 { 1655 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i];1757 GOPEntry geCur = xGetGopEntries(curLayerIdInVps)[i]; 1656 1758 curSubLayersMaxMinus1 = std::max( curSubLayersMaxMinus1, geCur.m_temporalId ); 1657 1759 } … … 1679 1781 for( Int i = 0; i < ( getGOPSize() + 1); i++ ) 1680 1782 { 1681 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][( i < getGOPSize() ? i : MAX_GOP )];1682 GOPEntry geRef = m_GOPListMvc[refLayerIdInVps][( i < getGOPSize() ? i : MAX_GOP )];1783 GOPEntry geCur = xGetGopEntries(curLayerIdInVps)[( i < getGOPSize() ? i : MAX_GOP )]; 1784 GOPEntry geRef = xGetGopEntries(refLayerIdInVps)[( i < getGOPSize() ? i : MAX_GOP )]; 1683 1785 for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++) 1684 1786 { … … 1705 1807 for( Int i = 0; i < ( getGOPSize() + 1); i++ ) 1706 1808 { 1707 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][( i < getGOPSize() ? i : MAX_GOP )];1708 GOPEntry geRef = m_GOPListMvc[refLayerIdInVps][( i < getGOPSize() ? i : MAX_GOP )];1809 GOPEntry geCur = xGetGopEntries(curLayerIdInVps)[( i < getGOPSize() ? i : MAX_GOP )]; 1810 GOPEntry geRef = xGetGopEntries(refLayerIdInVps)[( i < getGOPSize() ? i : MAX_GOP )]; 1709 1811 if ( geCur.m_interCompPredFlag ) 1710 1812 { … … 1719 1821 for( Int i = 0; i < ( getGOPSize() + 1); i++ ) 1720 1822 { 1721 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][( i < getGOPSize() ? i : MAX_GOP )];1722 GOPEntry geRef = m_GOPListMvc[refLayerIdInVps][( i < getGOPSize() ? i : MAX_GOP )];1823 GOPEntry geCur = xGetGopEntries(curLayerIdInVps)[( i < getGOPSize() ? i : MAX_GOP )]; 1824 GOPEntry geRef = xGetGopEntries(refLayerIdInVps)[( i < getGOPSize() ? i : MAX_GOP )]; 1723 1825 1724 1826 if ( geCur.m_interCompPredFlag ) … … 1761 1863 for( Int i = 0; i < ( getGOPSize() + 1) && maxOneActiveRefLayerFlag; i++ ) 1762 1864 { 1763 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ];1865 GOPEntry ge = xGetGopEntries(layerIdInVps)[ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1764 1866 maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numActiveRefLayerPics <= 1); 1765 1867 } … … 1784 1886 for( Int i = 0; i < ( getGOPSize() + 1) && allRefLayersActiveFlag; i++ ) 1785 1887 { 1786 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ];1888 GOPEntry ge = xGetGopEntries(layerIdInVps)[ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1787 1889 Int tId = ge.m_temporalId; // Should be equal for all layers. 1788 1890 … … 1838 1940 1839 1941 1840 GOPEntry* TAppEncTop::xGetGopEntry( Int layerIdInVps, Int poc )1841 {1842 GOPEntry* geFound = NULL;1843 for( Int i = 0; i < ( getGOPSize() + 1) && geFound == NULL ; i++ )1844 {1845 GOPEntry* ge = &(m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]);1846 if ( ge->m_POC == poc )1847 {1848 geFound = ge;1849 }1850 }1851 assert( geFound != NULL );1852 return geFound;1853 }1854 1855 1856 1942 Void TAppEncTop::xSetTimingInfo( TComVPS& vps ) 1857 1943 { … … 1905 1991 { 1906 1992 1993 xDeriveProfAndConstrFlags( vps ); 1994 xCheckProfiles ( vps ); 1995 xPrintProfiles ( ); 1996 1907 1997 // SET PTL 1908 1998 assert( m_profiles.size() == m_level.size() && m_profiles.size() == m_levelTier.size() ); … … 1912 2002 if ( ptlIdx > 1 ) 1913 2003 { 1914 Bool vpsProfilePresentFlag = ( m_profiles[ptlIdx] != m_profiles[ptlIdx - 1] ) 1915 || ( m_inblFlag[ptlIdx ] != m_inblFlag[ptlIdx - 1] ); 2004 Bool vpsProfilePresentFlag = 2005 ( m_profiles [ptlIdx ] != m_profiles [ptlIdx - 1] ) 2006 || ( m_progressiveSourceFlags [ptlIdx ] != m_progressiveSourceFlags [ptlIdx - 1] ) 2007 || ( m_interlacedSourceFlags [ptlIdx ] != m_interlacedSourceFlags [ptlIdx - 1] ) 2008 || ( m_nonPackedConstraintFlags[ptlIdx ] != m_nonPackedConstraintFlags[ptlIdx - 1] ) 2009 || ( m_frameOnlyConstraintFlags[ptlIdx ] != m_frameOnlyConstraintFlags[ptlIdx - 1] ) 2010 || ( m_inblFlag [ptlIdx ] != m_inblFlag [ptlIdx - 1] ); 2011 2012 2013 if ( m_profiles[ ptlIdx ] >= 4 && m_profiles[ ptlIdx ] <= 7 ) 2014 { 2015 2016 vpsProfilePresentFlag = vpsProfilePresentFlag 2017 || ( m_profiles [ptlIdx ] != m_profiles [ptlIdx - 1] ) 2018 || ( m_progressiveSourceFlags [ptlIdx ] != m_progressiveSourceFlags [ptlIdx - 1] ) 2019 || ( m_interlacedSourceFlags [ptlIdx ] != m_interlacedSourceFlags [ptlIdx - 1] ) 2020 || ( m_nonPackedConstraintFlags[ptlIdx ] != m_nonPackedConstraintFlags[ptlIdx - 1] ) 2021 || ( m_frameOnlyConstraintFlags[ptlIdx ] != m_frameOnlyConstraintFlags[ptlIdx - 1] ) 2022 || ( m_inblFlag [ptlIdx ] != m_inblFlag [ptlIdx - 1] ); 2023 2024 } 2025 2026 1916 2027 vps.setVpsProfilePresentFlag( ptlIdx, vpsProfilePresentFlag ); 1917 2028 } 1918 2029 1919 2030 xSetProfileTierLevel( vps, ptlIdx, -1, m_profiles[ptlIdx], m_level[ptlIdx], 1920 m_levelTier[ ptlIdx ], m_progressiveSourceFlag , m_interlacedSourceFlag,1921 m_nonPackedConstraintFlag , m_frameOnlyConstraintFlag, m_inblFlag[ptlIdx] );1922 } 1923 } 1924 1925 Void TAppEncTop::xSetProfileTierLevel(TComVPS& vps, Int p rofileTierLevelIdx, Int subLayer, Profile::Name profile, Level::Name level, Level::Tier tier, Bool progressiveSourceFlag, Bool interlacedSourceFlag, Bool nonPackedConstraintFlag, Bool frameOnlyConstraintFlag, Bool inbldFlag)2031 m_levelTier[ ptlIdx ], m_progressiveSourceFlags[ptlIdx], m_interlacedSourceFlags[ptlIdx], 2032 m_nonPackedConstraintFlags[ptlIdx], m_frameOnlyConstraintFlags[ptlIdx], m_inblFlag[ptlIdx] ); 2033 } 2034 } 2035 2036 Void TAppEncTop::xSetProfileTierLevel(TComVPS& vps, Int ptlIdx, Int subLayer, Profile::Name profile, Level::Name level, Level::Tier tier, Bool progressiveSourceFlag, Bool interlacedSourceFlag, Bool nonPackedConstraintFlag, Bool frameOnlyConstraintFlag, Bool inbldFlag) 1926 2037 { 1927 TComPTL* ptlStruct = vps.getPTL( profileTierLevelIdx ); 2038 2039 TComPTL* ptlStruct = vps.getPTL( ptlIdx ); 1928 2040 assert( ptlStruct != NULL ); 1929 2041 … … 1940 2052 assert( ptl != NULL ); 1941 2053 1942 ptl->setProfileIdc( profile ); 1943 ptl->setTierFlag ( tier ); 1944 ptl->setLevelIdc ( level ); 1945 ptl->setProfileCompatibilityFlag( profile, true ); 1946 ptl->setInbldFlag( inbldFlag ); 1947 1948 switch ( profile ) 1949 { 1950 case Profile::MAIN: 1951 break; 1952 case Profile::MULTIVIEWMAIN: 1953 #if NH_3D 1954 case Profile::MAIN3D: 1955 #endif 1956 ptl->setMax12bitConstraintFlag ( true ); 1957 ptl->setMax12bitConstraintFlag ( true ); 1958 ptl->setMax10bitConstraintFlag ( true ); 1959 ptl->setMax8bitConstraintFlag ( true ); 1960 ptl->setMax422chromaConstraintFlag ( true ); 1961 ptl->setMax420chromaConstraintFlag ( true ); 1962 ptl->setMaxMonochromeConstraintFlag ( false ); 1963 ptl->setIntraConstraintFlag ( false ); 1964 ptl->setOnePictureOnlyConstraintFlag( false ); 1965 ptl->setLowerBitRateConstraintFlag ( true ); 1966 break; 1967 default: 1968 assert( 0 ); // other profiles currently not supported 1969 break; 1970 } 2054 ptl->setProfileIdc ( m_profiles [ ptlIdx ] ); 2055 ptl->setTierFlag ( m_levelTier[ ptlIdx ] ); 2056 ptl->setLevelIdc ( m_level [ ptlIdx ] ); 2057 ptl->setProfileCompatibilityFlag( m_profiles [ ptlIdx ], true ); 2058 ptl->setInbldFlag ( m_inblFlag [ ptlIdx ] ); 2059 2060 Int bitDepth = m_bitDepthConstraints[ptlIdx]; 2061 ChromaFormat chroma = m_chromaFormatConstraints[ptlIdx]; 2062 2063 ptl->setMax12bitConstraintFlag ( bitDepth <= 12 ); 2064 ptl->setMax10bitConstraintFlag ( bitDepth <= 10 ); 2065 ptl->setMax8bitConstraintFlag ( bitDepth <= 8 ); 2066 ptl->setMax422chromaConstraintFlag ( chroma == CHROMA_400 || chroma == CHROMA_420 || chroma == CHROMA_422 ); 2067 ptl->setMax420chromaConstraintFlag ( chroma == CHROMA_400 || chroma == CHROMA_420 ); ; 2068 ptl->setMaxMonochromeConstraintFlag ( chroma == CHROMA_400 ); 2069 ptl->setIntraConstraintFlag ( m_intraConstraintFlags[ ptlIdx ] ); 2070 ptl->setOnePictureOnlyConstraintFlag( m_onePictureOnlyConstraintFlags[ ptlIdx ] ); 2071 ptl->setLowerBitRateConstraintFlag ( m_lowerBitRateConstraintFlags[ ptlIdx ] ); 1971 2072 } 1972 2073 1973 2074 Void TAppEncTop::xSetRepFormat( TComVPS& vps ) 1974 2075 { 1975 1976 Bool anyDepth = false; 1977 #if NH_3D 1978 for ( Int i = 0; i < m_numberOfLayers; i++ ) 1979 { 1980 vps.setVpsRepFormatIdx( i, m_depthFlag[ i ] ? 1 : 0 ); 1981 anyDepth = anyDepth || m_depthFlag[ i ]; 1982 } 1983 #endif 1984 1985 vps.setRepFormatIdxPresentFlag( anyDepth ); 1986 vps.setVpsNumRepFormatsMinus1 ( anyDepth ? 1 : 0 ); 2076 vps.setVpsNumRepFormatsMinus1 ( m_numRepFormats - 1 ); 1987 2077 1988 2078 … … 1991 2081 for ( Int j = 0; j <= vps.getVpsNumRepFormatsMinus1(); j++ ) 1992 2082 { 1993 repFormat[j].setBitDepthVpsChromaMinus8 ( m_internalBitDepth [CHANNEL_TYPE_LUMA ] - 8 );1994 repFormat[j].setBitDepthVpsLumaMinus8 ( m_internalBitDepth [CHANNEL_TYPE_CHROMA] - 8 );1995 repFormat[j].setChromaFormatVpsIdc ( j == 1 ? CHROMA_400 : CHROMA_420);1996 repFormat[j].setPicHeightVpsInLumaSamples ( m_iSourceHeight );1997 repFormat[j].setPicWidthVpsInLumaSamples ( m_iSourceWidth 2083 repFormat[j].setBitDepthVpsChromaMinus8 ( m_internalBitDepths[j][CHANNEL_TYPE_LUMA ] - 8 ); 2084 repFormat[j].setBitDepthVpsLumaMinus8 ( m_internalBitDepths[j][CHANNEL_TYPE_CHROMA] - 8 ); 2085 repFormat[j].setChromaFormatVpsIdc ( m_chromaFormatIDCs[j] ); 2086 repFormat[j].setPicHeightVpsInLumaSamples ( m_iSourceHeights[j] ); 2087 repFormat[j].setPicWidthVpsInLumaSamples ( m_iSourceWidths [j] ); 1998 2088 repFormat[j].setChromaAndBitDepthVpsPresentFlag( true ); 1999 2089 // ToDo not supported yet. … … 2001 2091 2002 2092 repFormat[j].setConformanceWindowVpsFlag( true ); 2003 repFormat[j].setConfWinVpsLeftOffset ( m_confWinLeft 2004 repFormat[j].setConfWinVpsRightOffset ( m_confWinRight / TComSPS::getWinUnitX( repFormat[j].getChromaFormatVpsIdc() ));2005 repFormat[j].setConfWinVpsTopOffset ( m_confWinTop / TComSPS::getWinUnitY( repFormat[j].getChromaFormatVpsIdc() ));2006 repFormat[j].setConfWinVpsBottomOffset ( m_confWinBottom / TComSPS::getWinUnitY( repFormat[j].getChromaFormatVpsIdc() ) );2093 repFormat[j].setConfWinVpsLeftOffset ( m_confWinLefts [j] / TComSPS::getWinUnitX( repFormat[j].getChromaFormatVpsIdc() ) ); 2094 repFormat[j].setConfWinVpsRightOffset ( m_confWinRights [j] / TComSPS::getWinUnitX( repFormat[j].getChromaFormatVpsIdc() ) ); 2095 repFormat[j].setConfWinVpsTopOffset ( m_confWinTops [j] / TComSPS::getWinUnitY( repFormat[j].getChromaFormatVpsIdc() ) ); 2096 repFormat[j].setConfWinVpsBottomOffset ( m_confWinBottoms[j] / TComSPS::getWinUnitY( repFormat[j].getChromaFormatVpsIdc() ) ); 2007 2097 } 2008 2098 2009 2099 vps.setRepFormat( repFormat ); 2100 2101 2102 if ( vps.getVpsNumRepFormatsMinus1() > 0 ) 2103 { 2104 Bool repFormatIdxPresentFlag = false; 2105 for( Int i = vps.getVpsBaseLayerInternalFlag() ? 1 : 0; i <= vps.getMaxLayersMinus1(); i++ ) 2106 { 2107 repFormatIdxPresentFlag = repFormatIdxPresentFlag || ( m_layerIdxInVpsToRepFormatIdx[i] != vps.inferVpsRepFormatIdx( i ) ); 2108 } 2109 vps.setRepFormatIdxPresentFlag( repFormatIdxPresentFlag ); 2110 } 2111 2112 for( Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) 2113 { 2114 // When base_layer_internal_flag is equal to 1, the first repFormatIdx cannot be signaled but is inferred. 2115 if( !vps.getRepFormatIdxPresentFlag() || ( vps.getVpsBaseLayerInternalFlag() && i == 0 ) ) 2116 { 2117 vps.setVpsRepFormatIdx( i, vps.inferVpsRepFormatIdx( i ) ); 2118 AOF( vps.getVpsRepFormatIdx( i ) == m_layerIdxInVpsToRepFormatIdx[i] ); 2119 } 2120 else 2121 { 2122 vps.setVpsRepFormatIdx( i, m_layerIdxInVpsToRepFormatIdx[i] ); 2123 } 2124 } 2125 2126 2127 xConfirmRepFormat( vps ); 2010 2128 2011 2129 } … … 2431 2549 2432 2550 2433 #if NH_3D _DLT2551 #if NH_3D 2434 2552 Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT* dlt ) 2435 2553 { 2554 std::cout << "Analyzing input depth for DLT "; 2436 2555 Int iNumDepthViews = 0; 2437 2556 Bool bDltPresentFlag = false; … … 2449 2568 if( dlt->getUseDLTFlag( layer ) ) 2450 2569 { 2570 std::cout << "."; 2451 2571 xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod[layer], 24), &vps, dlt); 2452 2572 bDltPresentFlag = bDltPresentFlag || dlt->getUseDLTFlag(layer); … … 2523 2643 2524 2644 // bit map branch 2525 uiNumBitsBitMap = 1 << m_inputBitDepth[CHANNEL_TYPE_LUMA]; 2645 Int repFormatIdx = m_layerIdxInVpsToRepFormatIdx[ layer ]; 2646 uiNumBitsBitMap = 1 << m_inputBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA]; 2526 2647 2527 2648 // determine bDltBitMapFlag … … 2529 2650 2530 2651 dlt->setUseBitmapRep(layer, bDltBitMapRepFlag); 2531 } 2652 2653 AOF( m_inputBitDepths[repFormatIdx][CHANNEL_TYPE_LUMA] == m_inputBitDepths[0][CHANNEL_TYPE_LUMA] ) 2654 } 2655 2532 2656 } 2533 2657 2534 2658 dlt->setDltPresentFlag( bDltPresentFlag ); 2535 2659 dlt->setNumDepthViews ( iNumDepthViews ); 2536 dlt->setDepthViewBitDepth( m_inputBitDepth[CHANNEL_TYPE_LUMA] ); 2660 dlt->setDepthViewBitDepth( m_inputBitDepths[CHANNEL_TYPE_LUMA][0] ); 2661 std::cout << " done." << std::endl; 2537 2662 } 2538 2663 #endif -
trunk/source/App/TAppEncoder/TAppEncTop.h
r1405 r1413 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 * … … 73 73 74 74 std::vector<Int> m_frameRcvd; ///< number of received frames 75 76 75 TComPicLists m_ivPicLists; ///< picture buffers of encoder instances 76 77 ParameterSetMap<TComSPS> m_spsMap; 78 ParameterSetMap<TComPPS> m_ppsMap; 79 80 IntAry1d m_parameterSetId; 81 BoolAry1d m_sendParameterSets; 82 83 77 84 #if NH_MV 78 85 TComVPS* m_vps; ///< vps … … 147 154 Void xSetCamPara ( TComVPS& vps ); 148 155 #endif 149 GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc ); 156 157 Void xDeriveParameterSetIds( TComVPS& vps ) 158 { 159 160 m_parameterSetId .clear(); 161 m_sendParameterSets.clear(); 162 163 m_parameterSetId .resize( m_numberOfLayers, -1 ); 164 m_sendParameterSets.resize( m_numberOfLayers, false ); 165 if ( !m_shareParameterSets ) 166 { 167 AOT( m_numberOfLayers > 16 ); 168 for (Int curVpsLayerId = 0; curVpsLayerId < m_numberOfLayers; curVpsLayerId++ ) 169 { 170 m_parameterSetId [curVpsLayerId] = curVpsLayerId; 171 m_sendParameterSets[curVpsLayerId] = true ; 172 } 173 } 174 else 175 { 176 // The spec requires e.g.: 177 // - It is a requirement of bitstream conformance that, when present, the value of chroma_format_idc shall be less than or equal to chroma_format_vps_idc 178 // of the vps_rep_format_idx[ j ]-th rep_format( ) syntax structure in the active VPS, where j is equal to LayerIdxInVps[ layerIdCurr ]. 179 180 // Consequently, a depth layer with chorma format 4:0:0 cannot refer to a base layer SPS with chroma format 4:2:0 181 182 // Furthermore, it is required that 183 // - the SPS RBSP shall have nuh_layer_id equal to 0, nuhLayerId, or IdRefLayer[ nuhLayerId ][ i ] with any value of i in the range of 0 to NumRefLayers[ nuhLayerId ] - 1, inclusive. 184 185 // Because of these requirements and when parameter set sharing is enabled, HTM sends the parameter sets for a current layer in its smallest reference layer having the same representation format. 186 187 188 Int curPsId = 0; 189 190 // Loop all layers 191 for (Int curVpsLayerId = 0; curVpsLayerId < m_numberOfLayers; curVpsLayerId++ ) 192 { 193 // Get smallest reference layer with same rep format idx 194 Int curNuhLayerId = vps.getLayerIdInNuh(curVpsLayerId); 195 Int smallestRefNuhLIdSameRepFmt = curNuhLayerId; 196 197 Int curRepFormatIdx = m_layerIdxInVpsToRepFormatIdx[ curVpsLayerId ]; 198 199 for (Int j = 0; j < vps.getNumRefLayers( curNuhLayerId ); j++ ) 200 { 201 Int refNuhLayerId = vps.getIdRefLayer( curNuhLayerId, j ); 202 Int refVpsLayerId = vps.getLayerIdInVps( refNuhLayerId ); 203 204 if ( smallestRefNuhLIdSameRepFmt > refNuhLayerId && m_layerIdxInVpsToRepFormatIdx[refVpsLayerId] == curRepFormatIdx ) 205 { 206 smallestRefNuhLIdSameRepFmt = refNuhLayerId; 207 } 208 } 209 210 Int smallestRefVpsLIdSameRepFmt = vps.getLayerIdInVps( smallestRefNuhLIdSameRepFmt ); 211 212 if (smallestRefVpsLIdSameRepFmt == curVpsLayerId ) 213 { 214 m_sendParameterSets[ curVpsLayerId ] = true; 215 m_parameterSetId [ curVpsLayerId ] = curPsId; 216 curPsId++; 217 AOT( curPsId > 15 ); 218 } 219 else 220 { 221 AOT( m_parameterSetId [ smallestRefVpsLIdSameRepFmt ] == -1 ); 222 m_parameterSetId [ curVpsLayerId ] = m_parameterSetId [ smallestRefVpsLIdSameRepFmt ]; 223 } 224 225 226 } 227 } 228 } 229 150 230 Int xGetMax( std::vector<Int>& vec); 151 231 Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId ); 152 232 #endif 153 #if NH_3D _DLT233 #if NH_3D 154 234 Void xDeriveDltArray( TComVPS& vps, TComDLT* dlt ); 155 235 Void xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt); … … 165 245 #else 166 246 TEncTop& getTEncTop () { return m_cTEncTop; } ///< return encoder class pointer reference 167 #endif 247 248 #endif 249 private: 250 168 251 };// END CLASS DEFINITION TAppEncTop 169 252 -
trunk/source/App/TAppEncoder/encmain.cpp
r1405 r1413 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 * … … 57 57 fprintf( stdout, "\n" ); 58 58 #if NH_MV 59 fprintf( stdout, "3D-HTM Software: Encoder Version [%s] based on HM Version [%s]", NV_VERSION, HM_VERSION ); 59 #if NH_3D 60 const char* hevcExt = "3D"; 61 #else 62 const char* hevcExt = "MV"; 63 #endif 64 fprintf( stdout, "HTM Software: Encoder Version [%s][%s] based on HM Version [%s]", NV_VERSION, hevcExt , HM_VERSION); 60 65 #else 61 66 fprintf( stdout, "HM software: Encoder Version [%s] (including RExt)", NV_VERSION ); … … 65 70 fprintf( stdout, NVM_BITS ); 66 71 fprintf( stdout, "\n\n" ); 67 72 #if NH_MV 73 fprintf( stdout, "Use the HEVC_EXT define to select between MV- and 3D-HEVC. \n\n" ); 74 #endif 68 75 // create application encoder class 69 76 cTAppEncTop.create(); -
trunk/source/App/utils/BitrateTargeting/ExtractBitrates.cpp
r1405 r1413 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 * -
trunk/source/App/utils/BitrateTargeting/ExtractBitrates.h
r1405 r1413 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 * -
trunk/source/App/utils/BitrateTargeting/ExtractBitratesMain.cpp
r1405 r1413 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 * -
trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.cpp
r1405 r1413 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 * -
trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiers.h
r1405 r1413 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 * -
trunk/source/App/utils/BitrateTargeting/GuessLambdaModifiersMain.cpp
r1405 r1413 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 * -
trunk/source/App/utils/BitrateTargeting/RuntimeError.h
r1405 r1413 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 * -
trunk/source/App/utils/annexBbytecount.cpp
r1405 r1413 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 * -
trunk/source/App/utils/convert_NtoMbit_YCbCr.cpp
r1405 r1413 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 *
Note: See TracChangeset for help on using the changeset viewer.