Changeset 833 in 3DVCSoftware for trunk/source/Lib
- Timestamp:
- 7 Feb 2014, 20:31:12 (11 years ago)
- Location:
- trunk/source/Lib
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/ContextTables.h
r773 r833 97 97 98 98 #if H_3D_ARP 99 #if MTK_ARP_FLAG_CABAC_SIMP_G0061 100 #define NUM_ARPW_CTX 3 ///< number of context models for weighting factor index used by advanced residual prediction 101 #else 99 102 #define NUM_ARPW_CTX 4 ///< number of context models for weighting factor index used by advanced residual prediction 100 103 #endif 104 #endif 101 105 102 106 #if H_3D_IC 107 #if MTK_IC_FLAG_CABAC_SIMP_G0061 108 #define NUM_IC_FLAG_CTX 1 ///< number of context models for illumination compensation flag 109 #else 103 110 #define NUM_IC_FLAG_CTX 3 ///< number of context models for illumination compensation flag 104 111 #endif 112 #endif 105 113 106 114 #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' 107 115 108 116 #if H_3D_DIM 117 #if QC_GENERIC_SDC_G0122 118 #define NUM_DEPTH_INTRA_MODE_CTX 1 ///< number of context models for depth intra modes 119 #else 109 120 #define NUM_DEPTH_INTRA_MODE_CTX 8 ///< number of context models for depth intra modes 121 #endif 110 122 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (DMM or RBC) 111 123 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or RBC) … … 113 125 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 114 126 #endif 127 #if QC_GENERIC_SDC_G0122 128 #define NUM_ANGLE_FLAG_CTX 3 129 #if !QC_SDC_UNIFY_G0130 130 #define NUM_INTRASDC_FLAG_CTX 3 131 #endif 132 #endif 115 133 #endif 116 134 … … 120 138 #endif 121 139 122 #if H_3D_INTER_SDC 140 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 123 141 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 124 142 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual 125 143 #define NUM_INTER_SDC_RESIDUAL_CTX 1 ///< number of context models for abs of inter SDC residual 144 #endif 145 146 #if QC_SDC_UNIFY_G0130 147 #define NUM_SDC_FLAG_CTX 1 ///< number of context 148 #endif 149 #if H_3D_DBBP 150 #define DBBP_NUM_FLAG_CTX 1 126 151 #endif 127 152 // ==================================================================================================================== … … 364 389 365 390 #if H_3D_ARP 391 #if MTK_ARP_FLAG_CABAC_SIMP_G0061 392 static const UChar 393 INIT_ARPW[3][NUM_ARPW_CTX] = 394 { 395 { 162, 153, 162 }, 396 { 162, 153, 162 }, 397 { 162, 153, 162 }, 398 }; 399 #else 366 400 static const UChar 367 401 INIT_ARPW[3][NUM_ARPW_CTX] = … … 372 406 }; 373 407 #endif 374 408 #endif 375 409 #if H_3D_IC 410 #if MTK_IC_FLAG_CABAC_SIMP_G0061 411 static const UChar 412 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 413 { 414 { 154 }, 415 { 154 }, 416 { 154 }, 417 }; 418 #else 376 419 static const UChar 377 420 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = … … 382 425 }; 383 426 #endif 427 #endif 384 428 #if H_3D_DIM 429 #if QC_GENERIC_SDC_G0122 430 static const UChar 431 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = 432 { 433 { 154, }, 434 { 154, }, 435 { 154, } 436 }; 437 #else 385 438 static const UChar 386 439 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = … … 390 443 {64, 0, CNU, CNU, 168, 109, 0, 0} 391 444 }; 445 #endif 446 447 #if QC_GENERIC_SDC_G0122 448 static const UChar 449 INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] = 450 { 451 { 154, 155, 156 }, 452 { 141, 185, 214 }, 453 { 155, 170, 157 }, 454 }; 455 #if !QC_SDC_UNIFY_G0130 456 static const UChar 457 INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] = 458 { 459 { 214, 229, 230 }, 460 { 215, 202, 174 }, 461 { 213, 201, 246 }, 462 }; 463 #endif 464 #endif 392 465 393 466 static const UChar … … 432 505 #endif 433 506 434 #if H_3D_INTER_SDC 507 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 435 508 static const UChar 436 509 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = … … 458 531 #endif 459 532 //! \} 460 461 462 #endif 533 #if QC_SDC_UNIFY_G0130 534 static const UChar 535 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = 536 { 537 { 154 }, 538 { 154 }, 539 { 154 }, 540 }; 541 #endif 542 543 #if H_3D_DBBP 544 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] = 545 { 546 { CNU }, 547 { CNU }, 548 { CNU }, 549 }; 550 #endif 551 552 #endif -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r773 r833 123 123 #if H_3D_DIM_SDC 124 124 m_pbSDCFlag = NULL; 125 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 126 for( Int i = 0; i < 4; i++ ) 127 { 128 m_apSegmentDCOffset[i] = NULL; 129 } 130 #else 125 131 m_apSegmentDCOffset[0] = NULL; 126 132 m_apSegmentDCOffset[1] = NULL; 133 #endif 127 134 #endif 128 135 #endif … … 146 153 #endif 147 154 #if H_3D_INTER_SDC 155 #if !QC_SDC_UNIFY_G0130 148 156 m_pbInterSDCFlag = NULL; 149 157 for( Int i = 0; i < 4; i++ ) … … 151 159 m_apSegmentInterDCOffset[i] = NULL; 152 160 } 161 #endif 162 #if !SEC_INTER_SDC_G0101 153 163 m_pucInterSDCMask = NULL; 164 #endif 165 #endif 166 #if H_3D_DBBP 167 m_pbDBBPFlag = NULL; 168 #endif 169 170 #if MTK_DDD_G0063 171 m_pucDisparityDerivedDepth = NULL; 172 m_pbUseDDD = NULL; 154 173 #endif 155 174 } … … 272 291 #if H_3D_DIM_SDC 273 292 m_pbSDCFlag = (Bool*)xMalloc(Bool, uiNumPartition); 293 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 294 for( Int i = 0; i < 4; i++ ) 295 { 296 m_apSegmentDCOffset[i] = (Pel*)xMalloc(Pel, uiNumPartition); 297 } 298 #else 274 299 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 275 300 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 276 301 #endif 277 302 #endif 278 #if H_3D_INTER_SDC 303 #endif 304 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 279 305 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 280 306 for( Int i = 0; i < 4; i++ ) … … 283 309 } 284 310 #endif 311 #if H_3D_DBBP 312 m_pbDBBPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 313 #endif 285 314 } 286 315 else … … 289 318 m_acCUMvField[1].setNumPartition(uiNumPartition ); 290 319 } 320 #if !SEC_INTER_SDC_G0101 291 321 #if H_3D_INTER_SDC 292 322 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth); 293 323 #endif 324 #endif 294 325 m_sliceStartCU = (UInt* )xMalloc(UInt, uiNumPartition); 295 326 m_sliceSegmentStartCU = (UInt* )xMalloc(UInt, uiNumPartition); … … 298 329 m_pcPattern = (TComPattern*)xMalloc(TComPattern, 1); 299 330 331 #if MTK_DDD_G0063 332 m_pucDisparityDerivedDepth = (UChar* )xMalloc( UChar, uiNumPartition); 333 m_pbUseDDD = (Bool* ) xMalloc( Bool, uiNumPartition); 334 #endif 335 300 336 // create motion vector fields 301 337 … … 377 413 #endif 378 414 415 #if MTK_DDD_G0063 416 if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth); m_pucDisparityDerivedDepth = NULL; } 417 if ( m_pbUseDDD ) { xFree(m_pbUseDDD); m_pbUseDDD = NULL; } 418 #endif 419 379 420 #if H_3D_ARP 380 421 if ( m_puhARPW ) { delete[] m_puhARPW; m_puhARPW = NULL; } … … 400 441 #if H_3D_DIM_SDC 401 442 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 443 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 444 for( Int i = 0; i < 4; i++ ) 445 { 446 if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]); m_apSegmentDCOffset[i] = NULL; } 447 } 448 #else 402 449 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 403 450 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 404 451 #endif 405 452 #endif 406 #if H_3D_INTER_SDC 453 #endif 454 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 407 455 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 408 456 for(Int i = 0; i < 4; i++ ) … … 411 459 } 412 460 #endif 413 } 461 #if H_3D_DBBP 462 if ( m_pbDBBPFlag ) { xFree(m_pbDBBPFlag); m_pbDBBPFlag = NULL; } 463 #endif 464 } 465 #if !SEC_INTER_SDC_G0101 414 466 #if H_3D_INTER_SDC 415 467 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; } 468 #endif 416 469 #endif 417 470 m_pcCUAboveLeft = NULL; … … 525 578 m_pbICFlag[ui] = pcFrom->m_pbICFlag[ui]; 526 579 #endif 580 581 #if MTK_DDD_G0063 582 m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui]; 583 m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui]; 584 #endif 585 527 586 m_puhWidth [ui] = pcFrom->getWidth(ui); 528 587 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 554 613 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 555 614 #endif 556 #if H_3D_INTER_SDC 615 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 557 616 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 617 #endif 618 #if H_3D_DBBP 619 m_pbDBBPFlag[ui] = pcFrom->m_pbDBBPFlag[ui]; 558 620 #endif 559 621 } … … 602 664 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) ); 603 665 #endif 666 667 #if MTK_DDD_G0063 668 memset( m_pucDisparityDerivedDepth + firstElement, 0, numElements * sizeof( *m_pucDisparityDerivedDepth ) ); 669 memset( m_pbUseDDD + firstElement, 0, numElements * sizeof( *m_pbUseDDD ) ); 670 #endif 671 604 672 #if H_3D_DIM 605 673 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 616 684 #if H_3D_DIM_SDC 617 685 memset( m_pbSDCFlag + firstElement, 0, numElements * sizeof( *m_pbSDCFlag ) ); 686 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 687 for( Int i = 0; i < 4; i++ ) 688 { 689 memset( m_apSegmentDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[i] ) ); 690 } 691 #else 618 692 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 619 693 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 620 694 #endif 621 695 #endif 622 #if H_3D_INTER_SDC 696 #endif 697 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 623 698 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 624 699 for( Int i = 0; i < 4; i++ ) … … 626 701 memset( m_apSegmentInterDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentInterDCOffset[i] ) ); 627 702 } 703 #endif 704 #if H_3D_DBBP 705 memset( m_pbDBBPFlag + firstElement, false, numElements * sizeof( *m_pbDBBPFlag ) ); 628 706 #endif 629 707 } … … 774 852 m_pbICFlag[ui] = false; 775 853 #endif 854 855 #if MTK_DDD_G0063 856 m_pucDisparityDerivedDepth[ui] = 0; 857 m_pbUseDDD[ui] = 0; 858 #endif 859 776 860 #if H_3D_DIM 777 861 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 788 872 #if H_3D_DIM_SDC 789 873 m_pbSDCFlag [ui] = false; 874 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 875 for( Int i = 0; i < 4; i++ ) 876 { 877 m_apSegmentDCOffset[i][ui] = 0; 878 } 879 #else 790 880 m_apSegmentDCOffset[0][ui] = 0; 791 881 m_apSegmentDCOffset[1][ui] = 0; 792 882 #endif 793 883 #endif 794 #if H_3D_INTER_SDC 884 #endif 885 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 795 886 m_pbInterSDCFlag[ui] = false; 796 887 for( Int i = 0; i < 4; i++ ) … … 798 889 m_apSegmentInterDCOffset[i][ui] = 0; 799 890 } 891 #endif 892 #if H_3D_DBBP 893 m_pbDBBPFlag[ui] = false; 800 894 #endif 801 895 } … … 879 973 memset( m_puhARPW, 0, iSizeInUchar ); 880 974 #endif 975 976 #if MTK_DDD_G0063 977 memset( m_pucDisparityDerivedDepth, 0, iSizeInUchar ); 978 memset( m_pbUseDDD, 0, iSizeInBool ); 979 #endif 980 881 981 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; 882 982 UChar uhHeight = g_uiMaxCUHeight >> uiDepth; … … 901 1001 #if H_3D_DIM_SDC 902 1002 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 1003 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 1004 for( Int i = 0; i < 4; i++ ) 1005 { 1006 memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition ); 1007 } 1008 #else 903 1009 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 904 1010 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 905 1011 #endif 906 1012 #endif 907 #if H_3D_INTER_SDC 1013 #endif 1014 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 908 1015 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 909 1016 for( Int i = 0; i < 4; i++ ) … … 911 1018 memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition ); 912 1019 } 1020 #endif 1021 #if H_3D_DBBP 1022 memset( m_pbDBBPFlag, 0, iSizeInBool ); 913 1023 #endif 914 1024 … … 964 1074 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 965 1075 #endif 1076 1077 #if MTK_DDD_G0063 1078 m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui]; 1079 m_pbUseDDD[ui] = pcCU->m_pbUseDDD[uiPartOffset+ui]; 1080 #endif 1081 966 1082 #if H_3D_DIM 967 1083 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 978 1094 #if H_3D_DIM_SDC 979 1095 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 1096 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 1097 for( Int i = 0; i < 4; i++ ) 1098 { 1099 m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ]; 1100 } 1101 #else 980 1102 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 981 1103 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 982 1104 #endif 983 1105 #endif 984 #if H_3D_INTER_SDC 1106 #endif 1107 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 985 1108 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 986 1109 for( Int i = 0; i < 4; i++ ) … … 988 1111 m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ]; 989 1112 } 1113 #endif 1114 #if H_3D_DBBP 1115 m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui]; 990 1116 #endif 991 1117 } … … 1109 1235 #endif 1110 1236 1237 #if MTK_DDD_G0063 1238 m_pucDisparityDerivedDepth = pcCU->getDDDepth() + uiPart; 1239 m_pbUseDDD = pcCU->getUseDDD() + uiPart; 1240 #endif 1241 1111 1242 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; 1112 1243 m_puhChromaIntraDir = pcCU->getChromaIntraDir() + uiPart; … … 1134 1265 #if H_3D_DIM_SDC 1135 1266 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1267 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 1268 for( Int i = 0; i < 4; i++ ) 1269 { 1270 m_apSegmentDCOffset[i] = pcCU->getSDCSegmentDCOffset(i) + uiPart; 1271 } 1272 #else 1136 1273 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1137 1274 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1138 1275 #endif 1139 1276 #endif 1140 #if H_3D_INTER_SDC 1277 #endif 1278 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1141 1279 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1142 1280 for( Int i = 0; i < 4; i++ ) … … 1144 1282 m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart; 1145 1283 } 1284 #endif 1285 #if H_3D_DBBP 1286 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiPart; 1146 1287 #endif 1147 1288 m_puhDepth=pcCU->getDepth() + uiPart; … … 1256 1397 #if H_3D_ARP 1257 1398 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1399 #endif 1400 1401 #if MTK_DDD_G0063 1402 m_pucDisparityDerivedDepth = pcCU->getDDDepth() + uiAbsPartIdx; 1403 m_pbUseDDD = pcCU->getUseDDD() + uiAbsPartIdx; 1404 #endif 1405 1406 #if H_3D_DBBP 1407 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiAbsPartIdx; 1258 1408 #endif 1259 1409 … … 1314 1464 memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar ); 1315 1465 1466 #if MTK_DDD_G0063 1467 memcpy( m_pucDisparityDerivedDepth + uiOffset, pcCU->getDDDepth(), iSizeInUchar ); 1468 memcpy( m_pbUseDDD + uiOffset, pcCU->getUseDDD(), iSizeInBool ); 1469 #endif 1470 1471 1316 1472 #if H_3D_DIM 1317 1473 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 1328 1484 #if H_3D_DIM_SDC 1329 1485 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), iSizeInBool ); 1486 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 1487 for( Int i = 0; i < 4; i++ ) 1488 { 1489 memcpy( m_apSegmentDCOffset[i] + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition); 1490 } 1491 #else 1330 1492 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1331 1493 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1332 1494 #endif 1333 1495 #endif 1334 #if H_3D_INTER_SDC 1496 #endif 1497 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1335 1498 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1336 1499 for( Int i = 0; i < 4; i++ ) … … 1338 1501 memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition); 1339 1502 } 1503 #endif 1504 #if H_3D_DBBP 1505 memcpy( m_pbDBBPFlag + uiOffset, pcCU->getDBBPFlag(), iSizeInBool ); 1340 1506 #endif 1341 1507 … … 1410 1576 #if H_3D_NBDV 1411 1577 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1578 #endif 1579 1580 #if MTK_DDD_G0063 1581 memcpy( rpcCU->getDDDepth() + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth, iSizeInUchar ); 1582 memcpy( rpcCU->getUseDDD() + m_uiAbsIdxInLCU, m_pbUseDDD, iSizeInBool ); 1412 1583 #endif 1413 1584 … … 1450 1621 #if H_3D_DIM_SDC 1451 1622 memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag, iSizeInBool ); 1623 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 1624 for( Int i = 0; i < 4; i++ ) 1625 { 1626 memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition); 1627 } 1628 #else 1452 1629 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1453 1630 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1454 1631 #endif 1455 1632 #endif 1456 #if H_3D_INTER_SDC 1633 #endif 1634 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1457 1635 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1458 1636 for( Int i = 0;i < 4; i++ ) … … 1461 1639 } 1462 1640 #endif 1641 #if H_3D_DBBP 1642 memcpy( rpcCU->getDBBPFlag() + m_uiAbsIdxInLCU, m_pbDBBPFlag, iSizeInBool ); 1643 #endif 1644 1463 1645 memcpy( rpcCU->getDepth() + m_uiAbsIdxInLCU, m_puhDepth, iSizeInUchar ); 1464 1646 memcpy( rpcCU->getWidth() + m_uiAbsIdxInLCU, m_puhWidth, iSizeInUchar ); … … 1544 1726 memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar ); 1545 1727 1728 #if MTK_DDD_G0063 1729 memcpy( rpcCU->getDDDepth() + uiPartOffset, m_pucDisparityDerivedDepth, iSizeInUchar ); 1730 memcpy( rpcCU->getUseDDD() + uiPartOffset, m_pbUseDDD, iSizeInBool ); 1731 #endif 1732 1546 1733 #if H_3D_DIM 1547 1734 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) … … 1558 1745 #if H_3D_DIM_SDC 1559 1746 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1747 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 1748 for( Int i = 0; i < 4; i++ ) 1749 { 1750 memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart); 1751 } 1752 #else 1560 1753 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1561 1754 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1562 1755 #endif 1563 1756 #endif 1564 #if H_3D_INTER_SDC 1757 #endif 1758 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1565 1759 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1566 1760 for( Int i = 0; i < 4; i++ ) … … 1569 1763 } 1570 1764 #endif 1765 #if H_3D_DBBP 1766 memcpy( rpcCU->getDBBPFlag() + uiPartOffset, m_pbDBBPFlag, iSizeInBool ); 1767 #endif 1768 1571 1769 memcpy( rpcCU->getDepth() + uiPartOffset, m_puhDepth, iSizeInUchar ); 1572 1770 memcpy( rpcCU->getWidth() + uiPartOffset, m_puhWidth, iSizeInUchar ); … … 1611 1809 #endif 1612 1810 } 1811 1812 #if MTK_DDD_G0063 1813 Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1814 { 1815 setSubPart<UChar>( ucDDD, m_pucDisparityDerivedDepth, uiAbsPartIdx, uiDepth, uiPartIdx ); 1816 } 1817 1818 Void TComDataCU::setUseDDD ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1819 { 1820 setSubPart<Bool>( bUseDDD, m_pbUseDDD, uiAbsPartIdx, uiDepth, uiPartIdx ); 1821 } 1822 1823 Void TComDataCU::setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth ) 1824 { 1825 memset( m_pbUseDDD + uiAbsPartIdx, bUseDDD, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) ); 1826 } 1827 1828 #endif 1613 1829 1614 1830 // -------------------------------------------------------------------------------------------------------------------- … … 2267 2483 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 2268 2484 2485 #if !MTK_ARP_FLAG_CABAC_SIMP_G0061 2269 2486 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2270 2487 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 2271 2488 #endif 2272 2489 return uiCtx; 2273 2490 } 2274 2491 #endif 2275 2492 #if !MTK_IC_FLAG_CABAC_SIMP_G0061 2276 2493 #if H_3D_IC 2277 2494 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) … … 2291 2508 } 2292 2509 #endif 2510 #endif 2511 #if H_3D_DBBP 2512 Pel* TComDataCU::getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride) 2513 { 2514 // get coded and reconstructed depth view 2515 TComPicYuv* depthPicYuv = NULL; 2516 Pel* pDepthPels = NULL; 2517 2518 // DBBP is a texture coding tool 2519 if( getSlice()->getIsDepth() ) 2520 { 2521 return NULL; 2522 } 2523 2524 #if H_3D_FCO 2525 TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 2526 2527 if( depthPic && depthPic->getPicYuvRec() != NULL && depthPic->getIsDepth() ) // depth first 2528 { 2529 depthPicYuv = depthPic->getPicYuvRec(); 2530 depthPicYuv->extendPicBorder(); 2531 2532 // get collocated depth block for current CU 2533 uiDepthStride = depthPicYuv->getStride(); 2534 pDepthPels = depthPicYuv->getLumaAddr( getAddr(), uiAbsPartIdx ); 2535 } 2536 else // texture first 2537 #else 2538 { 2539 DisInfo DvInfo = getDvInfo(uiAbsPartIdx); 2540 2541 TComPic* baseDepthPic = getSlice()->getIvPic (true, DvInfo.m_aVIdxCan); 2542 2543 if( baseDepthPic == NULL || baseDepthPic->getPicYuvRec() == NULL ) 2544 { 2545 return NULL; 2546 } 2547 2548 depthPicYuv = baseDepthPic->getPicYuvRec(); 2549 depthPicYuv->extendPicBorder(); 2550 uiDepthStride = depthPicYuv->getStride(); 2551 2552 Int iBlkX = ( getAddr() % baseDepthPic->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ getZorderIdxInCU()+uiAbsPartIdx ] ]; 2553 Int iBlkY = ( getAddr() / baseDepthPic->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ getZorderIdxInCU()+uiAbsPartIdx ] ]; 2554 2555 Int iPictureWidth = depthPicYuv->getWidth(); 2556 Int iPictureHeight = depthPicYuv->getHeight(); 2557 2558 Int iWidth = uiWidth; 2559 Int iHeight = uiHeight; 2560 2561 Bool depthRefineFlag = false; 2562 #if H_3D_NBDV_REF 2563 depthRefineFlag = m_pcSlice->getVPS()->getDepthRefinementFlag( m_pcSlice->getLayerIdInVps() ); 2564 #endif // H_3D_NBDV_REF 2565 2566 TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV; 2567 2568 Int depthPosX = Clip3(0, iPictureWidth - iWidth, iBlkX + ((cDv.getHor()+2)>>2)); 2569 Int depthPosY = Clip3(0, iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2)); 2570 2571 pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride; 2572 } 2573 #endif 2574 2575 AOF( depthPicYuv != NULL ); 2576 AOF( pDepthPels != NULL ); 2577 AOF( uiDepthStride != 0 ); 2578 2579 return pDepthPels; 2580 } 2581 #endif 2582 2583 #if H_3D_DBBP 2584 Void TComDataCU::setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2585 { 2586 setSubPart( bDBBPFlag, m_pbDBBPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2587 } 2588 #endif 2293 2589 2294 2590 #if H_3D_INTER_SDC 2591 #if !QC_SDC_UNIFY_G0130 2295 2592 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2296 2593 { … … 2302 2599 return 0; 2303 2600 } 2304 2601 #endif 2602 2603 #if !SEC_INTER_SDC_G0101 2305 2604 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ) 2306 2605 { … … 2400 2699 } 2401 2700 #endif 2701 #endif 2702 2703 #if QC_GENERIC_SDC_G0122 2704 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2705 { 2706 #if QC_SDC_UNIFY_G0130 2707 return 0; 2708 #else 2709 TComDataCU* pcTempCU; 2710 UInt uiTempPartIdx; 2711 UInt uiCtx = 0; 2712 2713 // Get BCBP of left PU 2714 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2715 uiCtx = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0; 2716 2717 // Get BCBP of above PU 2718 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2719 uiCtx += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0; 2720 2721 return uiCtx; 2722 #endif 2723 } 2724 2725 UInt TComDataCU::getCtxAngleFlag( UInt uiAbsPartIdx ) 2726 { 2727 TComDataCU* pcTempCU; 2728 UInt uiTempPartIdx; 2729 UInt uiCtx = 0; 2730 2731 // Get BCBP of left PU 2732 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2733 uiCtx = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0; 2734 2735 // Get BCBP of above PU 2736 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2737 uiCtx += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0; 2738 2739 return uiCtx; 2740 } 2741 #endif 2402 2742 2403 2743 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) … … 2627 2967 if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 2628 2968 return false; 2629 2969 #if QC_GENERIC_SDC_G0122 2970 if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) ) 2971 { 2972 return true; 2973 } 2974 2975 if( getLumaIntraDir( uiAbsPartIdx ) < NUM_INTRA_MODE ) 2976 { 2977 return true; 2978 } 2979 2980 return false; 2981 #endif 2630 2982 // check prediction mode 2631 2983 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); … … 3250 3602 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ) 3251 3603 { 3604 #if MTK_NBDV_IVREF_FIX_G0067 3605 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1) 3606 #else 3252 3607 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() ) 3608 #endif 3253 3609 { 3254 3610 return false; … … 3267 3623 3268 3624 Bool refViewAvailFlag = false; 3269 UChar predFlag[2] = {0, 0}; 3625 UChar predFlag[2] = {0, 0}; 3626 #if !MTK_RBIP_VSP_G0069 3270 3627 Int refListIdY = 0; 3271 3628 Int viewIdInRefListX = -1; 3629 #endif 3272 3630 3273 3631 for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) … … 3281 3639 refViewAvailFlag = true; 3282 3640 predFlag[iRefListIdX] = 1; 3641 #if !MTK_RBIP_VSP_G0069 3283 3642 viewIdInRefListX = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId(); 3284 3643 refListIdY = 1 - iRefListIdX; 3644 #endif 3285 3645 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i ); 3286 3646 #if H_3D_NBDV … … 3291 3651 } 3292 3652 3653 #if !MTK_RBIP_VSP_G0069 3293 3654 if (m_pcSlice->isInterB() && refViewAvailFlag) 3294 3655 { … … 3330 3691 } 3331 3692 } 3693 #endif 3332 3694 3333 3695 // Set values to be returned … … 3448 3810 for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ ) 3449 3811 { 3812 #if NTT_STORE_SPDV_VSP_G0148 3813 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) ) 3814 #else 3450 3815 if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) ) 3816 #endif 3451 3817 { 3452 3818 continue; … … 3880 4246 UChar tmpDir; 3881 4247 4248 #if MTK_DDD_G0063 4249 m_iUseDDDCandIdx = -1; 4250 #endif 4251 3882 4252 ////////////////////////////////// 3883 4253 //////// GET DISPARITIES //////// … … 3932 4302 Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false; 3933 4303 #endif 4304 #if H_3D_DBBP 4305 Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx); 4306 #endif 3934 4307 3935 4308 #if H_3D … … 3957 4330 iPosLeftAbove[0] = numA1B1B0; 3958 4331 #if H_3D_VSP 4332 #if NTT_STORE_SPDV_VSP_G0148 4333 if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 4334 #else 3959 4335 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1 4336 #endif 3960 4337 #if H_3D_IC 3961 4338 && !bICFlag … … 3980 4357 iPosLeftAbove[1] = numA1B1B0; 3981 4358 #if H_3D_VSP 4359 #if NTT_STORE_SPDV_VSP_G0148 4360 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0) 4361 #else 3982 4362 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 4363 #endif 3983 4364 #if H_3D_IC 3984 4365 && !bICFlag … … 4003 4384 { 4004 4385 #if H_3D_VSP 4386 #if NTT_STORE_SPDV_VSP_G0148 4387 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0) 4388 #else 4005 4389 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 4390 #endif 4006 4391 #if H_3D_IC 4007 4392 && !bICFlag … … 4024 4409 { 4025 4410 #if H_3D_VSP 4411 #if NTT_STORE_SPDV_VSP_G0148 4412 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0 4413 #else 4026 4414 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1 4415 #endif 4027 4416 #if H_3D_IC 4028 4417 && !bICFlag … … 4047 4436 { 4048 4437 #if H_3D_VSP 4438 #if NTT_STORE_SPDV_VSP_G0148 4439 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0) 4440 #else 4049 4441 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 4442 #endif 4050 4443 #if H_3D_IC 4051 4444 && !bICFlag … … 4075 4468 if( bMPIFlag) 4076 4469 { 4470 #if QC_SPIVMP_MPI_G0119 4471 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4472 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4473 tmpDir = 0; 4474 4475 TComPic * pcTexPic = m_pcSlice->getTexturePic(); 4476 #if H_3D_FCO 4477 if (pcTexturePic->getReconMark()) 4478 { 4479 #endif 4480 TComPicYuv* pcTexRec = pcTexPic->getPicYuvRec (); 4481 UInt uiPartAddr; 4482 Int iWidth, iHeight; 4483 Int iCurrPosX, iCurrPosY; 4484 4485 this->getPartIndexAndSize( uiPUIdx, uiPartAddr, iWidth, iHeight ); 4486 pcTexRec->getTopLeftSamplePos( this->getAddr(), this->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 4487 4488 Int iPUWidth, iPUHeight, iNumPart, iNumPartLine; 4489 this->getSPPara(iWidth, iHeight, iNumPart, iNumPartLine, iPUWidth, iPUHeight); 4490 4491 for (Int i=0; i<iNumPart; i++) 4492 { 4493 puhInterDirSP[i] = 0; 4494 pcMvFieldSP[2*i].getMv().set(0, 0); 4495 pcMvFieldSP[2*i+1].getMv().set(0, 0); 4496 pcMvFieldSP[2*i].setRefIdx(-1); 4497 pcMvFieldSP[2*i+1].setRefIdx(-1); 4498 } 4499 4500 Int iTexCUAddr; 4501 Int iTexAbsPartIdx; 4502 TComDataCU* pcTexCU; 4503 Int iPartition = 0; 4504 Int iInterDirSaved = 0; 4505 TComMvField cMvFieldSaved[2]; 4506 4507 Int iOffsetX = iPUWidth/2;; 4508 Int iOffsetY = iPUHeight/2; 4509 4510 Int iTexPosX, iTexPosY; 4511 const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4512 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight) 4513 { 4514 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iPUWidth) 4515 { 4516 iTexPosX = j + iOffsetX; 4517 iTexPosY = i + iOffsetY; 4518 pcTexRec->getCUAddrAndPartIdx( iTexPosX, iTexPosY, iTexCUAddr, iTexAbsPartIdx ); 4519 pcTexCU = pcTexPic->getCU( iTexCUAddr ); 4520 4521 if( pcTexCU && !pcTexCU->isIntra(iTexAbsPartIdx) ) 4522 { 4523 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 4524 { 4525 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 4526 TComMvField cTexMvField; 4527 pcTexCU->getMvField( pcTexCU, iTexAbsPartIdx, eCurrRefPicList, cTexMvField ); 4528 Int iValidDepRef = getPic()->isTextRefValid( eCurrRefPicList, cTexMvField.getRefIdx() ); 4529 if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) ) 4530 { 4531 TComMv cMv = cTexMvField.getMv() + cMvRounding; 4532 cMv >>=2; 4533 this->clipMv( cMv ); 4534 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef); 4535 } 4536 } 4537 } 4538 puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0); 4539 if (puhInterDirSP[iPartition] == 0) 4540 { 4541 if (iInterDirSaved != 0) 4542 { 4543 puhInterDirSP[iPartition] = iInterDirSaved; 4544 pcMvFieldSP[2*iPartition] = cMvFieldSaved[0]; 4545 pcMvFieldSP[2*iPartition + 1] = cMvFieldSaved[1]; 4546 } 4547 } 4548 else 4549 { 4550 if (iInterDirSaved ==0) 4551 { 4552 pbSPIVMPFlag[iCount] = true; 4553 tmpDir = puhInterDirSP[iPartition]; 4554 tmpMV[0] = pcMvFieldSP[2*iPartition]; 4555 tmpMV[1] = pcMvFieldSP[2*iPartition+1]; 4556 4557 if (iPartition != 0) 4558 { 4559 for (Int iPart = iPartition-1; iPart >= 0; iPart--) 4560 { 4561 puhInterDirSP[iPart] = puhInterDirSP[iPartition]; 4562 pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition]; 4563 pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1]; 4564 } 4565 } 4566 } 4567 iInterDirSaved = puhInterDirSP[iPartition]; 4568 cMvFieldSaved[0] = pcMvFieldSP[2*iPartition]; 4569 cMvFieldSaved[1] = pcMvFieldSP[2*iPartition + 1]; 4570 } 4571 iPartition ++; 4572 } 4573 } 4574 #if H_3D_FCO 4575 } 4576 #endif 4577 #else 4077 4578 UInt uiPartIdxCenter; 4078 4579 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); … … 4131 4632 tmpDir += ((tmpMV[1].getRefIdx()>=0)?2:0); 4132 4633 } 4133 4634 #endif 4134 4635 if( tmpDir != 0 ) 4135 4636 { … … 4190 4691 } 4191 4692 } 4192 4693 #if QC_SPIVMP_MPI_G0119 4694 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx()); 4695 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx()); 4696 #else 4193 4697 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4194 4698 { … … 4202 4706 } 4203 4707 } 4708 #endif 4204 4709 puhInterDirNeighbours[iCount] = tmpDir; 4205 4710 … … 4210 4715 iCount ++; 4211 4716 } 4212 } 4213 } 4214 4717 #if !QC_SPIVMP_MPI_G0119 4718 } 4719 #endif 4720 } 4721 #if MTK_DDD_G0063 4722 if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0 && bMPIFlag ) 4723 { 4724 UInt uiPartIdx; 4725 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4726 TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 4727 4728 4729 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4730 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4731 tmpDir = 0; 4732 4733 xDeriveCenterIdx( uiPUIdx, uiPartIdx); 4734 4735 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) ) 4736 { 4737 4738 TComMvField cMVField; 4739 UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx ); 4740 4741 Int iDV = 0; 4742 Int iViewIdx = 0; 4743 if( ucInterDir & 1 ) 4744 { 4745 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField ); 4746 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4747 { 4748 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex(); 4749 iDV = cMVField.getHor(); 4750 4751 4752 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() ); 4753 4754 if( iValidDepRef >= 0 ) 4755 { 4756 const TComMv cAdd( 2, 2 ); 4757 cMVField.getMv() += cAdd; 4758 cMVField.getMv() >>= 2; 4759 clipMv( cMVField.getMv() ); 4760 tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef ); 4761 tmpDir = 1; 4762 } 4763 } 4764 } 4765 if( !tmpDir && ( ucInterDir & 2 )) 4766 { 4767 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField ); 4768 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4769 { 4770 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex(); 4771 iDV = cMVField.getHor(); 4772 4773 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() ); 4774 4775 if( iValidDepRef >= 0 ) 4776 { 4777 const TComMv cAdd( 2, 2 ); 4778 cMVField.getMv() += cAdd; 4779 cMVField.getMv() >>= 2; 4780 clipMv( cMVField.getMv() ); 4781 tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef ); 4782 tmpDir = 2; 4783 } 4784 } 4785 } 4786 if( tmpDir != 0 ) 4787 { 4788 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4789 m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV, iViewIdx ); 4790 m_iUseDDDCandIdx = iCount; 4791 4792 if( tmpDir == 1 ) 4793 { 4794 pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ]; 4795 } 4796 else if( tmpDir == 2 ) 4797 { 4798 pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ]; 4799 } 4800 4801 abCandIsInter [ iCount ] = true; 4802 puhInterDirNeighbours[ iCount ] = tmpDir; 4803 4804 if ( mrgCandIdx == iCount ) 4805 { 4806 return; 4807 } 4808 iCount ++; 4809 4810 Int iLeftAboveAvail = 0; 4811 if( iPosLeftAbove[ 0 ] != -1 ) 4812 { 4813 iPosLeftAbove[ 0 ] = iCount; 4814 iLeftAboveAvail = 1; 4815 } 4816 if( iPosLeftAbove[ 1 ] != -1 ) 4817 { 4818 iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail; 4819 } 4820 4821 } 4822 } 4823 4824 } 4825 #endif 4215 4826 ///////////////////////////////////////////////////////////////// 4216 4827 //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC Candidates ///// … … 4229 4840 Bool ivMvPredFlag = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() ); 4230 4841 4842 #if MTK_NBDV_IVREF_FIX_G0067 4843 if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1) 4844 #else 4231 4845 if ( ivMvPredFlag ) 4846 #endif 4232 4847 { 4233 4848 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP ); … … 4237 4852 //////// INTER VIEW MOTION COMP(IvMC) ///////// 4238 4853 /////////////////////////////////////////////// 4239 4854 #if QC_DEPTH_MERGE_SIMP_G0127 4855 if( getSlice()->getIsDepth() ) 4856 { 4857 ivCandDir[1] = ivCandDir[2] = ivCandDir[3] = 0; 4858 } 4859 #endif 4240 4860 if( ivCandDir[0] ) 4241 4861 { … … 4277 4897 for(; iCnloop >= 0; iCnloop --) 4278 4898 { 4899 #if MTK_DDD_G0063 4900 if( iCnloop == m_iUseDDDCandIdx ) 4901 { 4902 continue; 4903 } 4904 #endif 4279 4905 if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1]) // F0125 compatible with F0093 4280 4906 { … … 4339 4965 if (bIvMC) 4340 4966 { 4967 #if QC_SPIVMP_MPI_G0119 4968 if(!m_pcSlice->getIsDepth()) 4969 #endif 4970 #if SEC_SPIVMP_MCP_SIZE_G0077 4971 if(getPartitionSize(0) == SIZE_2Nx2N) 4972 pbSPIVMPFlag[iCount] = true; 4973 #else 4341 4974 pbSPIVMPFlag[iCount] = true; 4975 #endif 4976 #if H_3D_DBBP 4977 pbSPIVMPFlag[iCount] &= !bDBBPFlag; 4978 #endif 4342 4979 if( ( ivCandDir[0] & 1 ) == 1 ) 4343 4980 { … … 4466 5103 #endif 4467 5104 5105 #if MTK_DDD_G0063 5106 // early termination 5107 if ( iCount >= getSlice()->getMaxNumMergeCand()) 5108 { 5109 return; 5110 } 5111 #endif 4468 5112 4469 5113 #if H_3D_IV_MERGE … … 4471 5115 //////// INTER VIEW DISP COMP (IvDC) //////// 4472 5116 ///////////////////////////////////////////// 4473 5117 #if QC_DEPTH_MERGE_SIMP_G0127 5118 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 5119 #else 4474 5120 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand()) 5121 #endif 4475 5122 { 4476 5123 assert(iCount < getSlice()->getMaxNumMergeCand()); … … 4633 5280 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 4634 5281 //////////////////////////////////////////////////// 5282 #if QC_DEPTH_MERGE_SIMP_G0127 5283 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 5284 #else 4635 5285 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() ) 5286 #endif 4636 5287 { 4637 5288 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) ) … … 5439 6090 Int height = 0; 5440 6091 UInt partAddr; 6092 6093 #if H_3D_DBBP 6094 if( getDBBPFlag(0) ) 6095 { 6096 return true; 6097 } 6098 #endif 5441 6099 5442 6100 getPartIndexAndSize( puIdx, partAddr, width, height ); … … 6362 7020 #endif 6363 7021 #if H_3D_IV_MERGE 7022 #if SEC_DEPTH_DV_DERIVAITON_G0074 7023 Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 7024 #else 6364 7025 Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 6365 { 7026 #endif 7027 { 7028 #if SEC_DEPTH_DV_DERIVAITON_G0074 7029 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N); 7030 7031 TComMv cMv; 7032 Int iDisp = getSlice()->getDepthToDisparityB( 0 )[ 128 ]; 7033 cMv.setHor(iDisp); 7034 cMv.setVer(0); 7035 pDisp->m_acNBDV = cMv; 7036 pDisp->m_aVIdxCan = 0; 7037 7038 return true; 7039 #else 6366 7040 Pel pDepPos[3] = {0, 0, 0}; 6367 7041 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N); … … 6409 7083 return false; 6410 7084 } 7085 #endif 6411 7086 } 6412 7087 #endif … … 6425 7100 // Init disparity struct for results 6426 7101 pDInfo->bDV = false; 7102 #if MTK_NBDV_IVREF_FIX_G0067 7103 pDInfo->m_aVIdxCan = -1; 7104 #endif 6427 7105 // Init struct for disparities from MCP neighboring blocks 6428 7106 IDVInfo cIDVInfo; … … 6945 7623 { 6946 7624 Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId()); 7625 #if QC_SPIVMP_MPI_G0119 7626 if( getSlice()->getIsDepth() ) 7627 { 7628 iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size(); 7629 } 7630 #endif 6947 7631 iNumSPInOneLine = iPUWidth/iSubPUSize; 6948 7632 iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine; … … 7038 7722 //////////sub-PU IvMC/////////// 7039 7723 //////////////////////////////// 7040 7724 #if QC_SPIVMP_MPI_G0119 7725 if(!m_pcSlice->getIsDepth()) 7726 { 7727 #endif 7728 #if SEC_SPIVMP_MCP_SIZE_G0077 7729 if( getPartitionSize(0) == SIZE_2Nx2N ) 7730 { 7731 #endif 7041 7732 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 7042 7733 getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); … … 7055 7746 TComDataCU* pcBaseCU; 7056 7747 Int iPartition = 0; 7748 #if !KHU_SIMP_SPIVMP_G0147 7057 7749 Int iInterDirLast = 0; 7058 7750 TComMvField cMvFieldLast[2]; 7751 #endif 7059 7752 7060 7753 Int iDelX = iSPWidth/2; 7061 7754 Int iDelY = iSPHeight/2; 7062 7755 7756 #if KHU_SIMP_SPIVMP_G0147 7757 Int iCenterPosX = iCurrPosX + ( ( iWidth / iSPWidth ) >> 1 ) * iSPWidth + ( iSPWidth >> 1 ); 7758 Int iCenterPosY = iCurrPosY + ( ( iHeight / iSPHeight ) >> 1 ) * iSPHeight + (iSPHeight >> 1); 7759 Int iRefCenterCUAddr, iRefCenterAbsPartIdx; 7760 7761 if(iWidth == iSPWidth && iHeight == iSPHeight) 7762 { 7763 iCenterPosX = iCurrPosX + (iWidth >> 1); 7764 iCenterPosY = iCurrPosY + (iHeight >> 1); 7765 } 7766 7767 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 7768 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 7769 7770 pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx ); 7771 TComDataCU* pcDefaultCU = pcBasePic->getCU( iRefCenterCUAddr ); 7772 if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA )) 7773 { 7774 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7775 { 7776 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 7777 Bool stopLoop = false; 7778 for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop) 7779 { 7780 RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 7781 TComMvField cDefaultMvField; 7782 pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField ); 7783 Int iDefaultRefIdx = cDefaultMvField.getRefIdx(); 7784 if (iDefaultRefIdx >= 0) 7785 { 7786 Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx); 7787 if (iDefaultRefPOC != pcSlice->getPOC()) 7788 { 7789 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 7790 { 7791 if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 7792 { 7793 abPdmAvailable[ uiCurrRefListId ] = true; 7794 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 7795 #if H_3D_NBDV 7796 #if H_3D_IV_MERGE 7797 if( !bIsDepth ) 7798 { 7799 #endif 7800 cMv.setIDVFlag (true); 7801 cMv.setIDVHor (cDv.getHor()); 7802 cMv.setIDVVer (cDv.getVer()); 7803 cMv.setIDVVId (iViewIndex); 7804 #if H_3D_IV_MERGE 7805 } 7806 #endif 7807 #endif 7808 clipMv( cMv ); 7809 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 7810 pacPdmMv [ uiCurrRefListId ] = cMv; 7811 stopLoop = true; 7812 break; 7813 } 7814 } 7815 } 7816 } 7817 } 7818 } 7819 } 7820 availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0); 7821 7822 if(availableMcDc[0]) 7823 { 7824 #endif 7063 7825 Int iBasePosX, iBasePosY; 7064 7826 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) … … 7119 7881 if (puhInterDirSP[iPartition] == 0) 7120 7882 { 7883 #if KHU_SIMP_SPIVMP_G0147 7884 puhInterDirSP[iPartition] = availableMcDc[0]; 7885 pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]); 7886 pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]); 7887 #else 7121 7888 if (iInterDirLast != 0) 7122 7889 { … … 7125 7892 pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1]; 7126 7893 } 7127 } 7894 #endif 7895 } 7896 #if !KHU_SIMP_SPIVMP_G0147 7128 7897 else 7129 7898 { … … 7150 7919 cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1]; 7151 7920 } 7152 7921 #endif 7153 7922 iPartition ++; 7154 7923 7155 7924 } 7156 } 7925 } 7926 #if KHU_SIMP_SPIVMP_G0147 7927 } 7928 #endif 7929 #if SEC_SPIVMP_MCP_SIZE_G0077 7930 } 7931 #endif 7157 7932 7158 7933 iCurrPosX += ( iWidth >> 1 ); 7159 7934 iCurrPosY += ( iHeight >> 1 ); 7935 #if QC_SPIVMP_MPI_G0119 7936 } 7937 #endif 7160 7938 #endif 7161 7939 … … 7165 7943 7166 7944 #if H_3D_SPIVMP 7945 #if QC_SPIVMP_MPI_G0119 7946 if(m_pcSlice->getIsDepth()) 7947 { 7948 iCurrPosX += ( iWidth >> 1 ); 7949 iCurrPosY += ( iHeight >> 1 ); 7950 } 7951 #if QC_DEPTH_MERGE_SIMP_G0127 7952 #if SEC_SPIVMP_MCP_SIZE_G0077 7953 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 7954 #else 7955 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 7956 #endif 7957 #else 7958 #if SEC_SPIVMP_MCP_SIZE_G0077 7959 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < 2; iLoopCan ++) 7960 #else 7961 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++) 7962 #endif 7963 #endif 7964 #else 7965 #if SEC_SPIVMP_MCP_SIZE_G0077 7966 for(Int iLoopCan = (getPartitionSize(uiPartAddr) == SIZE_2Nx2N ? 1 : 0); iLoopCan < 2; iLoopCan ++) 7967 #else 7167 7968 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 7969 #endif 7970 #endif 7168 7971 #else 7169 7972 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) … … 7173 7976 // iLoopCan == 1 --> IvMCShift 7174 7977 7175 #if !H_3D_SPIVMP 7978 #if !H_3D_SPIVMP || QC_SPIVMP_MPI_G0119 7176 7979 Int iBaseCUAddr; 7177 7980 Int iBaseAbsPartIdx; … … 7181 7984 Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 ); 7182 7985 7183 #if H_3D_SPIVMP 7986 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119 7184 7987 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 7185 7988 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); … … 7190 7993 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 7191 7994 7192 #if H_3D_SPIVMP 7995 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119 7193 7996 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 7194 7997 #else … … 7248 8051 } 7249 8052 #if H_3D_SPIVMP 8053 #if QC_SPIVMP_MPI_G0119 8054 #if QC_DEPTH_MERGE_SIMP_G0127 8055 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 8056 #else 8057 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++) 8058 #endif 8059 #else 7250 8060 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 8061 #endif 7251 8062 #else 7252 8063 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) … … 7260 8071 /////// IvDC + IvDCShift /////// 7261 8072 //////////////////////////////// 7262 8073 #if QC_DEPTH_MERGE_SIMP_G0127 8074 if( !getSlice()->getIsDepth() ) 8075 { 8076 #endif 7263 8077 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 7264 8078 { … … 7294 8108 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 7295 8109 } 8110 #if QC_DEPTH_MERGE_SIMP_G0127 8111 } 8112 #endif 7296 8113 return false; 7297 8114 } … … 7367 8184 #endif 7368 8185 8186 #if NTT_STORE_SPDV_VSP_G0148 8187 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize ) 8188 { 8189 // Get depth reference 8190 Int depthRefViewIdx = pcCU->getDvInfo(partAddr).m_aVIdxCan; 8191 8192 #if H_3D_FCO_VSP_DONBDV_E0163 8193 TComPic* pRefPicBaseDepth = 0; 8194 Bool bIsCurrDepthCoded = false; 8195 pRefPicBaseDepth = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() ); 8196 if ( pRefPicBaseDepth->getPicYuvRec() != NULL ) 8197 { 8198 bIsCurrDepthCoded = true; 8199 } 8200 else 8201 { 8202 pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 8203 } 8204 #else 8205 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 8206 #endif 8207 assert(pRefPicBaseDepth != NULL); 8208 TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 8209 assert(pcBaseViewDepthPicYuv != NULL); 8210 pcBaseViewDepthPicYuv->extendPicBorder(); 8211 8212 // Get texture reference 8213 assert(iRefIdx >= 0); 8214 TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx ); 8215 TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 8216 assert(pcBaseViewTxtPicYuv != NULL); 8217 8218 // Initialize LUT according to the reference viewIdx 8219 Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex(); 8220 Int* pShiftLUT = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx ); 8221 assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() ); 8222 8223 // prepare Dv to access depth map or reference view 8224 TComMv cDv = pcCU->getDvInfo(partAddr).m_acNBDV; 8225 pcCU->clipMv(cDv); 8226 8227 #if H_3D_FCO_VSP_DONBDV_E0163 8228 if ( bIsCurrDepthCoded ) 8229 { 8230 cDv.setZero(); 8231 } 8232 #endif 8233 8234 // fetch virtual depth map & convert depth to motion vector, which are stored in the motion memory 8235 xSetMvFieldForVSP( pcCU, pcBaseViewDepthPicYuv, &cDv, partAddr, width, height, pShiftLUT, eRefPicList, iRefIdx, pcCU->getSlice()->getIsDepth(), vspSize ); 8236 } 8237 8238 Void TComDataCU::xSetMvFieldForVSP( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ) 8239 { 8240 TComCUMvField *cuMvField = cu->getCUMvField( refPicList ); 8241 Int partAddrRasterSubPULine = g_auiZscanToRaster[ partAddr ]; 8242 Int numPartsLine = cu->getPic()->getNumPartInWidth(); 8243 8244 Int nTxtPerMvInfoX = 4; // cu->getPic()->getMinCUWidth(); 8245 Int nTxtPerMvInfoY = 4; // cu->getPic()->getMinCUHeight(); 8246 8247 Int refDepStride = picRefDepth->getStride(); 8248 8249 TComMv tmpMv(0, 0); 8250 tmpMv.setIDVFlag(false); 8251 8252 Int refDepOffset = ( (dv->getHor()+2) >> 2 ) + ( (dv->getVer()+2) >> 2 ) * refDepStride; 8253 Pel *refDepth = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refDepOffset; 8254 8255 if ((height % 8)) 8256 { 8257 vspSize = 1; // 8x4 8258 } 8259 else if ((width % 8)) 8260 { 8261 vspSize = 0; // 4x8 8262 } 8263 else 8264 { 8265 Bool ULvsBR, URvsBL; 8266 ULvsBR = refDepth[0] < refDepth[refDepStride * (height-1) + width-1]; 8267 URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)]; 8268 vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1; 8269 } 8270 8271 Int subBlockW, subBlockH; 8272 if (vspSize) 8273 { 8274 subBlockW = 8; 8275 subBlockH = 4; 8276 } 8277 else 8278 { 8279 subBlockW = 4; 8280 subBlockH = 8; 8281 } 8282 8283 Int numPartsInSubPUW = subBlockW / nTxtPerMvInfoX; 8284 Int numPartsInSubPUH = subBlockH / nTxtPerMvInfoY * numPartsLine; 8285 8286 for( Int y=0; y<height; y+=subBlockH, partAddrRasterSubPULine+=numPartsInSubPUH ) 8287 { 8288 Pel *refDepthTmp[4]; 8289 refDepthTmp[0] = refDepth + refDepStride * y; 8290 refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1; 8291 refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1); 8292 refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1; 8293 8294 Int partAddrRasterSubPU = partAddrRasterSubPULine; 8295 for( Int x=0; x<width; x+=subBlockW, partAddrRasterSubPU+=numPartsInSubPUW ) 8296 { 8297 Pel maxDepthVal; 8298 maxDepthVal = refDepthTmp[0][x]; 8299 maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]); 8300 maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]); 8301 maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]); 8302 tmpMv.setHor( (Short) shiftLUT[ maxDepthVal ] ); 8303 8304 Int partAddrRasterPartLine = partAddrRasterSubPU; 8305 for( Int sY=0; sY<numPartsInSubPUH; sY+=numPartsLine, partAddrRasterPartLine += numPartsLine ) 8306 { 8307 Int partAddrRasterPart = partAddrRasterPartLine; 8308 for( Int sX=0; sX<numPartsInSubPUW; sX+=1, partAddrRasterPart++ ) 8309 { 8310 cuMvField->setMv ( g_auiRasterToZscan[ partAddrRasterPart ], tmpMv ); 8311 cuMvField->setRefIdx( g_auiRasterToZscan[ partAddrRasterPart ], refIdx ); 8312 } 8313 } 8314 } 8315 } 8316 8317 vspSize = (vspSize<<2)+1; 8318 8319 } 8320 #endif // NTT_STORE_SPDV_VSP_G0148 7369 8321 7370 8322 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.h
r773 r833 97 97 }; 98 98 99 #if H_3D_DBBP 100 typedef struct _DBBPTmpData 101 { 102 TComMv acMvd[2][2]; // for two segments and two lists 103 TComMvField acMvField[2][2]; // for two segments and two lists 104 Int aiMvpNum[2][2]; // for two segments and two lists 105 Int aiMvpIdx[2][2]; // for two segments and two lists 106 UChar auhInterDir[2]; // for two segments 107 Bool abMergeFlag[2]; // for two segments 108 UChar auhMergeIndex[2]; // for two segments 109 Char ahVSPFlag[2]; // for two segments 110 DisInfo acDvInfo[2]; // for two segments 111 112 PartSize eVirtualPartSize; 113 UInt uiVirtualPartIndex; 114 } DBBPTmpData; 115 #endif 99 116 100 117 // ==================================================================================================================== … … 215 232 #if H_3D_DIM_SDC 216 233 Bool* m_pbSDCFlag; 234 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 235 Pel* m_apSegmentDCOffset[4]; 236 #else 217 237 Pel* m_apSegmentDCOffset[2]; 218 238 #endif 219 239 #endif 240 #endif 220 241 #if H_3D_INTER_SDC 242 #if !QC_SDC_UNIFY_G0130 221 243 Bool* m_pbInterSDCFlag; 222 244 Int* m_apSegmentInterDCOffset[4]; 245 #endif 246 #if !SEC_INTER_SDC_G0101 223 247 UChar* m_pucInterSDCMask; 248 #endif 249 #endif 250 #if H_3D_DBBP 251 Bool* m_pbDBBPFlag; ///< array of DBBP flags 252 DBBPTmpData m_sDBBPTmpData; 224 253 #endif 225 254 #if H_3D … … 250 279 #endif 251 280 281 #if MTK_DDD_G0063 282 UChar* m_pucDisparityDerivedDepth; 283 Bool* m_pbUseDDD; 284 Int m_iUseDDDCandIdx; 285 UChar m_ucDDTmpDepth; 286 #endif 287 252 288 protected: 253 289 … … 283 319 284 320 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 321 322 #if NTT_STORE_SPDV_VSP_G0148 323 Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); 324 #endif 285 325 286 326 public: … … 351 391 Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); 352 392 393 #if H_3D_DBBP 394 Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); 395 #endif 396 353 397 Bool* getSkipFlag () { return m_skipFlag; } 354 398 Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } … … 362 406 Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } 363 407 Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); 408 409 #if H_3D_DBBP 410 Bool* getDBBPFlag () { return m_pbDBBPFlag; } 411 Bool getDBBPFlag ( UInt uiIdx ) { return m_pbDBBPFlag[uiIdx]; } 412 Void setDBBPFlag ( UInt uiIdx, Bool b ) { m_pbDBBPFlag[uiIdx] = b; } 413 Void setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 414 DBBPTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; } 415 #endif 364 416 365 417 UChar* getWidth () { return m_puhWidth; } … … 501 553 #if H_3D 502 554 Void rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo* inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV); 555 #if SEC_DEPTH_DV_DERIVAITON_G0074 556 Bool getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); 557 #else 503 558 Bool getDispNeighBlocks ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); 559 #endif 504 560 Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); 505 561 #endif … … 571 627 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 572 628 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 629 #if QC_GENERIC_SDC_G0122 630 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 631 UInt getCtxAngleFlag ( UInt uiAbsPartIdx ); 632 #endif 573 633 #endif 574 634 #endif 575 635 #if H_3D_INTER_SDC 636 #if !QC_SDC_UNIFY_G0130 576 637 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 577 638 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } … … 582 643 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } 583 644 645 #endif 646 #if !SEC_INTER_SDC_G0101 584 647 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); 585 648 586 649 UChar* getInterSDCMask () { return m_pucInterSDCMask; } 650 #endif 587 651 #endif 588 652 … … 691 755 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } 692 756 Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 757 #if NTT_STORE_SPDV_VSP_G0148 758 Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); 759 #endif 693 760 #endif 694 761 Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); … … 730 797 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 731 798 #endif 799 #if !MTK_IC_FLAG_CABAC_SIMP_G0061 732 800 #if H_3D_IC 733 801 UInt getCtxICFlag ( UInt uiAbsPartIdx ); 802 #endif 734 803 #endif 735 804 UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } … … 751 820 UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); 752 821 822 #if MTK_DDD_G0063 823 UChar* getDDDepth () { return m_pucDisparityDerivedDepth; } 824 UChar getDDDepth ( UInt uiIdx ) { return m_pucDisparityDerivedDepth[uiIdx]; } 825 Void setDDDepth ( UInt uiIdx, UChar n ) { m_pucDisparityDerivedDepth[uiIdx] = n; } 826 Void setDDDepthSubParts( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 827 828 Bool* getUseDDD () { return m_pbUseDDD; } 829 Bool getUseDDD ( UInt uiIdx ) { return m_pbUseDDD[uiIdx]; } 830 Void setUseDDD ( UInt uiIdx, Bool n ) { m_pbUseDDD[uiIdx] = n; } 831 Void setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth ); 832 833 Void setUseDDD ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 834 835 UChar getDDTmpDepth(){ return m_ucDDTmpDepth; } 836 Int getUseDDDCandIdx(){ return m_iUseDDDCandIdx;} 837 838 #endif 753 839 }; 754 840 -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r773 r833 176 176 Void setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ); 177 177 #endif 178 #if NTT_STORE_SPDV_VSP_G0148 179 Void setMv ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; } 180 Void setRefIdx ( Int iIdx, Int iRefIdx ) { m_piRefIdx[iIdx] = iRefIdx; } 181 #endif 178 182 179 183 Void setNumPartition( Int iNumPart ) -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r773 r833 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 ) 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 ) 419 423 { 420 424 assert( iWidth == iHeight ); … … 442 446 case( DMM4_IDX ): 443 447 { 448 #if QC_GENERIC_SDC_G0122 449 if( dmm4Segmentation == NULL ) 450 { 451 dmmSegmentation = new TComWedgelet( iWidth, iHeight ); 452 xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation ); 453 } 454 else 455 { 456 xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmm4Segmentation ); 457 dmmSegmentation = dmm4Segmentation; 458 } 459 #else 444 460 dmmSegmentation = new TComWedgelet( iWidth, iHeight ); 445 461 xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation ); 462 #endif 446 463 } break; 447 464 default: assert(0); … … 494 511 495 512 #if H_3D_DIM_DMM 513 #if QC_GENERIC_SDC_G0122 514 if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; } 515 #else 496 516 if( dimType == DMM4_IDX ) { dmmSegmentation->destroy(); delete dmmSegmentation; } 517 #endif 497 518 #endif 498 519 } … … 598 619 } 599 620 return true; 621 } 622 #endif 623 624 #if H_3D_DBBP 625 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize) 626 { 627 // find virtual partitioning for this CU based on depth block 628 // segmentation of texture block --> mask IDs 629 Pel* pDepthBlockStart = pDepthPels; 630 631 // first compute average of depth block for thresholding 632 Int iSumDepth = 0; 633 Int iSubSample = 4; 634 for (Int y=0; y<uiSize; y+=iSubSample) 635 { 636 for (Int x=0; x<uiSize; x+=iSubSample) 637 { 638 Int depthPel = pDepthPels[x]; 639 640 iSumDepth += depthPel; 641 } 642 643 // next row 644 pDepthPels += uiDepthStride*iSubSample; 645 } 646 647 Int iSizeInBits = g_aucConvertToBit[uiSize] - g_aucConvertToBit[iSubSample]; // respect sub-sampling factor 648 Int iMean = iSumDepth >> iSizeInBits*2; // iMean /= (uiSize*uiSize); 649 650 // start again for segmentation 651 pDepthPels = pDepthBlockStart; 652 653 // start mapping process 654 Bool bAMPAvail = uiSize > 8; 655 Int matchedPartSum[6][2] = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}}; // counter for each part size and boolean option 656 PartSize virtualPartSizes[6] = { SIZE_Nx2N, SIZE_2NxN, SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N }; 657 658 UInt uiHalfSize = uiSize>>1; 659 UInt uiQuarterSize = uiSize>>2; 660 661 for (Int y=0; y<uiSize; y+=iSubSample) 662 { 663 for (Int x=0; x<uiSize; x+=iSubSample) 664 { 665 Int depthPel = pDepthPels[x]; 666 667 // decide which segment this pixel belongs to 668 Int ucSegment = (Int)(depthPel>iMean); 669 670 // Matched Filter to find optimal (conventional) partitioning 671 672 // SIZE_Nx2N 673 if(x<uiHalfSize) // left 674 { 675 matchedPartSum[0][ucSegment]++; 676 } 677 else // right 678 { 679 matchedPartSum[0][1-ucSegment]++; 680 } 681 682 // SIZE_2NxN 683 if(y<uiHalfSize) // top 684 { 685 matchedPartSum[1][ucSegment]++; 686 } 687 else // bottom 688 { 689 matchedPartSum[1][1-ucSegment]++; 690 } 691 692 if( bAMPAvail ) 693 { 694 // SIZE_2NxnU 695 if(y<uiQuarterSize) // top (1/4) 696 { 697 matchedPartSum[2][ucSegment]++; 698 } 699 else // bottom (3/4) 700 { 701 matchedPartSum[2][1-ucSegment]++; 702 } 703 704 // SIZE_2NxnD 705 if(y<(uiQuarterSize*3)) // top (3/4) 706 { 707 matchedPartSum[3][ucSegment]++; 708 } 709 else // bottom (1/4) 710 { 711 matchedPartSum[3][1-ucSegment]++; 712 } 713 714 // SIZE_nLx2N 715 if(x<uiQuarterSize) // left (1/4) 716 { 717 matchedPartSum[4][ucSegment]++; 718 } 719 else // right (3/4) 720 { 721 matchedPartSum[4][1-ucSegment]++; 722 } 723 724 // SIZE_nRx2N 725 if(x<(uiQuarterSize*3)) // left (3/4) 726 { 727 matchedPartSum[5][ucSegment]++; 728 } 729 else // right (1/4) 730 { 731 matchedPartSum[5][1-ucSegment]++; 732 } 733 } 734 } 735 736 // next row 737 pDepthPels += uiDepthStride*iSubSample; 738 } 739 740 PartSize matchedPartSize = SIZE_NONE; 741 742 Int iMaxMatchSum = 0; 743 for(Int p=0; p<6; p++) // loop over partition sizes 744 { 745 for( Int b=0; b<=1; b++ ) // loop over boolean options 746 { 747 if(matchedPartSum[p][b] > iMaxMatchSum) 748 { 749 iMaxMatchSum = matchedPartSum[p][b]; 750 matchedPartSize = virtualPartSizes[p]; 751 } 752 } 753 } 754 755 AOF( matchedPartSize != SIZE_NONE ); 756 757 return matchedPartSize; 758 } 759 760 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask ) 761 { 762 // segmentation of texture block --> mask IDs 763 Pel* pDepthBlockStart = pDepthPels; 764 765 // first compute average of depth block for thresholding 766 Int iSumDepth = 0; 767 Int uiMinDepth = MAX_INT; 768 Int uiMaxDepth = 0; 769 for (Int y=0; y<uiHeight; y++) 770 { 771 for (Int x=0; x<uiWidth; x++) 772 { 773 Int depthPel = pDepthPels[x]; 774 iSumDepth += depthPel; 775 776 if( depthPel > uiMaxDepth ) 777 { 778 uiMaxDepth = depthPel; 779 } 780 if( depthPel < uiMinDepth ) 781 { 782 uiMinDepth = depthPel; 783 } 784 } 785 786 // next row 787 pDepthPels += uiDepthStride; 788 } 789 790 // don't generate mask for blocks with small depth range (encoder decision) 791 if( uiMaxDepth - uiMinDepth < 10 ) 792 { 793 return false; 794 } 795 796 AOF(uiWidth==uiHeight); 797 Int iSizeInBits = g_aucConvertToBit[uiWidth]+2; 798 Int iMean = iSumDepth >> iSizeInBits*2; // iMean /= (uiWidth*uiHeight); 799 800 // start again for segmentation 801 pDepthPels = pDepthBlockStart; 802 803 Bool bInvertMask = pDepthPels[0]>iMean; // top-left segment needs to be mapped to partIdx 0 804 805 // generate mask 806 UInt uiSumPix[2] = {0,0}; 807 for (Int y=0; y<uiHeight; y++) 808 { 809 for (Int x=0; x<uiHeight; x++) 810 { 811 Int depthPel = pDepthPels[x]; 812 813 // decide which segment this pixel belongs to 814 Int ucSegment = (Int)(depthPel>iMean); 815 816 if( bInvertMask ) 817 { 818 ucSegment = 1-ucSegment; 819 } 820 821 // count pixels for each segment 822 uiSumPix[ucSegment]++; 823 824 // set mask value 825 pMask[x] = (Bool)ucSegment; 826 } 827 828 // next row 829 pDepthPels += uiDepthStride; 830 pMask += MAX_CU_SIZE; 831 } 832 833 // don't generate valid mask for tiny segments (encoder decision) 834 // each segment needs to cover at least 1/8th of block 835 UInt uiMinPixPerSegment = (uiWidth*uiHeight) >> 3; 836 if( !( uiSumPix[0] > uiMinPixPerSegment && uiSumPix[1] > uiMinPixPerSegment ) ) 837 { 838 return false; 839 } 840 841 // all good 842 return true; 843 } 844 845 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr ) 846 { 847 Pel* piSrc[2] = {pInYuv[0]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)}; 848 UInt uiSrcStride = pInYuv[0]->getStride(); 849 Pel* piDst = pOutYuv->getLumaAddr(uiPartAddr); 850 UInt uiDstStride = pOutYuv->getStride(); 851 852 UInt uiMaskStride= MAX_CU_SIZE; 853 854 // backup pointer 855 Bool* pMaskStart = pMask; 856 857 // combine luma first 858 for (Int y=0; y<uiHeight; y++) 859 { 860 for (Int x=0; x<uiWidth; x++) 861 { 862 UChar ucSegment = (UChar)pMask[x]; 863 AOF( ucSegment < 2 ); 864 865 // filtering 866 Bool t = (y==0)?pMaskStart[(y+1)*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x]; 867 Bool l = (x==0)?pMaskStart[y*uiMaskStride+x+1]:pMaskStart[y*uiMaskStride+x-1]; 868 Bool b = (y==uiHeight-1)?pMaskStart[(y-1)*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x]; 869 Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x-1]:pMaskStart[y*uiMaskStride+x+1]; 870 871 Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r)); 872 piDst[x] = bBlend?((piSrc[0][x]+piSrc[1][x]+1)>>1):piSrc[ucSegment][x]; 873 } 874 875 piSrc[0] += uiSrcStride; 876 piSrc[1] += uiSrcStride; 877 piDst += uiDstStride; 878 pMask += uiMaskStride; 879 } 880 881 // now combine chroma 882 Pel* piSrcU[2] = { pInYuv[0]->getCbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) }; 883 Pel* piSrcV[2] = { pInYuv[0]->getCrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) }; 884 UInt uiSrcStrideC = pInYuv[0]->getCStride(); 885 Pel* piDstU = pOutYuv->getCbAddr(uiPartAddr); 886 Pel* piDstV = pOutYuv->getCrAddr(uiPartAddr); 887 UInt uiDstStrideC = pOutYuv->getCStride(); 888 UInt uiWidthC = uiWidth >> 1; 889 UInt uiHeightC = uiHeight >> 1; 890 pMask = pMaskStart; 891 892 for (Int y=0; y<uiHeightC; y++) 893 { 894 for (Int x=0; x<uiWidthC; x++) 895 { 896 UChar ucSegment = (UChar)pMask[x*2]; 897 AOF( ucSegment < 2 ); 898 899 // filtering 900 Bool t = (y==0)?pMaskStart[(y+1)*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2]; 901 Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+(x+1)*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2]; 902 Bool b = (y==uiHeightC-1)?pMaskStart[(y-1)*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2]; 903 Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+(x-1)*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2]; 904 905 Bool bBlend = !((t&&l&&b&&r) || (!t&&!l&&!b&&!r)); 906 907 piDstU[x] = bBlend?((piSrcU[0][x]+piSrcU[1][x]+1)>>1):piSrcU[ucSegment][x]; 908 piDstV[x] = bBlend?((piSrcV[0][x]+piSrcV[1][x]+1)>>1):piSrcV[ucSegment][x]; 909 } 910 911 piSrcU[0] += uiSrcStrideC; 912 piSrcU[1] += uiSrcStrideC; 913 piSrcV[0] += uiSrcStrideC; 914 piSrcV[1] += uiSrcStrideC; 915 piDstU += uiDstStrideC; 916 piDstV += uiDstStrideC; 917 pMask += 2*uiMaskStride; 918 } 600 919 } 601 920 #endif … … 783 1102 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 784 1103 pcCU->clipMv(cMv); 1104 1105 #if MTK_DDD_G0063 1106 if( pcCU->getUseDDD( uiPartAddr ) ) 1107 { 1108 assert( pcCU->getSPIVMPFlag( uiPartAddr ) == 0 ); 1109 assert( pcCU->getSlice()->getViewIndex() != 0 ); 1110 1111 Int dstStride = rpcYuvPred->getStride(); 1112 Int dstStrideC = rpcYuvPred->getCStride(); 1113 Pel *dst = rpcYuvPred->getLumaAddr( uiPartAddr ); 1114 Pel *dstU = rpcYuvPred->getCbAddr( uiPartAddr ); 1115 Pel *dstV = rpcYuvPred->getCrAddr( uiPartAddr ); 1116 1117 Int iWidthC = iWidth >> 1; 1118 Int iHeightC = iHeight >> 1; 1119 Int DefaultC = 1 << ( g_bitDepthY - 1); 1120 for ( Int i = 0; i < iHeight; i++) 1121 { 1122 for ( Int j = 0; j < iWidth ; j++) 1123 { 1124 dst[j] = pcCU->getDDDepth( uiPartAddr ); 1125 } 1126 dst += dstStride; 1127 } 1128 for ( Int i = 0; i < iHeightC; i++) 1129 { 1130 for ( Int j = 0; j < iWidthC; j++) 1131 { 1132 dstU[j] = dstV[j] = DefaultC; 1133 } 1134 dstU += dstStrideC; 1135 dstV += dstStrideC; 1136 } 1137 1138 //return; 1139 } else 1140 #endif 785 1141 #if H_3D_ARP 786 1142 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) … … 826 1182 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 827 1183 { 1184 #if NTT_STORE_SPDV_VSP_G0148 1185 Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1; 1186 1187 Int widthSubPU, heightSubPU; 1188 if (vspSize) 1189 { 1190 widthSubPU = 8; 1191 heightSubPU = 4; 1192 } 1193 else 1194 { 1195 widthSubPU = 4; 1196 heightSubPU = 8; 1197 } 1198 xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU ); 1199 1200 #else // NTT_STORE_SPDV_VSP_G0148 828 1201 // Get depth reference 829 1202 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; … … 877 1250 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 878 1251 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 879 } 1252 #endif // NTT_STORE_SPDV_VSP_G0148 1253 } 1254 1255 #if NTT_STORE_SPDV_VSP_G0148 1256 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU ) 1257 { 1258 UInt numPartsInLine = pcCU->getPic()->getNumPartInWidth(); 1259 UInt horiNumPartsInSubPU = widthSubPU >> 2; 1260 UInt vertNumPartsInSubPU = (heightSubPU >> 2) * numPartsInLine; 1261 1262 UInt partAddrRasterLine = g_auiZscanToRaster[ uiPartAddr ]; 1263 1264 for( Int posY=0; posY<iHeight; posY+=heightSubPU, partAddrRasterLine+=vertNumPartsInSubPU ) 1265 { 1266 UInt partAddrRasterSubPU = partAddrRasterLine; 1267 for( Int posX=0; posX<iWidth; posX+=widthSubPU, partAddrRasterSubPU+=horiNumPartsInSubPU ) 1268 { 1269 UInt partAddrSubPU = g_auiRasterToZscan[ partAddrRasterSubPU ]; 1270 Int refIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( partAddrSubPU ); assert (refIdx >= 0); 1271 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( partAddrSubPU ); 1272 pcCU->clipMv(cMv); 1273 1274 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi ); 1275 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi ); 1276 1277 } 1278 } 1279 } 1280 #endif // NTT_STORE_SPDV_VSP_G0148 1281 880 1282 #endif 881 1283 … … 1732 2134 1733 2135 #if H_3D_VSP 2136 #if !(NTT_STORE_SPDV_VSP_G0148) 1734 2137 // not fully support iRatioTxtPerDepth* != 1 1735 2138 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) … … 2044 2447 } 2045 2448 } 2046 2449 #endif 2047 2450 2048 2451 #if H_3D_VSP_CONSTRAINED … … 2082 2485 if( bL == bT ) 2083 2486 { 2487 #if SCU_HS_DEPTH_DC_PRED_G0143 2488 const Int iTRR = ( patternStride * 2 - 1 ) - srcStride; 2489 const Int iLBB = ( patternStride * 2 - 1 ) * srcStride - 1; 2490 refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : (abs(ptrSrc[iTRR] - ptrSrc[-(Int)srcStride]) > abs(ptrSrc[iLBB] - ptrSrc[ -1]) ? ptrSrc[iTRR] : ptrSrc[iLBB]); 2491 #else 2084 2492 refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : 1<<( g_bitDepthY - 1 ); 2493 #endif 2085 2494 refDC2 = ( ptrSrc[ -1] + ptrSrc[-(Int)srcStride] )>>1; 2086 2495 } … … 2184 2593 Int iSumPix[2]; 2185 2594 memset(iSumPix, 0, sizeof(Int)*2); 2186 2595 #if QC_GENERIC_SDC_G0122 2596 for( Int i = 0; i < uiNumSegments; i++ ) 2597 { 2598 rpSegMeans[i] = 0; 2599 } 2600 #endif 2187 2601 if (orgDC == false) 2188 2602 { … … 2199 2613 rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ]; 2200 2614 } 2615 #if QC_GENERIC_SDC_G0122 2616 else if( getDimType( uiIntraMode ) == DMM4_IDX ) 2617 { 2618 Pel *ptmpOrig = pOrig; 2619 Bool *ptmpMask = pMask, bBreak = false; 2620 UChar ucSegment = ptmpMask? (UChar) ptmpMask[0] : 0; 2621 UChar bFirstSeg = ucSegment; 2622 2623 rpSegMeans[ucSegment] = ptmpOrig[0]; 2624 for ( Int y = 0; y < uiSize; y++ ) 2625 { 2626 for ( Int x = 0; x < uiSize; x++ ) 2627 { 2628 ucSegment = ptmpMask[x]; 2629 assert( ucSegment < uiNumSegments ); 2630 2631 if( bFirstSeg != ucSegment ) 2632 { 2633 rpSegMeans[ucSegment] = ptmpOrig[x]; 2634 bBreak = true; 2635 break; 2636 } 2637 } 2638 2639 if( bBreak ) 2640 { 2641 break; 2642 } 2643 2644 ptmpOrig += uiStride; 2645 ptmpMask += uiMaskStride; 2646 } 2647 } 2648 else 2649 #else 2201 2650 else if (uiIntraMode == PLANAR_IDX) 2651 #endif 2202 2652 { 2203 2653 Pel* pLeftTop = pOrig; -
trunk/source/Lib/TLibCommon/TComPrediction.h
r773 r833 121 121 122 122 #if H_3D_VSP 123 #if NTT_STORE_SPDV_VSP_G0148 124 Void xPredInterUniSubPU ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 ); 125 #else 123 126 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 ); 124 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); 125 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 #endif 126 130 #endif 127 131 … … 167 171 #if H_3D_DIM 168 172 // Depth intra 169 Void predIntraLumaDepth ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false ); 173 Void predIntraLumaDepth ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false 174 #if QC_GENERIC_SDC_G0122 175 , TComWedgelet* dmm4Segmentation = NULL 176 #endif 177 ); 170 178 #if H_3D_DIM_SDC 171 179 Void analyzeSegmentsSDC ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride … … 175 183 #endif 176 184 #endif 185 186 #if H_3D_DBBP 187 PartSize getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize); 188 Bool getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask ); 189 Void combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr = 0 ); 190 #endif 177 191 178 192 Pel predIntraGetPredValDC ( Int* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft ); -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r655 r833 266 266 m_bUseEstimatedVSD = false; 267 267 #endif 268 #if H_3D_DBBP 269 m_bUseMask = false; 270 #endif 268 271 } 269 272 … … 326 329 rcDistParam.DistFunc = m_afpDistortFunc[eDFunc + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 327 330 331 #if H_3D_DBBP 332 if( m_bUseMask ) 333 { 334 if( eDFunc >= DF_SSE && eDFunc <= DF_SSE16N ) 335 { 336 rcDistParam.DistFunc = TComRdCost::xGetMaskedSSE; 337 } 338 else if( eDFunc >= DF_SAD && eDFunc <= DF_SADS16N ) 339 { 340 rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD; 341 } 342 else if( eDFunc >= DF_HADS && eDFunc <= DF_HADS16N ) 343 { 344 rcDistParam.DistFunc = TComRdCost::xGetMaskedHADs; 345 } 346 else if( eDFunc >= DF_VSD && eDFunc <= DF_VSD16N ) 347 { 348 rcDistParam.DistFunc = TComRdCost::xGetMaskedVSD; 349 } 350 else if( eDFunc >= DF_SAD12 && eDFunc <= DF_SADS48 ) 351 { 352 rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD; 353 } 354 } 355 #endif 356 328 357 // initialize 329 358 rcDistParam.iSubShift = 0; … … 357 386 { 358 387 rcDistParam.DistFunc = m_afpDistortFunc[45 ]; 388 } 389 #endif 390 391 #if H_3D_DBBP 392 if( m_bUseMask ) 393 { 394 rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD; 359 395 } 360 396 #endif … … 411 447 rcDistParam.DistFunc = m_afpDistortFunc[DF_HADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 412 448 } 449 450 #if H_3D_DBBP 451 if( m_bUseMask ) 452 { 453 rcDistParam.DistFunc = (bHADME)?TComRdCost::xGetMaskedHADs:TComRdCost::xGetMaskedSAD; 454 } 455 #endif 413 456 414 457 // initialize … … 433 476 rcDP.bitDepth = bitDepth; 434 477 rcDP.DistFunc = m_afpDistortFunc[ ( bHadamard ? DF_HADS : DF_SADS ) + g_aucConvertToBit[ iWidth ] + 1 ]; 478 479 #if H_3D_DBBP 480 if( m_bUseMask ) 481 { 482 rcDP.DistFunc = (bHadamard)?TComRdCost::xGetMaskedHADs:TComRdCost::xGetMaskedSAD; 483 } 484 #endif 485 435 486 #if NS_HAD 436 487 rcDP.bUseNSHAD = bUseNSHAD; … … 586 637 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 587 638 639 #if SCU_HS_VSD_BUGFIX_IMPROV_G0163 640 cDtParam.bitDepth = g_bitDepthY; 641 #endif 588 642 Dist dist = cDtParam.DistFunc( &cDtParam ); 589 643 … … 631 685 // Distortion functions 632 686 // ==================================================================================================================== 687 688 #if H_3D_DBBP 689 // -------------------------------------------------------------------------------------------------------------------- 690 // Masked distortion functions 691 // -------------------------------------------------------------------------------------------------------------------- 692 693 UInt TComRdCost::xGetMaskedSSE( DistParam* pcDtParam ) 694 { 695 Pel* piOrg = pcDtParam->pOrg; 696 Pel* piCur = pcDtParam->pCur; 697 Int iRows = pcDtParam->iRows; 698 Int iCols = pcDtParam->iCols; 699 Int iStrideOrg = pcDtParam->iStrideOrg; 700 Int iStrideCur = pcDtParam->iStrideCur; 701 702 UInt uiSum = 0; 703 704 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 705 706 Int iTemp; 707 708 for( ; iRows != 0; iRows-- ) 709 { 710 for (Int n = 0; n < iCols; n++ ) 711 { 712 if( piOrg[n] != DBBP_INVALID_SHORT ) 713 { 714 iTemp = piOrg[n ] - piCur[n ]; 715 uiSum += ( iTemp * iTemp ) >> uiShift; 716 } 717 } 718 piOrg += iStrideOrg; 719 piCur += iStrideCur; 720 } 721 722 return ( uiSum ); 723 } 724 725 UInt TComRdCost::xGetMaskedSAD( DistParam* pcDtParam ) 726 { 727 728 AOF(!pcDtParam->bApplyWeight); 729 #if H_3D_IC 730 AOF(!pcDtParam->bUseIC); 731 #endif 732 733 Pel* piOrg = pcDtParam->pOrg; 734 Pel* piCur = pcDtParam->pCur; 735 Int iRows = pcDtParam->iRows; 736 Int iCols = pcDtParam->iCols; 737 Int iStrideCur = pcDtParam->iStrideCur; 738 Int iStrideOrg = pcDtParam->iStrideOrg; 739 740 UInt uiSum = 0; 741 742 for( ; iRows != 0; iRows-- ) 743 { 744 for (Int n = 0; n < iCols; n++ ) 745 { 746 if( piOrg[n] != DBBP_INVALID_SHORT ) 747 { 748 uiSum += abs( piOrg[n] - piCur[n] ); 749 } 750 } 751 piOrg += iStrideOrg; 752 piCur += iStrideCur; 753 } 754 755 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 756 } 757 758 UInt TComRdCost::xGetMaskedHADs( DistParam* pcDtParam ) 759 { 760 AOF(!pcDtParam->bApplyWeight); 761 #if H_3D_IC 762 AOF(!pcDtParam->bUseIC); 763 #endif 764 Pel* piOrg = pcDtParam->pOrg; 765 Pel* piCur = pcDtParam->pCur; 766 Int iRows = pcDtParam->iRows; 767 Int iCols = pcDtParam->iCols; 768 Int iStrideCur = pcDtParam->iStrideCur; 769 Int iStrideOrg = pcDtParam->iStrideOrg; 770 Int iStep = pcDtParam->iStep; 771 772 Int x, y; 773 774 UInt uiSum = 0; 775 776 #if NS_HAD 777 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) ) 778 #else 779 if( ( iRows % 8 == 0) && (iCols % 8 == 0) ) 780 #endif 781 { 782 Int iOffsetOrg = iStrideOrg<<3; 783 Int iOffsetCur = iStrideCur<<3; 784 for ( y=0; y<iRows; y+= 8 ) 785 { 786 for ( x=0; x<iCols; x+= 8 ) 787 { 788 if( piOrg[x] != DBBP_INVALID_SHORT ) 789 { 790 uiSum += xCalcHADs8x8( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 791 } 792 } 793 piOrg += iOffsetOrg; 794 piCur += iOffsetCur; 795 } 796 } 797 #if NS_HAD 798 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 799 { 800 Int iOffsetOrg = iStrideOrg<<2; 801 Int iOffsetCur = iStrideCur<<2; 802 for ( y=0; y<iRows; y+= 4 ) 803 { 804 for ( x=0; x<iCols; x+= 16 ) 805 { 806 if( piOrg[x] != DBBP_INVALID_SHORT ) 807 { 808 uiSum += xCalcHADs16x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 809 } 810 } 811 piOrg += iOffsetOrg; 812 piCur += iOffsetCur; 813 } 814 } 815 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 816 { 817 Int iOffsetOrg = iStrideOrg<<4; 818 Int iOffsetCur = iStrideCur<<4; 819 for ( y=0; y<iRows; y+= 16 ) 820 { 821 for ( x=0; x<iCols; x+= 4 ) 822 { 823 if( piOrg[x] != DBBP_INVALID_SHORT ) 824 { 825 uiSum += xCalcHADs4x16( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 826 } 827 } 828 piOrg += iOffsetOrg; 829 piCur += iOffsetCur; 830 } 831 } 832 #endif 833 else if( ( iRows % 4 == 0) && (iCols % 4 == 0) ) 834 { 835 Int iOffsetOrg = iStrideOrg<<2; 836 Int iOffsetCur = iStrideCur<<2; 837 838 for ( y=0; y<iRows; y+= 4 ) 839 { 840 for ( x=0; x<iCols; x+= 4 ) 841 { 842 if( piOrg[x] != DBBP_INVALID_SHORT ) 843 { 844 uiSum += xCalcHADs4x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 845 } 846 } 847 piOrg += iOffsetOrg; 848 piCur += iOffsetCur; 849 } 850 } 851 else if( ( iRows % 2 == 0) && (iCols % 2 == 0) ) 852 { 853 Int iOffsetOrg = iStrideOrg<<1; 854 Int iOffsetCur = iStrideCur<<1; 855 for ( y=0; y<iRows; y+=2 ) 856 { 857 for ( x=0; x<iCols; x+=2 ) 858 { 859 if( piOrg[x] != DBBP_INVALID_SHORT ) 860 { 861 uiSum += xCalcHADs2x2( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 862 } 863 } 864 piOrg += iOffsetOrg; 865 piCur += iOffsetCur; 866 } 867 } 868 else 869 { 870 assert(false); 871 } 872 873 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 874 } 875 876 UInt TComRdCost::xGetMaskedVSD( DistParam* pcDtParam ) 877 { 878 Pel* piOrg = pcDtParam->pOrg; 879 Pel* piCur = pcDtParam->pCur; 880 Pel* piVirRec = pcDtParam->pVirRec; 881 Pel* piVirOrg = pcDtParam->pVirOrg; 882 Int iRows = pcDtParam->iRows; 883 Int iCols = pcDtParam->iCols; 884 Int iStrideOrg = pcDtParam->iStrideOrg; 885 Int iStrideCur = pcDtParam->iStrideCur; 886 Int iStrideVir = pcDtParam->iStrideVir; 887 888 UInt uiSum = 0; 889 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8)<<1; 890 891 Int dDM; 892 893 for ( Int y = 0 ; y < iRows ; y++ ) 894 { 895 for (Int x = 0; x < iCols; x++ ) 896 { 897 if( piOrg[x] != DBBP_INVALID_SHORT ) 898 { 899 dDM = (Int) ( piOrg[x ] - piCur[x ] ); 900 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 901 } 902 } 903 piOrg += iStrideOrg; 904 piCur += iStrideCur; 905 } 906 907 return ( uiSum ); 908 } 909 #endif 633 910 634 911 // -------------------------------------------------------------------------------------------------------------------- … … 2747 3024 dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff; 2748 3025 3026 #if SCU_HS_VSD_BUGFIX_IMPROV_G0163 3027 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 ); 3028 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 ] ) ) ); 3029 #else 2749 3030 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 ] ) ) ); 3031 #endif 2750 3032 iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5)); 2751 3033 -
trunk/source/Lib/TLibCommon/TComRdCost.h
r655 r833 184 184 #endif 185 185 186 #if H_3D_DBBP 187 Bool m_bUseMask; 188 #endif 189 186 190 public: 187 191 TComRdCost(); … … 229 233 Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); 230 234 Void setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false ); 235 #endif 236 237 #if H_3D_DBBP 238 Void setUseMask(Bool b) { m_bUseMask = b; } 231 239 #endif 232 240 … … 334 342 #endif 335 343 344 #if H_3D_DBBP 345 static UInt xGetMaskedSSE ( DistParam* pcDtParam ); 346 static UInt xGetMaskedSAD ( DistParam* pcDtParam ); 347 static UInt xGetMaskedHADs ( DistParam* pcDtParam ); 348 static UInt xGetMaskedVSD ( DistParam* pcDtParam ); 349 #endif 350 336 351 public: 337 352 #if WEIGHTED_CHROMA_DISTORTION -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r773 r833 1827 1827 #if H_3D_INTER_SDC 1828 1828 m_bInterSDCFlag [ i ] = false; 1829 #endif 1830 #if H_3D_DBBP 1831 m_dbbpFlag [ i ] = false; 1829 1832 #endif 1830 1833 #if H_3D_IV_MERGE … … 3129 3132 for ( Int refListIdx = 0; refListIdx < ((m_eSliceType==B_SLICE) ? 2 : 1); refListIdx++ ) 3130 3133 { 3134 #if MTK_ARP_REF_SELECTION_G0053 3135 Int diffPOC=MAX_INT; 3136 Int idx=-1; 3137 #endif 3131 3138 for(Int i = 0; i < getNumRefIdx(RefPicList(refListIdx)); i++ ) 3132 3139 { 3133 3140 if ( getRefPic(RefPicList(refListIdx), i)->getPOC() != getPOC() ) 3134 3141 { 3142 #if MTK_ARP_REF_SELECTION_G0053 3143 if( abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC()) < diffPOC) 3144 { 3145 diffPOC=abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC()); 3146 idx=i; 3147 } 3148 #else 3135 3149 setFirstTRefIdx (RefPicList(refListIdx), i); 3136 3150 break; 3151 #endif 3137 3152 } 3153 #if MTK_ARP_REF_SELECTION_G0053 3154 if(idx>=0) 3155 { 3156 setFirstTRefIdx (RefPicList(refListIdx), idx); 3157 } 3158 #endif 3138 3159 } 3139 3160 } … … 3272 3293 #endif 3273 3294 3295 #if MTK_DDD_G0063 3296 if( getIsDepth() && getViewIndex() > 0 ) 3297 { 3298 TComSlice *pcTextSlice = getTexturePic()->getSlice( 0 ); 3299 memcpy( m_aiDDDInvScale, pcTextSlice->m_aiDDDInvScale, sizeof( Int ) * getViewIndex() ); 3300 memcpy( m_aiDDDInvOffset, pcTextSlice->m_aiDDDInvOffset, sizeof( Int ) * getViewIndex() ); 3301 memcpy( m_aiDDDShift, pcTextSlice->m_aiDDDShift, sizeof( Int ) * getViewIndex() ); 3302 } 3303 #endif 3304 3274 3305 if( !setupLUT ) 3275 3306 return; … … 3319 3350 m_depthToDisparityF[ i ][ d ] = ( invCodScale[ i ] * d + invOffset ) >> log2Div; 3320 3351 } 3321 } 3322 } 3323 #endif 3324 #endif 3352 3353 #if MTK_DDD_G0063 3354 InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i ); 3355 #endif 3356 } 3357 } 3358 #endif 3359 #endif 3360 3361 #if MTK_DDD_G0063 3362 Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ) 3363 { 3364 UInt uiViewId = getViewIndex(); 3365 3366 if( uiViewId == 0 ) 3367 { 3368 m_aiDDDInvScale[ iBaseViewIdx ] = m_aiDDDInvOffset[ iBaseViewIdx ] = m_aiDDDShift[ iBaseViewIdx ] = 0; 3369 return; 3370 } 3371 3372 3373 Int iSign = iCodedScale >= 0 ? 1 : -1; 3374 iCodedScale = abs( iCodedScale ); 3375 3376 Int iBitWidth = 0; 3377 3378 const Int iInvPres = 9; 3379 3380 while( ((( 1 << iBitWidth ) << 1 ) <= iCodedScale ) ) 3381 { 3382 iBitWidth ++; 3383 } 3384 iBitWidth += iInvPres; 3385 Int iTargetValue = 1 << iBitWidth; 3386 3387 Int iMinError = MAX_INT; 3388 Int iBestD = 1 << ( iInvPres - 1 ); 3389 for( Int d = 1 << ( iInvPres - 1 ); d < ( 1 << iInvPres ); d++ ) 3390 { 3391 Int iError = abs( iCodedScale * d - iTargetValue ); 3392 if( iError < iMinError ) 3393 { 3394 iMinError = iError; 3395 iBestD = d; 3396 } 3397 if( iMinError == 0 ) 3398 { 3399 break; 3400 } 3401 } 3402 Int iRoundingDir = 0; 3403 if( iCodedScale * iBestD > iTargetValue ) 3404 { 3405 iRoundingDir = -1; 3406 } 3407 else if( iCodedScale * iBestD < iTargetValue ) 3408 { 3409 iRoundingDir = 1; 3410 } 3411 Int iCamPres = uiCamParsCodedPrecision - 1; 3412 m_aiDDDInvScale [ iBaseViewIdx ] = ( iBestD << ( iCamPres + g_bitDepthY )) * iSign; 3413 m_aiDDDInvOffset[ iBaseViewIdx ] = -iSign * iBestD * ( iCodedOffset << g_bitDepthY ); 3414 m_aiDDDShift [ iBaseViewIdx ] = iBitWidth; 3415 m_aiDDDInvOffset[ iBaseViewIdx ] += 1 << ( m_aiDDDShift[ iBaseViewIdx ] - 1 ); 3416 m_aiDDDInvOffset[ iBaseViewIdx ] += ( 1 << ( m_aiDDDShift[ iBaseViewIdx ] - 4 ) ) * iRoundingDir; 3417 3418 return; 3419 } 3420 #endif 3421 3325 3422 /** get scaling matrix from RefMatrixID 3326 3423 * \param sizeId size index -
trunk/source/Lib/TLibCommon/TComSlice.h
r773 r833 783 783 #endif 784 784 #endif 785 #if QC_SPIVMP_MPI_G0119 786 Int m_iSubPUMPILog2Size; 787 #endif 785 788 #if H_3D_VSP 786 789 Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; … … 801 804 #if H_3D_INTER_SDC 802 805 Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; 806 #endif 807 #if H_3D_DBBP 808 Bool m_dbbpFlag[MAX_NUM_LAYERS]; 803 809 #endif 804 810 #if H_3D_IV_MERGE … … 952 958 Bool inferOutputLayerFlag( Int layerSetIdx, Int i ) { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1 ) )); } 953 959 954 Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; }960 Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx ] = val; } 955 961 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 956 962 Void setAltOutputLayerFlag( Bool flag ) { m_altOutputLayerFlag = flag; } … … 1058 1064 #endif 1059 1065 #endif 1066 #if QC_SPIVMP_MPI_G0119 1067 Int getSubPUMPILog2Size( ) { return m_iSubPUMPILog2Size; } 1068 Void setSubPUMPILog2Size( Int u ) { m_iSubPUMPILog2Size = u; } 1069 #endif 1060 1070 #if H_3D_VSP 1061 1071 Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } … … 1074 1084 Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } 1075 1085 Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } 1086 #endif 1087 #if H_3D_DBBP 1088 Bool getUseDBBP ( Int layerIdInVps ) { return m_dbbpFlag[layerIdInVps]; } 1089 Void setUseDBBP ( Int layerIdInVps, Bool bval ){ m_dbbpFlag[layerIdInVps] = bval; } 1076 1090 #endif 1077 1091 #if H_3D_IV_MERGE … … 2055 2069 #endif 2056 2070 #endif 2071 2072 #if MTK_DDD_G0063 2073 Int m_aiDDDInvScale [MAX_NUM_LAYERS]; 2074 Int m_aiDDDInvOffset[MAX_NUM_LAYERS]; 2075 UInt m_aiDDDShift [MAX_NUM_LAYERS]; 2076 #endif 2077 2057 2078 public: 2058 2079 TComSlice(); … … 2401 2422 TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); 2402 2423 #endif 2424 2425 #if MTK_DDD_G0063 2426 Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ); 2427 Int getDepthFromDV( Int iDV, Int iBaseViewIdx ) 2428 { 2429 return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]); 2430 } 2431 #endif 2432 2403 2433 protected: 2404 2434 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, -
trunk/source/Lib/TLibCommon/TypeDef.h
r773 r833 235 235 #define H_3D_DELTA_DLT 1 236 236 #endif 237 238 237 #define H_3D_DIM_ENC 1 // Depth Intra encoder optimizations, includes: 239 238 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 … … 250 249 #endif 251 250 251 252 252 ///// ***** ILLUMATION COMPENSATION ********* 253 253 #if H_3D_IC … … 257 257 #endif 258 258 259 259 260 ///// ***** FCO ********* 260 261 #if H_3D_FCO … … 272 273 /////////////////////////////////// HTM-10.0 Integrations ////////////////////////////// 273 274 ///////////////////////////////////////////////////////////////////////////////////////// 274 275 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 276 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 277 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 278 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 279 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 280 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 281 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 282 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 283 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 284 // !!! PLEASE PUT MACROS RELATED TO HTM-10.0 INTEGRATIONS HERE !!! 285 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 282 #if H_3D_VSP 283 #define MTK_RBIP_VSP_G0069 1 // Restricted bi-prediction for VSP 284 #define NTT_STORE_SPDV_VSP_G0148 1 // Storing Sub-PU based DV for VSP 285 #endif 286 287 #define H_3D_DBBP 1 // DBBP: Depth-based Block Partitioning and Merging 288 289 #if H_3D_DBBP 290 #define DBBP_INVALID_SHORT (-4) 291 #define RWTH_DBBP_PACK_MODE SIZE_2NxN 292 #endif 293 294 #if H_3D_DIM 295 #define QC_PKU_SDC_SPLIT_G0123 1 // Intra SDC Split 296 #if QC_PKU_SDC_SPLIT_G0123 297 #define HS_TSINGHUA_SDC_SPLIT_G0111 1 298 #endif 299 #define SCU_HS_DEPTH_DC_PRED_G0143 1 300 #define QC_GENERIC_SDC_G0122 1 // Generalize SDC to all depth intra modes 301 #if H_3D_DIM_SDC && H_3D_INTER_SDC 302 #define QC_SDC_UNIFY_G0130 1 // Unify intra SDC and inter SDC 303 #define QC_SDC_UNIFY_G0130_FIX 1 // Fix bug of G0130 304 #define QC_SDC_UNIFY_G0130_FIX2 1 // Fix bug of G0130 305 #endif 306 #define SEC_INTER_SDC_G0101 1 // Improved inter SDC with multiple DC candidates 307 #endif 308 309 #define KHU_SIMP_SPIVMP_G0147 1 // Simplification on Sub-PU level temporal interview motion prediction 310 311 #if H_3D_SPIVMP 312 #define QC_SPIVMP_MPI_G0119 1 // Sub-PU level MPI merge candidate 313 #endif 314 315 #define QC_DEPTH_MERGE_SIMP_G0127 1 // Remove DV candidate and shifting candidate for depth coding 316 #define SEC_IC_ARP_SIG_G0072 1 // Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121 317 #define SCU_HS_VSD_BUGFIX_IMPROV_G0163 1 318 #define SEC_SPIVMP_MCP_SIZE_G0077 1 // Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077 319 #define SEC_DEPTH_DV_DERIVAITON_G0074 1 // Simplification of DV derivation for depth, JCT3V-G0074 320 #define MTK_ARP_REF_SELECTION_G0053 1 // ARP Reference picture selection in JCT3V-G0053 321 #define MTK_ARP_FLAG_CABAC_SIMP_G0061 1 // Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061 322 #define MTK_IC_FLAG_CABAC_SIMP_G0061 1 // Use only 1 context for IC flag in JCT3V-G0061 323 #define MTK_NBDV_IVREF_FIX_G0067 1 // Disable IvMC, VSP when IVREF is not available, JCT3V-G0067 324 #endif 286 325 ///////////////////////////////////////////////////////////////////////////////////////// 287 326 /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r773 r833 1697 1697 READ_FLAG( uiCode, "iv_mv_pred_flag[i]"); pcVPS->setIvMvPredFlag ( i, uiCode == 1 ? true : false ); 1698 1698 #if H_3D_SPIVMP 1699 #if SEC_SPIVMP_MCP_SIZE_G0077 1700 READ_UVLC (uiCode, "log2_sub_PU_size_minus3"); pcVPS->setSubPULog2Size(i, uiCode+3); 1701 #else 1699 1702 READ_UVLC (uiCode, "log2_sub_PU_size_minus2"); pcVPS->setSubPULog2Size(i, uiCode+2); 1703 #endif 1700 1704 #endif 1701 1705 #endif … … 1710 1714 READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false ); 1711 1715 #endif 1716 #if H_3D_DBBP 1717 READ_FLAG( uiCode, "use_dbbp_flag[i]" ); pcVPS->setUseDBBP( i, uiCode == 1 ? true : false ); 1718 #endif 1712 1719 } 1713 1720 else … … 1722 1729 if (i!=1) 1723 1730 { 1731 #if SEC_SPIVMP_MCP_SIZE_G0077 1732 READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]"); pcVPS->setSubPULog2Size(i, uiCode+3); 1733 #else 1724 1734 READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]"); pcVPS->setSubPULog2Size(i, uiCode+2); 1735 #endif 1725 1736 } 1726 1737 #endif … … 1762 1773 } 1763 1774 } 1764 1775 #if QC_SPIVMP_MPI_G0119 1776 READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3"); pcVPS->setSubPUMPILog2Size( uiCode + 3 ); 1777 #endif 1765 1778 READ_FLAG( uiCode, "iv_mv_scaling_flag"); pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 1766 1779 } … … 2774 2787 #endif 2775 2788 #if H_3D_INTER_SDC 2789 #if QC_SDC_UNIFY_G0130 2790 Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2791 { 2792 assert(0); 2793 } 2794 2795 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2796 { 2797 assert(0); 2798 } 2799 #else 2776 2800 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2777 2801 { … … 2783 2807 assert(0); 2784 2808 } 2809 #endif 2810 #endif 2811 #if H_3D_DBBP 2812 Void TDecCavlc::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2813 { 2814 assert(0); 2815 } 2785 2816 #endif 2786 2817 // ==================================================================================================================== -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r773 r833 124 124 #endif 125 125 #if H_3D_INTER_SDC 126 #if QC_SDC_UNIFY_G0130 127 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 128 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 129 #else 126 130 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 127 131 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 132 #endif 133 #endif 134 #if H_3D_DBBP 135 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 128 136 #endif 129 137 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r773 r833 50 50 m_ppcYuvReco = NULL; 51 51 m_ppcCU = NULL; 52 #if H_3D_DBBP 53 m_ppcYuvRecoDBBP = NULL; 54 #endif 52 55 } 53 56 … … 75 78 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; 76 79 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; 80 #if H_3D_DBBP 81 m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1]; 82 #endif 77 83 78 84 UInt uiNumPartitions; … … 86 92 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight ); 87 93 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 94 #if H_3D_DBBP 95 m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight ); 96 #endif 88 97 } 89 98 … … 106 115 m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; 107 116 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 117 #if H_3D_DBBP 118 m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL; 119 #endif 108 120 } 109 121 … … 111 123 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 112 124 delete [] m_ppcCU ; m_ppcCU = NULL; 125 #if H_3D_DBBP 126 delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL; 127 #endif 113 128 } 114 129 … … 213 228 DTRACE_CU("cqtDepth" , uiDepth) 214 229 #endif 230 215 231 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 216 232 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); … … 276 292 #endif 277 293 294 295 #if MTK_DDD_G0063 296 pcCU->setUseDDD( false, uiAbsPartIdx, uiDepth ); 297 #endif 298 278 299 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) 279 300 { … … 318 339 if( pcCU->getSlice()->getIsDepth()) 319 340 { 341 #if SEC_DEPTH_DV_DERIVAITON_G0074 342 DvInfo.bDV = m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo); 343 #else 320 344 DvInfo.bDV = m_ppcCU[uiDepth]->getDispNeighBlocks(0, 0, &DvInfo); 345 #endif 321 346 } 322 347 else … … 390 415 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 391 416 417 #if !SEC_IC_ARP_SIG_G0072 392 418 #if H_3D_IC 393 419 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 394 420 #endif 421 #endif 395 422 #if H_3D_ARP 396 423 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 424 #endif 425 #if SEC_IC_ARP_SIG_G0072 426 #if H_3D_IC 427 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 428 #endif 397 429 #endif 398 430 … … 434 466 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 435 467 468 #if MTK_DDD_G0063 469 if( uiMergeIndex == m_ppcCU[uiDepth]->getUseDDDCandIdx() ) 470 { 471 assert( pcCU->getSlice()->getViewIndex() != 0 ); 472 pcCU->setUseDDD( true, uiAbsPartIdx, 0, uiDepth ); 473 pcCU->setDDDepthSubParts( m_ppcCU[uiDepth]->getDDTmpDepth(),uiAbsPartIdx, 0, uiDepth ); 474 } 475 #endif 476 436 477 TComMv cTmpMv( 0, 0 ); 437 478 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) … … 443 484 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 444 485 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 486 #if NTT_STORE_SPDV_VSP_G0148 487 if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 ) 488 { 489 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) 490 { 491 UInt dummy; 492 Int vspSize; 493 Int width, height; 494 m_ppcCU[uiDepth]->getPartIndexAndSize( uiAbsPartIdx, dummy, width, height ); 495 m_ppcCU[uiDepth]->setMvFieldPUForVSP( pcCU, uiAbsPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); 496 pcCU->setVSPFlag( uiAbsPartIdx, vspSize ); 497 } 498 } 499 #endif 445 500 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 446 501 if ( g_decTraceMvFromMerge ) … … 496 551 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 497 552 553 #if QC_SDC_UNIFY_G0130 554 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 555 #endif 498 556 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 499 557 { … … 515 573 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 516 574 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 517 #if H_3D_INTER_SDC 575 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 518 576 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 519 577 #endif … … 585 643 { 586 644 case MODE_INTER: 645 #if H_3D_DBBP 646 if( m_ppcCU[uiDepth]->getDBBPFlag(0) ) 647 { 648 xReconInterDBBP( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 649 } 650 else 651 { 652 #endif 587 653 #if H_3D_INTER_SDC 654 #if QC_SDC_UNIFY_G0130 655 if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) ) 656 #else 588 657 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 658 #endif 589 659 { 590 660 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); … … 595 665 xReconInter( m_ppcCU[uiDepth], uiDepth ); 596 666 #if H_3D_INTER_SDC 667 } 668 #endif 669 #if H_3D_DBBP 597 670 } 598 671 #endif … … 646 719 UInt uiWidth = pcCU->getWidth ( 0 ); 647 720 UInt uiHeight = pcCU->getHeight( 0 ); 721 #if !SEC_INTER_SDC_G0101 648 722 UChar* pMask = pcCU->getInterSDCMask(); 649 723 650 724 memset( pMask, 0, uiWidth*uiHeight ); 651 725 pcCU->xSetInterSDCCUMask( pcCU, pMask ); 726 #endif 652 727 653 728 Pel *pResi; … … 660 735 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 661 736 { 737 #if SEC_INTER_SDC_G0101 738 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 ); 739 #else 662 740 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 663 664 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );; 741 #if QC_SDC_UNIFY_G0130 742 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 ); 743 #else 744 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ); 745 #endif 746 #endif 665 747 } 666 748 pResi += uiResiStride; … … 684 766 pRecCb += uiStrideC; 685 767 pRecCr += uiStrideC; 768 } 769 } 770 #endif 771 772 #if H_3D_DBBP 773 Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 774 { 775 AOF(!pcCU->getSlice()->getIsDepth()); 776 AOF(!pcCU->getSlice()->isIntra()); 777 PartSize ePartSize = pcCU->getPartitionSize( 0 ); 778 779 // get collocated depth block 780 UInt uiDepthStride = 0; 781 Pel* pDepthPels = pcCU->getVirtualDepthBlock(0, pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride); 782 AOF( pDepthPels != NULL ); 783 AOF( uiDepthStride != 0 ); 784 785 // compute mask by segmenting depth block 786 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 787 Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask); 788 AOF(bValidMask); 789 790 DBBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 791 TComYuv* apSegPredYuv[2] = { m_ppcYuvReco[uiDepth], m_ppcYuvRecoDBBP[uiDepth] }; 792 793 // first, extract the two sets of motion parameters 794 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4; 795 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 796 { 797 UInt uiPartAddr = uiSegment*uiPUOffset; 798 799 pDBBPTmpData->auhInterDir[uiSegment] = pcCU->getInterDir(uiPartAddr); 800 801 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 802 { 803 RefPicList eRefList = (RefPicList)uiRefListIdx; 804 pcCU->getMvField(pcCU, uiPartAddr, eRefList, pDBBPTmpData->acMvField[uiSegment][eRefList]); 805 } 806 807 pDBBPTmpData->ahVSPFlag[uiSegment] = pcCU->getVSPFlag( uiPartAddr ); 808 pDBBPTmpData->acDvInfo[uiSegment] = pcCU->getDvInfo( uiPartAddr ); 809 } 810 811 // do motion compensation for each segment as 2Nx2N 812 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 813 pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth ); 814 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 815 { 816 pcCU->setInterDirSubParts( pDBBPTmpData->auhInterDir[uiSegment], 0, 0, uiDepth ); 817 818 pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], 0, 0, uiDepth ); 819 pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], 0, 0, uiDepth ); 820 821 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 822 { 823 RefPicList eRefList = (RefPicList)uiRefListIdx; 824 825 pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], SIZE_2Nx2N, 0, 0 ); 826 } 827 828 // inter prediction 829 m_pcPrediction->motionCompensation( pcCU, apSegPredYuv[uiSegment] ); 830 } 831 832 // restore motion information in both segments again 833 pcCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); 834 pcCU->setPredModeSubParts( MODE_INTER, 0, uiDepth ); 835 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 836 { 837 UInt uiPartAddr = uiSegment*uiPUOffset; 838 839 pcCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uiDepth); 840 841 pcCU->setVSPFlagSubParts( pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uiDepth ); 842 pcCU->setDvInfoSubParts( pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uiDepth ); 843 844 pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uiDepth); // interprets depth relative to LCU level 845 846 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 847 { 848 RefPicList eRefList = (RefPicList)uiRefListIdx; 849 850 pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], ePartSize, uiPartAddr, 0, uiSegment ); // interprets depth relative to rpcTempCU level 851 } 852 } 853 854 // reconstruct final prediction signal by combining both segments 855 m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0)); 856 857 // inter recon 858 xDecodeInterTexture( pcCU, 0, uiDepth ); 859 860 // clip for only non-zero cbp case 861 if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) ) 862 { 863 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); 864 } 865 else 866 { 867 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); 686 868 } 687 869 } … … 906 1088 UInt uiWidth = pcCU->getWidth ( 0 ); 907 1089 UInt uiHeight = pcCU->getHeight ( 0 ); 908 1090 #if QC_PKU_SDC_SPLIT_G0123 1091 #if HS_TSINGHUA_SDC_SPLIT_G0111 1092 #if QC_GENERIC_SDC_G0122 1093 TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight ); 1094 #endif 1095 #else 1096 #if QC_GENERIC_SDC_G0122 1097 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1098 #endif 1099 #endif 1100 #endif 1101 #if QC_PKU_SDC_SPLIT_G0123 1102 UInt numParts = 1; 1103 UInt i = 0; 1104 UInt sdcDepth = 0; 1105 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 1106 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 1107 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 1108 1109 UInt uiStride = 0; 1110 Pel* piReco; 1111 Pel* piPred; 1112 Pel* piResi; 1113 1114 UInt uiZOrder; 1115 Pel* piRecIPred; 1116 UInt uiRecIPredStride; 1117 1118 UInt uiLumaPredMode = 0; 1119 1120 #if HS_TSINGHUA_SDC_SPLIT_G0111 1121 if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) 1122 { 1123 numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); 1124 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1125 uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); 1126 } 1127 #else 1128 if (uiWidth == 64) 1129 { 1130 numParts = 4; 1131 sdcDepth = 1; 1132 uiWidth = uiHeight = 32; 1133 } 1134 #endif 1135 1136 for ( i = 0; i < numParts; i++ ) 1137 { 1138 uiStride = pcRecoYuv->getStride (); 1139 piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 1140 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1141 piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 1142 1143 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1144 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1145 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1146 1147 uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 1148 1149 AOF( uiWidth == uiHeight ); 1150 #else 909 1151 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 910 1152 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; … … 926 1168 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 927 1169 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1170 #endif 928 1171 929 1172 //===== init availability pattern ===== 930 1173 Bool bAboveAvail = false; 931 1174 Bool bLeftAvail = false; 1175 #if QC_PKU_SDC_SPLIT_G0123 1176 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); 1177 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1178 #else 932 1179 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 933 1180 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 934 1181 #endif 1182 #if !QC_PKU_SDC_SPLIT_G0123 1183 #if QC_GENERIC_SDC_G0122 1184 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1185 #endif 1186 #endif 1187 #if HS_TSINGHUA_SDC_SPLIT_G0111 1188 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1189 #endif 935 1190 //===== get prediction signal ===== 936 1191 #if H_3D_DIM 937 1192 if( isDimMode( uiLumaPredMode ) ) 938 1193 { 939 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight ); 1194 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight 1195 #if QC_GENERIC_SDC_G0122 1196 , false, dmm4Segmentation 1197 #endif 1198 ); 1199 #if HS_TSINGHUA_SDC_SPLIT_G0111 1200 Bool* dmm4PatternSplit = dmm4Segmentation->getPattern(); 1201 Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern(); 1202 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 1203 { 1204 dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k]; 1205 } 1206 #endif 940 1207 } 941 1208 else … … 946 1213 } 947 1214 #endif 948 1215 #if QC_PKU_SDC_SPLIT_G0123 1216 if ( numParts > 1 ) 1217 { 1218 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1219 { 1220 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1221 { 1222 piReco [ uiX ] = ClipY( piPred[ uiX ] ); 1223 piRecIPred [ uiX ] = piReco[ uiX ]; 1224 } 1225 piPred += uiStride; 1226 piReco += uiStride; 1227 piRecIPred += uiRecIPredStride; 1228 } 1229 } 1230 uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 ); 1231 #if HS_TSINGHUA_SDC_SPLIT_G0111 1232 dmm4Segmentation->destroy(); delete dmm4Segmentation; 1233 #endif 1234 } 1235 uiAbsPartIdx = 0; 1236 1237 if ( numParts > 1 ) 1238 { 1239 uiWidth = pcCU->getWidth( 0 ); 1240 uiHeight = pcCU->getHeight( 0 ); 1241 } 1242 piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 1243 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1244 piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 1245 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1246 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1247 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1248 #endif 949 1249 // number of segments depends on prediction mode 950 1250 UInt uiNumSegments = 1; … … 963 1263 uiMaskStride = pcWedgelet->getStride(); 964 1264 } 965 1265 #if QC_GENERIC_SDC_G0122 1266 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) 1267 { 1268 uiNumSegments = 2; 1269 #if HS_TSINGHUA_SDC_SPLIT_G0111 1270 pbMask = dmm4SegmentationOrg->getPattern(); 1271 uiMaskStride = dmm4SegmentationOrg->getStride(); 1272 #else 1273 pbMask = dmm4Segmentation->getPattern(); 1274 uiMaskStride = dmm4Segmentation->getStride(); 1275 #endif 1276 } 1277 #endif 966 1278 // get DC prediction for each segment 967 1279 Pel apDCPredValues[2]; … … 1025 1337 pRecCr += uiStrideC; 1026 1338 } 1339 #if QC_GENERIC_SDC_G0122 1340 #if HS_TSINGHUA_SDC_SPLIT_G0111 1341 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 1342 #else 1343 dmm4Segmentation->destroy(); delete dmm4Segmentation; 1344 #endif 1345 #endif 1027 1346 } 1028 1347 #endif -
trunk/source/Lib/TLibDecoder/TDecCu.h
r655 r833 63 63 TComDataCU** m_ppcCU; ///< CU data array 64 64 65 #if H_3D_DBBP 66 TComYuv** m_ppcYuvRecoDBBP; 67 #endif 68 65 69 // access channel 66 70 TComTrQuant* m_pcTrQuant; … … 98 102 Void xReconInter ( TComDataCU* pcCU, UInt uiDepth ); 99 103 104 #if H_3D_DBBP 105 Void xReconInterDBBP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 106 #endif 107 100 108 Void xReconIntraQT ( TComDataCU* pcCU, UInt uiDepth ); 101 109 Void xIntraRecLumaBlk ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv ); -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r773 r833 111 111 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 112 112 113 #if SEC_IC_ARP_SIG_G0072 114 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) 115 #else 113 116 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 117 #endif 114 118 { 115 119 return; … … 137 141 { 138 142 m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); 143 144 #if H_3D_DBBP 145 if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE ) 146 { 147 decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth); 148 149 if( pcCU->getDBBPFlag(uiAbsPartIdx) ) 150 { 151 AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE ); 152 153 // get collocated depth block 154 UInt uiDepthStride = 0; 155 Pel* pDepthPels = NULL; 156 pDepthPels = pcCU->getVirtualDepthBlock(uiAbsPartIdx, pcCU->getWidth(uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), uiDepthStride); 157 158 AOF( pDepthPels != NULL ); 159 AOF( uiDepthStride != 0 ); 160 161 // derive true partitioning for this CU based on depth 162 // (needs to be done in parsing process as motion vector predictors are also derived during parsing) 163 PartSize eVirtualPartSize = m_pcPrediction->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(uiAbsPartIdx)); 164 AOF( eVirtualPartSize != SIZE_NONE ); 165 166 pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth); 167 } 168 } 169 #endif 139 170 } 140 171 … … 241 272 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 242 273 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 274 #if !SEC_IC_ARP_SIG_G0072 243 275 #if H_3D_IC 244 276 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 245 277 #endif 278 #endif 246 279 #if H_3D_ARP 247 280 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 248 281 #endif 282 #if SEC_IC_ARP_SIG_G0072 283 #if H_3D_IC 284 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 285 #endif 286 #endif 287 #if H_3D_DBBP 288 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false ) 289 #else 249 290 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 291 #endif 250 292 { 251 293 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); … … 320 362 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 321 363 364 #if MTK_DDD_G0063 365 if( uiMergeIndex == pcSubCU->getUseDDDCandIdx() ) 366 { 367 assert( pcCU->getSlice()->getViewIndex() != 0 ); 368 pcCU->setUseDDD( true, uiSubPartIdx, uiPartIdx, uiDepth ); 369 pcCU->setDDDepthSubParts( pcSubCU->getDDTmpDepth(),uiSubPartIdx, uiPartIdx, uiDepth ); 370 } 371 else 372 { 373 pcCU->setUseDDD( false, uiSubPartIdx, uiPartIdx, uiDepth ); 374 } 375 #endif 376 322 377 TComMv cTmpMv( 0, 0 ); 323 378 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) … … 329 384 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 330 385 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 386 #if NTT_STORE_SPDV_VSP_G0148 387 #if H_3D_DBBP 388 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) ) 389 #else 390 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 ) 391 #endif 392 { 393 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) 394 { 395 UInt dummy; 396 Int vspSize; 397 Int width, height; 398 pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 ); 399 pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); 400 pcCU->setVSPFlag( uiSubPartIdx, vspSize ); 401 } 402 } 403 #endif 331 404 } 332 405 } … … 367 440 } 368 441 } 442 #if !SEC_IC_ARP_SIG_G0072 369 443 #if H_3D_IC 370 444 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 371 445 #endif 446 #endif 372 447 #if H_3D_ARP 373 448 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 374 449 #endif 450 #if SEC_IC_ARP_SIG_G0072 451 #if H_3D_IC 452 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 453 #endif 454 #endif 375 455 } 376 456 #if H_3D_VSP 457 #if NTT_STORE_SPDV_VSP_G0148 458 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0)) 459 #else 377 460 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false)) 461 #endif 378 462 #else 379 463 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) … … 713 797 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 714 798 UInt uiChromaOffset = uiLumaOffset>>2; 715 799 #if QC_SDC_UNIFY_G0130 716 800 #if H_3D_DIM_SDC 717 if( pcCU->getSDCFlag( uiAbsPartIdx ) )801 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) 718 802 { 719 803 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 722 806 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 723 807 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 808 } 809 #endif 810 811 #if H_3D_INTER_SDC 812 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) 813 { 814 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 815 assert( !pcCU->isIntra( uiAbsPartIdx) ); 816 assert( pcCU->getSlice()->getIsDepth() ); 817 } 818 #endif 819 #if QC_SDC_UNIFY_G0130_FIX 820 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 821 #else 822 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) 823 #endif 824 { 825 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 826 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 827 828 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 829 { 830 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 831 { 832 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 833 { 834 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); 835 } 836 } 837 } 838 else 839 { 840 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth ); 841 return; 842 } 843 } 844 #else 845 #if H_3D_DIM_SDC 846 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 847 { 848 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 849 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 850 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 851 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 852 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 724 853 return; 725 854 } … … 737 866 } 738 867 #endif 868 #endif 739 869 740 870 if( pcCU->isIntra(uiAbsPartIdx) ) … … 760 890 761 891 #if H_3D_INTER_SDC 892 #if QC_SDC_UNIFY_G0130 893 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 894 { 895 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 896 897 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) || 898 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ) 899 { 900 return; 901 } 902 903 #if SEC_INTER_SDC_G0101 904 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) 905 #else 906 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 907 #endif 908 { 909 return; 910 } 911 912 #if SEC_INTER_SDC_G0101 913 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 914 #else 915 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 916 #endif 917 918 m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 919 } 920 921 #else 762 922 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 763 923 { … … 798 958 } 799 959 #endif 960 #endif 961 #if H_3D_DBBP 962 Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 963 { 964 m_pcEntropyDecoderIf->parseDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); 965 } 966 #endif 800 967 801 968 //! \} -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r773 r833 96 96 #endif 97 97 #if H_3D_INTER_SDC 98 #if QC_SDC_UNIFY_G0130 99 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0; 100 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 101 #else 98 102 virtual Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 99 103 virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; 104 #endif 105 #endif 106 #if H_3D_DBBP 107 virtual Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 100 108 #endif 101 109 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 179 187 #endif 180 188 #if H_3D_INTER_SDC 189 #if QC_SDC_UNIFY_G0130 190 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 191 #else 181 192 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 182 193 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 183 194 #endif 195 #endif 196 #if H_3D_DBBP 197 Void decodeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 198 #endif 184 199 Void decodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 185 200 -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r773 r833 87 87 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 88 88 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 89 #if QC_GENERIC_SDC_G0122 90 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #if !QC_SDC_UNIFY_G0130 92 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 93 #endif 94 #endif 89 95 #if H_3D_DIM_DMM 90 96 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 95 101 #endif 96 102 #endif 97 #if H_3D_INTER_SDC 103 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 98 104 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 99 105 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 100 106 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 #endif 108 #if QC_SDC_UNIFY_G0130 109 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 #endif 111 #if H_3D_DBBP 112 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 101 113 #endif 102 114 { … … 170 182 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 171 183 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA ); 184 #if QC_GENERIC_SDC_G0122 185 m_cAngleFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 186 #if !QC_SDC_UNIFY_G0130 187 m_cIntraSdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 188 #endif 189 #endif 172 190 #if H_3D_DIM_DMM 173 191 m_cDmm1DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM1_DATA ); … … 178 196 #endif 179 197 #endif 180 #if H_3D_INTER_SDC 198 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 181 199 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 182 200 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 183 201 m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 202 #endif 203 #if QC_SDC_UNIFY_G0130 204 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 205 #endif 206 #if H_3D_DBBP 207 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG ); 184 208 #endif 185 209 m_uiLastDQpNonZero = 0; … … 239 263 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 240 264 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 265 #if QC_GENERIC_SDC_G0122 266 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 267 #if !QC_SDC_UNIFY_G0130 268 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 269 #endif 270 #endif 241 271 #if H_3D_DIM_DMM 242 272 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 247 277 #endif 248 278 #endif 249 #if H_3D_INTER_SDC 279 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 250 280 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 251 281 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 252 282 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 283 #endif 284 #if QC_SDC_UNIFY_G0130 285 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 286 #endif 287 #if H_3D_DBBP 288 m_cDBBPFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG ); 253 289 #endif 254 290 m_pcTDecBinIf->start(); … … 784 820 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA); 785 821 822 #if MTK_TEX_DEP_PAR_G0055 823 Bool depthDependent = false; 824 UInt uiTexturePart = uiMode; 825 #endif 786 826 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC()) 787 827 { 788 828 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); 789 829 assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth); 830 #if !MTK_TEX_DEP_PAR_G0055 790 831 if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN) 832 #else 833 if(pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth ) 834 { 835 depthDependent = true; 836 uiTexturePart = pcTextureCU->getPartitionSize( uiAbsPartIdx ); 837 } 838 if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N) 839 #endif 791 840 { 792 841 bParsePartSize = false; … … 833 882 if(bParsePartSize) 834 883 { 884 #endif 885 #if MTK_TEX_DEP_PAR_G0055 886 if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N) 887 { 835 888 #endif 836 889 UInt uiMaxNumBits = 2; … … 870 923 } 871 924 } 925 #if MTK_TEX_DEP_PAR_G0055 926 } 927 else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD) 928 { 929 UInt uiMaxNumBits = 1; 930 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 931 { 932 uiMaxNumBits ++; 933 } 934 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 935 { 936 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) ); 937 if ( uiSymbol ) 938 { 939 break; 940 } 941 uiMode++; 942 } 943 eMode = (PartSize) uiMode; 944 if(uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==1 ) 945 { 946 eMode = SIZE_2NxN; 947 } 948 else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth )==0 && uiSymbol==0) 949 { 950 eMode = SIZE_2NxN; 951 } 952 else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==0) 953 { 954 m_pcTDecBinIf->decodeBinEP(uiSymbol); 955 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 956 } 957 } 958 else if(uiTexturePart == SIZE_Nx2N|| uiTexturePart==SIZE_nLx2N || uiTexturePart==SIZE_nRx2N) 959 { 960 UInt uiMaxNumBits = 1; 961 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 962 { 963 uiMaxNumBits ++; 964 } 965 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 966 { 967 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) ); 968 if ( uiSymbol ) 969 { 970 break; 971 } 972 uiMode++; 973 } 974 eMode = (PartSize) uiMode; 975 if(uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==1 ) 976 { 977 eMode = SIZE_Nx2N; 978 } 979 else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth )==0 && uiSymbol==0) 980 { 981 eMode = SIZE_Nx2N; 982 } 983 else if (uiMode && pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) && uiSymbol==0) 984 { 985 m_pcTDecBinIf->decodeBinEP(uiSymbol); 986 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 987 } 988 } 989 else 990 assert(0); 991 #endif 872 992 #if H_MV_ENC_DEC_TRAC 873 993 DTRACE_CU("part_mode", eMode ) … … 925 1045 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 926 1046 #if H_3D_DIM_SDC 1047 #if QC_GENERIC_SDC_G0122 1048 if( 1 ) // This should be cleaned up. 1049 #else 927 1050 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1051 #endif 928 1052 #endif 929 1053 { … … 943 1067 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 944 1068 #if H_3D_DIM_SDC 1069 #if QC_GENERIC_SDC_G0122 1070 if( 1 ) // This should be cleaned up. 1071 #else 945 1072 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1073 #endif 946 1074 #endif 947 1075 { … … 1046 1174 } 1047 1175 1176 #if !QC_SDC_UNIFY_G0130 1048 1177 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1049 1178 { 1050 1179 UInt symbol; 1180 #if QC_GENERIC_SDC_G0122 1181 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1; 1182 #else 1051 1183 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1184 #endif 1052 1185 1053 1186 if( pcCU->getSDCFlag( absPartIdx ) ) … … 1085 1218 } 1086 1219 } 1087 1220 #endif 1088 1221 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); 1089 1222 } 1090 1223 1224 #if QC_GENERIC_SDC_G0122 1225 Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 1226 { 1227 UInt uiSymbol, uiIsDimMode; 1228 1229 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 1230 { 1231 m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) ); 1232 } 1233 else 1234 { 1235 uiSymbol = 1; 1236 } 1237 uiIsDimMode = uiSymbol ? 0 : 1; 1238 pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth ); 1239 #if !QC_SDC_UNIFY_G0130 1240 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case 1241 { 1242 m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) ); 1243 } 1244 else 1245 { 1246 uiSymbol = 0; 1247 } 1248 1249 pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth ); 1250 #endif 1251 //decode DMM index 1252 if( uiIsDimMode ) 1253 { 1254 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) ); 1255 if( !uiSymbol ) 1256 { 1257 pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth ); 1258 } 1259 else 1260 { 1261 pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth ); 1262 } 1263 } 1264 } 1265 #else 1091 1266 Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 1092 1267 { … … 1151 1326 #endif 1152 1327 } 1328 #endif 1153 1329 #endif 1154 1330 … … 2058 2234 if( 1 == uiW ) 2059 2235 { 2236 #if MTK_ARP_FLAG_CABAC_SIMP_G0061 2237 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) ); 2238 #else 2060 2239 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 3 ) ); 2240 #endif 2061 2241 uiW += ( 1 == uiCode ? 1 : 0 ); 2062 2242 } … … 2078 2258 { 2079 2259 UInt uiSymbol = 0; 2260 #if MTK_IC_FLAG_CABAC_SIMP_G0061 2261 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) ); 2262 #else 2080 2263 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ); 2081 2264 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 2265 #endif 2082 2266 #if !H_MV_ENC_DEC_TRAC 2083 2267 DTRACE_CABAC_VL( g_nSymbolCounter++ ); … … 2097 2281 2098 2282 #if H_3D_INTER_SDC 2283 #if QC_SDC_UNIFY_G0130 2284 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2285 { 2286 if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2287 { 2288 assert( 0 ); 2289 } 2290 2291 UInt symbol = 0; 2292 UInt uiNumSegments = 0; 2293 2294 if( pcCU->isIntra( absPartIdx ) ) 2295 { 2296 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2297 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2298 2299 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) ); 2300 2301 if( pcCU->getSDCFlag( absPartIdx ) ) 2302 { 2303 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); 2304 pcCU->setTrIdxSubParts( 0, absPartIdx, depth ); 2305 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth ); 2306 } 2307 else 2308 { 2309 pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth ); 2310 } 2311 } 2312 else 2313 { 2314 #if SEC_INTER_SDC_G0101 2315 uiNumSegments = 1; 2316 #else 2317 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2318 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2319 #endif 2320 symbol = 1; 2321 } 2322 2323 2324 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2325 { 2326 Pel valDeltaDC = 0; 2327 if( symbol ) 2328 { 2329 xParseDimDeltaDC( valDeltaDC, uiNumSegments ); 2330 } 2331 2332 if( pcCU->isIntra( absPartIdx ) ) 2333 { 2334 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2335 2336 if( pcCU->getSDCFlag( absPartIdx ) ) 2337 { 2338 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2339 } 2340 else 2341 { 2342 pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC ); 2343 } 2344 } 2345 else 2346 { 2347 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2348 } 2349 } 2350 } 2351 2352 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2353 { 2354 UInt uiSymbol = 0; 2355 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2356 2357 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2358 2359 if( uiSymbol ) 2360 { 2361 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth ); 2362 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2363 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth ); 2364 } 2365 else 2366 { 2367 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 2368 } 2369 } 2370 #else 2099 2371 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2100 2372 { … … 2131 2403 } 2132 2404 #endif 2405 #endif 2406 2407 #if H_3D_DBBP 2408 Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2409 { 2410 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 2411 AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) ); 2412 AOF( !pcCU->getSlice()->getIsDepth() ); 2413 AOF( ePartSize == RWTH_DBBP_PACK_MODE ); 2414 2415 UInt uiSymbol = 0; 2416 2417 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) ); 2418 2419 if( uiSymbol ) 2420 { 2421 pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth); 2422 } 2423 } 2424 #endif 2133 2425 2134 2426 //! \} -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r773 r833 112 112 #endif 113 113 #if H_3D_INTER_SDC 114 #if QC_SDC_UNIFY_G0130 115 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 116 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 117 #else 114 118 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 115 119 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 120 #endif 121 #endif 122 #if H_3D_DBBP 123 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 116 124 #endif 117 125 private: … … 211 219 ContextModel3DBuffer m_cDdcFlagSCModel; 212 220 ContextModel3DBuffer m_cDdcDataSCModel; 221 #if QC_GENERIC_SDC_G0122 222 ContextModel3DBuffer m_cAngleFlagSCModel; 223 #if !QC_SDC_UNIFY_G0130 224 ContextModel3DBuffer m_cIntraSdcFlagSCModel; 225 #endif 226 #endif 213 227 #if H_3D_DIM_DMM 214 228 ContextModel3DBuffer m_cDmm1DataSCModel; … … 219 233 #endif 220 234 #endif 221 #if H_3D_INTER_SDC 235 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 222 236 ContextModel3DBuffer m_cInterSDCFlagSCModel; 223 237 ContextModel3DBuffer m_cInterSDCResidualSCModel; 224 238 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 225 239 #endif 240 #if QC_SDC_UNIFY_G0130 241 ContextModel3DBuffer m_cSDCFlagSCModel; 242 #endif 243 #if H_3D_DBBP 244 ContextModel3DBuffer m_cDBBPFlagSCModel; 245 #endif 226 246 }; 227 247 -
trunk/source/Lib/TLibDecoder/TDecTop.h
r773 r833 82 82 #endif 83 83 84 #if MTK_DDD_G0063 85 Int getCodedScale( Int iBaseView, Int iCureView){ return m_aaiCodedScale[ iBaseView ][ iCureView ];} 86 Int getCodedOffset( Int iBaseView, Int iCureView){ return m_aaiCodedOffset[ iBaseView ][ iCureView ];} 87 UInt getCamParsCodedPrecision(){ return m_uiCamParsCodedPrecision; } 88 #endif 89 84 90 private: 85 91 Bool xIsComplete (); -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r773 r833 1500 1500 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1501 1501 #if H_3D_SPIVMP 1502 #if SEC_SPIVMP_MCP_SIZE_G0077 1503 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]"); 1504 #else 1502 1505 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]"); 1506 #endif 1503 1507 #endif 1504 1508 #endif … … 1512 1516 WRITE_FLAG( pcVPS->getViewSynthesisPredFlag( i ) ? 1 : 0 , "view_synthesis_pred_flag[i]"); 1513 1517 #endif 1518 #if H_3D_DBBP 1519 WRITE_FLAG( pcVPS->getUseDBBP( i ) ? 1 : 0, "use_dbbp_flag[i]" ); 1520 #endif 1514 1521 } 1515 1522 else … … 1522 1529 if (i!=1) 1523 1530 { 1531 #if SEC_SPIVMP_MCP_SIZE_G0077 1532 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]"); 1533 #else 1524 1534 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]"); 1535 #endif 1525 1536 } 1526 1537 #endif … … 1555 1566 } 1556 1567 } 1568 #if QC_SPIVMP_MPI_G0119 1569 WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3"); 1570 #endif 1557 1571 #if H_3D_TMVP 1558 1572 WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 , "iv_mv_scaling_flag" ); … … 2513 2527 2514 2528 #if H_3D_INTER_SDC 2529 #if QC_SDC_UNIFY_G0130 2530 Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2531 { 2532 assert(0); 2533 } 2534 2535 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2536 { 2537 assert(0); 2538 } 2539 #else 2515 2540 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2516 2541 { … … 2523 2548 } 2524 2549 #endif 2550 #endif 2551 2552 #if H_3D_DBBP 2553 Void TEncCavlc::codeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2554 { 2555 assert(0); 2556 } 2557 #endif 2525 2558 //! \} -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r773 r833 138 138 #endif 139 139 #if H_3D_INTER_SDC 140 #if QC_SDC_UNIFY_G0130 141 Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 142 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 143 #else 140 144 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 141 145 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 146 #endif 147 #endif 148 #if H_3D_DBBP 149 Void codeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 142 150 #endif 143 151 -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r773 r833 411 411 Int m_iSubPULog2Size; 412 412 #endif 413 #if QC_SPIVMP_MPI_G0119 414 Int m_iSubPUMPILog2Size; 415 #endif 413 416 #if H_3D_IC 414 417 Bool m_bUseIC; … … 416 419 #if H_3D_INTER_SDC 417 420 bool m_bInterSDC; 421 #endif 422 #if H_3D_DBBP 423 Bool m_bUseDBBP; 418 424 #endif 419 425 //====== Depth Intra Modes ====== … … 515 521 Void setSubPULog2Size (Int u) { m_iSubPULog2Size = u; } 516 522 #endif 517 523 #if QC_SPIVMP_MPI_G0119 524 Int getSubPUMPILog2Size () { return m_iSubPUMPILog2Size;} 525 Void setSubPUMPILog2Size (Int u) { m_iSubPUMPILog2Size = u; } 526 #endif 518 527 #if H_3D_IC 519 528 Void setUseIC ( Bool bVal ) { m_bUseIC = bVal; } … … 523 532 Void setInterSDCEnable ( Bool bVal ) { m_bInterSDC = bVal; } 524 533 Bool getInterSDCEnable () { return m_bInterSDC; } 534 #endif 535 #if H_3D_DBBP 536 Void setUseDBBP ( Bool b ) { m_bUseDBBP = b; } 537 Bool getUseDBBP() { return m_bUseDBBP; } 525 538 #endif 526 539 //======== Transform ============= -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r773 r833 76 76 m_ppcRecoYuvTemp = new TComYuv*[m_uhTotalDepth-1]; 77 77 m_ppcOrigYuv = new TComYuv*[m_uhTotalDepth-1]; 78 #if H_3D_DBBP 79 m_ppcOrigYuvDBBP = new TComYuv*[m_uhTotalDepth-1]; 80 #endif 78 81 79 82 UInt uiNumPartitions; … … 100 103 101 104 m_ppcOrigYuv [i] = new TComYuv; m_ppcOrigYuv [i]->create(uiWidth, uiHeight); 105 #if H_3D_DBBP 106 m_ppcOrigYuvDBBP[i] = new TComYuv; m_ppcOrigYuvDBBP[i]->create(uiWidth, uiHeight); 107 #endif 102 108 } 103 109 … … 180 186 m_ppcOrigYuv[i]->destroy(); delete m_ppcOrigYuv[i]; m_ppcOrigYuv[i] = NULL; 181 187 } 188 #if H_3D_DBBP 189 if(m_ppcOrigYuvDBBP[i]) 190 { 191 m_ppcOrigYuvDBBP[i]->destroy(); delete m_ppcOrigYuvDBBP[i]; m_ppcOrigYuvDBBP[i] = NULL; 192 } 193 #endif 182 194 } 183 195 if(m_ppcBestCU) … … 234 246 m_ppcOrigYuv = NULL; 235 247 } 248 #if H_3D_DBBP 249 if(m_ppcOrigYuvDBBP) 250 { 251 delete [] m_ppcOrigYuvDBBP; 252 m_ppcOrigYuvDBBP = NULL; 253 } 254 #endif 236 255 } 237 256 … … 544 563 bTryNx2N = false; 545 564 bTry2NxN = false; 565 #if MTK_TEX_DEP_PAR_G0055 566 if( pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize(uiCUIdx) != SIZE_2Nx2N) 567 { 568 if(pcTextureCU->getPartitionSize(uiCUIdx)==SIZE_2NxN || pcTextureCU->getPartitionSize(uiCUIdx)==SIZE_2NxnU|| pcTextureCU->getPartitionSize(uiCUIdx)==SIZE_2NxnD) 569 bTry2NxN = true; 570 else 571 bTryNx2N = true; 572 } 573 #endif 546 574 } 547 575 } … … 570 598 if (rpcTempCU->getSlice()->getIsDepth() ) 571 599 { 600 #if SEC_DEPTH_DV_DERIVAITON_G0074 601 DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo); 602 #else 572 603 DvInfo.bDV = rpcTempCU->getDispNeighBlocks(0, 0, &DvInfo); 604 #endif 573 605 } 574 606 else … … 650 682 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 651 683 #endif 684 685 #if H_3D_DBBP 686 if( m_pcEncCfg->getUseDBBP() ) 687 { 688 xCheckRDCostInterDBBP( rpcBestCU, rpcTempCU, false ); 689 rpcTempCU->initEstData( uiDepth, iQP ); 690 #if H_3D_VSP 691 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 692 #endif 693 } 694 #endif 695 652 696 if(m_pcEncCfg->getUseCbfFastMode()) 653 697 { … … 1576 1620 #endif 1577 1621 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx ); 1622 #if !SEC_IC_ARP_SIG_G0072 1578 1623 #if H_3D_IC 1579 1624 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1580 1625 #endif 1626 #endif 1581 1627 #if H_3D_ARP 1582 1628 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1583 1629 #endif 1630 #if SEC_IC_ARP_SIG_G0072 1631 #if H_3D_IC 1632 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1633 #endif 1634 #endif 1584 1635 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1585 1636 return; … … 1589 1640 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1590 1641 1642 #if QC_SDC_UNIFY_G0130 1643 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1644 #endif 1591 1645 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1592 1646 { … … 1603 1657 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1604 1658 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1659 #if !SEC_IC_ARP_SIG_G0072 1605 1660 #if H_3D_IC 1606 1661 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1607 1662 #endif 1663 #endif 1608 1664 #if H_3D_ARP 1609 1665 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1610 1666 #endif 1611 #if H_3D_INTER_SDC 1667 #if SEC_IC_ARP_SIG_G0072 1668 #if H_3D_IC 1669 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1670 #endif 1671 #endif 1672 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1612 1673 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1613 1674 #endif … … 1837 1898 #if H_3D_ARP 1838 1899 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1900 #if SEC_IC_ARP_SIG_G0072 1901 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag ) 1902 #else 1839 1903 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV ) 1904 #endif 1840 1905 { 1841 1906 nARPWMax = 0; … … 1877 1942 1878 1943 #endif 1944 1945 #if MTK_DDD_G0063 1946 Int iDDDCand = rpcTempCU->getUseDDDCandIdx(); 1947 UChar ucDDDepth = rpcTempCU->getDDTmpDepth(); 1948 rpcTempCU->setUseDDD( false, 0, uhDepth ); 1949 #endif 1950 1879 1951 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) 1880 1952 { … … 1910 1982 rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth ); 1911 1983 #endif 1984 1985 #if MTK_DDD_G0063 1986 if( rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewIndex() != 0 && iDDDCand == uiMergeCand ) 1987 { 1988 rpcTempCU->setUseDDD( true, 0, 0, uhDepth ); 1989 rpcTempCU->setDDDepthSubParts( ucDDDepth, 0, 0, uhDepth ); 1990 } 1991 else 1992 { 1993 rpcTempCU->setUseDDD( false, 0, 0, uhDepth ); 1994 } 1995 #endif 1996 1912 1997 #if H_3D_SPIVMP 1913 1998 rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth); … … 1931 2016 } 1932 2017 else 2018 #endif 2019 #if NTT_STORE_SPDV_VSP_G0148 2020 if ( vspFlag[uiMergeCand] ) 1933 2021 { 1934 #endif 2022 UInt partAddr; 2023 Int vspSize; 2024 Int width, height; 2025 rpcTempCU->getPartIndexAndSize( 0, partAddr, width, height ); 2026 2027 if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 ) 2028 { 2029 rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_0, cMvFieldNeighbours[ 2*uiMergeCand + 0 ].getRefIdx(), vspSize ); 2030 rpcTempCU->setVSPFlag( partAddr, vspSize ); 2031 } 2032 else 2033 { 2034 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2035 } 2036 if( uhInterDirNeighbours[ uiMergeCand ] & 0x02 ) 2037 { 2038 rpcTempCU->setMvFieldPUForVSP( rpcTempCU, partAddr, width, height, REF_PIC_LIST_1 , cMvFieldNeighbours[ 2*uiMergeCand + 1 ].getRefIdx(), vspSize ); 2039 rpcTempCU->setVSPFlag( partAddr, vspSize ); 2040 } 2041 else 2042 { 2043 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2044 } 2045 2046 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 2047 } 2048 else 2049 #endif 2050 { 1935 2051 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1936 2052 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1937 2053 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1938 #if H_3D_SPIVMP1939 2054 } 1940 #endif1941 2055 // do MC 1942 2056 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 1968 2082 1969 2083 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 2084 #if NTT_STORE_SPDV_VSP_G0148 // possible bug fix 2085 if( rpcTempCU->getSkipFlag(0) ) 2086 { 2087 rpcTempCU->setTrIdxSubParts(0, 0, uhDepth); 2088 } 2089 #endif 1970 2090 #if H_3D_INTER_SDC 1971 2091 TComDataCU *rpcTempCUPre = rpcTempCU; … … 1977 2097 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1978 2098 { 2099 #if SEC_INTER_SDC_G0101 2100 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2101 { 2102 if( rpcTempCU != rpcTempCUPre ) 2103 { 2104 rpcTempCU->initEstData( uhDepth, orgQP ); 2105 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2106 } 2107 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2108 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2109 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2110 #if H_3D_VSO //M2 2111 if( m_pcRdCost->getUseRenModel() ) 2112 { //Reset 2113 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 2114 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); 2115 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr (); 2116 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 2117 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2118 } 2119 #endif 2120 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2121 m_ppcOrigYuv[uhDepth], 2122 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2123 m_ppcResiYuvTemp[uhDepth], 2124 m_ppcRecoYuvTemp[uhDepth], 2125 uiOffest, 2126 uhDepth ); 2127 2128 xCheckDQP( rpcTempCU ); 2129 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2130 } 2131 #else 1979 2132 if( rpcTempCU != rpcTempCUPre ) 1980 2133 { … … 2004 2157 xCheckDQP( rpcTempCU ); 2005 2158 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2159 #endif 2006 2160 } 2007 2161 #endif … … 2087 2241 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2088 2242 2243 #if SEC_IC_ARP_SIG_G0072 2244 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) ) 2245 #else 2089 2246 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV ) 2247 #endif 2090 2248 { 2091 2249 nARPWMax = 0; … … 2118 2276 rpcTempCU->setCUTransquantBypassSubParts ( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 2119 2277 2278 #if MTK_DDD_G0063 2279 rpcTempCU->setUseDDD( false, 0, uhDepth ); 2280 #endif 2281 2120 2282 #if H_3D_ARP 2121 2283 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); … … 2186 2348 2187 2349 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); 2188 2350 2351 #if NTT_STORE_SPDV_VSP_G0148 // possible bug fix 2352 if( rpcTempCU->getQtRootCbf(0)==0 ) 2353 { 2354 rpcTempCU->setTrIdxSubParts(0, 0, uhDepth); 2355 } 2356 #endif 2189 2357 2190 2358 #if H_3D_VSO // M4 … … 2200 2368 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2201 2369 #if H_3D_INTER_SDC 2370 #if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC 2371 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N) 2372 #else 2202 2373 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2203 { 2374 #endif 2375 { 2376 #if SEC_INTER_SDC_G0101 2377 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2378 { 2379 if( rpcTempCU != rpcTempCUPre ) 2380 { 2381 Int orgQP = rpcBestCU->getQP( 0 ); 2382 rpcTempCU->initEstData( uhDepth, orgQP ); 2383 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2384 } 2385 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2386 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2387 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2388 #if H_3D_VSO // M3 2389 if( m_pcRdCost->getUseRenModel() ) 2390 { 2391 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2392 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2393 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2394 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2395 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2396 } 2397 #endif 2398 2399 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2400 m_ppcOrigYuv[uhDepth], 2401 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2402 m_ppcResiYuvTemp[uhDepth], 2403 m_ppcRecoYuvTemp[uhDepth], 2404 uiOffest, 2405 uhDepth ); 2406 2407 xCheckDQP( rpcTempCU ); 2408 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2409 } 2410 #else 2204 2411 if( rpcTempCU != rpcTempCUPre ) 2205 2412 { … … 2231 2438 xCheckDQP( rpcTempCU ); 2232 2439 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2440 #endif 2233 2441 } 2234 2442 #endif … … 2240 2448 #endif 2241 2449 } 2450 2451 #if H_3D_DBBP 2452 Void TEncCu::xInvalidateOriginalSegments( TComYuv* pOrigYuv, TComYuv* pOrigYuvTemp, Bool* pMask, UInt uiValidSegment ) 2453 { 2454 UInt uiWidth = pOrigYuv->getWidth ( ); 2455 UInt uiHeight = pOrigYuv->getHeight( ); 2456 Pel* piSrc = pOrigYuv->getLumaAddr( ); 2457 UInt uiSrcStride = pOrigYuv->getStride(); 2458 Pel* piDst = pOrigYuvTemp->getLumaAddr( ); 2459 UInt uiDstStride = pOrigYuvTemp->getStride(); 2460 2461 UInt uiMaskStride= MAX_CU_SIZE; 2462 2463 AOF( uiWidth == uiHeight ); 2464 2465 // backup pointer 2466 Bool* pMaskStart = pMask; 2467 2468 for (Int y=0; y<uiHeight; y++) 2469 { 2470 for (Int x=0; x<uiWidth; x++) 2471 { 2472 UChar ucSegment = (UChar)pMask[x]; 2473 AOF( ucSegment < 2 ); 2474 2475 piDst[x] = (ucSegment==uiValidSegment)?piSrc[x]:DBBP_INVALID_SHORT; 2476 } 2477 2478 piSrc += uiSrcStride; 2479 piDst += uiDstStride; 2480 pMask += uiMaskStride; 2481 } 2482 2483 // now invalidate chroma 2484 Pel* piSrcU = pOrigYuv->getCbAddr(); 2485 Pel* piSrcV = pOrigYuv->getCrAddr(); 2486 UInt uiSrcStrideC = pOrigYuv->getCStride(); 2487 Pel* piDstU = pOrigYuvTemp->getCbAddr( ); 2488 Pel* piDstV = pOrigYuvTemp->getCrAddr( ); 2489 UInt uiDstStrideC = pOrigYuvTemp->getCStride(); 2490 pMask = pMaskStart; 2491 2492 for (Int y=0; y<uiHeight/2; y++) 2493 { 2494 for (Int x=0; x<uiWidth/2; x++) 2495 { 2496 UChar ucSegment = (UChar)pMask[x*2]; 2497 AOF( ucSegment < 2 ); 2498 2499 piDstU[x] = (ucSegment==uiValidSegment)?piSrcU[x]:DBBP_INVALID_SHORT; 2500 piDstV[x] = (ucSegment==uiValidSegment)?piSrcV[x]:DBBP_INVALID_SHORT; 2501 } 2502 2503 piSrcU += uiSrcStrideC; 2504 piSrcV += uiSrcStrideC; 2505 piDstU += uiDstStrideC; 2506 piDstV += uiDstStrideC; 2507 pMask += 2*uiMaskStride; 2508 } 2509 } 2510 2511 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) 2512 { 2513 AOF( !rpcTempCU->getSlice()->getIsDepth() ); 2514 2515 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2516 2517 #if H_3D_VSO 2518 if( m_pcRdCost->getUseRenModel() ) 2519 { 2520 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2521 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2522 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2523 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2524 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2525 } 2526 #endif 2527 2528 UInt uiWidth = rpcTempCU->getWidth(0); 2529 UInt uiHeight = rpcTempCU->getHeight(0); 2530 AOF( uiWidth == uiHeight ); 2531 2532 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); 2533 2534 // fetch virtual depth block 2535 UInt uiDepthStride = 0; 2536 Pel* pDepthPels = rpcTempCU->getVirtualDepthBlock(0, uiWidth, uiHeight, uiDepthStride); 2537 AOF( pDepthPels != NULL ); 2538 AOF( uiDepthStride != 0 ); 2539 2540 // derive partitioning from depth 2541 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth); 2542 2543 // derive segmentation mask from depth 2544 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2545 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask); 2546 2547 if( !bValidMask ) 2548 { 2549 return; 2550 } 2551 2552 // find optimal motion/disparity vector for each segment 2553 DisInfo originalDvInfo = rpcTempCU->getDvInfo(0); 2554 DBBPTmpData* pDBBPTmpData = rpcTempCU->getDBBPTmpData(); 2555 TComYuv* apPredYuv[2] = { m_ppcRecoYuvTemp[uhDepth], m_ppcPredYuvTemp[uhDepth] }; 2556 2557 // find optimal motion vector fields for both segments (as 2Nx2N) 2558 rpcTempCU->setDepthSubParts( uhDepth, 0 ); 2559 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); 2560 rpcTempCU->setPredModeSubParts( MODE_INTER, 0, uhDepth ); 2561 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 2562 { 2563 rpcTempCU->setDBBPFlagSubParts(true, 0, 0, uhDepth); 2564 rpcTempCU->setDvInfoSubParts(originalDvInfo, 0, uhDepth); 2565 2566 // invalidate all other segments in original YUV 2567 xInvalidateOriginalSegments(m_ppcOrigYuv[uhDepth], m_ppcOrigYuvDBBP[uhDepth], pMask, uiSegment); 2568 2569 // do motion estimation for this segment 2570 m_pcRdCost->setUseMask(true); 2571 rpcTempCU->getDBBPTmpData()->eVirtualPartSize = eVirtualPartSize; 2572 rpcTempCU->getDBBPTmpData()->uiVirtualPartIndex = uiSegment; 2573 m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, false, bUseMRG ); 2574 m_pcRdCost->setUseMask(false); 2575 2576 // extract motion parameters of full block for this segment 2577 pDBBPTmpData->auhInterDir[uiSegment] = rpcTempCU->getInterDir(0); 2578 2579 pDBBPTmpData->abMergeFlag[uiSegment] = rpcTempCU->getMergeFlag(0); 2580 pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0); 2581 2582 pDBBPTmpData->ahVSPFlag[uiSegment] = rpcTempCU->getVSPFlag(0); 2583 pDBBPTmpData->acDvInfo[uiSegment] = rpcTempCU->getDvInfo(0); 2584 2585 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 2586 { 2587 RefPicList eRefList = (RefPicList)uiRefListIdx; 2588 2589 pDBBPTmpData->acMvd[uiSegment][eRefList] = rpcTempCU->getCUMvField(eRefList)->getMvd(0); 2590 pDBBPTmpData->aiMvpNum[uiSegment][eRefList] = rpcTempCU->getMVPNum(eRefList, 0); 2591 pDBBPTmpData->aiMvpIdx[uiSegment][eRefList] = rpcTempCU->getMVPIdx(eRefList, 0); 2592 2593 rpcTempCU->getMvField(rpcTempCU, 0, eRefList, pDBBPTmpData->acMvField[uiSegment][eRefList]); 2594 } 2595 } 2596 2597 // store final motion/disparity information in each PU using derived partitioning 2598 rpcTempCU->setDepthSubParts( uhDepth, 0 ); 2599 rpcTempCU->setPartSizeSubParts ( eVirtualPartSize, 0, uhDepth ); 2600 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 2601 2602 UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMaxCUDepth() - uhDepth ) << 1 ) ) >> 4; 2603 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 2604 { 2605 UInt uiPartAddr = uiSegment*uiPUOffset; 2606 2607 rpcTempCU->setDBBPFlagSubParts(true, uiPartAddr, uiSegment, uhDepth); 2608 2609 // now set stored information from 2Nx2N motion search to each partition 2610 rpcTempCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[uiSegment], uiPartAddr, uiSegment, uhDepth); // interprets depth relative to LCU level 2611 2612 rpcTempCU->setMergeFlagSubParts(pDBBPTmpData->abMergeFlag[uiSegment], uiPartAddr, uiSegment, uhDepth); 2613 rpcTempCU->setMergeIndexSubParts(pDBBPTmpData->auhMergeIndex[uiSegment], uiPartAddr, uiSegment, uhDepth); 2614 2615 rpcTempCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[uiSegment], uiPartAddr, uiSegment, uhDepth); 2616 rpcTempCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[uiSegment], uiPartAddr, uiSegment, uhDepth); 2617 2618 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 2619 { 2620 RefPicList eRefList = (RefPicList)uiRefListIdx; 2621 2622 rpcTempCU->getCUMvField( eRefList )->setAllMvd(pDBBPTmpData->acMvd[uiSegment][eRefList], eVirtualPartSize, uiPartAddr, 0, uiSegment); 2623 rpcTempCU->setMVPNum(eRefList, uiPartAddr, pDBBPTmpData->aiMvpNum[uiSegment][eRefList]); 2624 rpcTempCU->setMVPIdx(eRefList, uiPartAddr, pDBBPTmpData->aiMvpIdx[uiSegment][eRefList]); 2625 2626 rpcTempCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[uiSegment][eRefList], eVirtualPartSize, uiPartAddr, 0, uiSegment ); // interprets depth relative to rpcTempCU level 2627 } 2628 } 2629 2630 // reconstruct final prediction signal by combining both segments 2631 m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight); 2632 2633 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); 2634 2635 xCheckDQP( rpcTempCU ); 2636 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2637 } 2638 #endif 2242 2639 2243 2640 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) … … 2285 2682 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2286 2683 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2684 #if QC_SDC_UNIFY_G0130 2685 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2686 #endif 2287 2687 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2288 2688 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); … … 2374 2774 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2375 2775 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2776 #if QC_SDC_UNIFY_G0130 2777 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2778 #endif 2376 2779 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2377 2780 -
trunk/source/Lib/TLibEncoder/TEncCu.h
r655 r833 82 82 TComYuv** m_ppcOrigYuv; ///< Original Yuv for each depth 83 83 84 #if H_3D_DBBP 85 TComYuv** m_ppcOrigYuvDBBP; 86 #endif 87 84 88 // Data : encoder control 85 89 Bool m_bEncodeDQP; … … 168 172 Void xCheckRDCostInter ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 169 173 #endif 174 #if H_3D_DBBP 175 Void xInvalidateOriginalSegments( TComYuv* pOrigYuv, TComYuv* pOrigYuvTemp, Bool* pMask, UInt uiValidSegment ); 176 Void xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false ); 177 #endif 170 178 Void xCheckRDCostIntra ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 171 179 Void xCheckDQP ( TComDataCU* pcCU ); -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r773 r833 160 160 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 161 161 { 162 #if SEC_IC_ARP_SIG_G0072 163 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) 164 #else 162 165 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 166 #endif 163 167 { 164 168 return; … … 240 244 uiAbsPartIdx = 0; 241 245 } 246 247 #if H_3D_DBBP 248 PartSize eVirtualPartSize = pcCU->getPartitionSize(uiAbsPartIdx); 249 if( pcCU->getDBBPFlag(uiAbsPartIdx) ) 250 { 251 AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) ); 252 253 // temporarily change partition size for DBBP blocks 254 pcCU->setPartSizeSubParts(RWTH_DBBP_PACK_MODE, uiAbsPartIdx, uiDepth); 255 } 256 #endif 257 242 258 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 259 260 #if H_3D_DBBP 261 if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE ) 262 { 263 encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD); 264 265 if( pcCU->getDBBPFlag(uiAbsPartIdx) ) 266 { 267 AOF( pcCU->getPartitionSize(uiAbsPartIdx) == RWTH_DBBP_PACK_MODE ); 268 // restore virtual partition size for DBBP blocks 269 pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth); 270 } 271 } 272 #endif 243 273 } 244 274 … … 649 679 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 650 680 UInt uiChromaOffset = uiLumaOffset>>2; 651 681 #if QC_SDC_UNIFY_G0130 652 682 #if H_3D_DIM_SDC 653 if( pcCU->getSDCFlag( uiAbsPartIdx ) )683 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) ) 654 684 { 655 685 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 658 688 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 659 689 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 660 return;661 690 } 662 691 #endif 663 692 664 693 #if H_3D_INTER_SDC 665 if( pcCU->get InterSDCFlag( uiAbsPartIdx ) )694 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) 666 695 { 667 696 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 668 697 assert( !pcCU->isIntra( uiAbsPartIdx) ); 669 698 assert( pcCU->getSlice()->getIsDepth() ); 699 } 700 #endif 701 #if QC_SDC_UNIFY_G0130_FIX 702 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 703 #else 704 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) 705 #endif 706 { 707 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 708 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 709 710 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 711 { 712 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 713 { 714 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 715 { 716 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 717 } 718 } 719 } 720 else 721 { 722 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx ); 723 return; 724 } 725 } 726 #else 727 #if H_3D_DIM_SDC 728 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 729 { 730 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 731 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 732 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 733 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 734 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 735 return; 736 } 737 #endif 738 739 #if H_3D_INTER_SDC 740 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 741 { 742 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 743 assert( !pcCU->isIntra( uiAbsPartIdx) ); 744 assert( pcCU->getSlice()->getIsDepth() ); 670 745 671 746 encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false ); 672 747 return; 673 748 } 749 #endif 674 750 #endif 675 751 … … 825 901 826 902 #if H_3D_INTER_SDC 903 #if QC_SDC_UNIFY_G0130 904 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ) 905 { 906 m_pcEntropyCoderIf->codeDeltaDC( pcCU, absPartIdx ); 907 } 908 909 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 910 { 911 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) || 912 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ) 913 { 914 return; 915 } 916 917 #if SEC_INTER_SDC_G0101 918 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) 919 #else 920 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 921 #endif 922 { 923 return; 924 } 925 926 #if SEC_INTER_SDC_G0101 927 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 928 #else 929 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 930 #endif 931 932 if( bRD ) 933 { 934 uiAbsPartIdx = 0; 935 } 936 937 m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx ); 938 } 939 #else 827 940 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 828 941 { … … 872 985 } 873 986 #endif 987 #endif 988 #if H_3D_DBBP 989 Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 990 { 991 if( bRD ) 992 { 993 uiAbsPartIdx = 0; 994 } 995 m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx ); 996 } 997 #endif 874 998 875 999 //! \} -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r655 r833 95 95 #endif 96 96 #if H_3D_INTER_SDC 97 #if QC_SDC_UNIFY_G0130 98 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 99 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 100 #else 97 101 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 98 102 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; 103 #endif 104 #endif 105 #if H_3D_DBBP 106 virtual Void codeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 99 107 #endif 100 108 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 186 194 #endif 187 195 #if H_3D_INTER_SDC 196 #if QC_SDC_UNIFY_G0130 197 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 198 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 199 #else 188 200 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 189 201 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); 202 #endif 203 #endif 204 #if H_3D_DBBP 205 Void encodeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 190 206 #endif 191 207 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r773 r833 93 93 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 94 94 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 95 #if QC_GENERIC_SDC_G0122 96 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !QC_SDC_UNIFY_G0130 98 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 99 #endif 100 #endif 95 101 #if H_3D_DIM_DMM 96 102 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 101 107 #endif 102 108 #endif 103 #if H_3D_INTER_SDC 109 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 104 110 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 105 111 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 112 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 113 #endif 114 #if QC_SDC_UNIFY_G0130 115 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 #endif 117 #if H_3D_DBBP 118 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 119 #endif 108 120 { … … 168 180 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 169 181 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 182 #if QC_GENERIC_SDC_G0122 183 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 184 #if !QC_SDC_UNIFY_G0130 185 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 186 #endif 187 #endif 170 188 #if H_3D_DIM_DMM 171 189 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 176 194 #endif 177 195 #endif 178 #if H_3D_INTER_SDC 196 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 179 197 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 180 198 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 181 199 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 200 #endif 201 #if QC_SDC_UNIFY_G0130 202 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 203 #endif 204 #if H_3D_DBBP 205 m_cDBBPFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG ); 182 206 #endif 183 207 // new structure … … 218 242 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 219 243 #endif 220 #if H_3D_INTER_SDC 244 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 221 245 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 222 246 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 223 247 curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 248 #endif 249 #if QC_SDC_UNIFY_G0130 250 curCost += m_cSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SDC_FLAG ); 251 #endif 252 #if H_3D_DBBP 253 curCost += m_cDBBPFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DBBP_FLAG ); 224 254 #endif 225 255 curCost += m_cCUPartSizeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_PART_SIZE ); … … 252 282 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG ); 253 283 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 284 #if QC_GENERIC_SDC_G0122 285 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 286 #if !QC_SDC_UNIFY_G0130 287 curCost += m_cIntraSdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 288 #endif 289 #endif 254 290 #if H_3D_DIM_DMM 255 291 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); … … 317 353 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 318 354 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 355 #if QC_GENERIC_SDC_G0122 356 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 357 #if !QC_SDC_UNIFY_G0130 358 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 359 #endif 360 #endif 319 361 #if H_3D_DIM_DMM 320 362 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 325 367 #endif 326 368 #endif 327 #if H_3D_INTER_SDC 369 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 328 370 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 329 371 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 330 372 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 373 #endif 374 #if QC_SDC_UNIFY_G0130 375 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 376 #endif 377 #if H_3D_DBBP 378 m_cDBBPFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG ); 331 379 #endif 332 380 m_pcBinIf->start(); … … 629 677 this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel ); 630 678 this->m_cDdcFlagSCModel .copyFrom( &pSrc->m_cDdcFlagSCModel ); 679 #if QC_GENERIC_SDC_G0122 680 this->m_cAngleFlagSCModel .copyFrom( &pSrc->m_cAngleFlagSCModel ); 681 #if !QC_SDC_UNIFY_G0130 682 this->m_cIntraSdcFlagSCModel .copyFrom( &pSrc->m_cIntraSdcFlagSCModel ); 683 #endif 684 #endif 631 685 } 632 686 #endif … … 679 733 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA); 680 734 735 #if MTK_TEX_DEP_PAR_G0055 736 Bool depthDependent = false; 737 UInt uiTexturePart = eSize; 738 #endif 681 739 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() ) 682 740 { … … 684 742 UInt uiCUIdx = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU(); 685 743 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); 744 #if !MTK_TEX_DEP_PAR_G0055 686 745 if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) != SIZE_NxN) 746 #else 747 if(pcTextureCU->getDepth(uiCUIdx) == uiDepth ) 748 { 749 depthDependent = true; 750 uiTexturePart = pcTextureCU->getPartitionSize( uiCUIdx ); 751 } 752 if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) == SIZE_2Nx2N) 753 #endif 687 754 { 688 755 assert( eSize == SIZE_2Nx2N ); … … 706 773 DTRACE_CU("part_mode", eSize ) 707 774 #endif 775 #if MTK_TEX_DEP_PAR_G0055 776 if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N) 777 { 778 #endif 708 779 switch(eSize) 709 780 { … … 772 843 } 773 844 } 845 #if MTK_TEX_DEP_PAR_G0055 846 } 847 else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD) 848 { 849 //assert(eSize!=SIZE_NxN); 850 //assert(eSize!=SIZE_Nx2N); 851 //assert(eSize==SIZE_2Nx2N || eSize==SIZE_2NxN || eSize==SIZE_2NxnU || eSize==SIZE_2NxnD); 852 switch(eSize) 853 { 854 case SIZE_2Nx2N: 855 { 856 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 857 break; 858 } 859 case SIZE_2NxN: 860 { 861 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 862 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 863 { 864 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 865 } 866 break; 867 } 868 case SIZE_2NxnU: 869 case SIZE_2NxnD: 870 { 871 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 872 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 873 m_pcBinIf->encodeBinEP((eSize == SIZE_2NxnU? 0: 1)); 874 break; 875 } 876 default: 877 { 878 assert(0); 879 } 880 } 881 } 882 else if(uiTexturePart == SIZE_Nx2N|| uiTexturePart==SIZE_nLx2N || uiTexturePart==SIZE_nRx2N) 883 { 884 //assert(eSize!=SIZE_NxN); 885 //assert(eSize!=SIZE_2NxN); 886 //assert(eSize==SIZE_2Nx2N ||eSize==SIZE_Nx2N || eSize==SIZE_nLx2N || eSize==SIZE_nRx2N); 887 switch(eSize) 888 { 889 case SIZE_2Nx2N: 890 { 891 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 892 break; 893 } 894 case SIZE_Nx2N: 895 { 896 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 897 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 898 { 899 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 900 } 901 break; 902 } 903 case SIZE_nLx2N: 904 case SIZE_nRx2N: 905 { 906 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 907 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 908 m_pcBinIf->encodeBinEP((eSize == SIZE_nLx2N? 0: 1)); 909 break; 910 } 911 default: 912 { 913 assert(0); 914 } 915 } 916 } 917 else 918 { 919 printf("uiTexturePart=%d",uiTexturePart); 920 assert(0); 921 } 922 #endif 774 923 } 775 924 … … 906 1055 if( nBinNum > 1 ) 907 1056 { 1057 #if MTK_ARP_FLAG_CABAC_SIMP_G0061 1058 m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 2 ) ); 1059 #else 908 1060 m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 3 ) ); 1061 #endif 909 1062 } 910 1063 #if H_MV_ENC_DEC_TRAC … … 924 1077 // get context function is here 925 1078 UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0; 1079 #if MTK_IC_FLAG_CABAC_SIMP_G0061 1080 m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) ); 1081 #else 926 1082 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ) ; 927 1083 m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 1084 #endif 928 1085 #if !H_MV_ENC_DEC_TRAC 929 1086 DTRACE_CABAC_VL( g_nSymbolCounter++ ); … … 1016 1173 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1017 1174 #if H_3D_DIM_SDC 1175 #if QC_GENERIC_SDC_G0122 1176 if( 1 ) 1177 #else 1018 1178 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1179 #endif 1019 1180 #endif 1020 1181 { … … 1042 1203 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1043 1204 #if H_3D_DIM_SDC 1205 #if QC_GENERIC_SDC_G0122 1206 if( 1 ) 1207 #else 1044 1208 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1209 #endif 1045 1210 #endif 1046 1211 { … … 1141 1306 default: break; 1142 1307 } 1143 1308 #if !QC_SDC_UNIFY_G0130 1144 1309 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1145 1310 { 1146 1311 UInt dimDeltaDC; 1147 1312 Pel deltaDC; 1313 #if QC_GENERIC_SDC_G0122 1314 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1; 1315 #else 1148 1316 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1317 #endif 1149 1318 if( pcCU->getSDCFlag( absPartIdx ) ) 1150 1319 { … … 1174 1343 } 1175 1344 } 1176 } 1177 1345 #endif 1346 } 1347 1348 #if QC_GENERIC_SDC_G0122 1349 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1350 { 1351 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 1352 1353 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 1354 { 1355 m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) ); 1356 } 1357 #if !QC_SDC_UNIFY_G0130 1358 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case 1359 { 1360 m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) ); 1361 } 1362 #endif 1363 if( isDimMode( dir ) ) 1364 { 1365 UInt uiCodeIdx = 0; 1366 1367 switch( getDimType( dir ) ) 1368 { 1369 case DMM1_IDX: uiCodeIdx = 0; break; 1370 case DMM4_IDX: uiCodeIdx = 1; break; 1371 default: break; 1372 } 1373 //mode coding 1374 m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) ); 1375 } 1376 } 1377 #else 1178 1378 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1179 1379 { … … 1216 1416 } 1217 1417 } 1418 #endif 1218 1419 #endif 1219 1420 … … 2137 2338 2138 2339 #if H_3D_INTER_SDC 2340 #if QC_SDC_UNIFY_G0130 2341 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2342 { 2343 if( !( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2344 { 2345 assert( 0 ); 2346 } 2347 2348 UInt uiNumSegments = 0; 2349 UInt dimDeltaDC = 0; 2350 2351 if( pcCU->isIntra( absPartIdx ) ) 2352 { 2353 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2354 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2355 2356 if( pcCU->getSDCFlag( absPartIdx ) ) 2357 { 2358 if( uiNumSegments == 1 ) 2359 { 2360 dimDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0; 2361 } 2362 else 2363 { 2364 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0; 2365 } 2366 } 2367 else 2368 { 2369 dimDeltaDC = isDimDeltaDC( dir ); 2370 } 2371 2372 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) ); 2373 } 2374 else //all-zero inter SDC is not allowed 2375 { 2376 #if SEC_INTER_SDC_G0101 2377 uiNumSegments = 1; 2378 #else 2379 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2380 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2381 #endif 2382 dimDeltaDC = 1; 2383 } 2384 2385 if( dimDeltaDC ) 2386 { 2387 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2388 { 2389 Pel deltaDC = 0; 2390 2391 if( pcCU->isIntra( absPartIdx ) ) 2392 { 2393 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2394 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset( segment, absPartIdx ) : pcCU->getDimDeltaDC( getDimType( dir ), segment, absPartIdx ); 2395 } 2396 else 2397 { 2398 deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx ); 2399 } 2400 2401 xCodeDimDeltaDC( deltaDC, uiNumSegments ); 2402 } 2403 } 2404 } 2405 2406 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2407 { 2408 UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2409 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2410 2411 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2412 } 2413 #else 2139 2414 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2140 2415 { … … 2158 2433 } 2159 2434 #endif 2435 #endif 2436 2437 #if H_3D_DBBP 2438 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2439 { 2440 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 2441 AOF( ePartSize == RWTH_DBBP_PACK_MODE ); 2442 AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) ); 2443 AOF( !pcCU->getSlice()->getIsDepth() ); 2444 2445 UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0; 2446 m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) ); 2447 } 2448 #endif 2449 2160 2450 //! \} -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r773 r833 154 154 #endif 155 155 #if H_3D_INTER_SDC 156 #if QC_SDC_UNIFY_G0130 157 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 158 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 159 #else 156 160 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 157 161 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 162 #endif 163 #endif 164 #if H_3D_DBBP 165 Void codeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 158 166 #endif 159 167 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 247 255 ContextModel3DBuffer m_cDdcFlagSCModel; 248 256 ContextModel3DBuffer m_cDdcDataSCModel; 257 #if QC_GENERIC_SDC_G0122 258 ContextModel3DBuffer m_cAngleFlagSCModel; 259 #if !QC_SDC_UNIFY_G0130 260 ContextModel3DBuffer m_cIntraSdcFlagSCModel; 261 #endif 262 #endif 249 263 #if H_3D_DIM_DMM 250 264 ContextModel3DBuffer m_cDmm1DataSCModel; … … 255 269 #endif 256 270 #endif 257 #if H_3D_INTER_SDC 271 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 258 272 ContextModel3DBuffer m_cInterSDCFlagSCModel; 259 273 ContextModel3DBuffer m_cInterSDCResidualSCModel; 260 274 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 261 275 #endif 276 #if QC_SDC_UNIFY_G0130 277 ContextModel3DBuffer m_cSDCFlagSCModel; 278 #endif 279 #if H_3D_DBBP 280 ContextModel3DBuffer m_cDBBPFlagSCModel; 281 #endif 262 282 }; 263 283 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r773 r833 922 922 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 923 923 924 #if QC_SDC_UNIFY_G0130 925 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 926 #endif 924 927 if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 925 928 { … … 938 941 { 939 942 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 943 #if QC_SDC_UNIFY_G0130_FIX 944 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 945 { 946 m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 ); 947 } 948 #endif 940 949 } 941 950 } … … 949 958 { 950 959 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts ); 960 #if QC_SDC_UNIFY_G0130_FIX 961 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 962 { 963 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts ); 964 } 965 #endif 951 966 } 952 967 } … … 954 969 { 955 970 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 956 } 957 } 971 #if QC_SDC_UNIFY_G0130_FIX 972 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 973 { 974 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx ); 975 } 976 #endif 977 } 978 } 979 #if QC_SDC_UNIFY_G0130 && !QC_SDC_UNIFY_G0130_FIX 980 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 981 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 982 983 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 984 { 985 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 986 { 987 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 988 { 989 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 990 } 991 } 992 } 993 #endif 958 994 } 959 995 if( bChroma ) … … 1862 1898 1863 1899 #if H_3D_DIM_SDC 1864 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ) 1900 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 1901 #if QC_GENERIC_SDC_G0122 1902 Bool bZeroResidual, Int iSDCDeltaResi 1903 #else 1904 Bool bResidual 1905 #endif 1906 ) 1865 1907 { 1866 1908 UInt uiLumaPredMode = pcCU ->getLumaIntraDir( uiAbsPartIdx ); 1867 1909 UInt uiWidth = pcCU ->getWidth ( 0 ); 1868 1910 UInt uiHeight = pcCU ->getHeight ( 0 ); 1911 #if QC_PKU_SDC_SPLIT_G0123 1912 #if HS_TSINGHUA_SDC_SPLIT_G0111 1913 #if QC_GENERIC_SDC_G0122 1914 TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight ); 1915 #endif 1916 #else 1917 #if QC_GENERIC_SDC_G0122 1918 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1919 #endif 1920 #endif 1921 #endif 1922 #if QC_PKU_SDC_SPLIT_G0123 1923 UInt numParts = 1; 1924 UInt i = 0; 1925 UInt sdcDepth = 0; 1926 UInt uiStride; 1927 Pel* piOrg; 1928 Pel* piPred; 1929 Pel* piReco; 1930 1931 UInt uiZOrder; 1932 Pel* piRecIPred; 1933 UInt uiRecIPredStride; 1934 1935 #if HS_TSINGHUA_SDC_SPLIT_G0111 1936 if ( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 ) 1937 { 1938 numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 1939 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1940 uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 1941 } 1942 #else 1943 if (uiWidth == 64) 1944 { 1945 numParts = 4; 1946 sdcDepth = 1; 1947 uiWidth = uiHeight = 32; 1948 } 1949 #endif 1950 1951 for ( i = 0; i < numParts; i++ ) 1952 { 1953 uiStride = pcOrgYuv ->getStride (); 1954 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 1955 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1956 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1957 1958 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1959 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1960 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1961 1962 AOF( uiWidth == uiHeight ); 1963 #else 1869 1964 UInt uiStride = pcOrgYuv ->getStride (); 1870 1965 Pel* piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); … … 1880 1975 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1881 1976 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1977 #endif 1978 #if !QC_GENERIC_SDC_G0122 1882 1979 AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) ); 1883 1980 AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64 ); 1981 #endif 1884 1982 1885 1983 //===== init availability pattern ===== 1886 1984 Bool bAboveAvail = false; 1887 1985 Bool bLeftAvail = false; 1986 #if QC_PKU_SDC_SPLIT_G0123 1987 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); 1988 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1989 #else 1888 1990 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 1889 1991 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1890 1992 1993 #endif 1994 #if !QC_PKU_SDC_SPLIT_G0123 1995 #if QC_GENERIC_SDC_G0122 1996 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1997 #endif 1998 #endif 1999 #if HS_TSINGHUA_SDC_SPLIT_G0111 2000 #if QC_GENERIC_SDC_G0122 2001 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 2002 #endif 2003 #endif 1891 2004 //===== get prediction signal ===== 1892 2005 #if H_3D_DIM 1893 2006 if( isDimMode( uiLumaPredMode ) ) 1894 2007 { 1895 predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true ); 2008 #if HS_TSINGHUA_SDC_SPLIT_G0111 2009 UInt dimType = getDimType ( uiLumaPredMode ); 2010 UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx); 2011 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX ) 2012 { 2013 if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used. 2014 patternID = 1349; // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16 2015 else 2016 patternID = patternID >> 1; // Other cases 2017 pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID); 2018 } 2019 #endif 2020 predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true 2021 #if QC_GENERIC_SDC_G0122 2022 , dmm4Segmentation 2023 #endif 2024 ); 2025 #if HS_TSINGHUA_SDC_SPLIT_G0111 2026 Bool* dmm4PatternSplit = dmm4Segmentation->getPattern(); 2027 Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern(); 2028 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 2029 { 2030 dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k]; 2031 } 2032 #endif 1896 2033 } 1897 2034 else … … 1902 2039 } 1903 2040 #endif 1904 2041 #if QC_PKU_SDC_SPLIT_G0123 2042 if ( numParts > 1 ) 2043 { 2044 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 2045 { 2046 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 2047 { 2048 piPred [ uiX ] = ClipY( piPred[ uiX ] ); 2049 piRecIPred [ uiX ] = piPred[ uiX ]; 2050 } 2051 piPred += uiStride; 2052 piRecIPred += uiRecIPredStride; 2053 } 2054 } 2055 uiAbsPartIdx += ( ( uiWidth * uiWidth ) >> 4 ); 2056 #if HS_TSINGHUA_SDC_SPLIT_G0111 2057 dmm4Segmentation->destroy(); delete dmm4Segmentation; 2058 #endif 2059 } 2060 uiAbsPartIdx = 0; 2061 uiStride = pcOrgYuv ->getStride (); 2062 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 2063 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2064 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2065 2066 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 2067 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 2068 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 2069 2070 if (numParts > 1) 2071 { 2072 uiWidth = pcCU->getWidth( 0 ); 2073 uiHeight = pcCU->getHeight( 0 ); 2074 } 2075 #endif 1905 2076 // number of segments depends on prediction mode 1906 2077 UInt uiNumSegments = 1; … … 1919 2090 uiMaskStride = pcWedgelet->getStride(); 1920 2091 } 2092 #if QC_GENERIC_SDC_G0122 2093 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) 2094 { 2095 uiNumSegments = 2; 2096 #if HS_TSINGHUA_SDC_SPLIT_G0111 2097 pbMask = dmm4SegmentationOrg->getPattern(); 2098 uiMaskStride = dmm4SegmentationOrg->getStride(); 2099 #else 2100 pbMask = dmm4Segmentation->getPattern(); 2101 uiMaskStride = dmm4Segmentation->getStride(); 2102 #endif 2103 } 2104 #endif 1921 2105 1922 2106 // get DC prediction for each segment … … 1931 2115 { 1932 2116 // remap reconstructed value to valid depth values 2117 #if QC_GENERIC_SDC_G0122 2118 Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment]; 2119 #else 1933 2120 Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment]; 1934 2121 #endif 1935 2122 // get residual (idx) 1936 2123 #if H_3D_DIM_DLT … … 1939 2126 Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment]; 1940 2127 #endif 1941 2128 #if QC_GENERIC_SDC_G0122 2129 if( !bZeroResidual ) 2130 { 2131 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 2132 Int pTestIdx = pPredIdx + pResidualIdx + iSDCDeltaResi; 2133 if( pTestIdx >= 0 && pTestIdx < pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) ) 2134 { 2135 pResidualIdx += iSDCDeltaResi; 2136 } 2137 } 2138 #endif 1942 2139 // save SDC DC offset 1943 2140 pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx); … … 2012 2209 2013 2210 // encode reduced intra header 2211 #if QC_SDC_UNIFY_G0130 2212 if( !pcCU->getSlice()->isIntra() ) 2213 { 2214 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2215 { 2216 m_pcEntropyCoder->encodeCUTransquantBypassFlag( pcCU, 0, true ); 2217 } 2218 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 2219 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2220 } 2221 2222 #if QC_SDC_UNIFY_G0130_FIX2 2223 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true ); 2224 #else 2225 m_pcEntropyCoder->encodePartSize( pcCU, 0, true ); 2226 #endif 2227 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2228 #else 2014 2229 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2230 #endif 2015 2231 2016 2232 // encode pred direction + DC residual data 2017 2233 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2234 #if QC_SDC_UNIFY_G0130 2235 Bool bDummy = false; 2236 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy ); 2237 #endif 2018 2238 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2019 2239 … … 2024 2244 #endif 2025 2245 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2246 #if QC_GENERIC_SDC_G0122 2247 #if HS_TSINGHUA_SDC_SPLIT_G0111 2248 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 2249 #else 2250 dmm4Segmentation->destroy(); delete dmm4Segmentation; 2251 #endif 2252 #endif 2026 2253 } 2027 2254 #endif … … 2901 3128 case( DMM4_IDX ): 2902 3129 { 3130 #if !QC_GENERIC_SDC_G0122 2903 3131 if( uiWidth > 4 ) 3132 #endif 2904 3133 { 2905 3134 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); … … 2957 3186 { 2958 3187 pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth ); 3188 #if QC_GENERIC_SDC_G0122 3189 for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ ) 3190 { 3191 if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 ) 3192 { 3193 continue; 3194 } 3195 #endif 2959 3196 #endif 2960 3197 … … 2966 3203 #if H_3D_DIM_SDC 2967 3204 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset); 3205 #endif 3206 #if QC_GENERIC_SDC_G0122 3207 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3208 { 3209 bTestZeroResi = false; 3210 } 2968 3211 #endif 2969 3212 #endif … … 3000 3243 3001 3244 // start encoding with SDC 3245 #if QC_GENERIC_SDC_G0122 3246 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3247 #else 3002 3248 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0)); 3249 #endif 3003 3250 } 3004 3251 else … … 3073 3320 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3074 3321 } 3322 #endif 3323 #if QC_GENERIC_SDC_G0122 3324 } // SDC residual loop 3075 3325 #endif 3076 3326 #if H_3D_DIM_SDC … … 3583 3833 pcCU->getPartIndexAndSize( iPUIdx, uiAbsPartIdx, iWidth, iHeight ); 3584 3834 UInt uiDepth = pcCU->getDepth( uiAbsPartIdx ); 3835 3836 #if H_3D_DBBP 3837 DBBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 3838 if( pcCU->getDBBPFlag(0) ) 3839 { 3840 AOF( uiAbsPartIdx == 0 ); 3841 AOF( iPUIdx == 0 ); 3842 AOF( pcCU->getPartitionSize(0) == SIZE_2Nx2N ); 3843 AOF( pDBBPTmpData->eVirtualPartSize != SIZE_NONE ); 3844 3845 // temporary change of partition size for candidate derivation 3846 pcCU->setPartSizeSubParts( pDBBPTmpData->eVirtualPartSize, 0, pcCU->getDepth(0)); 3847 iPUIdx = pcCU->getDBBPTmpData()->uiVirtualPartIndex; 3848 3849 // if this is handling the second segment, make sure that motion info of first segment is available 3850 if( iPUIdx == 1 ) 3851 { 3852 pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[0], 0, 0, pcCU->getDepth(0)); // interprets depth relative to LCU level 3853 3854 pcCU->setVSPFlagSubParts(pDBBPTmpData->ahVSPFlag[0], 0, 0, pcCU->getDepth(0)); 3855 pcCU->setDvInfoSubParts(pDBBPTmpData->acDvInfo[0], 0, 0, pcCU->getDepth(0)); 3856 3857 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 3858 { 3859 RefPicList eRefList = (RefPicList)uiRefListIdx; 3860 3861 pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[0][eRefList], pDBBPTmpData->eVirtualPartSize, 0, 0, 0 ); // interprets depth relative to rpcTempCU level 3862 } 3863 } 3864 3865 // update these values to virtual partition size 3866 pcCU->getPartIndexAndSize( iPUIdx, uiAbsPartIdx, iWidth, iHeight ); 3867 } 3868 #endif 3869 3585 3870 PartSize partSize = pcCU->getPartitionSize( 0 ); 3871 #if H_3D_DBBP 3872 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && partSize != SIZE_2Nx2N && pcCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(0) == false ) 3873 #else 3586 3874 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && partSize != SIZE_2Nx2N && pcCU->getWidth( 0 ) <= 8 ) 3875 #endif 3587 3876 { 3588 3877 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); … … 3634 3923 #endif 3635 3924 3925 #if H_3D_DBBP 3926 if( pcCU->getDBBPFlag(0) ) 3927 { 3928 // reset to 2Nx2N for actual motion search 3929 iPUIdx = 0; 3930 AOF( pcCU->getPartitionSize(0) == pDBBPTmpData->eVirtualPartSize ); 3931 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, pcCU->getDepth(0)); 3932 3933 // restore values for 2Nx2N partition size 3934 pcCU->getPartIndexAndSize( iPUIdx, uiAbsPartIdx, iWidth, iHeight ); 3935 3936 AOF( uiAbsPartIdx == 0 ); 3937 AOF( iWidth == iHeight ); 3938 } 3939 #endif 3636 3940 3637 3941 ruiCost = MAX_UINT; … … 3643 3947 3644 3948 PartSize ePartSize = pcCU->getPartitionSize( 0 ); 3949 3950 #if H_3D_VSP && NTT_STORE_SPDV_VSP_G0148 3951 pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3952 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3953 #endif 3645 3954 3646 3955 #if H_3D_SPIVMP … … 3662 3971 } 3663 3972 else 3664 { 3665 #endif 3973 #endif 3974 #if NTT_STORE_SPDV_VSP_G0148 3975 #if H_3D_DBBP 3976 if ( vspFlag[uiMergeCand] && !pcCU->getDBBPFlag(0) ) 3977 #else 3978 if ( vspFlag[uiMergeCand] ) 3979 #endif 3980 { 3981 UInt partAddr; 3982 Int vspSize; 3983 Int width, height; 3984 pcCU->getPartIndexAndSize( iPUIdx, partAddr, width, height ); 3985 3986 if( uhInterDirNeighbours[ uiMergeCand ] & 0x01 ) 3987 { 3988 pcCU->setMvFieldPUForVSP( pcCU, partAddr, width, height, REF_PIC_LIST_0, cMvFieldNeighbours[ 2*uiMergeCand + 0 ].getRefIdx(), vspSize ); 3989 pcCU->setVSPFlag( partAddr, vspSize ); 3990 } 3991 else 3992 { 3993 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3994 } 3995 if( uhInterDirNeighbours[ uiMergeCand ] & 0x02 ) 3996 { 3997 pcCU->setMvFieldPUForVSP( pcCU, partAddr, width, height, REF_PIC_LIST_1, cMvFieldNeighbours[ 2*uiMergeCand + 1 ].getRefIdx(), vspSize ); 3998 pcCU->setVSPFlag( partAddr, vspSize ); 3999 } 4000 else 4001 { 4002 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 4003 } 4004 } 4005 else 4006 #endif 4007 { 3666 4008 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3667 4009 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3668 #if H_3D_SPIVMP 3669 } 3670 #endif 3671 3672 #if H_3D_VSP 4010 } 4011 4012 #if H_3D_VSP && !NTT_STORE_SPDV_VSP_G0148 3673 4013 pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3674 4014 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 4015 #endif 4016 4017 #if MTK_DDD_G0063 4018 if( uiMergeCand == pcCU->getUseDDDCandIdx() ) 4019 { 4020 pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 4021 pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 4022 } 4023 else 4024 { 4025 pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 4026 } 3675 4027 #endif 3676 4028 … … 4302 4654 #endif 4303 4655 4656 #if H_3D_DBBP 4657 // test merge mode for DBBP (2Nx2N) 4658 if ( pcCU->getPartitionSize( uiPartAddr ) != SIZE_2Nx2N || pcCU->getDBBPFlag(0) ) 4659 #else 4304 4660 if ( pcCU->getPartitionSize( uiPartAddr ) != SIZE_2Nx2N ) 4661 #endif 4305 4662 { 4306 4663 UInt uiMRGInterDir = 0; … … 4372 4729 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4373 4730 #endif 4731 4732 #if MTK_DDD_G0063 4733 if( uiMRGIndex == pcCU->getUseDDDCandIdx() ) 4734 { 4735 assert( vspFlag[uiMRGIndex] == 0 ); 4736 assert( bSPIVMPFlag[uiMRGIndex] == 0 ); 4737 pcCU->setUseDDD( true, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4738 pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4739 } 4740 else 4741 { 4742 pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4743 } 4744 #endif 4745 4374 4746 #if H_3D_SPIVMP 4375 4747 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); … … 4399 4771 } 4400 4772 else 4401 { 4402 #endif 4773 #endif 4774 #if NTT_STORE_SPDV_VSP_G0148 4775 #if H_3D_DBBP 4776 if ( vspFlag[uiMRGIndex] && !pcCU->getDBBPFlag(uiPartAddr) ) 4777 #else 4778 if ( vspFlag[uiMRGIndex] ) 4779 #endif 4780 { 4781 UInt partAddrTemp; 4782 Int vspSize; 4783 Int width, height; 4784 pcCU->getPartIndexAndSize( iPartIdx, partAddrTemp, width, height ); // true or pcCU->getTotalNumPart()==256 4785 4786 if( uiMRGInterDir & 0x01 ) 4787 { 4788 pcCU->setMvFieldPUForVSP( pcCU, partAddrTemp, width, height, REF_PIC_LIST_0, cMRGMvField[0].getRefIdx(), vspSize ); 4789 pcCU->setVSPFlag( partAddrTemp, vspSize ); 4790 } 4791 else 4792 { 4793 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0], ePartSize, uiPartAddr, 0, iPartIdx ); 4794 } 4795 if( uiMRGInterDir & 0x02 ) 4796 { 4797 pcCU->setMvFieldPUForVSP( pcCU, partAddrTemp, width, height, REF_PIC_LIST_1, cMRGMvField[1].getRefIdx(), vspSize ); 4798 pcCU->setVSPFlag( partAddrTemp, vspSize ); 4799 } 4800 else 4801 { 4802 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx ); 4803 } 4804 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4805 } 4806 else 4807 #endif 4808 { 4403 4809 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4404 4810 { … … 4406 4812 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx ); 4407 4813 } 4408 #if H_3D_SPIVMP 4409 } 4410 #endif 4814 } 4411 4815 4412 4816 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, ePartSize, uiPartAddr, 0, iPartIdx ); … … 4422 4826 #if H_3D_SPIVMP 4423 4827 pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4828 #endif 4829 4830 #if MTK_DDD_G0063 4831 pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4424 4832 #endif 4425 4833 // set ME result … … 4473 4881 if (!bFilled) 4474 4882 { 4883 #if H_3D_DBBP 4884 DBBPTmpData* pDBBPTmpData = pcCU->getDBBPTmpData(); 4885 if( pcCU->getDBBPFlag(0) ) 4886 { 4887 AOF( uiPartAddr == 0 ); 4888 AOF( uiPartIdx == 0 ); 4889 AOF( pcCU->getPartitionSize(0) == SIZE_2Nx2N ); 4890 AOF( pDBBPTmpData->eVirtualPartSize != SIZE_NONE ); 4891 AOF( iRoiWidth == iRoiHeight ); 4892 4893 // temporary change of partition size for candidate derivation 4894 pcCU->setPartSizeSubParts( pDBBPTmpData->eVirtualPartSize, 0, pcCU->getDepth(0)); 4895 uiPartIdx = pcCU->getDBBPTmpData()->uiVirtualPartIndex; 4896 4897 // if this is handling the second segment, make sure that motion info of first segment is set to first segment 4898 if( uiPartIdx == 1 ) 4899 { 4900 pcCU->setInterDirSubParts(pDBBPTmpData->auhInterDir[0], 0, 0, pcCU->getDepth(0)); // interprets depth relative to LCU level 4901 4902 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 4903 { 4904 RefPicList eRefList = (RefPicList)uiRefListIdx; 4905 pcCU->getCUMvField( eRefList )->setAllMvField( pDBBPTmpData->acMvField[0][eRefList], pDBBPTmpData->eVirtualPartSize, 0, 0, 0 ); // interprets depth relative to rpcTempCU level 4906 } 4907 } 4908 4909 // update values to virtual partition size 4910 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 4911 } 4912 #endif 4913 4475 4914 pcCU->fillMvpCand( uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pcAMVPInfo ); 4915 4916 #if H_3D_DBBP 4917 if( pcCU->getDBBPFlag(0) ) 4918 { 4919 // restore 2Nx2N partitioning for motion estimation 4920 uiPartIdx = 0; 4921 AOF( pcCU->getPartitionSize(0) == pDBBPTmpData->eVirtualPartSize ); 4922 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, pcCU->getDepth(0)); 4923 4924 // restore values for 2Nx2N partition size 4925 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 4926 AOF(uiPartAddr==0); 4927 } 4928 #endif 4476 4929 } 4477 4930 … … 5253 5706 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 5254 5707 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true ); 5708 #if !SEC_IC_ARP_SIG_G0072 5255 5709 #if H_3D_IC 5256 5710 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 5257 5711 #endif 5712 #endif 5258 5713 #if H_3D_ARP 5259 5714 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 5715 #endif 5716 #if SEC_IC_ARP_SIG_G0072 5717 #if H_3D_IC 5718 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 5719 #endif 5260 5720 #endif 5261 5721 uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); … … 5536 5996 5537 5997 #if H_3D_INTER_SDC 5998 #if SEC_INTER_SDC_G0101 5999 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth ) 6000 #else 5538 6001 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 6002 #endif 5539 6003 { 5540 6004 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) ) … … 5542 6006 return; 5543 6007 } 5544 6008 #if QC_SDC_UNIFY_G0130 6009 pcCU->setSDCFlagSubParts( true, 0, uiDepth ); 6010 #else 5545 6011 pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth ); 6012 #endif 5546 6013 5547 6014 UInt uiWidth = pcCU->getWidth ( 0 ); 5548 6015 UInt uiHeight = pcCU->getHeight( 0 ); 6016 #if SEC_INTER_SDC_G0101 6017 UInt uiSegSize = 0; 6018 #else 5549 6019 UChar* pMask = pcCU->getInterSDCMask(); 5550 6020 memset( pMask, 0, uiWidth*uiHeight ); … … 5553 6023 5554 6024 UInt uiSegSize[4] = { 0, 0, 0, 0 }; 6025 #endif 5555 6026 Pel *pPred, *pOrg; 5556 6027 UInt uiPredStride = pcPred->getStride(); 5557 6028 UInt uiOrgStride = pcOrg->getStride(); 5558 6029 UInt uiPelX, uiPelY; 6030 #if !SEC_INTER_SDC_G0101 5559 6031 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 5560 6032 UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 ); 6033 #endif 5561 6034 5562 6035 pPred = pcPred->getLumaAddr( 0 ); 5563 6036 pOrg = pcOrg->getLumaAddr( 0 ); 6037 #if SEC_INTER_SDC_G0101 6038 Int pResDC = 0; 6039 #else 5564 6040 Int pResDC[4] = { 0, 0, 0, 0}; 6041 #endif 5565 6042 5566 6043 //calculate dc value for prediction and original signal, and calculate residual and reconstruction … … 5569 6046 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5570 6047 { 6048 #if SEC_INTER_SDC_G0101 6049 pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 6050 uiSegSize++; 6051 #else 5571 6052 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5572 6053 pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5573 6054 uiSegSize[uiSeg]++; 6055 #endif 5574 6056 } 5575 6057 pOrg += uiOrgStride; … … 5577 6059 } 5578 6060 6061 #if SEC_INTER_SDC_G0101 6062 Int iResiOffset = ( pResDC > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) ); 6063 pResDC = ( pResDC + iResiOffset ) / (Int) uiSegSize; 6064 6065 pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 ); 6066 #else 5579 6067 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5580 6068 { 5581 6069 Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) ); 5582 6070 pResDC [uiSeg] = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg]; 5583 6071 #if QC_SDC_UNIFY_G0130 6072 pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 6073 #else 5584 6074 pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5585 } 6075 #endif 6076 } 6077 #endif 5586 6078 5587 6079 Pel *pRec; … … 5594 6086 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5595 6087 { 6088 #if SEC_INTER_SDC_G0101 6089 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) ); 6090 #else 5596 6091 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5597 6092 assert( uiSeg < uiSegmentNum ); 5598 6093 5599 6094 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] ); 6095 #endif 5600 6096 } 5601 6097 pPred += uiPredStride; … … 5637 6133 #endif 5638 6134 6135 #if QC_SDC_UNIFY_G0130 6136 Bool bNonSkip = false; 6137 #else 5639 6138 Bool bNonSkip = true; 6139 #endif 6140 #if SEC_INTER_SDC_G0101 6141 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0; 6142 #else 5640 6143 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5641 6144 { 6145 #if QC_SDC_UNIFY_G0130 6146 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 6147 #else 5642 6148 bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 5643 } 6149 #endif 6150 } 6151 #endif 5644 6152 5645 6153 if( !bNonSkip ) … … 6833 7341 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6834 7342 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true); 7343 #if !SEC_IC_ARP_SIG_G0072 6835 7344 #if H_3D_IC 6836 7345 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 6837 7346 #endif 7347 #endif 6838 7348 #if H_3D_ARP 6839 7349 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 7350 #endif 7351 #if SEC_IC_ARP_SIG_G0072 7352 #if H_3D_IC 7353 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 7354 #endif 6840 7355 #endif 6841 7356 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); … … 6851 7366 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 6852 7367 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 7368 #if QC_SDC_UNIFY_G0130 7369 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7370 #endif 6853 7371 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 7372 #if !SEC_IC_ARP_SIG_G0072 6854 7373 #if H_3D_IC 6855 7374 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 6856 7375 #endif 7376 #endif 6857 7377 #if H_3D_ARP 6858 7378 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6859 7379 #endif 6860 #if H_3D_INTER_SDC 7380 #if SEC_IC_ARP_SIG_G0072 7381 #if H_3D_IC 7382 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 7383 #endif 7384 #endif 7385 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 6861 7386 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 6862 7387 #endif -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r773 r833 219 219 TComYuv* pcResi, 220 220 TComYuv* pcRec, 221 #if SEC_INTER_SDC_G0101 222 Int uiOffset, 223 #endif 221 224 const UInt uiDepth ); 222 225 #endif … … 353 356 #endif 354 357 #if H_3D_DIM_SDC 355 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ); 358 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 359 #if QC_GENERIC_SDC_G0122 360 Bool bZeroResidual, Int iSDCDeltaResi 361 #else 362 Bool bResidual 363 #endif 364 ); 356 365 #endif 357 366 #endif -
trunk/source/Lib/TLibEncoder/TEncSlice.h
r655 r833 107 107 UInt m_uiSliceIdx; 108 108 std::vector<TEncSbac*> CTXMem; 109 110 #if MTK_DDD_G0063 111 Int m_iDDDScale; 112 Int m_iDDDOffset; 113 UInt m_uiDDDPrecision; 114 #endif 109 115 public: 110 116 TEncSlice(); … … 147 153 Void setCtxMem( TEncSbac* sb, Int b ) { CTXMem[b] = sb; } 148 154 155 #if MTK_DDD_G0063 156 Void setDDDPar( Int iScale, Int iOffset, UInt uiPrecision ){ m_iDDDScale = iScale; m_iDDDOffset = iOffset; m_uiDDDPrecision = uiPrecision; } 157 #endif 158 149 159 private: 150 160 Double xGetQPValueAccordingToLambda ( Double lambda );
Note: See TracChangeset for help on using the changeset viewer.