Changeset 827 in 3DVCSoftware
- Timestamp:
- 5 Feb 2014, 20:06:56 (11 years ago)
- Location:
- branches/HTM-9.3-dev0/source/Lib
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.3-dev0/source/Lib/TLibCommon/ContextTables.h
r826 r827 115 115 116 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 117 120 #define NUM_DEPTH_INTRA_MODE_CTX 8 ///< number of context models for depth intra modes 121 #endif 118 122 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (DMM or RBC) 119 123 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or RBC) … … 121 125 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 122 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 123 133 #endif 124 134 … … 128 138 #endif 129 139 130 #if H_3D_INTER_SDC 140 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 131 141 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 132 142 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual … … 134 144 #endif 135 145 146 #if QC_SDC_UNIFY_G0130 147 #define NUM_SDC_FLAG_CTX 1 ///< number of context 148 #endif 136 149 #if H_3D_DBBP 137 150 #define DBBP_NUM_FLAG_CTX 1 … … 414 427 #endif 415 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 416 438 static const UChar 417 439 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = … … 421 443 {64, 0, CNU, CNU, 168, 109, 0, 0} 422 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 423 465 424 466 static const UChar … … 463 505 #endif 464 506 465 #if H_3D_INTER_SDC 507 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 466 508 static const UChar 467 509 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = … … 489 531 #endif 490 532 //! \} 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 491 542 492 543 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r826 r827 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 154 165 #endif 155 166 #if H_3D_DBBP … … 280 291 #if H_3D_DIM_SDC 281 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 282 299 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 283 300 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 284 301 #endif 285 302 #endif 286 #if H_3D_INTER_SDC 303 #endif 304 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 287 305 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 288 306 for( Int i = 0; i < 4; i++ ) … … 300 318 m_acCUMvField[1].setNumPartition(uiNumPartition ); 301 319 } 320 #if !SEC_INTER_SDC_G0101 302 321 #if H_3D_INTER_SDC 303 322 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth); 323 #endif 304 324 #endif 305 325 m_sliceStartCU = (UInt* )xMalloc(UInt, uiNumPartition); … … 421 441 #if H_3D_DIM_SDC 422 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 423 449 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 424 450 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 425 451 #endif 426 452 #endif 427 #if H_3D_INTER_SDC 453 #endif 454 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 428 455 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 429 456 for(Int i = 0; i < 4; i++ ) … … 436 463 #endif 437 464 } 465 #if !SEC_INTER_SDC_G0101 438 466 #if H_3D_INTER_SDC 439 467 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; } 468 #endif 440 469 #endif 441 470 m_pcCUAboveLeft = NULL; … … 584 613 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 585 614 #endif 586 #if H_3D_INTER_SDC 615 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 587 616 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 588 617 #endif … … 655 684 #if H_3D_DIM_SDC 656 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 657 692 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 658 693 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 659 694 #endif 660 695 #endif 661 #if H_3D_INTER_SDC 696 #endif 697 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 662 698 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 663 699 for( Int i = 0; i < 4; i++ ) … … 836 872 #if H_3D_DIM_SDC 837 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 838 880 m_apSegmentDCOffset[0][ui] = 0; 839 881 m_apSegmentDCOffset[1][ui] = 0; 840 882 #endif 841 883 #endif 842 #if H_3D_INTER_SDC 884 #endif 885 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 843 886 m_pbInterSDCFlag[ui] = false; 844 887 for( Int i = 0; i < 4; i++ ) … … 958 1001 #if H_3D_DIM_SDC 959 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 960 1009 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 961 1010 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 962 1011 #endif 963 1012 #endif 964 #if H_3D_INTER_SDC 1013 #endif 1014 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 965 1015 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 966 1016 for( Int i = 0; i < 4; i++ ) … … 1044 1094 #if H_3D_DIM_SDC 1045 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 1046 1102 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 1047 1103 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 1048 1104 #endif 1049 1105 #endif 1050 #if H_3D_INTER_SDC 1106 #endif 1107 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1051 1108 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 1052 1109 for( Int i = 0; i < 4; i++ ) … … 1208 1265 #if H_3D_DIM_SDC 1209 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 1210 1273 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1211 1274 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1212 1275 #endif 1213 1276 #endif 1214 #if H_3D_INTER_SDC 1277 #endif 1278 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1215 1279 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1216 1280 for( Int i = 0; i < 4; i++ ) … … 1420 1484 #if H_3D_DIM_SDC 1421 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 1422 1492 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1423 1493 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1424 1494 #endif 1425 1495 #endif 1426 #if H_3D_INTER_SDC 1496 #endif 1497 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1427 1498 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1428 1499 for( Int i = 0; i < 4; i++ ) … … 1550 1621 #if H_3D_DIM_SDC 1551 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 1552 1629 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1553 1630 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1554 1631 #endif 1555 1632 #endif 1556 #if H_3D_INTER_SDC 1633 #endif 1634 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1557 1635 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1558 1636 for( Int i = 0;i < 4; i++ ) … … 1667 1745 #if H_3D_DIM_SDC 1668 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 1669 1753 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1670 1754 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1671 1755 #endif 1672 1756 #endif 1673 #if H_3D_INTER_SDC 1757 #endif 1758 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1674 1759 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1675 1760 for( Int i = 0; i < 4; i++ ) … … 2504 2589 2505 2590 #if H_3D_INTER_SDC 2591 #if !QC_SDC_UNIFY_G0130 2506 2592 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2507 2593 { … … 2513 2599 return 0; 2514 2600 } 2515 2601 #endif 2602 2603 #if !SEC_INTER_SDC_G0101 2516 2604 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ) 2517 2605 { … … 2611 2699 } 2612 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 2613 2742 2614 2743 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) … … 2838 2967 if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 2839 2968 return false; 2840 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 2841 2982 // check prediction mode 2842 2983 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); -
branches/HTM-9.3-dev0/source/Lib/TLibCommon/TComDataCU.h
r826 r827 232 232 #if H_3D_DIM_SDC 233 233 Bool* m_pbSDCFlag; 234 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 235 Pel* m_apSegmentDCOffset[4]; 236 #else 234 237 Pel* m_apSegmentDCOffset[2]; 235 238 #endif 236 239 #endif 240 #endif 237 241 #if H_3D_INTER_SDC 242 #if !QC_SDC_UNIFY_G0130 238 243 Bool* m_pbInterSDCFlag; 239 244 Int* m_apSegmentInterDCOffset[4]; 245 #endif 246 #if !SEC_INTER_SDC_G0101 240 247 UChar* m_pucInterSDCMask; 248 #endif 241 249 #endif 242 250 #if H_3D_DBBP … … 619 627 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 620 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 621 633 #endif 622 634 #endif 623 635 #if H_3D_INTER_SDC 636 #if !QC_SDC_UNIFY_G0130 624 637 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 625 638 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } … … 630 643 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } 631 644 645 #endif 646 #if !SEC_INTER_SDC_G0101 632 647 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); 633 648 634 649 UChar* getInterSDCMask () { return m_pucInterSDCMask; } 650 #endif 635 651 #endif 636 652 -
branches/HTM-9.3-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r821 r827 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 } … … 2464 2485 if( bL == bT ) 2465 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 2466 2492 refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : 1<<( g_bitDepthY - 1 ); 2493 #endif 2467 2494 refDC2 = ( ptrSrc[ -1] + ptrSrc[-(Int)srcStride] )>>1; 2468 2495 } … … 2566 2593 Int iSumPix[2]; 2567 2594 memset(iSumPix, 0, sizeof(Int)*2); 2568 2595 #if QC_GENERIC_SDC_G0122 2596 for( Int i = 0; i < uiNumSegments; i++ ) 2597 { 2598 rpSegMeans[i] = 0; 2599 } 2600 #endif 2569 2601 if (orgDC == false) 2570 2602 { … … 2581 2613 rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ]; 2582 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 2583 2650 else if (uiIntraMode == PLANAR_IDX) 2651 #endif 2584 2652 { 2585 2653 Pel* pLeftTop = pOrig; -
branches/HTM-9.3-dev0/source/Lib/TLibCommon/TComPrediction.h
r816 r827 171 171 #if H_3D_DIM 172 172 // Depth intra 173 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 ); 174 178 #if H_3D_DIM_SDC 175 179 Void analyzeSegmentsSDC ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride -
branches/HTM-9.3-dev0/source/Lib/TLibCommon/TComRdCost.cpp
r823 r827 637 637 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 638 638 639 #if SCU_HS_VSD_BUGFIX_IMPROV_G0163 640 cDtParam.bitDepth = g_bitDepthY; 641 #endif 639 642 Dist dist = cDtParam.DistFunc( &cDtParam ); 640 643 … … 3021 3024 dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff; 3022 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 3023 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 3024 3032 iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5)); 3025 3033 -
branches/HTM-9.3-dev0/source/Lib/TLibCommon/TypeDef.h
r826 r827 227 227 #endif 228 228 229 #define SCU_HS_VSD_BUGFIX_IMPROV_G0163 1 229 230 //// ****** NEIGHBOURING BLOCK-BASED DISPARITY VECTOR ********* 230 231 #if H_3D_NBDV … … 253 254 #define H_3D_DIM_DLT 1 // Depth Lookup Table 254 255 256 #define SCU_HS_DEPTH_DC_PRED_G0143 1 255 257 #if H_3D_DIM_DLT 256 258 #define H_3D_DELTA_DLT 1 257 259 #endif 258 260 #define QC_GENERIC_SDC_G0122 1 // Generalize SDC to all depth intra modes 261 #if H_3D_DIM_SDC && H_3D_INTER_SDC 262 #define QC_SDC_UNIFY_G0130 1 // Unify intra SDC and inter SDC 263 #define QC_SDC_UNIFY_G0130_FIX 1 // Fix bug of G0130 264 #endif 265 #define SEC_INTER_SDC_G0101 1 // Improved inter SDC with multiple DC candidates 259 266 #define H_3D_DIM_ENC 1 // Depth Intra encoder optimizations, includes: 260 267 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 261 268 // LG_ZEROINTRADEPTHRESI_A0087 269 #endif 270 #define QC_PKU_SDC_SPLIT_G0123 1 // Intra SDC Split 271 #if QC_PKU_SDC_SPLIT_G0123 272 #define HS_TSINGHUA_SDC_SPLIT_G0111 1 262 273 #endif 263 274 ///// ***** VIEW SYNTHESIS PREDICTION ********* -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r816 r827 2787 2787 #endif 2788 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 2789 2800 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2790 2801 { … … 2796 2807 assert(0); 2797 2808 } 2809 #endif 2798 2810 #endif 2799 2811 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r816 r827 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 128 133 #endif 129 134 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r826 r827 551 551 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 552 552 553 #if QC_SDC_UNIFY_G0130 554 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 555 #endif 553 556 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 554 557 { … … 570 573 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 571 574 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 572 #if H_3D_INTER_SDC 575 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 573 576 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 574 577 #endif … … 649 652 #endif 650 653 #if H_3D_INTER_SDC 654 #if QC_SDC_UNIFY_G0130 655 if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) ) 656 #else 651 657 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 658 #endif 652 659 { 653 660 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); … … 712 719 UInt uiWidth = pcCU->getWidth ( 0 ); 713 720 UInt uiHeight = pcCU->getHeight( 0 ); 721 #if !SEC_INTER_SDC_G0101 714 722 UChar* pMask = pcCU->getInterSDCMask(); 715 723 716 724 memset( pMask, 0, uiWidth*uiHeight ); 717 725 pcCU->xSetInterSDCCUMask( pcCU, pMask ); 726 #endif 718 727 719 728 Pel *pResi; … … 726 735 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 727 736 { 737 #if SEC_INTER_SDC_G0101 738 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 ); 739 #else 728 740 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 729 730 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 731 747 } 732 748 pResi += uiResiStride; … … 1072 1088 UInt uiWidth = pcCU->getWidth ( 0 ); 1073 1089 UInt uiHeight = pcCU->getHeight ( 0 ); 1074 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 1075 1151 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 1076 1152 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; … … 1092 1168 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1093 1169 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1170 #endif 1094 1171 1095 1172 //===== init availability pattern ===== 1096 1173 Bool bAboveAvail = false; 1097 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 1098 1179 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 1099 1180 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1100 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 1101 1190 //===== get prediction signal ===== 1102 1191 #if H_3D_DIM 1103 1192 if( isDimMode( uiLumaPredMode ) ) 1104 1193 { 1105 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 1106 1207 } 1107 1208 else … … 1112 1213 } 1113 1214 #endif 1114 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 1115 1249 // number of segments depends on prediction mode 1116 1250 UInt uiNumSegments = 1; … … 1129 1263 uiMaskStride = pcWedgelet->getStride(); 1130 1264 } 1131 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 1132 1278 // get DC prediction for each segment 1133 1279 Pel apDCPredValues[2]; … … 1191 1337 pRecCr += uiStrideC; 1192 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 1193 1346 } 1194 1347 #endif -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r826 r827 797 797 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 798 798 UInt uiChromaOffset = uiLumaOffset>>2; 799 799 #if QC_SDC_UNIFY_G0130 800 800 #if H_3D_DIM_SDC 801 if( pcCU->getSDCFlag( uiAbsPartIdx ) )801 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) 802 802 { 803 803 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 806 806 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 807 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 ); 808 853 return; 809 854 } … … 821 866 } 822 867 #endif 868 #endif 823 869 824 870 if( pcCU->isIntra(uiAbsPartIdx) ) … … 844 890 845 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 846 922 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 847 923 { … … 882 958 } 883 959 #endif 884 960 #endif 885 961 #if H_3D_DBBP 886 962 Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r816 r827 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 100 105 #endif 101 106 #if H_3D_DBBP … … 182 187 #endif 183 188 #if H_3D_INTER_SDC 189 #if QC_SDC_UNIFY_G0130 190 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 191 #else 184 192 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 185 193 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 186 194 #endif 195 #endif 187 196 #if H_3D_DBBP 188 197 Void decodeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r826 r827 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) 101 110 #endif 102 111 #if H_3D_DBBP … … 173 182 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 174 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 175 190 #if H_3D_DIM_DMM 176 191 m_cDmm1DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM1_DATA ); … … 181 196 #endif 182 197 #endif 183 #if H_3D_INTER_SDC 198 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 184 199 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 185 200 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 186 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 ); 187 205 #endif 188 206 #if H_3D_DBBP … … 245 263 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 246 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 247 271 #if H_3D_DIM_DMM 248 272 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 253 277 #endif 254 278 #endif 255 #if H_3D_INTER_SDC 279 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 256 280 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 257 281 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 258 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 ); 259 286 #endif 260 287 #if H_3D_DBBP … … 1018 1045 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1019 1046 #if H_3D_DIM_SDC 1047 #if QC_GENERIC_SDC_G0122 1048 if( 1 ) // This should be cleaned up. 1049 #else 1020 1050 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1051 #endif 1021 1052 #endif 1022 1053 { … … 1036 1067 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1037 1068 #if H_3D_DIM_SDC 1069 #if QC_GENERIC_SDC_G0122 1070 if( 1 ) // This should be cleaned up. 1071 #else 1038 1072 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1073 #endif 1039 1074 #endif 1040 1075 { … … 1139 1174 } 1140 1175 1176 #if !QC_SDC_UNIFY_G0130 1141 1177 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1142 1178 { 1143 1179 UInt symbol; 1180 #if QC_GENERIC_SDC_G0122 1181 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1; 1182 #else 1144 1183 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1184 #endif 1145 1185 1146 1186 if( pcCU->getSDCFlag( absPartIdx ) ) … … 1178 1218 } 1179 1219 } 1180 1220 #endif 1181 1221 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); 1182 1222 } 1183 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 1184 1266 Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 1185 1267 { … … 1244 1326 #endif 1245 1327 } 1328 #endif 1246 1329 #endif 1247 1330 … … 2198 2281 2199 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 2200 2371 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2201 2372 { … … 2231 2402 pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx ); 2232 2403 } 2404 #endif 2233 2405 #endif 2234 2406 -
branches/HTM-9.3-dev0/source/Lib/TLibDecoder/TDecSbac.h
r816 r827 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 116 121 #endif 117 122 #if H_3D_DBBP … … 214 219 ContextModel3DBuffer m_cDdcFlagSCModel; 215 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 216 227 #if H_3D_DIM_DMM 217 228 ContextModel3DBuffer m_cDmm1DataSCModel; … … 222 233 #endif 223 234 #endif 224 #if H_3D_INTER_SDC 235 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 225 236 ContextModel3DBuffer m_cInterSDCFlagSCModel; 226 237 ContextModel3DBuffer m_cInterSDCResidualSCModel; 227 238 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 228 239 #endif 240 #if QC_SDC_UNIFY_G0130 241 ContextModel3DBuffer m_cSDCFlagSCModel; 242 #endif 229 243 #if H_3D_DBBP 230 244 ContextModel3DBuffer m_cDBBPFlagSCModel; -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r816 r827 2527 2527 2528 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 2529 2540 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2530 2541 { … … 2536 2547 assert(0); 2537 2548 } 2549 #endif 2538 2550 #endif 2539 2551 -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r816 r827 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 142 147 #endif 143 148 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r826 r827 1640 1640 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1641 1641 1642 #if QC_SDC_UNIFY_G0130 1643 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1644 #endif 1642 1645 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1643 1646 { … … 1667 1670 #endif 1668 1671 #endif 1669 #if H_3D_INTER_SDC 1672 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1670 1673 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1671 1674 #endif … … 2049 2052 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2050 2053 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2054 #if H_3D_SPIVMP 2051 2055 } 2056 #endif 2052 2057 // do MC 2053 2058 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 2094 2099 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 2095 2100 { 2101 #if SEC_INTER_SDC_G0101 2102 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2103 { 2104 if( rpcTempCU != rpcTempCUPre ) 2105 { 2106 rpcTempCU->initEstData( uhDepth, orgQP ); 2107 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2108 } 2109 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2110 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2111 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2112 #if H_3D_VSO //M2 2113 if( m_pcRdCost->getUseRenModel() ) 2114 { //Reset 2115 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 2116 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); 2117 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr (); 2118 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 2119 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2120 } 2121 #endif 2122 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2123 m_ppcOrigYuv[uhDepth], 2124 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2125 m_ppcResiYuvTemp[uhDepth], 2126 m_ppcRecoYuvTemp[uhDepth], 2127 uiOffest, 2128 uhDepth ); 2129 2130 xCheckDQP( rpcTempCU ); 2131 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2132 } 2133 #else 2096 2134 if( rpcTempCU != rpcTempCUPre ) 2097 2135 { … … 2121 2159 xCheckDQP( rpcTempCU ); 2122 2160 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2161 #endif 2123 2162 } 2124 2163 #endif … … 2331 2370 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2332 2371 #if H_3D_INTER_SDC 2372 #if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC 2373 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N) 2374 #else 2333 2375 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2334 { 2376 #endif 2377 { 2378 #if SEC_INTER_SDC_G0101 2379 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2380 { 2381 if( rpcTempCU != rpcTempCUPre ) 2382 { 2383 Int orgQP = rpcBestCU->getQP( 0 ); 2384 rpcTempCU->initEstData( uhDepth, orgQP ); 2385 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2386 } 2387 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2388 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2389 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2390 #if H_3D_VSO // M3 2391 if( m_pcRdCost->getUseRenModel() ) 2392 { 2393 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2394 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2395 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2396 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2397 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2398 } 2399 #endif 2400 2401 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2402 m_ppcOrigYuv[uhDepth], 2403 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2404 m_ppcResiYuvTemp[uhDepth], 2405 m_ppcRecoYuvTemp[uhDepth], 2406 uiOffest, 2407 uhDepth ); 2408 2409 xCheckDQP( rpcTempCU ); 2410 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2411 } 2412 #else 2335 2413 if( rpcTempCU != rpcTempCUPre ) 2336 2414 { … … 2362 2440 xCheckDQP( rpcTempCU ); 2363 2441 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2442 #endif 2364 2443 } 2365 2444 #endif … … 2605 2684 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2606 2685 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2686 #if QC_SDC_UNIFY_G0130 2687 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2688 #endif 2607 2689 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2608 2690 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); … … 2694 2776 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2695 2777 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2778 #if QC_SDC_UNIFY_G0130 2779 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2780 #endif 2696 2781 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2697 2782 -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r826 r827 679 679 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 680 680 UInt uiChromaOffset = uiLumaOffset>>2; 681 681 #if QC_SDC_UNIFY_G0130 682 682 #if H_3D_DIM_SDC 683 if( pcCU->getSDCFlag( uiAbsPartIdx ) )683 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) ) 684 684 { 685 685 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 688 688 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 689 689 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 690 return;691 690 } 692 691 #endif 693 692 694 693 #if H_3D_INTER_SDC 695 if( pcCU->get InterSDCFlag( uiAbsPartIdx ) )694 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) 696 695 { 697 696 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 698 697 assert( !pcCU->isIntra( uiAbsPartIdx) ); 699 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() ); 700 745 701 746 encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false ); 702 747 return; 703 748 } 749 #endif 704 750 #endif 705 751 … … 855 901 856 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 857 940 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 858 941 { … … 902 985 } 903 986 #endif 904 987 #endif 905 988 #if H_3D_DBBP 906 989 Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r816 r827 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 99 104 #endif 100 105 #if H_3D_DBBP … … 189 194 #endif 190 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 191 200 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 192 201 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); 202 #endif 193 203 #endif 194 204 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r826 r827 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) 107 116 #endif 108 117 #if H_3D_DBBP … … 171 180 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 172 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 173 188 #if H_3D_DIM_DMM 174 189 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 179 194 #endif 180 195 #endif 181 #if H_3D_INTER_SDC 196 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 182 197 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 183 198 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 184 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 ); 185 203 #endif 186 204 #if H_3D_DBBP … … 224 242 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 225 243 #endif 226 #if H_3D_INTER_SDC 244 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 227 245 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 228 246 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 229 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 ); 230 251 #endif 231 252 #if H_3D_DBBP … … 261 282 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG ); 262 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 263 290 #if H_3D_DIM_DMM 264 291 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); … … 326 353 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 327 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 328 361 #if H_3D_DIM_DMM 329 362 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 334 367 #endif 335 368 #endif 336 #if H_3D_INTER_SDC 369 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 337 370 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 338 371 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 339 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 ); 340 376 #endif 341 377 #if H_3D_DBBP … … 641 677 this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel ); 642 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 643 685 } 644 686 #endif … … 1131 1173 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1132 1174 #if H_3D_DIM_SDC 1175 #if QC_GENERIC_SDC_G0122 1176 if( 1 ) 1177 #else 1133 1178 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1179 #endif 1134 1180 #endif 1135 1181 { … … 1157 1203 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1158 1204 #if H_3D_DIM_SDC 1205 #if QC_GENERIC_SDC_G0122 1206 if( 1 ) 1207 #else 1159 1208 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1209 #endif 1160 1210 #endif 1161 1211 { … … 1256 1306 default: break; 1257 1307 } 1258 1308 #if !QC_SDC_UNIFY_G0130 1259 1309 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1260 1310 { 1261 1311 UInt dimDeltaDC; 1262 1312 Pel deltaDC; 1313 #if QC_GENERIC_SDC_G0122 1314 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1; 1315 #else 1263 1316 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1317 #endif 1264 1318 if( pcCU->getSDCFlag( absPartIdx ) ) 1265 1319 { … … 1289 1343 } 1290 1344 } 1291 } 1292 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 1293 1378 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1294 1379 { … … 1331 1416 } 1332 1417 } 1418 #endif 1333 1419 #endif 1334 1420 … … 2252 2338 2253 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 2254 2414 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2255 2415 { … … 2273 2433 } 2274 2434 #endif 2435 #endif 2275 2436 2276 2437 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSbac.h
r816 r827 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 158 163 #endif 159 164 #if H_3D_DBBP … … 250 255 ContextModel3DBuffer m_cDdcFlagSCModel; 251 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 252 263 #if H_3D_DIM_DMM 253 264 ContextModel3DBuffer m_cDmm1DataSCModel; … … 258 269 #endif 259 270 #endif 260 #if H_3D_INTER_SDC 271 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 261 272 ContextModel3DBuffer m_cInterSDCFlagSCModel; 262 273 ContextModel3DBuffer m_cInterSDCResidualSCModel; 263 274 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 264 275 #endif 276 #if QC_SDC_UNIFY_G0130 277 ContextModel3DBuffer m_cSDCFlagSCModel; 278 #endif 265 279 #if H_3D_DBBP 266 280 ContextModel3DBuffer m_cDBBPFlagSCModel; -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r826 r827 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 m_pcEntropyCoder->encodePartSize( pcCU, 0, true ); 2223 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2224 #else 2014 2225 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2226 #endif 2015 2227 2016 2228 // encode pred direction + DC residual data 2017 2229 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2230 #if QC_SDC_UNIFY_G0130 2231 Bool bDummy = false; 2232 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy ); 2233 #endif 2018 2234 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2019 2235 … … 2024 2240 #endif 2025 2241 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2242 #if QC_GENERIC_SDC_G0122 2243 #if HS_TSINGHUA_SDC_SPLIT_G0111 2244 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 2245 #else 2246 dmm4Segmentation->destroy(); delete dmm4Segmentation; 2247 #endif 2248 #endif 2026 2249 } 2027 2250 #endif … … 2901 3124 case( DMM4_IDX ): 2902 3125 { 3126 #if !QC_GENERIC_SDC_G0122 2903 3127 if( uiWidth > 4 ) 3128 #endif 2904 3129 { 2905 3130 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); … … 2957 3182 { 2958 3183 pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth ); 3184 #if QC_GENERIC_SDC_G0122 3185 for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ ) 3186 { 3187 if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 ) 3188 { 3189 continue; 3190 } 3191 #endif 2959 3192 #endif 2960 3193 … … 2966 3199 #if H_3D_DIM_SDC 2967 3200 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset); 3201 #endif 3202 #if QC_GENERIC_SDC_G0122 3203 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3204 { 3205 bTestZeroResi = false; 3206 } 2968 3207 #endif 2969 3208 #endif … … 3000 3239 3001 3240 // start encoding with SDC 3241 #if QC_GENERIC_SDC_G0122 3242 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3243 #else 3002 3244 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0)); 3245 #endif 3003 3246 } 3004 3247 else … … 3073 3316 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3074 3317 } 3318 #endif 3319 #if QC_GENERIC_SDC_G0122 3320 } // SDC residual loop 3075 3321 #endif 3076 3322 #if H_3D_DIM_SDC … … 5746 5992 5747 5993 #if H_3D_INTER_SDC 5994 #if SEC_INTER_SDC_G0101 5995 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth ) 5996 #else 5748 5997 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 5998 #endif 5749 5999 { 5750 6000 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) ) … … 5752 6002 return; 5753 6003 } 5754 6004 #if QC_SDC_UNIFY_G0130 6005 pcCU->setSDCFlagSubParts( true, 0, uiDepth ); 6006 #else 5755 6007 pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth ); 6008 #endif 5756 6009 5757 6010 UInt uiWidth = pcCU->getWidth ( 0 ); 5758 6011 UInt uiHeight = pcCU->getHeight( 0 ); 6012 #if SEC_INTER_SDC_G0101 6013 UInt uiSegSize = 0; 6014 #else 5759 6015 UChar* pMask = pcCU->getInterSDCMask(); 5760 6016 memset( pMask, 0, uiWidth*uiHeight ); … … 5763 6019 5764 6020 UInt uiSegSize[4] = { 0, 0, 0, 0 }; 6021 #endif 5765 6022 Pel *pPred, *pOrg; 5766 6023 UInt uiPredStride = pcPred->getStride(); 5767 6024 UInt uiOrgStride = pcOrg->getStride(); 5768 6025 UInt uiPelX, uiPelY; 6026 #if !SEC_INTER_SDC_G0101 5769 6027 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 5770 6028 UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 ); 6029 #endif 5771 6030 5772 6031 pPred = pcPred->getLumaAddr( 0 ); 5773 6032 pOrg = pcOrg->getLumaAddr( 0 ); 6033 #if SEC_INTER_SDC_G0101 6034 Int pResDC = 0; 6035 #else 5774 6036 Int pResDC[4] = { 0, 0, 0, 0}; 6037 #endif 5775 6038 5776 6039 //calculate dc value for prediction and original signal, and calculate residual and reconstruction … … 5779 6042 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5780 6043 { 6044 #if SEC_INTER_SDC_G0101 6045 pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 6046 uiSegSize++; 6047 #else 5781 6048 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5782 6049 pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5783 6050 uiSegSize[uiSeg]++; 6051 #endif 5784 6052 } 5785 6053 pOrg += uiOrgStride; … … 5787 6055 } 5788 6056 6057 #if SEC_INTER_SDC_G0101 6058 Int iResiOffset = ( pResDC > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) ); 6059 pResDC = ( pResDC + iResiOffset ) / (Int) uiSegSize; 6060 6061 pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 ); 6062 #else 5789 6063 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5790 6064 { 5791 6065 Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) ); 5792 6066 pResDC [uiSeg] = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg]; 5793 6067 #if QC_SDC_UNIFY_G0130 6068 pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 6069 #else 5794 6070 pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5795 } 6071 #endif 6072 } 6073 #endif 5796 6074 5797 6075 Pel *pRec; … … 5804 6082 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5805 6083 { 6084 #if SEC_INTER_SDC_G0101 6085 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) ); 6086 #else 5806 6087 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5807 6088 assert( uiSeg < uiSegmentNum ); 5808 6089 5809 6090 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] ); 6091 #endif 5810 6092 } 5811 6093 pPred += uiPredStride; … … 5847 6129 #endif 5848 6130 6131 #if QC_SDC_UNIFY_G0130 6132 Bool bNonSkip = false; 6133 #else 5849 6134 Bool bNonSkip = true; 6135 #endif 6136 #if SEC_INTER_SDC_G0101 6137 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0; 6138 #else 5850 6139 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5851 6140 { 6141 #if QC_SDC_UNIFY_G0130 6142 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 6143 #else 5852 6144 bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 5853 } 6145 #endif 6146 } 6147 #endif 5854 6148 5855 6149 if( !bNonSkip ) … … 7068 7362 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 7069 7363 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 7364 #if QC_SDC_UNIFY_G0130 7365 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7366 #endif 7070 7367 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 7071 7368 #if !SEC_IC_ARP_SIG_G0072 … … 7082 7379 #endif 7083 7380 #endif 7084 #if H_3D_INTER_SDC 7381 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 7085 7382 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 7086 7383 #endif -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSearch.h
r773 r827 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
Note: See TracChangeset for help on using the changeset viewer.