Changeset 884 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 29 Mar 2014, 18:55:16 (11 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/ContextTables.h
r872 r884 94 94 95 95 #if H_3D_ARP 96 #if MTK_ARP_FLAG_CABAC_SIMP_G006197 96 #define NUM_ARPW_CTX 3 ///< number of context models for weighting factor index used by advanced residual prediction 98 #else99 #define NUM_ARPW_CTX 4 ///< number of context models for weighting factor index used by advanced residual prediction100 #endif101 97 #endif 102 98 103 99 #if H_3D_IC 104 #if MTK_IC_FLAG_CABAC_SIMP_G0061105 100 #define NUM_IC_FLAG_CTX 1 ///< number of context models for illumination compensation flag 106 #else107 #define NUM_IC_FLAG_CTX 3 ///< number of context models for illumination compensation flag108 #endif109 101 #endif 110 102 … … 112 104 113 105 #if H_3D_DIM 114 #if QC_GENERIC_SDC_G0122115 106 #define NUM_DEPTH_INTRA_MODE_CTX 1 ///< number of context models for depth intra modes 116 #else117 #define NUM_DEPTH_INTRA_MODE_CTX 8 ///< number of context models for depth intra modes118 #endif119 107 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (DMM or RBC) 120 108 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or RBC) … … 122 110 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 123 111 #endif 124 #if QC_GENERIC_SDC_G0122125 112 #define NUM_ANGLE_FLAG_CTX 3 126 #if !QC_SDC_UNIFY_G0130127 #define NUM_INTRASDC_FLAG_CTX 3128 #endif129 #endif130 113 #endif 131 114 132 115 #if H_3D_DIM_SDC 133 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 134 #define SDC_NUM_RESIDUAL_CTX 1 135 #endif 136 137 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 138 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 139 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual 140 #define NUM_INTER_SDC_RESIDUAL_CTX 1 ///< number of context models for abs of inter SDC residual 141 #endif 142 143 #if QC_SDC_UNIFY_G0130 116 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 117 #define SDC_NUM_RESIDUAL_CTX 1 144 118 #define NUM_SDC_FLAG_CTX 1 ///< number of context 145 119 #endif … … 366 340 367 341 #if H_3D_ARP 368 #if MTK_ARP_FLAG_CABAC_SIMP_G0061369 342 static const UChar 370 343 INIT_ARPW[3][NUM_ARPW_CTX] = … … 374 347 { 162, 153, 162 }, 375 348 }; 376 #else 377 static const UChar 378 INIT_ARPW[3][NUM_ARPW_CTX] = 379 { 380 { 162, 153, 154, 162 }, 381 { 162, 153, 154, 162 }, 382 { 162, 153, 154, 162 }, 383 }; 384 #endif 349 385 350 #endif 386 351 #if H_3D_IC 387 #if MTK_IC_FLAG_CABAC_SIMP_G0061388 352 static const UChar 389 353 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = … … 393 357 { 154 }, 394 358 }; 395 #else 396 static const UChar 397 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 398 { 399 { 154, 154, 154, }, 400 { 154, 154, 154, }, 401 { 154, 154, 154, }, 402 }; 403 #endif 359 404 360 #endif 405 361 #if H_3D_DIM 406 #if QC_GENERIC_SDC_G0122407 362 static const UChar 408 363 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = … … 412 367 { 154, } 413 368 }; 414 #else 415 static const UChar 416 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = 417 { 418 {0, 0, 64, 168, 168, 124, CNU, 0}, 419 {0, 64, 0, 183, CNU, 108, 0, 0}, 420 {64, 0, CNU, CNU, 168, 109, 0, 0} 421 }; 422 #endif 423 424 #if QC_GENERIC_SDC_G0122 369 425 370 static const UChar 426 371 INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] = … … 430 375 { 155, 170, 157 }, 431 376 }; 432 #if !QC_SDC_UNIFY_G0130433 static const UChar434 INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =435 {436 { 214, 229, 230 },437 { 215, 202, 174 },438 { 213, 201, 246 },439 };440 #endif441 #endif442 377 443 378 static const UChar … … 482 417 #endif 483 418 484 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 485 static const UChar 486 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = 487 { 488 { CNU }, 489 { 154 }, 490 { 154 }, 491 }; 492 493 static const UChar 494 INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] = 495 { 496 { CNU }, 497 { 154 }, 498 { 154 }, 499 }; 500 501 static const UChar 502 INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] = 503 { 504 { CNU }, 505 { 154 }, 506 { 154 }, 507 }; 508 #endif 419 509 420 //! \} 510 #if QC_SDC_UNIFY_G0130421 #if H_3D_DIM_SDC 511 422 static const UChar 512 423 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = -
trunk/source/Lib/TLibCommon/SEI.h
r872 r884 72 72 SCALABLE_NESTING = 133, 73 73 REGION_REFRESH_INFO = 134, 74 #if H_MV _HLS_7_SEI_P0204_2674 #if H_MV 75 75 SUB_BITSTREAM_PROPERTY = 139, // Final PayloadType to be defined after finalization 76 76 #endif … … 366 366 }; 367 367 368 #if H_MV _HLS_7_SEI_P0204_26368 #if H_MV 369 369 class SEISubBitstreamProperty : public SEI 370 370 { -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r872 r884 123 123 #if H_3D_DIM_SDC 124 124 m_pbSDCFlag = NULL; 125 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101126 for( Int i = 0; i < 4; i++ )127 {128 m_apSegmentDCOffset[i] = NULL;129 }130 #else131 125 m_apSegmentDCOffset[0] = NULL; 132 126 m_apSegmentDCOffset[1] = NULL; 133 #endif134 127 #endif 135 128 #endif … … 153 146 #endif 154 147 #if H_3D_INTER_SDC 155 #if !QC_SDC_UNIFY_G0130156 m_pbInterSDCFlag = NULL;157 for( Int i = 0; i < 4; i++ )158 {159 m_apSegmentInterDCOffset[i] = NULL;160 }161 #endif162 #if !SEC_INTER_SDC_G0101163 m_pucInterSDCMask = NULL;164 #endif165 148 #endif 166 149 #if H_3D_DBBP … … 168 151 #endif 169 152 170 #if MTK_DDD_G0063153 #if H_3D_DDD 171 154 m_pucDisparityDerivedDepth = NULL; 172 155 m_pbUseDDD = NULL; … … 291 274 #if H_3D_DIM_SDC 292 275 m_pbSDCFlag = (Bool*)xMalloc(Bool, uiNumPartition); 293 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101294 for( Int i = 0; i < 4; i++ )295 {296 m_apSegmentDCOffset[i] = (Pel*)xMalloc(Pel, uiNumPartition);297 }298 #else299 276 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 300 277 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 301 278 #endif 302 279 #endif 303 #endif304 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130305 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition);306 for( Int i = 0; i < 4; i++ )307 {308 m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition);309 }310 #endif311 280 #if H_3D_DBBP 312 281 m_pbDBBPFlag = (Bool* )xMalloc(Bool, uiNumPartition); … … 318 287 m_acCUMvField[1].setNumPartition(uiNumPartition ); 319 288 } 320 #if !SEC_INTER_SDC_G0101321 #if H_3D_INTER_SDC322 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth);323 #endif324 #endif325 289 m_sliceStartCU = (UInt* )xMalloc(UInt, uiNumPartition); 326 290 m_sliceSegmentStartCU = (UInt* )xMalloc(UInt, uiNumPartition); … … 329 293 m_pcPattern = (TComPattern*)xMalloc(TComPattern, 1); 330 294 331 #if MTK_DDD_G0063295 #if H_3D_DDD 332 296 m_pucDisparityDerivedDepth = (UChar* )xMalloc( UChar, uiNumPartition); 333 297 m_pbUseDDD = (Bool* ) xMalloc( Bool, uiNumPartition); … … 413 377 #endif 414 378 415 #if MTK_DDD_G0063379 #if H_3D_DDD 416 380 if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth); m_pucDisparityDerivedDepth = NULL; } 417 381 if ( m_pbUseDDD ) { xFree(m_pbUseDDD); m_pbUseDDD = NULL; } … … 441 405 #if H_3D_DIM_SDC 442 406 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 443 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101444 for( Int i = 0; i < 4; i++ )445 {446 if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]); m_apSegmentDCOffset[i] = NULL; }447 }448 #else449 407 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 450 408 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 451 #endif452 409 #endif 453 410 #endif 454 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130455 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; }456 for(Int i = 0; i < 4; i++ )457 {458 if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }459 }460 #endif461 411 #if H_3D_DBBP 462 412 if ( m_pbDBBPFlag ) { xFree(m_pbDBBPFlag); m_pbDBBPFlag = NULL; } 463 413 #endif 464 414 } 465 #if !SEC_INTER_SDC_G0101466 #if H_3D_INTER_SDC467 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; }468 #endif469 #endif470 415 m_pcCUAboveLeft = NULL; 471 416 m_pcCUAboveRight = NULL; … … 560 505 #endif 561 506 562 #if MTK_DDD_G0063507 #if H_3D_DDD 563 508 m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui]; 564 509 m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui]; … … 593 538 #if H_3D_DIM_SDC 594 539 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 595 #endif596 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130597 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];598 540 #endif 599 541 #if H_3D_DBBP … … 646 588 #endif 647 589 648 #if MTK_DDD_G0063590 #if H_3D_DDD 649 591 memset( m_pucDisparityDerivedDepth + firstElement, 0, numElements * sizeof( *m_pucDisparityDerivedDepth ) ); 650 592 memset( m_pbUseDDD + firstElement, 0, numElements * sizeof( *m_pbUseDDD ) ); … … 665 607 #if H_3D_DIM_SDC 666 608 memset( m_pbSDCFlag + firstElement, 0, numElements * sizeof( *m_pbSDCFlag ) ); 667 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101668 for( Int i = 0; i < 4; i++ )669 {670 memset( m_apSegmentDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[i] ) );671 }672 #else673 609 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 674 610 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 675 611 #endif 676 #endif677 #endif678 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130679 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) );680 for( Int i = 0; i < 4; i++ )681 {682 memset( m_apSegmentInterDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );683 }684 612 #endif 685 613 #if H_3D_DBBP … … 834 762 #endif 835 763 836 #if MTK_DDD_G0063764 #if H_3D_DDD 837 765 m_pucDisparityDerivedDepth[ui] = 0; 838 766 m_pbUseDDD[ui] = 0; … … 853 781 #if H_3D_DIM_SDC 854 782 m_pbSDCFlag [ui] = false; 855 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101856 for( Int i = 0; i < 4; i++ )857 {858 m_apSegmentDCOffset[i][ui] = 0;859 }860 #else861 783 m_apSegmentDCOffset[0][ui] = 0; 862 784 m_apSegmentDCOffset[1][ui] = 0; 863 785 #endif 864 #endif865 #endif866 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130867 m_pbInterSDCFlag[ui] = false;868 for( Int i = 0; i < 4; i++ )869 {870 m_apSegmentInterDCOffset[i][ui] = 0;871 }872 786 #endif 873 787 #if H_3D_DBBP … … 955 869 #endif 956 870 957 #if MTK_DDD_G0063871 #if H_3D_DDD 958 872 memset( m_pucDisparityDerivedDepth, 0, iSizeInUchar ); 959 873 memset( m_pbUseDDD, 0, iSizeInBool ); … … 982 896 #if H_3D_DIM_SDC 983 897 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 984 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101985 for( Int i = 0; i < 4; i++ )986 {987 memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition );988 }989 #else990 898 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 991 899 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 992 900 #endif 993 #endif994 #endif995 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130996 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition );997 for( Int i = 0; i < 4; i++ )998 {999 memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );1000 }1001 901 #endif 1002 902 #if H_3D_DBBP … … 1056 956 #endif 1057 957 1058 #if MTK_DDD_G0063958 #if H_3D_DDD 1059 959 m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui]; 1060 960 m_pbUseDDD[ui] = pcCU->m_pbUseDDD[uiPartOffset+ui]; … … 1075 975 #if H_3D_DIM_SDC 1076 976 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 1077 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011078 for( Int i = 0; i < 4; i++ )1079 {1080 m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ];1081 }1082 #else1083 977 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 1084 978 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 1085 979 #endif 1086 #endif1087 #endif1088 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301089 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ];1090 for( Int i = 0; i < 4; i++ )1091 {1092 m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ];1093 }1094 980 #endif 1095 981 #if H_3D_DBBP … … 1216 1102 #endif 1217 1103 1218 #if MTK_DDD_G00631104 #if H_3D_DDD 1219 1105 m_pucDisparityDerivedDepth = pcCU->getDDDepth() + uiPart; 1220 1106 m_pbUseDDD = pcCU->getUseDDD() + uiPart; … … 1246 1132 #if H_3D_DIM_SDC 1247 1133 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1248 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011249 for( Int i = 0; i < 4; i++ )1250 {1251 m_apSegmentDCOffset[i] = pcCU->getSDCSegmentDCOffset(i) + uiPart;1252 }1253 #else1254 1134 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1255 1135 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1256 #endif1257 1136 #endif 1258 1137 #endif 1259 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301260 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart;1261 for( Int i = 0; i < 4; i++ )1262 {1263 m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart;1264 }1265 #endif1266 1138 #if H_3D_DBBP 1267 1139 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiPart; … … 1380 1252 #endif 1381 1253 1382 #if MTK_DDD_G00631254 #if H_3D_DDD 1383 1255 m_pucDisparityDerivedDepth = pcCU->getDDDepth() + uiAbsPartIdx; 1384 1256 m_pbUseDDD = pcCU->getUseDDD() + uiAbsPartIdx; … … 1445 1317 memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar ); 1446 1318 1447 #if MTK_DDD_G00631319 #if H_3D_DDD 1448 1320 memcpy( m_pucDisparityDerivedDepth + uiOffset, pcCU->getDDDepth(), iSizeInUchar ); 1449 1321 memcpy( m_pbUseDDD + uiOffset, pcCU->getUseDDD(), iSizeInBool ); … … 1465 1337 #if H_3D_DIM_SDC 1466 1338 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), iSizeInBool ); 1467 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011468 for( Int i = 0; i < 4; i++ )1469 {1470 memcpy( m_apSegmentDCOffset[i] + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition);1471 }1472 #else1473 1339 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1474 1340 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1475 1341 #endif 1476 #endif1477 #endif1478 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301479 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool );1480 for( Int i = 0; i < 4; i++ )1481 {1482 memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition);1483 }1484 1342 #endif 1485 1343 #if H_3D_DBBP … … 1559 1417 #endif 1560 1418 1561 #if MTK_DDD_G00631419 #if H_3D_DDD 1562 1420 memcpy( rpcCU->getDDDepth() + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth, iSizeInUchar ); 1563 1421 memcpy( rpcCU->getUseDDD() + m_uiAbsIdxInLCU, m_pbUseDDD, iSizeInBool ); … … 1602 1460 #if H_3D_DIM_SDC 1603 1461 memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag, iSizeInBool ); 1604 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011605 for( Int i = 0; i < 4; i++ )1606 {1607 memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition);1608 }1609 #else1610 1462 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1611 1463 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1612 1464 #endif 1613 #endif1614 #endif1615 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301616 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool );1617 for( Int i = 0;i < 4; i++ )1618 {1619 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition);1620 }1621 1465 #endif 1622 1466 #if H_3D_DBBP … … 1707 1551 memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar ); 1708 1552 1709 #if MTK_DDD_G00631553 #if H_3D_DDD 1710 1554 memcpy( rpcCU->getDDDepth() + uiPartOffset, m_pucDisparityDerivedDepth, iSizeInUchar ); 1711 1555 memcpy( rpcCU->getUseDDD() + uiPartOffset, m_pbUseDDD, iSizeInBool ); … … 1726 1570 #if H_3D_DIM_SDC 1727 1571 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1728 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011729 for( Int i = 0; i < 4; i++ )1730 {1731 memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart);1732 }1733 #else1734 1572 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1735 1573 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1736 1574 #endif 1737 #endif1738 #endif1739 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301740 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool );1741 for( Int i = 0; i < 4; i++ )1742 {1743 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart);1744 }1745 1575 #endif 1746 1576 #if H_3D_DBBP … … 1791 1621 } 1792 1622 1793 #if MTK_DDD_G00631623 #if H_3D_DDD 1794 1624 Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1795 1625 { … … 2463 2293 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2464 2294 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 2465 2466 #if !MTK_ARP_FLAG_CABAC_SIMP_G0061 2467 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2468 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 2469 #endif 2470 return uiCtx; 2471 } 2472 #endif 2473 #if !MTK_IC_FLAG_CABAC_SIMP_G0061 2474 #if H_3D_IC 2475 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) 2476 { 2477 UInt uiCtx = 0; 2478 2479 TComDataCU* pcTempCU = NULL; 2480 UInt uiTempPartIdx = 0; 2481 2482 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2483 uiCtx = ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0; 2484 2485 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2486 uiCtx += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0; 2487 2488 return uiCtx; 2489 } 2490 #endif 2295 return uiCtx; 2296 } 2491 2297 #endif 2492 2298 #if H_3D_DBBP … … 2569 2375 #endif 2570 2376 2571 #if H_3D_INTER_SDC 2572 #if !QC_SDC_UNIFY_G0130 2573 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2574 { 2575 setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2576 } 2577 2578 UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx ) 2377 #if H_3D_DIM_SDC 2378 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2579 2379 { 2580 2380 return 0; 2581 }2582 #endif2583 2584 #if !SEC_INTER_SDC_G01012585 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )2586 {2587 UInt uiWidth = pcCU->getWidth ( 0 );2588 UInt uiHeight = pcCU->getHeight( 0 );2589 UInt uiPartitionSize = pcCU->getPartitionSize( 0 );2590 UInt uiXOffset = 0, uiYOffset = 0;2591 2592 switch( uiPartitionSize )2593 {2594 case SIZE_2NxN:2595 uiXOffset = uiWidth; uiYOffset = uiHeight >> 1; break;2596 case SIZE_2NxnU:2597 uiXOffset = uiWidth; uiYOffset = uiHeight >> 2; break;2598 case SIZE_2NxnD:2599 uiXOffset = uiWidth; uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 ); break;2600 case SIZE_Nx2N:2601 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break;2602 case SIZE_nLx2N:2603 uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break;2604 case SIZE_nRx2N:2605 uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break;2606 case SIZE_NxN:2607 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1; break;2608 default:2609 assert( uiPartitionSize == SIZE_2Nx2N );2610 uiXOffset = uiWidth; uiYOffset = uiHeight; break;2611 }2612 2613 UInt uiPelX, uiPelY;2614 2615 memset( pMask, 0, uiWidth*uiHeight );2616 2617 //mask2618 if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU )2619 {2620 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )2621 {2622 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )2623 {2624 pMask[uiPelX + uiPelY*uiWidth] = 0;2625 }2626 }2627 2628 for( ; uiPelY < uiHeight; uiPelY++ )2629 {2630 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )2631 {2632 pMask[uiPelX + uiPelY*uiWidth] = 1;2633 }2634 }2635 }2636 else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N )2637 {2638 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )2639 {2640 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )2641 {2642 pMask[uiPelX + uiPelY*uiWidth] = 0;2643 }2644 2645 for( ; uiPelX < uiWidth; uiPelX++ )2646 {2647 pMask[uiPelX + uiPelY*uiWidth] = 1;2648 }2649 }2650 }2651 else if( uiPartitionSize == SIZE_NxN )2652 {2653 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )2654 {2655 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )2656 {2657 pMask[uiPelX + uiPelY*uiWidth] = 0;2658 }2659 2660 for( ; uiPelX < uiWidth; uiPelX++ )2661 {2662 pMask[uiPelX + uiPelY*uiWidth] = 1;2663 }2664 }2665 2666 for( ; uiPelY < uiHeight; uiPelY++ )2667 {2668 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )2669 {2670 pMask[uiPelX + uiPelY*uiWidth] = 2;2671 }2672 2673 for( ; uiPelX < uiWidth; uiPelX++ )2674 {2675 pMask[uiPelX + uiPelY*uiWidth] = 3;2676 }2677 }2678 }2679 2680 }2681 #endif2682 #endif2683 2684 #if QC_GENERIC_SDC_G01222685 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )2686 {2687 #if QC_SDC_UNIFY_G01302688 return 0;2689 #else2690 TComDataCU* pcTempCU;2691 UInt uiTempPartIdx;2692 UInt uiCtx = 0;2693 2694 // Get BCBP of left PU2695 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );2696 uiCtx = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;2697 2698 // Get BCBP of above PU2699 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );2700 uiCtx += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;2701 2702 return uiCtx;2703 #endif2704 2381 } 2705 2382 … … 2947 2624 // check general CU information 2948 2625 if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 2626 { 2949 2627 return false; 2950 #if QC_GENERIC_SDC_G0122 2628 } 2629 2951 2630 if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) ) 2952 2631 { … … 2960 2639 2961 2640 return false; 2962 #endif2963 2641 // check prediction mode 2964 2642 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); … … 3582 3260 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 3583 3261 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ) 3584 { 3585 #if MTK_NBDV_IVREF_FIX_G0067 3262 { 3586 3263 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1) 3587 #else3588 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )3589 #endif3590 3264 { 3591 3265 return false; … … 3594 3268 Int refViewIdx = pDInfo->m_aVIdxCan; 3595 3269 TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx ); 3596 3270 3597 3271 if( picDepth == NULL ) // No depth reference avail 3598 3272 { … … 3602 3276 3603 3277 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 3604 3278 3605 3279 Bool refViewAvailFlag = false; 3606 3280 UChar predFlag[2] = {0, 0}; 3607 #if !MTK_RBIP_VSP_G0069 3608 Int refListIdY = 0; 3609 Int viewIdInRefListX = -1; 3610 #endif 3611 3281 3612 3282 for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) 3613 3283 { … … 3620 3290 refViewAvailFlag = true; 3621 3291 predFlag[iRefListIdX] = 1; 3622 #if !MTK_RBIP_VSP_G00693623 viewIdInRefListX = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId();3624 refListIdY = 1 - iRefListIdX;3625 #endif3626 3292 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i ); 3627 3293 #if H_3D_NBDV … … 3631 3297 } 3632 3298 } 3633 3634 #if !MTK_RBIP_VSP_G00693635 if (m_pcSlice->isInterB() && refViewAvailFlag)3636 {3637 RefPicList eRefPicListY = RefPicList( refListIdY );3638 refViewAvailFlag = false;3639 for ( Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicListY) && !refViewAvailFlag; i++ )3640 {3641 Int viewIdxRefInListY = m_pcSlice->getRefPic(eRefPicListY, i)->getViewIndex();3642 if ( viewIdxRefInListY != refViewIdx && viewIdxRefInListY != m_pcSlice->getViewIndex() )3643 {3644 refViewAvailFlag = true;3645 predFlag[refListIdY] = 1;3646 TComMv cMv = pDInfo->m_acNBDV;3647 3648 Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId();3649 Int currViewId = m_pcSlice->getViewId();3650 3651 //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed):3652 // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx );3653 3654 Int iScale = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX );3655 3656 // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX.3657 if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() )3658 {3659 cMv = cMv.scaleMv( iScale );3660 }3661 else3662 {3663 3664 cMv = cMv;3665 }3666 clipMv( cMv );3667 pcMvFieldNeighbours[(iCount<<1)+refListIdY].setMvField( cMv, i );3668 #if H_3D_NBDV3669 pcMvFieldNeighbours[(iCount<<1)+refListIdY].getMv().setIDVFlag (false);3670 #endif3671 }3672 }3673 }3674 #endif3675 3299 3676 3300 // Set values to be returned … … 3791 3415 for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ ) 3792 3416 { 3793 #if NTT_STORE_SPDV_VSP_G01483794 3417 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) ) 3795 #else3796 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )3797 #endif3798 3418 { 3799 3419 continue; … … 4227 3847 UChar tmpDir; 4228 3848 4229 #if MTK_DDD_G00633849 #if H_3D_DDD 4230 3850 m_iUseDDDCandIdx = -1; 4231 3851 #endif … … 4311 3931 iPosLeftAbove[0] = numA1B1B0; 4312 3932 #if H_3D_VSP 4313 #if NTT_STORE_SPDV_VSP_G01484314 3933 if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 4315 #else4316 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 14317 #endif4318 3934 #if H_3D_IC 4319 3935 && !bICFlag … … 4338 3954 iPosLeftAbove[1] = numA1B1B0; 4339 3955 #if H_3D_VSP 4340 #if NTT_STORE_SPDV_VSP_G01484341 3956 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0) 4342 #else4343 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)4344 #endif4345 3957 #if H_3D_IC 4346 3958 && !bICFlag … … 4365 3977 { 4366 3978 #if H_3D_VSP 4367 #if NTT_STORE_SPDV_VSP_G01484368 3979 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0) 4369 #else4370 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)4371 #endif4372 3980 #if H_3D_IC 4373 3981 && !bICFlag … … 4390 3998 { 4391 3999 #if H_3D_VSP 4392 #if NTT_STORE_SPDV_VSP_G01484393 4000 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0 4394 #else4395 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 14396 #endif4397 4001 #if H_3D_IC 4398 4002 && !bICFlag … … 4417 4021 { 4418 4022 #if H_3D_VSP 4419 #if NTT_STORE_SPDV_VSP_G01484420 4023 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0) 4421 #else4422 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)4423 #endif4424 4024 #if H_3D_IC 4425 4025 && !bICFlag … … 4449 4049 if( bMPIFlag) 4450 4050 { 4451 #if QC_SPIVMP_MPI_G01194452 4051 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4453 4052 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); … … 4556 4155 } 4557 4156 #endif 4558 #else 4559 UInt uiPartIdxCenter; 4560 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4561 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4562 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4563 Int tRef[2]={-1, -1}; 4564 4565 #if H_3D_FCO 4566 TComPic * pcTexturePic = m_pcSlice->getTexturePic(); 4567 TComDataCU *pcTextureCU = 0; 4568 if ( pcTexturePic ) 4569 pcTextureCU = pcTexturePic->getCU( getAddr() ); 4570 #else 4571 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4572 #endif 4573 4574 #if H_3D_FCO 4575 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 4576 #else 4577 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 4578 #endif 4579 { 4580 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] ); 4581 tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() ); 4582 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4583 { 4584 TComMv cMvPred = tmpMV[0].getMv(); 4585 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4586 cMvPred+=cAdd; 4587 cMvPred>>=2; 4588 clipMv(cMvPred); 4589 tmpMV[0].setMvField(cMvPred,tRef[0]); 4590 } 4591 if ( getSlice()->isInterB() ) 4592 { 4593 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, tmpMV[1] ); 4594 tRef[1] = getPic()->isTextRefValid( REF_PIC_LIST_1, tmpMV[1].getRefIdx() ); 4595 if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) ) 4157 if( tmpDir != 0 ) 4158 { 4159 Int iCnloop = 0; 4160 Bool bRemoveSpa = false; //pruning 4161 4162 for(Int i = 0; i < 2; i ++) 4163 { 4164 iCnloop = iPosLeftAbove[i]; 4165 if ( iCnloop == -1 ) 4596 4166 { 4597 TComMv cMvPred = tmpMV[1].getMv(); 4598 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4599 cMvPred+=cAdd; 4600 cMvPred>>=2; 4601 clipMv(cMvPred); 4602 tmpMV[1].setMvField(cMvPred,tRef[1]); 4167 continue; 4603 4168 } 4604 } 4605 4606 tmpDir = 0; 4607 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4608 { 4609 tmpDir += ((tmpMV[0].getRefIdx()>=0)?1:0); 4610 } 4611 if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) ) 4612 { 4613 tmpDir += ((tmpMV[1].getRefIdx()>=0)?2:0); 4614 } 4615 #endif 4616 if( tmpDir != 0 ) 4617 { 4618 Int iCnloop = 0; 4619 Bool bRemoveSpa = false; //pruning 4620 4621 for(Int i = 0; i < 2; i ++) 4169 if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1]) 4622 4170 { 4623 iCnloop = iPosLeftAbove[i]; 4624 if ( iCnloop == -1 ) 4171 bRemoveSpa = true; 4172 break; 4173 } 4174 } 4175 4176 if (!bRemoveSpa) 4177 { 4178 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4179 } 4180 else 4181 { 4182 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV); 4183 if (iCnloop<numA1B1B0) 4184 { 4185 numA1B1B0--; 4186 } 4187 iCountHEVC--; 4188 4189 if (iPosLeftAbove[0] != -1) 4190 { 4191 if (iCnloop == iPosLeftAbove[0]) 4625 4192 { 4626 continue;4193 iPosLeftAbove[0] = -1; 4627 4194 } 4628 if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])4195 else 4629 4196 { 4630 bRemoveSpa = true; 4631 break; 4632 } 4197 iPosLeftAbove[0]++; 4198 } 4633 4199 } 4634 4635 if (!bRemoveSpa) 4200 if (iPosLeftAbove[1] != -1) 4636 4201 { 4637 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4638 } 4639 else 4640 { 4641 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV); 4642 if (iCnloop<numA1B1B0) 4202 if (iCnloop == iPosLeftAbove[1]) 4643 4203 { 4644 numA1B1B0--;4204 iPosLeftAbove[1] = -1; 4645 4205 } 4646 iCountHEVC--; 4647 4648 if (iPosLeftAbove[0] != -1) 4206 else 4649 4207 { 4650 if (iCnloop == iPosLeftAbove[0])4208 if (iCnloop > iPosLeftAbove[1]) 4651 4209 { 4652 iPosLeftAbove[0] = -1; 4653 } 4654 else 4655 { 4656 iPosLeftAbove[0]++; 4657 } 4658 } 4659 if (iPosLeftAbove[1] != -1) 4660 { 4661 if (iCnloop == iPosLeftAbove[1]) 4662 { 4663 iPosLeftAbove[1] = -1; 4664 } 4665 else 4666 { 4667 if (iCnloop > iPosLeftAbove[1]) 4668 { 4669 iPosLeftAbove[1]++; 4670 } 4210 iPosLeftAbove[1]++; 4671 4211 } 4672 4212 } 4673 4213 } 4674 #if QC_SPIVMP_MPI_G0119 4675 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx()); 4676 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx()); 4677 #else 4678 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4214 } 4215 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx()); 4216 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx()); 4217 4218 puhInterDirNeighbours[iCount] = tmpDir; 4219 4220 if ( mrgCandIdx == iCount ) 4221 { 4222 return; 4223 } 4224 iCount ++; 4225 } 4226 } 4227 #if H_3D_DDD 4228 if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0 && bMPIFlag ) 4229 { 4230 UInt uiPartIdx; 4231 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4232 TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 4233 4234 4235 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4236 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4237 tmpDir = 0; 4238 4239 xDeriveCenterIdx( uiPUIdx, uiPartIdx); 4240 4241 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) ) 4242 { 4243 4244 TComMvField cMVField; 4245 Int iDV = 0; 4246 Int iViewIdx = 0; 4247 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField ); 4248 if( cMVField.getRefIdx() >= 0 ) 4249 { 4250 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4679 4251 { 4680 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tRef[0]); 4681 } 4682 if ( getSlice()->isInterB()) 4683 { 4684 if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) ) 4252 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex(); 4253 iDV = cMVField.getHor(); 4254 4255 4256 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() ); 4257 4258 if( iValidDepRef >= 0 ) 4685 4259 { 4686 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tRef[1]); 4260 const TComMv cAdd( 2, 2 ); 4261 cMVField.getMv() += cAdd; 4262 cMVField.getMv() >>= 2; 4263 clipMv( cMVField.getMv() ); 4264 tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef ); 4265 tmpDir = 1; 4687 4266 } 4688 4267 } 4689 #endif 4690 puhInterDirNeighbours[iCount] = tmpDir; 4268 } 4269 4270 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField ); 4271 4272 if( !tmpDir && cMVField.getRefIdx() >= 0 ) 4273 { 4274 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4275 { 4276 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex(); 4277 iDV = cMVField.getHor(); 4278 4279 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() ); 4280 4281 if( iValidDepRef >= 0 ) 4282 { 4283 const TComMv cAdd( 2, 2 ); 4284 cMVField.getMv() += cAdd; 4285 cMVField.getMv() >>= 2; 4286 clipMv( cMVField.getMv() ); 4287 tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef ); 4288 tmpDir = 2; 4289 } 4290 } 4291 } 4292 if( tmpDir != 0 ) 4293 { 4294 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4295 m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV, iViewIdx ); 4296 m_iUseDDDCandIdx = iCount; 4297 4298 if( tmpDir == 1 ) 4299 { 4300 pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ]; 4301 } 4302 else if( tmpDir == 2 ) 4303 { 4304 pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ]; 4305 } 4306 4307 abCandIsInter [ iCount ] = true; 4308 puhInterDirNeighbours[ iCount ] = tmpDir; 4691 4309 4692 4310 if ( mrgCandIdx == iCount ) … … 4695 4313 } 4696 4314 iCount ++; 4697 } 4698 #if !QC_SPIVMP_MPI_G0119 4699 } 4700 #endif 4701 } 4702 #if MTK_DDD_G0063 4703 if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0 && bMPIFlag ) 4704 { 4705 UInt uiPartIdx; 4706 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4707 TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 4708 4709 4710 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4711 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4712 tmpDir = 0; 4713 4714 xDeriveCenterIdx( uiPUIdx, uiPartIdx); 4715 4716 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) ) 4717 { 4718 4719 TComMvField cMVField; 4720 #if !HTM10RC1_FIX 4721 UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx ); 4722 #endif 4723 Int iDV = 0; 4724 Int iViewIdx = 0; 4725 #if !HTM10RC1_FIX 4726 if( ucInterDir & 1 ) 4727 { 4728 #endif 4729 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField ); 4730 #if HTM10RC1_FIX 4731 if( cMVField.getRefIdx() >= 0 ) 4732 { 4733 #endif 4734 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4735 { 4736 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex(); 4737 iDV = cMVField.getHor(); 4738 4739 4740 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() ); 4741 4742 if( iValidDepRef >= 0 ) 4743 { 4744 const TComMv cAdd( 2, 2 ); 4745 cMVField.getMv() += cAdd; 4746 cMVField.getMv() >>= 2; 4747 clipMv( cMVField.getMv() ); 4748 tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef ); 4749 tmpDir = 1; 4750 } 4751 } 4752 } 4753 4754 #if !HTM10RC1_FIX 4755 if( !tmpDir && ( ucInterDir & 2 )) 4756 { 4757 #endif 4758 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField ); 4759 4760 #if HTM10RC1_FIX 4761 if( !tmpDir && cMVField.getRefIdx() >= 0 ) 4762 { 4763 #endif 4764 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4765 { 4766 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex(); 4767 iDV = cMVField.getHor(); 4768 4769 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() ); 4770 4771 if( iValidDepRef >= 0 ) 4772 { 4773 const TComMv cAdd( 2, 2 ); 4774 cMVField.getMv() += cAdd; 4775 cMVField.getMv() >>= 2; 4776 clipMv( cMVField.getMv() ); 4777 tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef ); 4778 tmpDir = 2; 4779 } 4780 } 4781 } 4782 if( tmpDir != 0 ) 4783 { 4784 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4785 m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV, iViewIdx ); 4786 m_iUseDDDCandIdx = iCount; 4787 4788 if( tmpDir == 1 ) 4789 { 4790 pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ]; 4791 } 4792 else if( tmpDir == 2 ) 4793 { 4794 pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ]; 4795 } 4796 4797 abCandIsInter [ iCount ] = true; 4798 puhInterDirNeighbours[ iCount ] = tmpDir; 4799 4800 if ( mrgCandIdx == iCount ) 4801 { 4802 return; 4803 } 4804 iCount ++; 4805 4806 Int iLeftAboveAvail = 0; 4807 if( iPosLeftAbove[ 0 ] != -1 ) 4808 { 4809 iPosLeftAbove[ 0 ] = iCount; 4810 iLeftAboveAvail = 1; 4811 } 4812 if( iPosLeftAbove[ 1 ] != -1 ) 4813 { 4814 iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail; 4815 } 4816 4817 } 4818 } 4819 4315 4316 Int iLeftAboveAvail = 0; 4317 if( iPosLeftAbove[ 0 ] != -1 ) 4318 { 4319 iPosLeftAbove[ 0 ] = iCount; 4320 iLeftAboveAvail = 1; 4321 } 4322 if( iPosLeftAbove[ 1 ] != -1 ) 4323 { 4324 iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail; 4325 } 4326 } 4327 } 4820 4328 } 4821 4329 #endif … … 4836 4344 Bool ivMvPredFlag = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() ); 4837 4345 4838 #if MTK_NBDV_IVREF_FIX_G00674839 4346 if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1) 4840 #else4841 if ( ivMvPredFlag )4842 #endif4843 4347 { 4844 4348 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP ); … … 4848 4352 //////// INTER VIEW MOTION COMP(IvMC) ///////// 4849 4353 /////////////////////////////////////////////// 4850 #if QC_DEPTH_MERGE_SIMP_G01274851 4354 if( getSlice()->getIsDepth() ) 4852 4355 { 4853 4356 ivCandDir[1] = ivCandDir[2] = ivCandDir[3] = 0; 4854 4357 } 4855 #endif 4358 4856 4359 if( ivCandDir[0] ) 4857 4360 { … … 4893 4396 for(; iCnloop >= 0; iCnloop --) 4894 4397 { 4895 #if MTK_DDD_G00634398 #if H_3D_DDD 4896 4399 if( iCnloop == m_iUseDDDCandIdx ) 4897 4400 { … … 4961 4464 if (bIvMC) 4962 4465 { 4963 #if QC_SPIVMP_MPI_G0119 4964 if(!m_pcSlice->getIsDepth()) 4965 #endif 4966 #if SEC_SPIVMP_MCP_SIZE_G0077 4967 if(getPartitionSize(0) == SIZE_2Nx2N) 4466 if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N ) 4467 { 4968 4468 pbSPIVMPFlag[iCount] = true; 4969 #else 4970 pbSPIVMPFlag[iCount] = true; 4971 #endif 4469 } 4972 4470 #if H_3D_DBBP 4973 4471 pbSPIVMPFlag[iCount] &= !bDBBPFlag; … … 5099 4597 #endif 5100 4598 5101 #if MTK_DDD_G00634599 #if H_3D_DDD 5102 4600 // early termination 5103 4601 if ( iCount >= getSlice()->getMaxNumMergeCand()) … … 5111 4609 //////// INTER VIEW DISP COMP (IvDC) //////// 5112 4610 ///////////////////////////////////////////// 5113 #if QC_DEPTH_MERGE_SIMP_G01275114 4611 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 5115 #else5116 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())5117 #endif5118 4612 { 5119 4613 assert(iCount < getSlice()->getMaxNumMergeCand()); … … 5276 4770 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 5277 4771 //////////////////////////////////////////////////// 5278 #if QC_DEPTH_MERGE_SIMP_G01275279 4772 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 5280 #else5281 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() )5282 #endif5283 4773 { 5284 4774 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) ) … … 6645 6135 #endif 6646 6136 #if H_3D_IV_MERGE 6647 #if SEC_DEPTH_DV_DERIVAITON_G00746648 6137 Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 6649 #else 6650 Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 6651 #endif 6652 { 6653 #if SEC_DEPTH_DV_DERIVAITON_G0074 6138 { 6139 6654 6140 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N); 6655 6141 … … 6662 6148 6663 6149 return true; 6664 #else6665 Pel pDepPos[3] = {0, 0, 0};6666 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);6667 Bool bDepAvail = false;6668 Pel *pDepth = this->getPic()->getPicYuvRec()->getLumaAddr();6669 Int iDepStride = this->getPic()->getPicYuvRec()->getStride();6670 TComMv cMv;6671 6672 Int xP, yP, nPSW, nPSH;6673 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);6674 6675 if(xP != 0 && yP != 0)6676 {6677 pDepPos[0] = pDepth[ (yP-1) * iDepStride + (xP-1) ];6678 bDepAvail = true;6679 }6680 6681 if(xP != 0)6682 {6683 pDepPos[1] = pDepth[ (yP+nPSH-1) * iDepStride + (xP-1) ];6684 bDepAvail = true;6685 }6686 6687 if(yP != 0)6688 {6689 pDepPos[2] = pDepth[ (yP-1) * iDepStride + (xP+nPSW-1) ];6690 bDepAvail = true;6691 }6692 6693 if (bDepAvail)6694 {6695 Pel pAvgDepth = (xP != 0 && yP != 0) ? ((5*pDepPos[0] + 5*pDepPos[1] + 6*pDepPos[2] + 8)>>4) : (xP == 0) ? pDepPos[2] : pDepPos[1];6696 Int iDisp = getSlice()->getDepthToDisparityB( 0 )[ pAvgDepth ];6697 cMv.setHor(iDisp);6698 cMv.setVer(0);6699 pDisp->m_acNBDV = cMv;6700 pDisp->m_aVIdxCan = 0;6701 return true;6702 }6703 else6704 {6705 cMv.setZero();6706 pDisp->m_acNBDV = cMv;6707 pDisp->m_aVIdxCan = 0;6708 return false;6709 }6710 #endif6711 6150 } 6712 6151 #endif … … 6725 6164 // Init disparity struct for results 6726 6165 pDInfo->bDV = false; 6727 #if MTK_NBDV_IVREF_FIX_G00676728 6166 pDInfo->m_aVIdxCan = -1; 6729 #endif 6167 6730 6168 // Init struct for disparities from MCP neighboring blocks 6731 6169 IDVInfo cIDVInfo; … … 7248 6686 { 7249 6687 Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId()); 7250 #if QC_SPIVMP_MPI_G01197251 6688 if( getSlice()->getIsDepth() ) 7252 6689 { 7253 6690 iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size(); 7254 6691 } 7255 #endif 6692 7256 6693 iNumSPInOneLine = iPUWidth/iSubPUSize; 7257 6694 iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine; … … 7310 6747 TComSlice* pcSlice = getSlice (); 7311 6748 Int iViewIndex = pDInfo->m_aVIdxCan; 7312 6749 7313 6750 //--- get base CU/PU and check prediction mode --- 7314 6751 TComPic* pcBasePic = pcSlice->getIvPic( bIsDepth, iViewIndex ); … … 7334 6771 7335 6772 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 7336 6773 7337 6774 Bool abPdmAvailable[8] = {false, false, false, false, false, false, false, false}; 7338 6775 #if H_3D_NBDV … … 7347 6784 //////////sub-PU IvMC/////////// 7348 6785 //////////////////////////////// 7349 #if QC_SPIVMP_MPI_G01197350 6786 if(!m_pcSlice->getIsDepth()) 7351 6787 { 7352 #endif 7353 #if SEC_SPIVMP_MCP_SIZE_G0077 7354 if( getPartitionSize(0) == SIZE_2Nx2N ) 7355 { 7356 #endif 7357 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 7358 getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 7359 7360 for (Int i=0; i<iNumSP; i++) 7361 { 7362 puhInterDirSP[i] = 0; 7363 pcMvFieldSP[2*i].getMv().set(0, 0); 7364 pcMvFieldSP[2*i+1].getMv().set(0,0); 7365 pcMvFieldSP[2*i].setRefIdx(-1); 7366 pcMvFieldSP[2*i+1].setRefIdx(-1); 7367 } 7368 7369 Int iBaseCUAddr; 7370 Int iBaseAbsPartIdx; 7371 TComDataCU* pcBaseCU; 7372 Int iPartition = 0; 7373 #if !KHU_SIMP_SPIVMP_G0147 7374 Int iInterDirLast = 0; 7375 TComMvField cMvFieldLast[2]; 7376 #endif 7377 7378 Int iDelX = iSPWidth/2; 7379 Int iDelY = iSPHeight/2; 7380 7381 #if KHU_SIMP_SPIVMP_G0147 7382 Int iCenterPosX = iCurrPosX + ( ( iWidth / iSPWidth ) >> 1 ) * iSPWidth + ( iSPWidth >> 1 ); 7383 Int iCenterPosY = iCurrPosY + ( ( iHeight / iSPHeight ) >> 1 ) * iSPHeight + (iSPHeight >> 1); 7384 Int iRefCenterCUAddr, iRefCenterAbsPartIdx; 7385 7386 if(iWidth == iSPWidth && iHeight == iSPHeight) 7387 { 7388 iCenterPosX = iCurrPosX + (iWidth >> 1); 7389 iCenterPosY = iCurrPosY + (iHeight >> 1); 7390 } 7391 7392 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 7393 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 7394 7395 pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx ); 7396 TComDataCU* pcDefaultCU = pcBasePic->getCU( iRefCenterCUAddr ); 7397 if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA )) 7398 { 7399 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7400 { 7401 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 7402 Bool stopLoop = false; 7403 for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop) 7404 { 7405 RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 7406 TComMvField cDefaultMvField; 7407 pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField ); 7408 Int iDefaultRefIdx = cDefaultMvField.getRefIdx(); 7409 if (iDefaultRefIdx >= 0) 7410 { 7411 Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx); 7412 if (iDefaultRefPOC != pcSlice->getPOC()) 7413 { 7414 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 7415 { 7416 if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 7417 { 7418 abPdmAvailable[ uiCurrRefListId ] = true; 7419 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 7420 #if H_3D_NBDV 7421 #if H_3D_IV_MERGE 7422 if( !bIsDepth ) 7423 { 7424 #endif 7425 cMv.setIDVFlag (true); 7426 cMv.setIDVHor (cDv.getHor()); 7427 cMv.setIDVVer (cDv.getVer()); 7428 cMv.setIDVVId (iViewIndex); 7429 #if H_3D_IV_MERGE 7430 } 7431 #endif 7432 #endif 7433 clipMv( cMv ); 7434 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 7435 pacPdmMv [ uiCurrRefListId ] = cMv; 7436 stopLoop = true; 7437 break; 7438 } 7439 } 7440 } 7441 } 7442 } 7443 } 7444 } 7445 availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0); 7446 7447 if(availableMcDc[0]) 7448 { 7449 #endif 7450 Int iBasePosX, iBasePosY; 7451 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) 7452 { 7453 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth) 7454 { 7455 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 )); 7456 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 7457 7458 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx ); 7459 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 7460 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 7461 { 7462 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 6788 if( getPartitionSize(0) == SIZE_2Nx2N ) 6789 { 6790 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 6791 getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 6792 6793 for (Int i=0; i<iNumSP; i++) 6794 { 6795 puhInterDirSP[i] = 0; 6796 pcMvFieldSP[2*i].getMv().set(0, 0); 6797 pcMvFieldSP[2*i+1].getMv().set(0,0); 6798 pcMvFieldSP[2*i].setRefIdx(-1); 6799 pcMvFieldSP[2*i+1].setRefIdx(-1); 6800 } 6801 6802 Int iBaseCUAddr; 6803 Int iBaseAbsPartIdx; 6804 TComDataCU* pcBaseCU; 6805 Int iPartition = 0; 6806 6807 Int iDelX = iSPWidth/2; 6808 Int iDelY = iSPHeight/2; 6809 6810 Int iCenterPosX = iCurrPosX + ( ( iWidth / iSPWidth ) >> 1 ) * iSPWidth + ( iSPWidth >> 1 ); 6811 Int iCenterPosY = iCurrPosY + ( ( iHeight / iSPHeight ) >> 1 ) * iSPHeight + (iSPHeight >> 1); 6812 Int iRefCenterCUAddr, iRefCenterAbsPartIdx; 6813 6814 if(iWidth == iSPWidth && iHeight == iSPHeight) 6815 { 6816 iCenterPosX = iCurrPosX + (iWidth >> 1); 6817 iCenterPosY = iCurrPosY + (iHeight >> 1); 6818 } 6819 6820 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 6821 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 6822 6823 pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx ); 6824 TComDataCU* pcDefaultCU = pcBasePic->getCU( iRefCenterCUAddr ); 6825 if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA )) 6826 { 6827 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7463 6828 { 7464 6829 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 7465 Bool bLoop_stop = false;7466 for(Int iLoop = 0; iLoop < 2 && ! bLoop_stop; ++iLoop)6830 Bool stopLoop = false; 6831 for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop) 7467 6832 { 7468 RefPicList e BaseRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId );7469 TComMvField c BaseMvField;7470 pc BaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );7471 Int i BaseRefIdx = cBaseMvField.getRefIdx();7472 if (i BaseRefIdx >= 0)6833 RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 6834 TComMvField cDefaultMvField; 6835 pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField ); 6836 Int iDefaultRefIdx = cDefaultMvField.getRefIdx(); 6837 if (iDefaultRefIdx >= 0) 7473 6838 { 7474 Int i BaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);7475 if (i BaseRefPOC != pcSlice->getPOC())6839 Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx); 6840 if (iDefaultRefPOC != pcSlice->getPOC()) 7476 6841 { 7477 6842 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 7478 6843 { 7479 if (i BaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))6844 if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 7480 6845 { 7481 6846 abPdmAvailable[ uiCurrRefListId ] = true; 7482 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 7483 6847 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 6848 #if H_3D_NBDV 6849 #if H_3D_IV_MERGE 7484 6850 if( !bIsDepth ) 7485 6851 { 6852 #endif 7486 6853 cMv.setIDVFlag (true); 7487 6854 cMv.setIDVHor (cDv.getHor()); 7488 6855 cMv.setIDVVer (cDv.getVer()); 7489 6856 cMv.setIDVVId (iViewIndex); 6857 #if H_3D_IV_MERGE 7490 6858 } 7491 6859 #endif 6860 #endif 7492 6861 clipMv( cMv ); 7493 bLoop_stop = true;7494 7495 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);6862 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 6863 pacPdmMv [ uiCurrRefListId ] = cMv; 6864 stopLoop = true; 7496 6865 break; 7497 6866 } … … 7502 6871 } 7503 6872 } 7504 7505 puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0); 7506 if (puhInterDirSP[iPartition] == 0) 7507 { 7508 #if KHU_SIMP_SPIVMP_G0147 7509 puhInterDirSP[iPartition] = availableMcDc[0]; 7510 pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]); 7511 pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]); 7512 #else 7513 if (iInterDirLast != 0) 6873 availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0); 6874 6875 if(availableMcDc[0]) 6876 { 6877 6878 Int iBasePosX, iBasePosY; 6879 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) 7514 6880 { 7515 puhInterDirSP[iPartition] = iInterDirLast; 7516 pcMvFieldSP[2*iPartition] = cMvFieldLast[0]; 7517 pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1]; 7518 } 7519 #endif 7520 } 7521 #if !KHU_SIMP_SPIVMP_G0147 7522 else 7523 { 7524 if (iInterDirLast ==0) 7525 { 7526 availableMcDc[0] = puhInterDirSP[iPartition]; 7527 paiPdmRefIdx [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx(); 7528 pacPdmMv [ 0 ] = pcMvFieldSP[2*iPartition].getMv(); 7529 paiPdmRefIdx [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx(); 7530 pacPdmMv [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv(); 7531 7532 if (iPartition != 0) 6881 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth) 7533 6882 { 7534 for (Int iPart = iPartition-1; iPart >= 0; iPart--) 6883 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 )); 6884 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 6885 6886 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx ); 6887 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 6888 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 7535 6889 { 7536 puhInterDirSP[iPart] = puhInterDirSP[iPartition]; 7537 pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition]; 7538 pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1]; 6890 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 6891 { 6892 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 6893 Bool bLoop_stop = false; 6894 for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop) 6895 { 6896 RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 6897 TComMvField cBaseMvField; 6898 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 6899 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 6900 if (iBaseRefIdx >= 0) 6901 { 6902 Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx); 6903 if (iBaseRefPOC != pcSlice->getPOC()) 6904 { 6905 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 6906 { 6907 if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 6908 { 6909 abPdmAvailable[ uiCurrRefListId ] = true; 6910 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 6911 6912 if( !bIsDepth ) 6913 { 6914 cMv.setIDVFlag (true); 6915 cMv.setIDVHor (cDv.getHor()); 6916 cMv.setIDVVer (cDv.getVer()); 6917 cMv.setIDVVId (iViewIndex); 6918 } 6919 6920 clipMv( cMv ); 6921 bLoop_stop = true; 6922 6923 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx); 6924 break; 6925 } 6926 } 6927 } 6928 } 6929 } 6930 } 7539 6931 } 6932 6933 puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0); 6934 if (puhInterDirSP[iPartition] == 0) 6935 { 6936 puhInterDirSP[iPartition] = availableMcDc[0]; 6937 pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]); 6938 pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]); 6939 6940 } 6941 iPartition ++; 7540 6942 } 7541 6943 } 7542 iInterDirLast = puhInterDirSP[iPartition]; 7543 cMvFieldLast[0] = pcMvFieldSP[2*iPartition]; 7544 cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1]; 7545 } 7546 #endif 7547 iPartition ++; 7548 7549 } 7550 } 7551 #if KHU_SIMP_SPIVMP_G0147 7552 } 7553 #endif 7554 #if SEC_SPIVMP_MCP_SIZE_G0077 7555 } 7556 #endif 7557 7558 iCurrPosX += ( iWidth >> 1 ); 7559 iCurrPosY += ( iHeight >> 1 ); 7560 #if QC_SPIVMP_MPI_G0119 7561 } 7562 #endif 6944 } 6945 } 6946 6947 iCurrPosX += ( iWidth >> 1 ); 6948 iCurrPosY += ( iHeight >> 1 ); 6949 } 7563 6950 #endif 7564 6951 … … 7568 6955 7569 6956 #if H_3D_SPIVMP 7570 #if QC_SPIVMP_MPI_G0119 7571 if(m_pcSlice->getIsDepth()) 7572 { 7573 iCurrPosX += ( iWidth >> 1 ); 7574 iCurrPosY += ( iHeight >> 1 ); 7575 } 7576 #if QC_DEPTH_MERGE_SIMP_G0127 7577 #if SEC_SPIVMP_MCP_SIZE_G0077 6957 if(m_pcSlice->getIsDepth()) 6958 { 6959 iCurrPosX += ( iWidth >> 1 ); 6960 iCurrPosY += ( iHeight >> 1 ); 6961 } 7578 6962 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 7579 6963 #else 7580 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)7581 #endif7582 #else7583 #if SEC_SPIVMP_MCP_SIZE_G00777584 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < 2; iLoopCan ++)7585 #else7586 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)7587 #endif7588 #endif7589 #else7590 #if SEC_SPIVMP_MCP_SIZE_G00777591 for(Int iLoopCan = (getPartitionSize(uiPartAddr) == SIZE_2Nx2N ? 1 : 0); iLoopCan < 2; iLoopCan ++)7592 #else7593 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)7594 #endif7595 #endif7596 #else7597 6964 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7598 6965 #endif … … 7601 6968 // iLoopCan == 1 --> IvMCShift 7602 6969 7603 #if !H_3D_SPIVMP || QC_SPIVMP_MPI_G01197604 6970 Int iBaseCUAddr; 7605 6971 Int iBaseAbsPartIdx; 7606 #endif7607 6972 7608 6973 Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 ); 7609 6974 Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 ); 7610 6975 7611 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G01197612 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );7613 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );7614 #else7615 6976 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 7616 6977 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 7617 #endif7618 6978 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 7619 6979 7620 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G01197621 pcBaseCU = pcBasePic->getCU( iBaseCUAddr );7622 #else7623 6980 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 7624 #endif7625 6981 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 7626 6982 { … … 7676 7032 } 7677 7033 #if H_3D_SPIVMP 7678 #if QC_SPIVMP_MPI_G01197679 #if QC_DEPTH_MERGE_SIMP_G01277680 7034 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 7681 7035 #else 7682 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)7683 #endif7684 #else7685 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)7686 #endif7687 #else7688 7036 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7689 7037 #endif … … 7691 7039 availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0); 7692 7040 } 7693 7694 7041 7042 7695 7043 //////////////////////////////// 7696 7044 /////// IvDC + IvDCShift /////// 7697 7045 //////////////////////////////// 7698 #if QC_DEPTH_MERGE_SIMP_G0127 7046 7699 7047 if( !getSlice()->getIsDepth() ) 7700 7048 { 7701 #endif 7702 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 7703 { 7704 RefPicList eRefPicListDMV = RefPicList( iRefListId ); 7705 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListDMV ); 7706 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 7707 { 7708 if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan)) 7709 { 7710 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7049 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 7050 { 7051 RefPicList eRefPicListDMV = RefPicList( iRefListId ); 7052 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListDMV ); 7053 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 7054 { 7055 if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan)) 7711 7056 { 7712 Int ioffsetDV = (iLoopCan == 0) ? 0 : 4; 7713 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 7714 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 7057 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7058 { 7059 Int ioffsetDV = (iLoopCan == 0) ? 0 : 4; 7060 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 7061 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 7715 7062 #if H_3D_NBDV_REF 7716 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;7717 #endif 7718 cMv.setHor( cMv.getHor() + ioffsetDV );7063 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 7064 #endif 7065 cMv.setHor( cMv.getHor() + ioffsetDV ); 7719 7066 #if H_3D_IV_MERGE 7720 if( bIsDepth ) 7721 cMv.setHor((cMv.getHor()+2)>>2); 7722 #endif 7723 cMv.setVer( 0 ); 7724 clipMv( cMv ); 7725 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; 7067 if( bIsDepth ) 7068 { 7069 cMv.setHor((cMv.getHor()+2)>>2); 7070 } 7071 #endif 7072 cMv.setVer( 0 ); 7073 clipMv( cMv ); 7074 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; 7075 } 7076 break; 7726 7077 } 7727 break; 7728 } 7729 } 7730 } 7731 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7732 { 7733 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 7734 } 7735 #if QC_DEPTH_MERGE_SIMP_G0127 7736 } 7737 #endif 7078 } 7079 } 7080 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7081 { 7082 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 7083 } 7084 } 7738 7085 return false; 7739 7086 } … … 7809 7156 #endif 7810 7157 7811 #if NTT_STORE_SPDV_VSP_G01487158 #if H_3D_VSP 7812 7159 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize ) 7813 7160 { … … 7943 7290 7944 7291 } 7945 #endif // NTT_STORE_SPDV_VSP_G01487292 #endif 7946 7293 7947 7294 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.h
r872 r884 192 192 #if H_3D_DIM_SDC 193 193 Bool* m_pbSDCFlag; 194 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101195 Pel* m_apSegmentDCOffset[4];196 #else197 194 Pel* m_apSegmentDCOffset[2]; 198 #endif199 #endif200 #endif201 #if H_3D_INTER_SDC202 #if !QC_SDC_UNIFY_G0130203 Bool* m_pbInterSDCFlag;204 Int* m_apSegmentInterDCOffset[4];205 #endif206 #if !SEC_INTER_SDC_G0101207 UChar* m_pucInterSDCMask;208 195 #endif 209 196 #endif … … 239 226 #endif 240 227 241 #if MTK_DDD_G0063228 #if H_3D_DDD 242 229 UChar* m_pucDisparityDerivedDepth; 243 230 Bool* m_pbUseDDD; … … 280 267 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 281 268 282 #if NTT_STORE_SPDV_VSP_G0148269 #if H_3D_VSP 283 270 Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); 284 271 #endif … … 499 486 #if H_3D 500 487 Void rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo* inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV); 501 #if SEC_DEPTH_DV_DERIVAITON_G0074502 488 Bool getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); 503 #else504 Bool getDispNeighBlocks ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);505 #endif506 489 Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); 507 490 #endif … … 573 556 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 574 557 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 575 #if QC_GENERIC_SDC_G0122576 558 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 577 559 UInt getCtxAngleFlag ( UInt uiAbsPartIdx ); 578 #endif579 #endif580 #endif581 #if H_3D_INTER_SDC582 #if !QC_SDC_UNIFY_G0130583 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; }584 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; }585 Void setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );586 UInt getCtxInterSDCFlag ( UInt uiAbsPartIdx );587 Int* getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; }588 Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }589 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }590 591 #endif592 #if !SEC_INTER_SDC_G0101593 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );594 595 UChar* getInterSDCMask () { return m_pucInterSDCMask; }596 560 #endif 597 561 #endif … … 701 665 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } 702 666 Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 703 #if NTT_STORE_SPDV_VSP_G0148704 667 Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); 705 #endif706 668 #endif 707 669 Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); … … 743 705 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 744 706 #endif 745 #if !MTK_IC_FLAG_CABAC_SIMP_G0061746 #if H_3D_IC747 UInt getCtxICFlag ( UInt uiAbsPartIdx );748 #endif749 #endif750 707 UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } 751 708 UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } … … 766 723 UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); 767 724 768 #if MTK_DDD_G0063725 #if H_3D_DDD 769 726 UChar* getDDDepth () { return m_pucDisparityDerivedDepth; } 770 727 UChar getDDDepth ( UInt uiIdx ) { return m_pucDisparityDerivedDepth[uiIdx]; } -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r872 r884 176 176 Void setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ); 177 177 #endif 178 #if NTT_STORE_SPDV_VSP_G0148178 #if H_3D_VSP 179 179 Void setMv ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; } 180 180 Void setRefIdx ( Int iIdx, Int iRefIdx ) { m_piRefIdx[iIdx] = iRefIdx; } -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r872 r884 416 416 417 417 #if H_3D_DIM 418 Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc 419 #if QC_GENERIC_SDC_G0122 420 , TComWedgelet* dmm4Segmentation 421 #endif 422 ) 418 Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc, TComWedgelet* dmm4Segmentation ) 423 419 { 424 420 assert( iWidth == iHeight ); … … 446 442 case( DMM4_IDX ): 447 443 { 448 #if QC_GENERIC_SDC_G0122449 444 if( dmm4Segmentation == NULL ) 450 445 { … … 457 452 dmmSegmentation = dmm4Segmentation; 458 453 } 459 #else460 dmmSegmentation = new TComWedgelet( iWidth, iHeight );461 xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );462 #endif463 454 } break; 464 455 default: assert(0); … … 511 502 512 503 #if H_3D_DIM_DMM 513 #if QC_GENERIC_SDC_G0122514 504 if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; } 515 #else516 if( dimType == DMM4_IDX ) { dmmSegmentation->destroy(); delete dmmSegmentation; }517 #endif518 505 #endif 519 506 } … … 1103 1090 pcCU->clipMv(cMv); 1104 1091 1105 #if MTK_DDD_G00631092 #if H_3D_DDD 1106 1093 if( pcCU->getUseDDD( uiPartAddr ) ) 1107 1094 { … … 1182 1169 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1183 1170 { 1184 #if NTT_STORE_SPDV_VSP_G01481185 1171 Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1; 1186 1172 … … 1197 1183 } 1198 1184 xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU ); 1199 1200 #else // NTT_STORE_SPDV_VSP_G0148 1201 // Get depth reference 1202 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 1203 #if H_3D_FCO_VSP_DONBDV_E0163 1204 TComPic* pRefPicBaseDepth = 0; 1205 Bool bIsCurrDepthCoded = false; 1206 pRefPicBaseDepth = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() ); 1207 if ( pRefPicBaseDepth->getPicYuvRec() != NULL ) 1208 { 1209 bIsCurrDepthCoded = true; 1210 } 1211 else 1212 { 1213 pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 1214 } 1215 #else 1216 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 1217 #endif 1218 assert(pRefPicBaseDepth != NULL); 1219 TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 1220 assert(pcBaseViewDepthPicYuv != NULL); 1221 1222 // Get texture reference 1223 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1224 assert(iRefIdx >= 0); 1225 TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx ); 1226 TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 1227 assert(pcBaseViewTxtPicYuv != NULL); 1228 1229 // Initialize LUT according to the reference viewIdx 1230 Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex(); 1231 Int* pShiftLUT = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx ); 1232 assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() ); 1233 1234 // Do compensation 1235 TComMv cDv = pcCU->getDvInfo(uiPartAddr).m_acNBDV; 1236 pcCU->clipMv(cDv); 1237 1238 #if H_3D_FCO_VSP_DONBDV_E0163 1239 if ( bIsCurrDepthCoded ) 1240 { 1241 cDv.setZero(); 1242 } 1243 #endif 1244 // fetch virtual depth map 1245 pcBaseViewDepthPicYuv->extendPicBorder(); 1246 1247 Int vspSize=0; 1248 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize ); 1249 // sub-PU based compensation 1250 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 1251 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 1252 #endif // NTT_STORE_SPDV_VSP_G0148 1253 } 1254 1255 #if NTT_STORE_SPDV_VSP_G0148 1185 } 1186 1256 1187 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU ) 1257 1188 { … … 1278 1209 } 1279 1210 } 1280 #endif // NTT_STORE_SPDV_VSP_G01481281 1211 1282 1212 #endif … … 2133 2063 #endif 2134 2064 2135 #if H_3D_VSP2136 #if !(NTT_STORE_SPDV_VSP_G0148)2137 // not fully support iRatioTxtPerDepth* != 12138 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )2139 {2140 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;2141 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;2142 2143 Int refDepStride = picRefDepth->getStride();2144 2145 Int refDepOffset = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride;2146 Pel *refDepth = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );2147 2148 if( ratioTxtPerDepthX!=1 || ratioTxtPerDepthY!=1 )2149 {2150 Int posX, posY;2151 refDepth = picRefDepth->getLumaAddr( );2152 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture2153 posX /= ratioTxtPerDepthX; // texture position -> depth postion2154 posY /= ratioTxtPerDepthY;2155 refDepOffset += posX + posY * refDepStride;2156 2157 width /= ratioTxtPerDepthX; // texture size -> depth size2158 height /= ratioTxtPerDepthY;2159 }2160 2161 refDepth += refDepOffset;2162 2163 Int depStride = yuvDepth->getStride();2164 Pel *depth = yuvDepth->getLumaAddr();2165 2166 if ((height % 8))2167 {2168 vspSize = 1; // 8x42169 }2170 else if ((width % 8))2171 {2172 vspSize = 0; // 4x82173 }2174 else2175 {2176 Bool ULvsBR, URvsBL;2177 ULvsBR = refDepth[0] < refDepth[refDepStride * (height-1) + width-1];2178 URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];2179 vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;2180 }2181 Int subBlockW, subBlockH;2182 Int depStrideTmp = depStride * nTxtPerDepthY;2183 if (vspSize)2184 {2185 subBlockW = 8;2186 subBlockH = 4;2187 }2188 else2189 {2190 subBlockW = 4;2191 subBlockH = 8;2192 }2193 for( Int y=0; y<height; y+=subBlockH )2194 {2195 Pel *refDepthTmp[4];2196 refDepthTmp[0] = refDepth + refDepStride * y;2197 refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;2198 refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);2199 refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;2200 for( Int x=0; x<width; x+=subBlockW )2201 {2202 Pel maxDepthVal;2203 maxDepthVal = refDepthTmp[0][x];2204 maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);2205 maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);2206 maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);2207 Pel *depthTmp = &depth[x+y*depStride];2208 for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )2209 {2210 for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )2211 {2212 depthTmp[sX] = maxDepthVal;2213 }2214 depthTmp += depStrideTmp;2215 }2216 }2217 }2218 }2219 2220 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)2221 {2222 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;2223 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;2224 2225 nTxtPerDepthX = nTxtPerDepthX << vspSize;2226 nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);2227 2228 Int refStride = picRef->getStride();2229 Int dstStride = yuvDst->getStride();2230 Int depStride = yuvDepth->getStride();2231 Int refStrideBlock = refStride * nTxtPerDepthY;2232 Int dstStrideBlock = dstStride * nTxtPerDepthY;2233 Int depStrideBlock = depStride * nTxtPerDepthY;2234 2235 Pel *ref = picRef->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );2236 Pel *dst = yuvDst->getLumaAddr(partAddr);2237 Pel *depth = yuvDepth->getLumaAddr();2238 2239 #if H_3D_VSP_BLOCKSIZE == 12240 #if H_3D_VSP_CONSTRAINED2241 //get LUT based horizontal reference range2242 Int range = xGetConstrainedSize(width, height);2243 2244 // The minimum depth value2245 Int minRelativePos = MAX_INT;2246 Int maxRelativePos = MIN_INT;2247 2248 Pel* depthTemp, *depthInitial=depth;2249 for (Int yTxt = 0; yTxt < height; yTxt++)2250 {2251 for (Int xTxt = 0; xTxt < width; xTxt++)2252 {2253 if (depthPosX+xTxt < widthDepth)2254 {2255 depthTemp = depthInitial + xTxt;2256 }2257 else2258 {2259 depthTemp = depthInitial + (widthDepth - depthPosX - 1);2260 }2261 2262 Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec;2263 Int disparityInt = disparity >> 2;2264 2265 if( disparity <= 0)2266 {2267 if (minRelativePos > disparityInt+xTxt)2268 {2269 minRelativePos = disparityInt+xTxt;2270 }2271 }2272 else2273 {2274 if (maxRelativePos < disparityInt+xTxt)2275 {2276 maxRelativePos = disparityInt+xTxt;2277 }2278 }2279 }2280 if (depthPosY+yTxt < heightDepth)2281 {2282 depthInitial = depthInitial + depStride;2283 }2284 }2285 2286 Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec;2287 if (disparity_tmp <= 0)2288 {2289 maxRelativePos = minRelativePos + range -1 ;2290 }2291 else2292 {2293 minRelativePos = maxRelativePos - range +1 ;2294 }2295 #endif2296 #endif // H_3D_VSP_BLOCKSIZE == 12297 2298 TComMv dv(0, 0);2299 2300 for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )2301 {2302 for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )2303 {2304 Pel repDepth = depth[ xTxt ];2305 assert( repDepth >= 0 && repDepth <= 255 );2306 2307 Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ??2308 Int xFrac = disparity & 0x3;2309 2310 dv.setHor( disparity );2311 cu->clipMv( dv );2312 2313 Int refOffset = xTxt + (dv.getHor() >> 2);2314 2315 #if H_3D_VSP_CONSTRAINED2316 if(refOffset<minRelativePos || refOffset>maxRelativePos)2317 {2318 xFrac = 0;2319 }2320 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2321 #endif2322 2323 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );2324 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );2325 }2326 ref += refStrideBlock;2327 dst += dstStrideBlock;2328 depth += depStrideBlock;2329 }2330 2331 }2332 2333 Void TComPrediction::xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)2334 {2335 #if (H_3D_VSP_BLOCKSIZE==1)2336 Int nTxtPerDepthX = 1;2337 Int nTxtPerDepthY = 1;2338 #else2339 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;2340 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;2341 #endif2342 2343 nTxtPerDepthX = nTxtPerDepthX << vspSize;2344 nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);2345 2346 Int refStride = picRef->getCStride();2347 Int dstStride = yuvDst->getCStride();2348 Int depStride = yuvDepth->getStride();2349 Int refStrideBlock = refStride * nTxtPerDepthY;2350 Int dstStrideBlock = dstStride * nTxtPerDepthY;2351 Int depStrideBlock = depStride * (nTxtPerDepthY<<1);2352 2353 Pel *refCb = picRef->getCbAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );2354 Pel *refCr = picRef->getCrAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );2355 Pel *dstCb = yuvDst->getCbAddr(partAddr);2356 Pel *dstCr = yuvDst->getCrAddr(partAddr);2357 Pel *depth = yuvDepth->getLumaAddr();2358 2359 #if H_3D_VSP_BLOCKSIZE == 12360 #if H_3D_VSP_CONSTRAINED2361 //get LUT based horizontal reference range2362 Int range = xGetConstrainedSize(width, height, false);2363 2364 // The minimum depth value2365 Int minRelativePos = MAX_INT;2366 Int maxRelativePos = MIN_INT;2367 2368 Int depthTmp;2369 for (Int yTxt=0; yTxt<height; yTxt++)2370 {2371 for (Int xTxt=0; xTxt<width; xTxt++)2372 {2373 depthTmp = m_pDepthBlock[xTxt+yTxt*width];2374 Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec;2375 Int disparityInt = disparity >> 3;//in chroma resolution2376 2377 if (disparityInt < 0)2378 {2379 if (minRelativePos > disparityInt+xTxt)2380 {2381 minRelativePos = disparityInt+xTxt;2382 }2383 }2384 else2385 {2386 if (maxRelativePos < disparityInt+xTxt)2387 {2388 maxRelativePos = disparityInt+xTxt;2389 }2390 }2391 }2392 }2393 2394 depthTmp = m_pDepthBlock[0];2395 Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec;2396 if ( disparity_tmp < 0 )2397 {2398 maxRelativePos = minRelativePos + range - 1;2399 }2400 else2401 {2402 minRelativePos = maxRelativePos - range + 1;2403 }2404 2405 #endif // H_3D_VSP_CONSTRAINED2406 #endif // H_3D_VSP_BLOCKSIZE == 12407 2408 TComMv dv(0, 0);2409 // luma size -> chroma size2410 height >>= 1;2411 width >>= 1;2412 2413 for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )2414 {2415 for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )2416 {2417 Pel repDepth = depth[ xTxt<<1 ];2418 assert( repDepth >= 0 && repDepth <= 255 );2419 2420 Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec;2421 Int xFrac = disparity & 0x7;2422 2423 dv.setHor( disparity );2424 cu->clipMv( dv );2425 2426 Int refOffset = xTxt + (dv.getHor() >> 3);2427 2428 #if H_3D_VSP_CONSTRAINED2429 if(refOffset<minRelativePos || refOffset>maxRelativePos)2430 {2431 xFrac = 0;2432 }2433 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2434 #endif2435 2436 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );2437 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );2438 2439 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );2440 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );2441 }2442 refCb += refStrideBlock;2443 refCr += refStrideBlock;2444 dstCb += dstStrideBlock;2445 dstCr += dstStrideBlock;2446 depth += depStrideBlock;2447 }2448 }2449 #endif2450 2451 #if H_3D_VSP_CONSTRAINED2452 Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma)2453 {2454 Int iSize = 0;2455 if (bLuma)2456 {2457 Int iArea = (nPbW+7) * (nPbH+7);2458 Int iAlpha = iArea / nPbH - nPbW - 7;2459 iSize = iAlpha + nPbW;2460 }2461 else // chroma2462 {2463 Int iArea = (nPbW+2) * (nPbH+2);2464 Int iAlpha = iArea / nPbH - nPbW - 4;2465 iSize = iAlpha + nPbW;2466 }2467 return iSize;2468 }2469 #endif // H_3D_VSP_CONSTRAINED2470 2471 #endif // H_3D_VSP2472 2473 2065 #if H_3D_DIM 2474 2066 Void TComPrediction::xPredBiSegDCs( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 ) … … 2485 2077 if( bL == bT ) 2486 2078 { 2487 #if SCU_HS_DEPTH_DC_PRED_G01432488 2079 const Int iTRR = ( patternStride * 2 - 1 ) - srcStride; 2489 2080 const Int iLBB = ( patternStride * 2 - 1 ) * srcStride - 1; 2490 2081 refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : (abs(ptrSrc[iTRR] - ptrSrc[-(Int)srcStride]) > abs(ptrSrc[iLBB] - ptrSrc[ -1]) ? ptrSrc[iTRR] : ptrSrc[iLBB]); 2491 #else2492 refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : 1<<( g_bitDepthY - 1 );2493 #endif2494 2082 refDC2 = ( ptrSrc[ -1] + ptrSrc[-(Int)srcStride] )>>1; 2495 2083 } … … 2593 2181 Int iSumPix[2]; 2594 2182 memset(iSumPix, 0, sizeof(Int)*2); 2595 #if QC_GENERIC_SDC_G01222596 2183 for( Int i = 0; i < uiNumSegments; i++ ) 2597 2184 { 2598 2185 rpSegMeans[i] = 0; 2599 2186 } 2600 #endif2601 2187 if (orgDC == false) 2602 2188 { … … 2613 2199 rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ]; 2614 2200 } 2615 #if QC_GENERIC_SDC_G01222616 2201 else if( getDimType( uiIntraMode ) == DMM4_IDX ) 2617 2202 { … … 2647 2232 } 2648 2233 else 2649 #else2650 else if (uiIntraMode == PLANAR_IDX)2651 #endif2652 2234 { 2653 2235 Pel* pLeftTop = pOrig; -
trunk/source/Lib/TLibCommon/TComPrediction.h
r872 r884 80 80 81 81 #if H_3D_VSP 82 Int* m_pDepthBlock; ///< Store a depth block, local variable, to prevent memory allocation every time 83 #if H_3D_VSP_CONSTRAINED 84 Int xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true); 85 #endif 86 TComYuv m_cYuvDepthOnVsp; 82 Int* m_pDepthBlock; ///< Store a depth block, local variable, to prevent memory allocation every time 83 TComYuv m_cYuvDepthOnVsp; 87 84 #endif 88 85 … … 121 118 122 119 #if H_3D_VSP 123 #if NTT_STORE_SPDV_VSP_G0148124 120 Void xPredInterUniSubPU ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 ); 125 #else126 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 );127 Void xPredInterLumaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);128 Void xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);129 #endif130 121 #endif 131 122 … … 172 163 // Depth intra 173 164 Void predIntraLumaDepth ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false 174 #if QC_GENERIC_SDC_G0122175 165 , TComWedgelet* dmm4Segmentation = NULL 176 #endif177 166 ); 178 167 #if H_3D_DIM_SDC -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r872 r884 599 599 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 600 600 601 #if SCU_HS_VSD_BUGFIX_IMPROV_G0163602 601 cDtParam.bitDepth = g_bitDepthY; 603 #endif 602 604 603 Dist dist = cDtParam.DistFunc( &cDtParam ); 605 604 … … 2985 2984 dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff; 2986 2985 2987 #if SCU_HS_VSD_BUGFIX_IMPROV_G01632988 2986 Double dDepthWeight = ( pOrg[x] >= ( (1<<(g_bitDepthY - 3)) + (1<<(g_bitDepthY - 2)) ) ? 4 : pOrg[x] > ((1<<g_bitDepthY) >> 4) ? (Float)(pOrg[x] - ((1<<g_bitDepthY) >> 4))/(Float)((1<<g_bitDepthY) >> 3) + 1 : 1.0 ); 2989 2987 Double dTemp = ( 0.5 * fabs(dD) * dDepthWeight * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) ); 2990 #else2991 Double dTemp = ( 0.5 * fabs(dD) * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) );2992 #endif2993 2988 iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5)); 2994 2989 -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r872 r884 112 112 , m_interLayerPredEnabledFlag (false) 113 113 , m_numInterLayerRefPicsMinus1 (0) 114 #if H_MV _HLS_7_POC_P0041114 #if H_MV 115 115 , m_sliceSegmentHeaderExtensionLength (0) 116 116 , m_pocResetIdc (0) … … 1284 1284 1285 1285 1286 1287 1286 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1288 1287 */ … … 1340 1339 1341 1340 } 1342 #if H_MV _HLS_7_MISC_P0130_201341 #if H_MV 1343 1342 if( isReference ) // Current picture is in the temporal RPS 1344 1343 { … … 1727 1726 } 1728 1727 } 1729 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271730 m_vpsNumberLayerSetsMinus1 = -1;1731 #endif1732 1728 m_vpsNumProfileTierLevelMinus1 = -1; 1733 1729 1734 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271735 for ( Int i = 0; i < MAX_VPS_PROFILE_TIER_LEVEL; i++)1736 {1737 #if !H_MV_HLS_7_VPS_P0048_141738 m_profileRefMinus1[ i ] = -1;1739 #endif1740 }1741 1742 m_moreOutputLayerSetsThanDefaultFlag = false;1743 m_numAddOutputLayerSetsMinus1 = -1;1744 m_defaultOneTargetOutputLayerIdc = 0;1745 #else1746 1730 m_numAddOutputLayerSets = -1; 1747 1731 m_defaultTargetOutputLayerIdc = 0; 1748 #endif1749 1732 1750 1733 for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++) … … 1756 1739 m_outputLayerFlag[i][j] = false; 1757 1740 } 1758 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271759 1741 m_altOutputLayerFlag[ i ] = false; 1760 #endif 1761 } 1762 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1763 m_altOutputLayerFlag = false; 1764 #endif 1742 } 1765 1743 m_maxOneActiveRefLayerFlag = false; 1766 1744 m_directDepTypeLenMinus2 = 0; … … 1768 1746 1769 1747 m_avcBaseLayerFlag = false; 1770 #if H_MV_HLS_7_VPS_P0307_231771 1748 m_vpsNonVuiExtensionLength = 0; 1772 #else1773 m_vpsVuiOffset = 0;1774 #endif1775 1749 m_splittingFlag = false; 1776 1750 … … 1786 1760 { 1787 1761 m_vpsProfilePresentFlag [i] = false; 1788 #if !H_MV_HLS_7_VPS_P0048_141789 m_profileRefMinus1[i] = 0;1790 #endif1791 1762 m_outputLayerSetIdxMinus1 [i] = 0; 1792 1763 for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ ) … … 2099 2070 Int TComVPS::getNumOutputLayerSets() 2100 2071 { 2101 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_272102 2072 return getNumAddOutputLayerSets() + getVpsNumLayerSetsMinus1() + 1; 2103 #else2104 Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1;2105 if ( getMoreOutputLayerSetsThanDefaultFlag( ) )2106 {2107 numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1);2108 }2109 return numOutputLayerSets;2110 #endif2111 2073 } 2112 2074 … … 2156 2118 } 2157 2119 2158 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_272159 2120 Void TComVPS::initTargetLayerIdLists() 2160 2121 { … … 2176 2137 } 2177 2138 } 2178 #else 2179 Void TComVPS::deriveTargetLayerIdLists() 2180 { 2181 m_targetDecLayerIdLists.resize( getNumOutputLayerSets() ); 2182 m_targetOptLayerIdLists.resize( getNumOutputLayerSets() ); 2183 2184 for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ ) 2185 { 2186 Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1; 2187 Int lsIdx = targetDecLayerSetIdx; 2188 2189 for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ ) 2190 { 2191 m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2192 if( getOutputLayerFlag( targetOptLayerSetIdx, j )) // This seems to be wrong in draft text 2193 { 2194 m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2195 } 2196 } 2197 } 2198 } 2199 #endif 2139 2140 Bool TComVPS::inferOutputLayerFlag( Int i, Int j ) 2141 { 2142 Bool outputLayerFlag; 2143 switch ( getDefaultTargetOutputLayerIdc( ) ) 2144 { 2145 case 0: 2146 outputLayerFlag = true; 2147 break; 2148 case 1: 2149 outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 ); 2150 break; 2151 case 2: 2152 if ( i == 0 && j == 0) 2153 { 2154 outputLayerFlag = true; // This is a software only fix for a bug in the spec. In spec outputLayerFlag is neither present nor inferred. 2155 } 2156 else 2157 { 2158 assert( 0 ); 2159 } 2160 break; 2161 default: 2162 assert( 0 ); 2163 break; 2164 } 2165 return outputLayerFlag; 2166 } 2167 2168 Int TComVPS::getMaxSubLayersInLayerSetMinus1( Int i ) 2169 { 2170 Int maxSLMinus1 = 0; 2171 Int optLsIdx = getLayerSetIdxForOutputLayerSet( i ); 2172 for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ ) 2173 { 2174 Int lId = m_layerSetLayerIdList[optLsIdx][k]; 2175 maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) )); 2176 } 2177 return maxSLMinus1; 2178 } 2200 2179 2201 2180 #endif // H_MV … … 2445 2424 , m_ppsInferScalingListFlag(false) 2446 2425 , m_ppsScalingListRefLayerId(0) 2447 #if H_MV_HLS_7_POC_P00412448 2426 , m_pocResetInfoPresentFlag(false) 2449 #endif2450 2427 #if H_3D 2451 2428 , m_pcDLT(NULL) … … 2455 2432 m_scalingList = new TComScalingList; 2456 2433 2457 #if H_MV _HLS_7_GEN_P0166_PPS_EXTENSION2434 #if H_MV 2458 2435 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 2459 2436 { … … 2461 2438 } 2462 2439 #endif 2463 2464 2440 } 2465 2441 … … 2980 2956 // Consider to check here: 2981 2957 // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer0 and RefPicSetInterLayer1 that is a RASL picture. " 2982 #if H_MV_HLS_7_MISC_P0130_202983 2958 assert( picRef->getSlice(0)->getDiscardableFlag() == false ); // "There shall be no picture that has discardable_flag equal to 1 in RefPicSetInterLayer0 or RefPicSetInterLayer1". 2984 #endif2985 2959 } 2986 2960 } … … 3018 2992 { 3019 2993 break; 3020 }2994 } 3021 2995 } 3022 2996 … … 3028 3002 if ( pcPic ) 3029 3003 { 3030 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 3031 { 3032 Bool remainingInterLayerReferencesFlag = false; 3033 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 3004 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 3034 3005 { 3035 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 3036 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 3006 Bool remainingInterLayerReferencesFlag = false; 3007 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 3008 { 3009 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 3010 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 3011 { 3012 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 3013 { 3014 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 3015 { 3016 remainingInterLayerReferencesFlag = true; 3017 } 3018 } 3019 } 3020 } 3021 if( !remainingInterLayerReferencesFlag ) 3037 3022 { 3038 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 3039 { 3040 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 3041 { 3042 remainingInterLayerReferencesFlag = true; 3023 pcPic->getSlice(0)->setReferenced( false ); 3043 3024 } 3044 3025 } 3045 } 3046 } 3047 if( !remainingInterLayerReferencesFlag ) 3048 { 3049 pcPic->getSlice(0)->setReferenced( false ); 3050 } 3051 } 3052 } 3053 } 3054 } 3026 } 3027 } 3028 } 3055 3029 } 3056 3030 … … 3157 3131 Int numActiveRefLayerPics; 3158 3132 3159 #if H_MV_HLS_7_MISC_P0079_183160 3133 if( getLayerId() == 0 || getNumRefLayerPics() == 0 ) 3161 #else3162 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) == 0 )3163 #endif3164 3134 { 3165 3135 numActiveRefLayerPics = 0; … … 3175 3145 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 3176 3146 { 3177 #if H_MV_HLS_7_MISC_P0079_183178 3147 numActiveRefLayerPics = 1; 3179 #else3180 numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0;3181 #endif3182 3148 } 3183 3149 else … … 3207 3173 for ( Int refListIdx = 0; refListIdx < ((m_eSliceType==B_SLICE) ? 2 : 1); refListIdx++ ) 3208 3174 { 3209 #if MTK_ARP_REF_SELECTION_G00533210 3175 Int diffPOC=MAX_INT; 3211 3176 Int idx=-1; 3212 #endif3213 3177 for(Int i = 0; i < getNumRefIdx(RefPicList(refListIdx)); i++ ) 3214 3178 { 3215 3179 if ( getRefPic(RefPicList(refListIdx), i)->getPOC() != getPOC() ) 3216 3180 { 3217 #if MTK_ARP_REF_SELECTION_G00533218 3181 if( abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC()) < diffPOC) 3219 3182 { … … 3221 3184 idx=i; 3222 3185 } 3223 #else3224 setFirstTRefIdx (RefPicList(refListIdx), i);3225 break;3226 #endif3227 3186 } 3228 #if MTK_ARP_REF_SELECTION_G00533229 3187 if(idx>=0) 3230 3188 { 3231 3189 setFirstTRefIdx (RefPicList(refListIdx), idx); 3232 3190 } 3233 #endif3234 3191 } 3235 3192 } … … 3368 3325 #endif 3369 3326 3370 #if MTK_DDD_G00633327 #if H_3D_DDD 3371 3328 if( getIsDepth() && getViewIndex() > 0 ) 3372 3329 { … … 3426 3383 } 3427 3384 3428 #if MTK_DDD_G00633385 #if H_3D_DDD 3429 3386 InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i ); 3430 3387 #endif … … 3434 3391 #endif 3435 3392 3436 #if MTK_DDD_G00633393 #if H_3D_DDD 3437 3394 Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ) 3438 3395 { … … 3837 3794 { 3838 3795 m_crossLayerIrapAlignedFlag = true; 3839 #if H_MV_HLS_7_MISC_P0068_213840 3796 m_allLayersIdrAlignedFlag = false; 3841 #endif3842 3797 m_bitRatePresentVpsFlag = false; 3843 3798 m_picRatePresentVpsFlag = false; … … 3866 3821 m_minHorizontalCtuOffsetPlus1 [i][j] = -1; 3867 3822 } 3868 #if H_MV_HLS_7_MISC_P0182_133869 3823 m_baseLayerParameterSetCompatibilityFlag[i] = false; 3870 #endif3871 3824 } 3872 3825 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) … … 3889 3842 if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters; 3890 3843 m_vpsVuiBspHrdParameters = NULL; 3844 } 3845 3846 Void TComVPSVUI::inferVpsVui( Bool encoderFlag ) 3847 { 3848 // inference of syntax elements that differ from default inference (as done in constructor), when VPS VUI is not present 3849 if (!encoderFlag ) 3850 { 3851 setCrossLayerIrapAlignedFlag( false ); 3852 } 3853 else 3854 { 3855 assert( !getCrossLayerIrapAlignedFlag() ); 3856 } 3891 3857 } 3892 3858 … … 3955 3921 setMatrixCoefficients ( videoSignalInfo->getMatrixCoeffsVps () ); 3956 3922 } 3957 #endif 3923 3924 TComDpbSize::TComDpbSize() 3925 { 3926 for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ ) 3927 { 3928 m_subLayerFlagInfoPresentFlag[i] = false; 3929 3930 for (Int j = 0; j < MAX_TLAYER; j++ ) 3931 { 3932 m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ; 3933 m_maxVpsNumReorderPics [i][j] = 0; 3934 m_maxVpsLatencyIncreasePlus1 [i][j] = 0; 3935 3936 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ ) 3937 { 3938 m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 3939 } 3940 } 3941 } 3942 } 3943 #endif -
trunk/source/Lib/TLibCommon/TComSlice.h
r872 r884 473 473 Bool m_crossLayerPicTypeAlignedFlag; 474 474 Bool m_crossLayerIrapAlignedFlag; 475 #if H_MV_HLS_7_MISC_P0068_21476 475 Bool m_allLayersIdrAlignedFlag; 477 #endif478 476 Bool m_bitRatePresentVpsFlag; 479 477 Bool m_picRatePresentVpsFlag; … … 484 482 Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 485 483 Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 486 #if H_MV_HLS_7_VPS_P0076_15487 484 Bool m_videoSignalInfoIdxPresentFlag; 488 485 Int m_vpsNumVideoSignalInfoMinus1; 489 486 TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO]; 490 487 Int m_vpsVideoSignalInfoIdx [MAX_NUM_VIDEO_SIGNAL_INFO]; 491 #endif492 488 Bool m_tilesNotInUseFlag; 493 489 Bool m_tilesInUseFlag [MAX_NUM_LAYERS]; … … 500 496 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 501 497 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 502 #if !H_MV_HLS_7_VPS_P0076_15503 Bool m_videoSignalInfoIdxPresentFlag;504 Int m_vpsNumVideoSignalInfoMinus1;505 TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO];506 Int m_vpsVideoSignalInfoIdx [MAX_NUM_VIDEO_SIGNAL_INFO];507 #endif508 498 Bool m_vpsVuiBspHrdPresentFlag; 509 499 TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters; 510 #if H_MV_HLS_7_MISC_P0182_13511 500 Bool m_baseLayerParameterSetCompatibilityFlag[MAX_NUM_LAYERS]; 512 #endif513 501 514 502 public: … … 521 509 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 522 510 523 #if H_MV_HLS_7_MISC_P0068_21524 511 Void setAllLayersIdrAlignedFlag( Bool flag ) { m_allLayersIdrAlignedFlag = flag; } 525 512 Bool getAllLayersIdrAlignedFlag( ) { return m_allLayersIdrAlignedFlag; } 526 #endif527 513 528 514 Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } … … 550 536 Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } 551 537 552 #if H_MV_HLS_7_VPS_P0076_15553 538 Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } 554 539 Bool getVideoSignalInfoIdxPresentFlag( ) { return m_videoSignalInfoIdxPresentFlag; } … … 562 547 Void setVpsVideoSignalInfoIdx( Int i, Int val ) { m_vpsVideoSignalInfoIdx[i] = val; } 563 548 Int getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } 564 #endif565 549 566 550 Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; } … … 593 577 Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } 594 578 Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } 595 #if !H_MV_HLS_7_VPS_P0076_15 596 Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } 597 Bool getVideoSignalInfoIdxPresentFlag( ) { return m_videoSignalInfoIdxPresentFlag; } 598 599 Void setVideoSignalInfo( Int i, TComVideoSignalInfo* val ) { m_videoSignalInfo[i] = val; } 600 TComVideoSignalInfo* getVideoSignalInfo( Int i ) { return m_videoSignalInfo[i]; } 601 602 Void setVpsNumVideoSignalInfoMinus1( Int val ) { m_vpsNumVideoSignalInfoMinus1 = val; } 603 Int getVpsNumVideoSignalInfoMinus1( ) { return m_vpsNumVideoSignalInfoMinus1; } 604 605 Void setVpsVideoSignalInfoIdx( Int i, Int val ) { m_vpsVideoSignalInfoIdx[i] = val; } 606 Int getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } 607 #endif 579 608 580 Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; } 609 581 Bool getVpsVuiBspHrdPresentFlag( ) { return m_vpsVuiBspHrdPresentFlag; } … … 612 584 TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters( ) { return m_vpsVuiBspHrdParameters; } 613 585 614 #if H_MV_HLS_7_MISC_P0182_13615 586 Void setBaseLayerParameterSetCompatibilityFlag( Int i, Bool flag ) { m_baseLayerParameterSetCompatibilityFlag[i] = flag; } 616 587 Bool getBaseLayerParameterSetCompatibilityFlag( Int i ) { return m_baseLayerParameterSetCompatibilityFlag[i]; } 617 #endif 618 619 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG 620 Void inferVpsVui( Bool encoderFlag ) 621 { 622 // inference of syntax elements that differ from default inference (as done in constructor), when VPS VUI is not present 623 if (!encoderFlag ) 624 { 625 setCrossLayerIrapAlignedFlag( false ); 626 } 627 else 628 { 629 assert( !getCrossLayerIrapAlignedFlag() ); 630 } 631 632 } 633 #endif 588 589 Void inferVpsVui( Bool encoderFlag ); 634 590 }; 635 591 … … 686 642 687 643 public: 688 TComDpbSize( ) 689 { 690 for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ ) 691 { 692 m_subLayerFlagInfoPresentFlag[i] = false; 693 694 for (Int j = 0; j < MAX_TLAYER; j++ ) 695 { 696 m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ; 697 m_maxVpsNumReorderPics [i][j] = 0; 698 m_maxVpsLatencyIncreasePlus1 [i][j] = 0; 699 700 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ ) 701 { 702 m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 703 } 704 } 705 } 706 } 644 TComDpbSize( ); 707 645 708 646 Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; } … … 768 706 /// VPS EXTENSION SYNTAX ELEMENTS 769 707 Bool m_avcBaseLayerFlag; 770 #if H_MV_HLS_7_VPS_P0307_23771 708 Int m_vpsNonVuiExtensionLength; 772 #else773 Int m_vpsVuiOffset;774 #endif775 709 Bool m_splittingFlag; 776 710 Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; … … 788 722 Int m_maxTidIlRefPicsPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 789 723 Bool m_allRefLayersActiveFlag; 790 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27791 Int m_vpsNumberLayerSetsMinus1;792 #endif793 724 Int m_vpsNumProfileTierLevelMinus1; 794 725 Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; 795 726 796 #if !H_MV_HLS_7_VPS_P0048_14797 Int m_profileRefMinus1 [MAX_VPS_PROFILE_TIER_LEVEL];798 #endif799 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27800 727 Int m_numAddOutputLayerSets; 801 728 Int m_defaultTargetOutputLayerIdc; 802 #else803 Bool m_moreOutputLayerSetsThanDefaultFlag;804 Int m_numAddOutputLayerSetsMinus1;805 Int m_defaultOneTargetOutputLayerIdc;806 #endif807 729 808 730 Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; 809 731 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 810 732 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 811 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27812 733 Bool m_altOutputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS]; 813 #else814 Bool m_altOutputLayerFlag;815 #endif816 734 Bool m_repFormatIdxPresentFlag; 817 735 Int m_vpsNumRepFormatsMinus1; … … 869 787 #if H_3D_SPIVMP 870 788 Int m_iSubPULog2Size [MAX_NUM_LAYERS ]; 871 #endif872 #endif873 #if QC_SPIVMP_MPI_G0119874 789 Int m_iSubPUMPILog2Size; 790 #endif 875 791 #endif 876 792 #if H_3D_VSP … … 974 890 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } 975 891 976 #if H_MV_HLS_7_VPS_P0307_23977 892 Void setVpsNonVuiExtensionLength( Int val ) { m_vpsNonVuiExtensionLength = val; } 978 893 Int getVpsNonVuiExtensionLength( ) { return m_vpsNonVuiExtensionLength; } 979 #else980 Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; }981 Int getVpsVuiOffset( ) { return m_vpsVuiOffset; }982 #endif983 894 984 895 Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } … … 988 899 Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } 989 900 Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } 901 990 902 Int getNumScalabilityTypes( ); 991 903 … … 1009 921 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 1010 922 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 923 1011 924 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 1012 925 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 926 1013 927 Void setVpsSubLayersMaxMinus1PresentFlag( Bool flag ) { m_vpsSubLayersMaxMinus1PresentFlag = flag; } 1014 928 Bool getVpsSubLayersMaxMinus1PresentFlag( ) { return m_vpsSubLayersMaxMinus1PresentFlag; } 929 1015 930 Void setSubLayersVpsMaxMinus1( Int i, Int val ) { m_subLayersVpsMaxMinus1[i] = val; } 1016 931 Int getSubLayersVpsMaxMinus1( Int i ) { return m_subLayersVpsMaxMinus1[i]; } 1017 932 Void checkSubLayersVpsMaxMinus1( Int i ) { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); } 933 1018 934 Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } 1019 935 Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } 936 1020 937 Void setMaxTidIlRefPicsPlus1( Int i, Int j, Int val ) { m_maxTidIlRefPicsPlus1[i][j] = val; } 1021 938 Int getMaxTidIlRefPicsPlus1( Int i, Int j ) { return m_maxTidIlRefPicsPlus1[i][j]; } 939 1022 940 Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } 1023 941 Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } 1024 942 1025 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271026 Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; }1027 Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; }1028 #endif1029 1030 943 Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } 1031 944 Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } … … 1034 947 Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } 1035 948 1036 #if !H_MV_HLS_7_VPS_P0048_141037 Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; }1038 Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; }1039 Void checkProfileRefMinus1( Int i ) { assert( getProfileRefMinus1( i ) + 1 <= i ); }; // The value of profile_ref_minus1[ i ] + 1 shall be less than or equal to i.1040 #endif1041 1042 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271043 Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; }1044 Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; }1045 #endif1046 1047 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271048 949 Void setNumAddOutputLayerSets( Int val ) { m_numAddOutputLayerSets = val; } 1049 950 Int getNumAddOutputLayerSets( ) { return m_numAddOutputLayerSets; } 1050 #else 1051 Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } 1052 Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } 1053 #endif 1054 1055 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 951 1056 952 Void setDefaultTargetOutputLayerIdc( Int val ) { m_defaultTargetOutputLayerIdc = val; } 1057 953 Int getDefaultTargetOutputLayerIdc( ) { return m_defaultTargetOutputLayerIdc; } 1058 #else1059 Void setDefaultOneTargetOutputLayerIdc( Int val ) { m_defaultOneTargetOutputLayerIdc = val; }1060 Int getDefaultOneTargetOutputLayerIdc( ) { return m_defaultOneTargetOutputLayerIdc; }1061 Void checkDefaultOneTargetOutputLayerIdc( ) { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); }1062 #endif1063 954 1064 955 Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } … … 1067 958 Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } 1068 959 Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } 1069 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1070 Bool inferOutputLayerFlag( Int i, Int j ) 1071 { 1072 Bool outputLayerFlag; 1073 switch ( getDefaultTargetOutputLayerIdc( ) ) 1074 { 1075 case 0: 1076 outputLayerFlag = true; 1077 break; 1078 case 1: 1079 outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 ); 1080 break; 1081 case 2: 1082 if ( i == 0 && j == 0) 1083 { 1084 outputLayerFlag = true; // This is a software only fix for a bug in the spec. In spec outputLayerFlag neither present nor inferred. 1085 } 1086 else 1087 { 1088 assert( 0 ); 1089 } 1090 break; 1091 default: 1092 assert( 0 ); 1093 break; 1094 } 1095 return outputLayerFlag; 1096 } 1097 #else 1098 Bool inferOutputLayerFlag( Int layerSetIdx, Int i ) { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1 ) )); } 1099 #endif 960 961 Bool inferOutputLayerFlag( Int i, Int j ); 1100 962 1101 963 Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx ] = val; } 1102 964 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 1103 965 1104 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271105 966 Void setAltOutputLayerFlag( Int i, Bool flag ) { m_altOutputLayerFlag[i] = flag; } 1106 967 Bool getAltOutputLayerFlag( Int i ) { return m_altOutputLayerFlag[i]; } 1107 #else1108 Void setAltOutputLayerFlag( Bool flag ) { m_altOutputLayerFlag = flag; }1109 Bool getAltOutputLayerFlag( ) { return m_altOutputLayerFlag; }1110 #endif1111 968 1112 969 Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } … … 1121 978 Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } 1122 979 TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } 980 1123 981 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 1124 982 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } … … 1134 992 Void setPocLsbNotPresentFlag( Int i, Bool flag ) { m_pocLsbNotPresentFlag[i] = flag; } 1135 993 Bool getPocLsbNotPresentFlag( Int i ) { return m_pocLsbNotPresentFlag[i]; } 994 1136 995 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 1137 996 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } … … 1142 1001 Void setDefaultDirectDependencyType( Int val ) { m_defaultDirectDependencyType = val; } 1143 1002 Int getDefaultDirectDependencyType( ) { return m_defaultDirectDependencyType; } 1003 1144 1004 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 1145 1005 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } … … 1167 1027 1168 1028 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 1169 1170 #if H_MV_HLS_7_VPS_P0306_221171 1029 Int getVpsRepFormatIdxLen() { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); }; 1172 #endif 1030 1173 1031 Int getNumLayersInIdList ( Int lsIdx ); 1174 1032 … … 1178 1036 Void deriveLayerSetLayerIdList(); 1179 1037 1180 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_271181 1038 Int getLayerSetIdxForOutputLayerSet( Int i ) { return ( i <= getVpsNumLayerSetsMinus1() ) ? i : getOutputLayerSetIdxMinus1( i ) + 1 ; }; 1182 1039 … … 1189 1046 Int getNumOutputLayersInOutputLayerSet( Int i ) { return (Int) getTargetOptLayerIdList( i ).size(); }; 1190 1047 Int getOlsHighestOutputLayerId( Int i ) { return getTargetOptLayerIdList( i ).back(); }; 1191 #else 1192 Void deriveTargetLayerIdLists(); 1193 std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 1194 std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 1195 #endif 1196 1197 #if H_MV_HLS_7_HRD_P0156_7 1198 Int getMaxSubLayersInLayerSetMinus1( Int i ) 1199 { 1200 Int maxSLMinus1 = 0; 1201 Int optLsIdx = getLayerSetIdxForOutputLayerSet( i ); 1202 for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ ) 1203 { 1204 Int lId = m_layerSetLayerIdList[optLsIdx][k]; 1205 maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) )); 1206 } 1207 return maxSLMinus1; 1208 } 1209 #endif 1048 1049 Int getMaxSubLayersInLayerSetMinus1( Int i ); 1210 1050 1211 1051 // inference … … 1232 1072 UInt getCamParPrecision () { return m_uiCamParPrecision; } 1233 1073 Bool getCamParPresent ( Int viewIndex ) { return m_bCamParPresent[viewIndex]; } 1234 #if FIX_CAM_PARS_COLLECTOR1235 1074 Void setCamParPresent ( Int viewIndex, Bool val ) { m_bCamParPresent[viewIndex] = val; } 1236 #endif1237 1075 Bool hasCamParInSliceHeader( Int viewIndex ) { return m_bCamParInSliceHeader[viewIndex]; } 1238 1076 Void setHasCamParInSliceHeader( Int viewIndex, Bool b ) { m_bCamParInSliceHeader[viewIndex] = b; } … … 1248 1086 Int getSubPULog2Size(Int layerIdInVps) { return m_iSubPULog2Size[layerIdInVps]; } 1249 1087 Void setSubPULog2Size(Int layerIdInVps, Int u) { m_iSubPULog2Size[layerIdInVps] = u;} 1250 #endif1251 #endif1252 #if QC_SPIVMP_MPI_G01191253 1088 Int getSubPUMPILog2Size( ) { return m_iSubPUMPILog2Size; } 1254 1089 Void setSubPUMPILog2Size( Int u ) { m_iSubPUMPILog2Size = u; } 1090 #endif 1255 1091 #endif 1256 1092 #if H_3D_VSP … … 1940 1776 Int m_ppsScalingListRefLayerId; 1941 1777 1942 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION1943 1778 Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM]; 1944 #endif1945 #if H_MV_HLS_7_POC_P00411946 1779 Bool m_pocResetInfoPresentFlag; 1947 #endif1948 1780 #endif 1949 1781 … … 2088 1920 Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } 2089 1921 2090 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION2091 1922 Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; } 2092 1923 Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; } 2093 #endif 2094 2095 #if H_MV_HLS_7_POC_P0041 1924 2096 1925 Void setPocResetInfoPresentFlag( Bool flag ) { m_pocResetInfoPresentFlag = flag; } 2097 1926 Bool getPocResetInfoPresentFlag( ) { return m_pocResetInfoPresentFlag; } 2098 #endif2099 2100 1927 #endif 2101 1928 }; … … 2243 2070 Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; 2244 2071 2245 #if H_MV_HLS_7_POC_P00412246 2072 Int m_sliceSegmentHeaderExtensionLength; 2247 2073 Int m_pocResetIdc; … … 2252 2078 Int m_pocMsbVal; 2253 2079 Bool m_pocMsbValRequiredFlag; 2254 #endif2255 2080 2256 2081 #if H_3D … … 2278 2103 #endif 2279 2104 2280 #if MTK_DDD_G00632105 #if H_3D_DDD 2281 2106 Int m_aiDDDInvScale [MAX_NUM_LAYERS]; 2282 2107 Int m_aiDDDInvOffset[MAX_NUM_LAYERS]; … … 2600 2425 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 2601 2426 2602 #if H_MV_HLS_7_POC_P00412603 2427 Void setSliceSegmentHeaderExtensionLength( Int val ) { m_sliceSegmentHeaderExtensionLength = val; } 2604 2428 Int getSliceSegmentHeaderExtensionLength( ) { return m_sliceSegmentHeaderExtensionLength; } … … 2637 2461 return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 2638 2462 } 2639 #endif2640 2463 2641 2464 // Additional variables derived in slice header semantics … … 2658 2481 2659 2482 #endif 2660 #if MTK_DDD_G00632483 #if H_3D_DDD 2661 2484 Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ); 2662 2485 Int getDepthFromDV( Int iDV, Int iBaseViewIdx ) -
trunk/source/Lib/TLibCommon/TypeDef.h
r872 r884 76 76 #if H_3D 77 77 #define H_3D_QTLPC 1 // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068 78 // HHI_QTLPC_RAU_OFF_C0160 // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 78 // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 79 // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055 79 80 80 81 #define H_3D_VSO 1 // VSO, View synthesis optimization, includes: … … 83 84 // SAIT_VSO_EST_A0033, JCT3V-A0033 modification 3 84 85 // LGE_WVSO_A0119 86 // SCU_HS_VSD_BUGFIX_IMPROV_G0163 85 87 #define H_3D_NBDV 1 // Neighboring block disparity derivation 86 88 // QC_JCT3V-A0097 … … 102 104 // SHARP_ARP_REF_CHECK_F0105 ARP reference picture selection and DPB check 103 105 // LGE_ARP_CTX_F0161 JCT3V-F0161 106 // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061 107 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 108 104 109 #define H_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 105 110 // Unifying rounding offset, for IC part, JCT3V-D0135 … … 109 114 // LGE_IC_CTX_F0160 //JCT3V-F0160 110 115 // SEC_ONLY_TEXTURE_IC_F0151 116 // MTK_IC_FLAG_CABAC_SIMP_G0061 117 // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121 111 118 112 119 #if H_3D_NBDV … … 133 140 // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss 134 141 // LGE_SHARP_VSP_INHERIT_F0104 142 // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP 143 // Restricted bi-prediction for VSP 135 144 136 145 #define H_3D_IV_MERGE 1 // Inter-view motion merge candidate … … 145 154 // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate 146 155 // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode 156 // MTK_NBDV_IVREF_FIX_G0067 , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067 157 // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074 158 // QC_DEPTH_MERGE_SIMP_G0127 Remove DV candidate and shifting candidate for depth coding 159 147 160 #define H_3D_TMVP 1 // QC_TMVP_C0047 148 161 // Sony_M23639 … … 173 186 // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs 174 187 // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes 188 // Unify intra SDC and inter SDC 189 // QC_GENERIC_SDC_G0122 Generalize SDC to all depth intra modes 190 // SCU_HS_DEPTH_DC_PRED_G0143 191 // HS_TSINGHUA_SDC_SPLIT_G0111 192 // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split 193 194 175 195 176 196 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding 177 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 197 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 198 // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates 199 178 200 #define H_3D_SPIVMP 1 // H_3D_SPIVMP // JCT3V-F0110: Sub-PU level inter-view motion prediction 201 // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077 202 // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate 203 // Simplification on Sub-PU level temporal interview motion prediction 204 205 206 #define H_3D_DBBP 1 // DBBP: Depth-based Block Partitioning and Merging 207 208 #define H_3D_DDD 1 // Disparity derived depth coding 209 179 210 #define H_3D_FCO 0 // Flexible coding order for 3D 180 211 … … 258 289 259 290 291 ///// ***** DEPTH BASED BLOCK PARTITIONING ********* 292 #if H_3D_DBBP 293 #define DBBP_INVALID_SHORT (-4) 294 #define RWTH_DBBP_PACK_MODE SIZE_2NxN 295 #endif 296 297 260 298 ///// ***** FCO ********* 261 299 #if H_3D_FCO … … 269 307 #endif 270 308 271 272 309 ///////////////////////////////////////////////////////////////////////////////////////// 273 /////////////////////////////////// HTM-10.0 Integrations//////////////////////////////310 /////////////////////////////////// TBD ////////////////////////////// 274 311 ///////////////////////////////////////////////////////////////////////////////////////// 275 #if H_3D 276 #if H_3D_QTLPC 277 #define MTK_TEX_DEP_PAR_G0055 1 // Texture-partition-dependent depth partition. JCT3V-G0055 278 #endif 279 280 #define MTK_DDD_G0063 1 // Disparity derived depth coding 281 #define HTM10RC1_FIX 1 // Fix of DDD 282 283 284 #if H_3D_VSP 285 #define MTK_RBIP_VSP_G0069 1 // Restricted bi-prediction for VSP 286 #define NTT_STORE_SPDV_VSP_G0148 1 // Storing Sub-PU based DV for VSP 287 #endif 288 289 #define H_3D_DBBP 1 // DBBP: Depth-based Block Partitioning and Merging 290 291 #if H_3D_DBBP 292 #define DBBP_INVALID_SHORT (-4) 293 #define RWTH_DBBP_PACK_MODE SIZE_2NxN 294 #endif 295 296 #if H_3D_DIM 297 #define QC_PKU_SDC_SPLIT_G0123 1 // Intra SDC Split 298 #if QC_PKU_SDC_SPLIT_G0123 299 #define HS_TSINGHUA_SDC_SPLIT_G0111 1 300 #endif 301 #define SCU_HS_DEPTH_DC_PRED_G0143 1 302 #define QC_GENERIC_SDC_G0122 1 // Generalize SDC to all depth intra modes 303 #if H_3D_DIM_SDC && H_3D_INTER_SDC 304 #define QC_SDC_UNIFY_G0130 1 // Unify intra SDC and inter SDC 305 #define QC_SDC_UNIFY_G0130_FIX 1 // Fix bug of G0130 306 #define QC_SDC_UNIFY_G0130_FIX2 1 // Fix bug of G0130 307 #endif 308 #define SEC_INTER_SDC_G0101 1 // Improved inter SDC with multiple DC candidates 309 #endif 310 311 #define KHU_SIMP_SPIVMP_G0147 1 // Simplification on Sub-PU level temporal interview motion prediction 312 313 #if H_3D_SPIVMP 314 #define QC_SPIVMP_MPI_G0119 1 // Sub-PU level MPI merge candidate 315 #endif 316 317 #define QC_DEPTH_MERGE_SIMP_G0127 1 // Remove DV candidate and shifting candidate for depth coding 318 #define SEC_IC_ARP_SIG_G0072 1 // Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121 319 #define SCU_HS_VSD_BUGFIX_IMPROV_G0163 1 320 #define SEC_SPIVMP_MCP_SIZE_G0077 1 // Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077 321 #define SEC_DEPTH_DV_DERIVAITON_G0074 1 // Simplification of DV derivation for depth, JCT3V-G0074 322 #define MTK_ARP_REF_SELECTION_G0053 1 // ARP Reference picture selection in JCT3V-G0053 323 #define MTK_ARP_FLAG_CABAC_SIMP_G0061 1 // Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061 324 #define MTK_IC_FLAG_CABAC_SIMP_G0061 1 // Use only 1 context for IC flag in JCT3V-G0061 325 #define MTK_NBDV_IVREF_FIX_G0067 1 // Disable IvMC, VSP when IVREF is not available, JCT3V-G0067 326 #endif 327 328 ///////////////////////////////////////////////////////////////////////////////////////// 329 /////////////////////////////////// HTM-10.1 Integrations ////////////////////////////// 330 ///////////////////////////////////////////////////////////////////////////////////////// 331 332 333 // TBD 312 334 313 // #define H_MV_HLS_7_POC_P0041_3 0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above) 335 314 // #define H_MV_HLS_7_POC_P0041_FIXES 0 // (POC/P0041/Fixes) For each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. … … 343 322 // #define H_MV_HLS_7_VPS_P0300_27 0 // Output part only. (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt. 344 323 345 346 #define H_MV_HLS_7_VPS_P0306_22 1 // (VPS/P0306/ue(v) coded syntax elements) #22 Several minor modifications to the VPS syntax, consistent with eliminating the previous intention to avoid ue(v) parsing in the VPS 347 #define H_MV_HLS_7_SEI_P0204_26 1 // (SEI/P0204/sub-bitstream SEI) #26 Add sub-bitstream property SEI message. Decision: Adopt 348 #define H_MV_HLS_7_MISC_P0130_20 1 // (MISC/P0130/discardable not in inter-layer RPS) #20 Add constraint restricting pictures marked as discardable from being present in the temporal or inter-layer RPS, 349 #define H_MV_HLS_7_VPS_P0125_24 1 // (VPS/P0125/VPS extension offset ) #24 Decision: Keep it as a reserved FFFF value. 350 #define H_MV_HLS_7_VPS_P0307_23 1 // (VPS/P0307/VPS VUI extension) #23 Decision: Adopt modification in P0307. 351 #define H_MV_HLS_7_POC_P0041 1 // Syntax related to POC reset 352 353 354 #define H_MV_HLS7_GEN 0 // General changes (not tested) 355 #define H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1 // Output layer sets, various 356 // (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt. 357 // (VPS/P0156/Num of output_layer_flag) #10 Proposal 3: The output_layer_flag[ i ][ j ] is signalled for j equal to 0 to NumLayersInIdList[ lsIdx ] inclusive. It was remarked that we might be able to just assume that the top layer is always output; however, this was not entirely clear , so the safe thing to do may be to also send the flag for this layer. 358 // (VPS/P0295/Default output layer sets) #5 Discussion from (P0110). Decision: Three-state approach (text in P0295, decoder shall allow 3 to be present and shall treat 3 the same as the value 2). 359 360 361 #define H_MV_HLS_7_HRD_P0156_7 1 // (HRD/P0156/MaxSubLayersInLayerSetMinus1) #7 Proposal 1: signal, in the VPS extension, the DPB parameters for an output layer set for sub-DPBs only up to the maximum temporal sub-layers in the corresponding layer set 362 #define H_MV_HLS_7_VPS_P0048_14 1 // (VPS/P0048/profile_ref_minus1 rem) #14 Remove profile_ref_minus1 from the VPS extension, from JCTVC-P0048 363 #define H_MV_HLS_7_VPS_P0076_15 1 // (VPS/P0076/video signal info move) #15 Move video signal information syntax structure earlier in the VPS VUI. 364 #define H_MV_HLS_7_SPS_P0155_16_32 1 // (SPS/P0155/sps_sub_layer_ordering_info) #16, #32 Not signal the sps_max_num_reorder_pics[], sps_max_latency_increase_plus1[], and sps_max_dec_pic_buffering_minus1[] syntax elements in the SPS when nuh_layer_id > 0. 365 #define H_MV_HLS_7_GEN_P0166_PPS_EXTENSION 1 // (GEN/P0166/pps_extension) #17 Add PPS extension type flags for conditional presence of syntax extensions per extension type, aligned with the SPS extension type flags, from JCTVC-P0166. Further align the SPS extension type flags syntax between RExt and MV-HEVC/SHVC 366 #define H_MV_HLS_7_FIX_SET_DPB_SIZE 1 // Fix derivation dpb size parameters 367 #define H_MV_HLS_7_RESERVED_FLAGS 1 // Added flags 368 // (SPS/P0312/SHVC reserved flag) The flag will be used for the syntax vert_phase_position_enable_flag in SHVC draft 369 // (VPS/O0215/SHVC reserved flag): this flag will be used for the syntax cross_layer_phase_alignment_flag in SHVC draft. 370 // (VPS VUI/O0199,P0312/SHVC reserved flags) the 3 reserved bits will be used for the syntaxes single_layer_for_non_irap_flag, higher_layer_irap_skip_flag and vert_phase_position_not_in_use_flag in SHVC draft. 371 #define H_MV_FIX_VPS_LAYER_ID_NOT_EQUAL_ZERO 1 // Discard VPS with nuh_layer_Id > 0 372 #define H_MV_HLS_7_MISC_P0130_EOS 1 // (MISC/P0130/EOS NAL layer id) #19 Require that end of bitstream NAL unit shall have nuh_layer_id equal to 0, from JCTVC-P0130. Decoders shall allow an end of bitstream NAL unit with nuh_layer_id > 0 to be present, and shall ignore the NAL unit. 373 #define H_MV_HLS_7_MISC_P0182_13 1 // (MISC/P0182/BL PS Compatibility flag) #13 Define the flag (in VPS VUI) with the proposed semantics, without specifying an associated extraction process. Editors to select the position in the VPS VUI. 374 #define H_MV_HLS_7_MISC_P0068_21 1 // (MISC/P0068/all irap idr flag) #21 Add flag in VUI to indicate that all IRAP pictures are IDRs and that all layer pictures in an AU are IDR aligned, from JCTVC-P0068 proposal 1. 375 #define H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG 1 // Fix inference of cross_layer_irap_aligned_flag 376 #define H_MV_HLS_7_MISC_P0079_18 1 // (MISC/P0079/NumActiveRefLayerPics) #18 Modification of derivation of variable NumActiveRefLayerPics. 377 #define FIX_CAM_PARS_COLLECTOR 1 378 #define UPDATE_HM13 1 // Only some parts in H_3D parts are marked! 379 #if H_3D 380 #define H_3D_FIX_G0148_BRACE 1 381 #endif 324 #define H_MV_HLS7_GEN 0 // General changes (not tested) 325 326 327 382 328 ///////////////////////////////////////////////////////////////////////////////////////// 383 329 /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// … … 416 362 #define MAX_NUM_BITSTREAM_PARTITIONS 100 ///< Maximum value is actually not specified 417 363 #define MAX_NUM_BSP_SCHED_COMBINATION 100 ///< Maximum value is actually not specified 418 #if H_MV_HLS_7_SEI_P0204_26419 364 #define MAX_SUB_STREAMS 1024 420 #endif421 365 #else 422 366 #define MAX_NUM_LAYER_IDS 64 … … 909 853 #if H_MV 910 854 911 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION912 855 enum PpsExtensionTypes 913 856 { … … 921 864 922 865 //Below for sps, would be good if this could be aligned 923 #endif924 866 925 867 enum PsExtensionTypes
Note: See TracChangeset for help on using the changeset viewer.