Changeset 1209 in 3DVCSoftware for branches/HTM-14.1-update-dev1-HHI/source
- Timestamp:
- 13 May 2015, 15:16:14 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1-HHI/source
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1-HHI/source/App/TAppDecoder/TAppDecTop.cpp
r1200 r1209 528 528 // initialize global variables 529 529 initROM(); 530 #if H_3D_DIM_DMM530 #if NH_3D_DMM 531 531 initWedgeLists(); 532 532 #endif -
branches/HTM-14.1-update-dev1-HHI/source/App/TAppEncoder/TAppEncCfg.cpp
r1200 r1209 1773 1773 // allocate slice-based dQP values 1774 1774 #if NH_MV 1775 for (Int i = m_layerIdInNuh.size(); i < m_numberOfLayers; i++ )1775 for (Int i = (Int)m_layerIdInNuh.size(); i < m_numberOfLayers; i++ ) 1776 1776 { 1777 1777 m_layerIdInNuh.push_back( i == 0 ? 0 : m_layerIdInNuh[ i - 1 ] + 1 ); -
branches/HTM-14.1-update-dev1-HHI/source/App/TAppEncoder/TAppEncTop.cpp
r1200 r1209 811 811 // initialize global variables 812 812 initROM(); 813 #if H_3D_DIM_DMM813 #if NH_3D_DMM 814 814 initWedgeLists( true ); 815 815 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/ContextTables.h
r1200 r1209 173 173 #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' 174 174 175 #if H_3D_DIM 176 #define NUM_DEPTH_INTRA_MODE_CTX 1 ///< number of context models for depth intra modes 177 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (DMM or RBC) 178 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or RBC) 179 #if H_3D_DIM_DMM 180 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 181 #endif 182 #define NUM_ANGLE_FLAG_CTX 1 183 #endif 184 175 #if NH_3D_DMM 176 #define NUM_NOTDMM_FLAG_CTX 1 ///< number of context models for not-DMM flag 177 #define NUM_DMM_MODE_CTX 1 ///< number of context models for DMM modes 178 #endif 179 #if NH_3D_DMM || NH_3D_SDC 180 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or SDC) 181 #endif 185 182 #if H_3D_DIM_SDC 186 183 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 187 184 #define SDC_NUM_RESIDUAL_CTX 1 188 185 #define NUM_SDC_FLAG_CTX 1 ///< number of context 186 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (SDC only) 189 187 #endif 190 188 #if H_3D_DBBP … … 562 560 563 561 #endif 564 #if H_3D_DIM 565 static const UChar 566 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = 567 { 568 { 154, }, 569 { 154, }, 570 { 154, } 571 }; 572 562 563 #if NH_3D_DMM 573 564 static const UChar 574 INIT_ ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =565 INIT_NOTDMM_FLAG[3][NUM_NOTDMM_FLAG_CTX] = 575 566 { 576 567 { 154 }, … … 578 569 { 155 }, 579 570 }; 580 571 static const UChar 572 INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] = 573 { 574 { CNU }, 575 { CNU }, 576 { CNU } 577 }; 578 #endif 579 #if NH_3D_DMM || NH_3D_SDC 580 static const UChar 581 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 582 { 583 { CNU }, 584 { CNU }, 585 { CNU }, 586 }; 587 #endif 588 #if H_3D_DIM_SDC 589 static const UChar 590 INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = 591 { 592 { CNU }, 593 { CNU }, 594 { CNU }, 595 }; 596 static const UChar 597 INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 598 { 599 { 155 }, 600 { 155 }, 601 { 155 }, 602 }; 603 static const UChar 604 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = 605 { 606 { 154 }, 607 { 154 }, 608 { 154 }, 609 }; 581 610 static const UChar 582 611 INIT_DDC_FLAG[3][NUM_DDC_FLAG_CTX] = … … 586 615 {64, CNU} 587 616 }; 588 static const UChar 589 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 590 { 591 { 154 }, 592 { 154 }, 593 { 154 }, 594 }; 595 #if H_3D_DIM_DMM 596 static const UChar 597 INIT_DMM1_DATA[3][NUM_DMM1_DATA_CTX] = 598 { 599 { CNU }, 600 { CNU }, 601 { CNU }, 602 }; 603 #endif 604 #if H_3D_DIM_SDC 605 static const UChar 606 INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = 607 { 608 { CNU }, 609 { CNU }, 610 { CNU }, 611 }; 612 static const UChar 613 INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 614 { 615 { 155 }, 616 { 155 }, 617 { 155 }, 618 }; 619 #endif 620 #endif 621 #if H_3D_DIM_SDC 622 static const UChar 623 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = 624 { 625 { 154 }, 626 { 154 }, 627 { 154 }, 628 }; 629 #endif 630 617 #endif 631 618 #if H_3D_DBBP 632 619 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] = -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComCodingStatistics.h
r1200 r1209 92 92 STATS__CABAC_BITS__ALIGNED_SIGN_BIT, 93 93 STATS__CABAC_BITS__ALIGNED_ESCAPE_BITS, 94 95 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 96 STATS__CABAC_BITS__DELTADC_SIGN_EP, 97 STATS__CABAC_BITS__DELTADC_PREFIX, 98 STATS__CABAC_BITS__DELTADC_SUFFIX_EP, 99 #endif 100 #if NH_3D_DMM 101 STATS__CABAC_BITS__NOTDMM_FLAG, 102 STATS__CABAC_BITS__DMMMODE, 103 STATS__CABAC_BITS__DMM1_BITS_EP, 104 #endif 105 94 106 STATS__NUM_STATS 95 107 }; … … 142 154 "CABAC_BITS__ALIGNED_SIGN_BIT", 143 155 "CABAC_BITS__ALIGNED_ESCAPE_BITS" 156 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 157 ,"STATS__CABAC_BITS__DELTADC_SIGN_EP" 158 ,"STATS__CABAC_BITS__DELTADC_PREFIX" 159 ,"STATS__CABAC_BITS__DELTADC_SUFFIX_EP" 160 #endif 161 #if NH_3D_DMM 162 ,"STATS__CABAC_BITS__NOTDMM_FLAG" 163 ,"STATS__CABAC_BITS__DMMMODE" 164 ,"STATS__CABAC_BITS__DMM1_BITS_EP" 165 #endif 144 166 }; 145 167 assert(STATS__NUM_STATS == sizeof(statNames)/sizeof(Char *) && name < STATS__NUM_STATS); -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComDataCU.cpp
r1200 r1209 104 104 } 105 105 106 #if H_3D_DIM 107 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 108 { 109 m_dimDeltaDC[i][0] = NULL; 110 m_dimDeltaDC[i][1] = NULL; 111 } 112 #if H_3D_DIM_DMM 113 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 114 { 115 m_dmmWedgeTabIdx[i] = NULL; 116 } 106 #if NH_3D_DMM 107 for( Int i = 0; i < NUM_DMM; i++ ) 108 { 109 m_dmmDeltaDC[i][0] = NULL; 110 m_dmmDeltaDC[i][1] = NULL; 111 } 112 m_dmm1WedgeTabIdx = NULL; 117 113 #endif 118 114 #if H_3D_DIM_SDC … … 120 116 m_apSegmentDCOffset[0] = NULL; 121 117 m_apSegmentDCOffset[1] = NULL; 122 #endif123 118 #endif 124 119 … … 255 250 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 256 251 #endif 257 #if H_3D_DIM 258 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 259 { 260 m_dimDeltaDC[i][0] = (Pel* )xMalloc(Pel, uiNumPartition); 261 m_dimDeltaDC[i][1] = (Pel* )xMalloc(Pel, uiNumPartition); 262 } 263 #if H_3D_DIM_DMM 264 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 265 { 266 m_dmmWedgeTabIdx[i] = (UInt*)xMalloc(UInt, uiNumPartition); 267 } 252 #if NH_3D_DMM 253 for( Int i = 0; i < NUM_DMM; i++ ) 254 { 255 m_dmmDeltaDC[i][0] = (Pel* )xMalloc(Pel, uiNumPartition); 256 m_dmmDeltaDC[i][1] = (Pel* )xMalloc(Pel, uiNumPartition); 257 } 258 m_dmm1WedgeTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 268 259 #endif 269 260 #if H_3D_DIM_SDC … … 271 262 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 272 263 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 273 #endif274 264 #endif 275 265 #if H_3D_DBBP … … 475 465 #endif 476 466 477 #if H_3D_DIM 478 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 479 { 480 if ( m_dimDeltaDC[i][0] ) { xFree( m_dimDeltaDC[i][0] ); m_dimDeltaDC[i][0] = NULL; } 481 if ( m_dimDeltaDC[i][1] ) { xFree( m_dimDeltaDC[i][1] ); m_dimDeltaDC[i][1] = NULL; } 482 } 483 #if H_3D_DIM_DMM 484 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 485 { 486 if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; } 487 } 467 #if NH_3D_DMM 468 for( Int i = 0; i < NUM_DMM; i++ ) 469 { 470 if ( m_dmmDeltaDC[i][0] ) { xFree( m_dmmDeltaDC[i][0] ); m_dmmDeltaDC[i][0] = NULL; } 471 if ( m_dmmDeltaDC[i][1] ) { xFree( m_dmmDeltaDC[i][1] ); m_dmmDeltaDC[i][1] = NULL; } 472 } 473 if ( m_dmm1WedgeTabIdx ) { xFree( m_dmm1WedgeTabIdx ); m_dmm1WedgeTabIdx = NULL; } 488 474 #endif 489 475 #if H_3D_DIM_SDC … … 491 477 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 492 478 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 493 #endif494 479 #endif 495 480 #if H_3D_DBBP … … 659 644 660 645 661 #if H_3D_DIM 662 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 663 { 664 memset( m_dimDeltaDC[i][0] + firstElement, 0, numElements * sizeof( *m_dimDeltaDC[i][0] ) ); 665 memset( m_dimDeltaDC[i][1] + firstElement, 0, numElements * sizeof( *m_dimDeltaDC[i][1] ) ); 666 } 667 #if H_3D_DIM_DMM 668 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 669 { 670 memset( m_dmmWedgeTabIdx[i] + firstElement, 0, numElements * sizeof( *m_dmmWedgeTabIdx[i] ) ); 671 } 646 647 #if NH_3D_DMM 648 for( Int i = 0; i < NUM_DMM; i++ ) 649 { 650 memset( m_dmmDeltaDC[i][0], 0, m_uiNumPartition * sizeof( *m_dmmDeltaDC[i][0] ) ); 651 memset( m_dmmDeltaDC[i][1], 0, m_uiNumPartition * sizeof( *m_dmmDeltaDC[i][1] ) ); 652 } 653 memset( m_dmm1WedgeTabIdx, 0, m_uiNumPartition * sizeof( *m_dmm1WedgeTabIdx ) ); 672 654 #endif 673 655 #if H_3D_DIM_SDC … … 675 657 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 676 658 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 677 # endif659 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 678 660 m_apDmmPredictor[0] = 0; 679 661 m_apDmmPredictor[1] = 0; 662 #endif 680 663 #endif 681 664 #if H_3D_DBBP … … 820 803 821 804 822 #if H_3D_DIM 823 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 824 { 825 m_dimDeltaDC[i][0] [ui] = 0; 826 m_dimDeltaDC[i][1] [ui] = 0; 827 } 828 #if H_3D_DIM_DMM 829 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 830 { 831 m_dmmWedgeTabIdx[i] [ui] = 0; 832 } 805 #if NH_3D_DMM 806 for( Int i = 0; i < NUM_DMM; i++ ) 807 { 808 m_dmmDeltaDC[i][0] [ui] = 0; 809 m_dmmDeltaDC[i][1] [ui] = 0; 810 } 811 m_dmm1WedgeTabIdx [ui] = 0; 833 812 #endif 834 813 #if H_3D_DIM_SDC … … 836 815 m_apSegmentDCOffset[0][ui] = 0; 837 816 m_apSegmentDCOffset[1][ui] = 0; 838 # endif817 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 839 818 m_apDmmPredictor[0] = 0; 840 819 m_apDmmPredictor[1] = 0; 820 #endif 841 821 #endif 842 822 #if H_3D_DBBP … … 929 909 memset( m_pbICFlag, 0, iSizeInBool ); 930 910 #endif 931 #if H_3D_DIM 932 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 933 { 934 memset( m_dimDeltaDC[i][0], 0, sizeof(Pel ) * m_uiNumPartition ); 935 memset( m_dimDeltaDC[i][1], 0, sizeof(Pel ) * m_uiNumPartition ); 936 } 937 #if H_3D_DIM_DMM 938 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 939 { 940 memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition ); 941 } 911 #if NH_3D_DMM 912 for( Int i = 0; i < NUM_DMM; i++ ) 913 { 914 memset( m_dmmDeltaDC[i][0], 0, sizeof(Pel ) * m_uiNumPartition ); 915 memset( m_dmmDeltaDC[i][1], 0, sizeof(Pel ) * m_uiNumPartition ); 916 } 917 memset( m_dmm1WedgeTabIdx, 0, sizeof(UInt) * m_uiNumPartition ); 942 918 #endif 943 919 #if H_3D_DIM_SDC … … 945 921 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 946 922 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 947 # endif923 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 948 924 m_apDmmPredictor[0] = 0; 949 925 m_apDmmPredictor[1] = 0; 926 #endif 950 927 #endif 951 928 #if H_3D_DBBP … … 989 966 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 990 967 #endif 991 #if H_3D_DIM 992 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 993 { 994 m_dimDeltaDC[i][0] [ui] = pcCU->m_dimDeltaDC[i][0] [uiPartOffset+ui]; 995 m_dimDeltaDC[i][1] [ui] = pcCU->m_dimDeltaDC[i][1] [uiPartOffset+ui]; 996 } 997 #if H_3D_DIM_DMM 998 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 999 { 1000 m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui]; 1001 } 968 #if NH_3D_DMM 969 for( Int i = 0; i < NUM_DMM; i++ ) 970 { 971 m_dmmDeltaDC[i][0] [ui] = pcCU->m_dmmDeltaDC[i][0] [uiPartOffset+ui]; 972 m_dmmDeltaDC[i][1] [ui] = pcCU->m_dmmDeltaDC[i][1] [uiPartOffset+ui]; 973 } 974 m_dmm1WedgeTabIdx [ui] = pcCU->m_dmm1WedgeTabIdx [uiPartOffset+ui]; 1002 975 #endif 1003 976 #if H_3D_DIM_SDC … … 1005 978 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 1006 979 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 1007 #endif1008 980 #endif 1009 981 #if H_3D_DBBP … … 1112 1084 m_explicitRdpcmMode[comp] = pcCU->getExplicitRdpcmMode(ComponentID(comp)) + uiPart; 1113 1085 } 1114 #if H_3D_DIM 1115 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 1116 { 1117 m_dimDeltaDC[i][0] = pcCU->getDimDeltaDC( i, 0 ) + uiPart; 1118 m_dimDeltaDC[i][1] = pcCU->getDimDeltaDC( i, 1 ) + uiPart; 1119 } 1120 #if H_3D_DIM_DMM 1121 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 1122 { 1123 m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart; 1124 } 1086 #if NH_3D_DMM 1087 for( Int i = 0; i < NUM_DMM; i++ ) 1088 { 1089 m_dmmDeltaDC[i][0] = pcCU->getDmmDeltaDC( (DmmID)i, 0 ) + uiPart; 1090 m_dmmDeltaDC[i][1] = pcCU->getDmmDeltaDC( (DmmID)i, 1 ) + uiPart; 1091 } 1092 m_dmm1WedgeTabIdx = pcCU->getDmm1WedgeTabIdx() + uiPart; 1125 1093 #endif 1126 1094 #if H_3D_DIM_SDC … … 1128 1096 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1129 1097 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1130 #endif1131 1098 #endif 1132 1099 #if H_3D_DBBP … … 1319 1286 memcpy( m_explicitRdpcmMode[comp] + uiOffset, pcCU->getExplicitRdpcmMode(ComponentID(comp)) , iSizeInUchar ); 1320 1287 } 1321 #if H_3D_DIM 1322 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 1323 { 1324 memcpy( m_dimDeltaDC[i][0] + uiOffset, pcCU->getDimDeltaDC( i, 0 ), sizeof(Pel ) * uiNumPartition ); 1325 memcpy( m_dimDeltaDC[i][1] + uiOffset, pcCU->getDimDeltaDC( i, 1 ), sizeof(Pel ) * uiNumPartition ); 1326 } 1327 #if H_3D_DIM_DMM 1328 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 1329 { 1330 memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition ); 1331 } 1288 #if NH_3D_DMM 1289 for( Int i = 0; i < NUM_DMM; i++ ) 1290 { 1291 memcpy( m_dmmDeltaDC[i][0] + uiOffset, pcCU->getDmmDeltaDC( (DmmID)i, 0 ), sizeof(Pel ) * uiNumPartition ); 1292 memcpy( m_dmmDeltaDC[i][1] + uiOffset, pcCU->getDmmDeltaDC( (DmmID)i, 1 ), sizeof(Pel ) * uiNumPartition ); 1293 } 1294 memcpy( m_dmm1WedgeTabIdx + uiOffset, pcCU->getDmm1WedgeTabIdx(), sizeof(UInt) * uiNumPartition ); 1332 1295 #endif 1333 1296 #if H_3D_DIM_SDC … … 1335 1298 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1336 1299 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1337 #endif1338 1300 #endif 1339 1301 #if H_3D_DBBP … … 1447 1409 } 1448 1410 1449 #if H_3D_DIM 1450 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) 1451 { 1452 memcpy( rpcCU->getDimDeltaDC( i, 0 ) + m_uiAbsIdxInLCU, m_dimDeltaDC[i][0], sizeof(Pel ) * m_uiNumPartition ); 1453 memcpy( rpcCU->getDimDeltaDC( i, 1 ) + m_uiAbsIdxInLCU, m_dimDeltaDC[i][1], sizeof(Pel ) * m_uiNumPartition ); 1454 } 1455 #if H_3D_DIM_DMM 1456 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) 1457 { 1458 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition ); 1459 } 1411 #if NH_3D_DMM 1412 for( Int i = 0; i < NUM_DMM; i++ ) 1413 { 1414 memcpy( pCtu->getDmmDeltaDC( (DmmID)i, 0 ) + m_absZIdxInCtu, m_dmmDeltaDC[i][0], sizeof(Pel ) * m_uiNumPartition ); 1415 memcpy( pCtu->getDmmDeltaDC( (DmmID)i, 1 ) + m_absZIdxInCtu, m_dmmDeltaDC[i][1], sizeof(Pel ) * m_uiNumPartition ); 1416 } 1417 memcpy( pCtu->getDmm1WedgeTabIdx() + m_absZIdxInCtu, m_dmm1WedgeTabIdx, sizeof(UInt) * m_uiNumPartition ); 1460 1418 #endif 1461 1419 #if H_3D_DIM_SDC … … 1463 1421 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1464 1422 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1465 #endif1466 1423 #endif 1467 1424 #if H_3D_DBBP … … 1522 1479 memcpy( rpcCU->getSPIVMPFlag() + uiPartOffset, m_pbSPIVMPFlag, sizeof(Bool) * uiQNumPart ); 1523 1480 #endif 1524 #if H_3D_DIM1525 for( Int i = 0; i < DMM_NUM_TYPE; i++ )1526 {1527 memcpy( rpcCU->getDimDeltaDC( i, 0 ) + uiPartOffset, m_dimDeltaDC[i][0], sizeof(Pel ) * uiQNumPart );1528 memcpy( rpcCU->getDimDeltaDC( i, 1 ) + uiPartOffset, m_dimDeltaDC[i][1], sizeof(Pel ) * uiQNumPart );1529 }1530 #if H_3D_DIM_DMM1531 for( Int i = 0; i < DMM_NUM_TYPE; i++ )1532 {1533 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart );1534 }1535 #endif1536 1481 #if H_3D_DIM_SDC 1537 1482 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1538 1483 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1539 1484 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1540 #endif1541 1485 #endif 1542 1486 #if H_3D_DBBP … … 1952 1896 } 1953 1897 iLeftIntraDir = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX; 1954 #if H_3D_DIM1955 mapD epthModeToIntraDir( iLeftIntraDir );1898 #if NH_3D_DMM 1899 mapDmmToIntraDir( iLeftIntraDir ); 1956 1900 #endif 1957 1901 … … 1964 1908 } 1965 1909 iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX; 1966 #if H_3D_DIM1967 mapD epthModeToIntraDir( iAboveIntraDir );1910 #if NH_3D_DMM 1911 mapDmmToIntraDir( iAboveIntraDir ); 1968 1912 #endif 1969 1913 … … 2460 2404 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx ) 2461 2405 { 2406 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 2407 if( getSlice()->getIsDepth() && isIntra(uiAbsPartIdx) && getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ) 2408 { 2409 UInt lumaPredMode = getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ); 2410 if( lumaPredMode < NUM_INTRA_MODE ) { return true; } 2411 #if NH_3D_DMM 2412 if( isDmmMode( lumaPredMode ) ) { return true; } 2413 #endif 2414 } 2415 return false; 2416 #else 2462 2417 // check general CU information 2463 2418 if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) … … 2466 2421 } 2467 2422 2468 if( isD imMode( getLumaIntraDir( uiAbsPartIdx ) ) )2423 if( isDmmMode( getLumaIntraDir( uiAbsPartIdx ) ) ) 2469 2424 { 2470 2425 return true; … … 2479 2434 // check prediction mode 2480 2435 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 2481 if( uiLumaPredMode == PLANAR_IDX || ( getD imType( uiLumaPredMode ) == DMM1_IDX ) )2436 if( uiLumaPredMode == PLANAR_IDX || ( getDmmType( uiLumaPredMode ) == DMM1_IDX ) ) 2482 2437 return true; 2483 2438 2484 2439 // else 2485 2440 return false; 2441 #endif 2486 2442 } 2487 2443 #endif … … 5637 5593 5638 5594 UInt uiDirMode = getIntraDir(toChannelType(compID), uiAbsPartIdx); 5639 5640 #if H_3D_DIM 5641 mapDepthModeToIntraDir( uiDirMode ); 5595 #if NH_3D_DMM 5596 mapDmmToIntraDir( uiDirMode ); 5642 5597 #endif 5643 5598 … … 5647 5602 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 5648 5603 uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU)); 5649 #if H_3D_DIM5650 mapDepthModeToIntraDir( uiDirMode );5604 #if NH_3D_DMM 5605 mapDmmToIntraDir( uiDirMode ); 5651 5606 #endif 5652 5607 } … … 6732 6687 } 6733 6688 #endif 6734 #if H_3D_DIM_DMM 6735 Void TComDataCU::setDmmWedgeTabIdxSubParts( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ) 6736 { 6737 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 6738 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 6739 { 6740 m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; 6741 } 6689 #if NH_3D_DMM 6690 Void TComDataCU::setDmm1WedgeTabIdxSubParts( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth ) 6691 { 6692 UInt uiCurrPartNumb = m_pcPic->getNumPartitionsInCtu() >> (uiDepth << 1); 6693 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm1WedgeTabIdx[uiAbsPartIdx+ui] = tabIdx; } 6742 6694 } 6743 6695 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComDataCU.h
r1200 r1209 182 182 Bool* m_pbICFlag; ///< array of IC flags 183 183 #endif 184 #if H_3D_DIM 185 Pel* m_dimDeltaDC[DIM_NUM_TYPE][2]; 186 #if H_3D_DIM_DMM 187 UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 184 #if NH_3D_DMM 185 Pel* m_dmmDeltaDC[NUM_DMM][2]; 186 UInt* m_dmm1WedgeTabIdx; 188 187 #endif 189 188 #if H_3D_DIM_SDC 190 189 Bool* m_pbSDCFlag; 191 190 Pel* m_apSegmentDCOffset[2]; 191 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 192 192 Pel m_apDmmPredictor[2]; 193 193 #endif … … 553 553 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); 554 554 555 #if H_3D_DIM 556 Pel* getDimDeltaDC ( UInt dimType, UInt segId ) { return m_dimDeltaDC[dimType][segId]; } 557 Pel getDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx ) { return m_dimDeltaDC[dimType][segId][uiIdx]; } 558 Void setDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val; } 559 #if H_3D_DIM_DMM 560 UInt* getDmmWedgeTabIdx ( UInt dmmType ) { return m_dmmWedgeTabIdx[dmmType]; } 561 UInt getDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx ) { return m_dmmWedgeTabIdx[dmmType][uiIdx]; } 562 Void setDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; } 563 Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); 564 555 #if NH_3D_DMM 556 Pel* getDmmDeltaDC ( DmmID dmmType, UInt segId ) { return m_dmmDeltaDC[dmmType][segId]; } 557 Pel getDmmDeltaDC ( DmmID dmmType, UInt segId, UInt uiIdx ) { return m_dmmDeltaDC[dmmType][segId][uiIdx]; } 558 Void setDmmDeltaDC ( DmmID dmmType, UInt segId, UInt uiIdx, Pel val ) { m_dmmDeltaDC[dmmType][segId][uiIdx] = val; } 559 560 UInt* getDmm1WedgeTabIdx () { return m_dmm1WedgeTabIdx; } 561 UInt getDmm1WedgeTabIdx ( UInt uiIdx ) { return m_dmm1WedgeTabIdx[uiIdx]; } 562 Void setDmm1WedgeTabIdx ( UInt uiIdx, UInt tabIdx ) { m_dmm1WedgeTabIdx[uiIdx] = tabIdx; } 563 Void setDmm1WedgeTabIdxSubParts ( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth ); 565 564 #endif 566 565 #if H_3D_DIM_SDC … … 574 573 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 575 574 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 575 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 576 576 Void setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; } 577 577 Pel getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; } 578 #endif 578 579 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 579 #endif580 580 #endif 581 581 … … 747 747 UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ; 748 748 749 #if H_3D_DIM 749 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 750 #if NH_3D_DMM 750 751 Bool isDMM1UpscaleMode ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; }; 751 752 UInt getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth = uiWidth; } return uiBaseWidth; } 752 753 #endif 753 754 #endif 754 755 }; 755 756 -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComPrediction.cpp
r1200 r1209 530 530 } 531 531 532 #if H_3D_DIM533 Void TComPrediction::predIntraLumaD epth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc, TComWedgelet* dmm4Segmentation)532 #if NH_3D_DMM 533 Void TComPrediction::predIntraLumaDmm( TComDataCU* pcCU, UInt uiAbsPartIdx, DmmID dmmType, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight ) 534 534 { 535 535 assert( iWidth == iHeight ); 536 assert( iWidth >= DIM_MIN_SIZE && iWidth <= DIM_MAX_SIZE ); 537 assert( isDimMode( uiIntraMode ) ); 538 539 UInt dimType = getDimType ( uiIntraMode ); 540 Bool isDmmMode = (dimType < DMM_NUM_TYPE); 541 542 Bool* biSegPattern = NULL; 543 UInt patternStride = 0; 544 545 // get partiton 546 #if H_3D_DIM_DMM 547 TComWedgelet* dmmSegmentation = NULL; 548 if( isDmmMode ) 549 { 550 switch( dimType ) 551 { 552 case( DMM1_IDX ): 553 { 554 dmmSegmentation = pcCU->isDMM1UpscaleMode((UInt)iWidth) ? 555 &(g_dmmWedgeLists[ g_aucConvertToBit[pcCU->getDMM1BasePatternWidth((UInt)iWidth)] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]) : 556 &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 557 } break; 558 case( DMM4_IDX ): 559 { 560 if( dmm4Segmentation == NULL ) 561 { 562 dmmSegmentation = new TComWedgelet( iWidth, iHeight ); 563 xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation ); 564 } 565 else 566 { 567 xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmm4Segmentation ); 568 dmmSegmentation = dmm4Segmentation; 569 } 570 } break; 571 default: assert(0); 572 } 573 assert( dmmSegmentation ); 574 if( dimType == DMM1_IDX && pcCU->isDMM1UpscaleMode((UInt)iWidth) ) 575 { 576 biSegPattern = dmmSegmentation->getScaledPattern((UInt)iWidth); 577 patternStride = iWidth; 578 } 579 else 580 { 581 biSegPattern = dmmSegmentation->getPattern(); 582 patternStride = dmmSegmentation->getStride (); 583 } 584 } 585 #endif 536 assert( iWidth >= DMM_MIN_SIZE && iWidth <= DMM_MAX_SIZE ); 537 #if H_3D_DIM_SDC 538 assert( !pcCU->getSDCFlag( uiAbsPartIdx ) ); 539 #endif 540 541 // get partition 542 Bool* biSegPattern = new Bool[ (UInt)(iWidth*iHeight) ]; 543 UInt patternStride = (UInt)iWidth; 544 switch( dmmType ) 545 { 546 case( DMM1_IDX ): { (getWedgeListScaled( (UInt)iWidth )->at( pcCU->getDmm1WedgeTabIdx( uiAbsPartIdx ) )).getPatternScaledCopy( (UInt)iWidth, biSegPattern ); } break; 547 case( DMM4_IDX ): { predContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, biSegPattern ); } break; 548 default: assert(0); 549 } 586 550 587 551 // get predicted partition values 588 assert( biSegPattern ); 589 Int* piMask = NULL; 590 piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering 591 assert( piMask ); 592 Int maskStride = 2*iWidth + 1; 593 Int* ptrSrc = piMask+maskStride+1; 594 Pel predDC1 = 0; Pel predDC2 = 0; 595 xPredBiSegDCs( ptrSrc, maskStride, biSegPattern, patternStride, predDC1, predDC2 ); 552 Pel predDC1 = 0, predDC2 = 0; 553 predBiSegDCs( pcCU, uiAbsPartIdx, iWidth, iHeight, biSegPattern, patternStride, predDC1, predDC2 ); 596 554 597 555 // set segment values with deltaDC offsets 598 Pel segDC1 = 0; 599 Pel segDC2 = 0; 600 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 601 { 602 Pel deltaDC1 = pcCU->getDimDeltaDC( dimType, 0, uiAbsPartIdx ); 603 Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx ); 604 #if H_3D_DIM_DMM 605 if( isDmmMode ) 606 { 556 Pel segDC1 = 0, segDC2 = 0; 557 Pel deltaDC1 = pcCU->getDmmDeltaDC( dmmType, 0, uiAbsPartIdx ); 558 Pel deltaDC2 = pcCU->getDmmDeltaDC( dmmType, 1, uiAbsPartIdx ); 607 559 #if H_3D_DIM_DLT 608 609 560 segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 ); 561 segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 ); 610 562 #else 611 segDC1 = ClipY( predDC1 + deltaDC1 ); 612 segDC2 = ClipY( predDC2 + deltaDC2 ); 613 #endif 614 } 615 #endif 616 } 617 else 618 { 619 segDC1 = predDC1; 620 segDC2 = predDC2; 621 } 563 segDC1 = ClipBD( predDC1 + deltaDC1, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 564 segDC2 = ClipBD( predDC2 + deltaDC2, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 565 #endif 622 566 623 567 // set prediction signal 624 568 Pel* pDst = piPred; 625 xAssignBiSegDCs( pDst, uiStride, biSegPattern, patternStride, segDC1, segDC2 ); 569 assignBiSegDCs( pDst, uiStride, biSegPattern, patternStride, segDC1, segDC2 ); 570 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 571 #if H_3D_DIM_SDC 626 572 pcCU->setDmmPredictor(segDC1, 0); 627 573 pcCU->setDmmPredictor(segDC2, 1); 628 629 #if H_3D_DIM_DMM 630 if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) 631 { 632 dmmSegmentation->destroy(); 633 delete dmmSegmentation; 634 } 635 #endif 574 #endif 575 #endif 576 delete[] biSegPattern; 636 577 } 637 578 #endif … … 2447 2388 #endif 2448 2389 2449 #if H_3D_DIM 2450 Void TComPrediction::xPredBiSegDCs( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 ) 2451 { 2390 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC 2391 #if NH_3D_SDC 2392 Void TComPrediction::predConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& predDC ) 2393 { 2394 Pel* pLeftTop = ptrSrc; 2395 Pel* pRightTop = ptrSrc + (uiSize-1); 2396 Pel* pLeftBottom = (ptrSrc+ (srcStride*(uiSize-1)) ); 2397 Pel* pRightBottom = (ptrSrc+ (srcStride*(uiSize-1)) + (uiSize-1)); 2398 predDC = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2; 2399 } 2400 #endif 2401 #else // PM: should be obsolete after cleanup 2402 #if H_3D_DIM_SDC 2403 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 2404 ,UInt uiIntraMode 2405 ,Bool orgDC 2406 ) 2407 { 2408 Int iSumDepth[2]; 2409 memset(iSumDepth, 0, sizeof(Int)*2); 2410 Int iSumPix[2]; 2411 memset(iSumPix, 0, sizeof(Int)*2); 2412 2413 for( Int i = 0; i < uiNumSegments; i++ ) 2414 { 2415 rpSegMeans[i] = 0; 2416 } 2417 2418 if ( !orgDC ) 2419 { 2420 Pel* pLeftTop = pOrig; 2421 Pel* pRightTop = pOrig + (uiSize-1); 2422 Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1))); 2423 Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1)); 2424 2425 rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2; 2426 return; 2427 } 2428 2429 Int subSamplePix; 2430 if ( uiSize == 64 || uiSize == 32 ) 2431 { 2432 subSamplePix = 2; 2433 } 2434 else 2435 { 2436 subSamplePix = 1; 2437 } 2438 2439 for (Int y=0; y<uiSize; y+=subSamplePix) 2440 { 2441 for (Int x=0; x<uiSize; x+=subSamplePix) 2442 { 2443 UChar ucSegment = pMask?(UChar)pMask[x]:0; 2444 assert( ucSegment < uiNumSegments ); 2445 2446 iSumDepth[ucSegment] += pOrig[x]; 2447 iSumPix[ucSegment] += 1; 2448 } 2449 2450 pOrig += uiStride*subSamplePix; 2451 pMask += uiMaskStride*subSamplePix; 2452 } 2453 2454 // compute mean for each segment 2455 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) 2456 { 2457 if( iSumPix[ucSeg] > 0 ) 2458 { 2459 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 2460 } 2461 else 2462 { 2463 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 2464 } 2465 } 2466 } 2467 #endif // H_3D_DIM_SDC 2468 #endif 2469 2470 #if NH_3D_DMM 2471 Void TComPrediction::predContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool* segPattern ) 2472 { 2473 // get copy of co-located texture luma block 2474 TComYuv cTempYuv; 2475 cTempYuv.create( uiWidth, uiHeight, CHROMA_400 ); 2476 cTempYuv.clear(); 2477 Pel* piRefBlkY = cTempYuv.getAddr( COMPONENT_Y ); 2478 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getTexturePic()->getPicYuvRec(); 2479 assert( pcPicYuvRef != NULL ); 2480 Int iRefStride = pcPicYuvRef->getStride( COMPONENT_Y ); 2481 Pel* piRefY = pcPicYuvRef->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); 2482 2483 for( Int y = 0; y < uiHeight; y++ ) 2484 { 2485 ::memcpy(piRefBlkY, piRefY, sizeof(Pel)*uiWidth); 2486 piRefBlkY += uiWidth; 2487 piRefY += iRefStride; 2488 } 2489 2490 2491 // find contour for texture luma block 2492 piRefBlkY = cTempYuv.getAddr( COMPONENT_Y ); 2493 UInt iDC = 0; 2494 iDC = piRefBlkY[ 0 ]; 2495 iDC += piRefBlkY[ uiWidth - 1 ]; 2496 iDC += piRefBlkY[ uiWidth * (uiHeight - 1) ]; 2497 iDC += piRefBlkY[ uiWidth * (uiHeight - 1) + uiWidth - 1 ]; 2498 iDC = iDC >> 2; 2499 2500 piRefBlkY = cTempYuv.getAddr( COMPONENT_Y ); 2501 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 2502 { 2503 segPattern[k] = (piRefBlkY[k] > iDC) ? true : false; 2504 } 2505 2506 cTempYuv.destroy(); 2507 } 2508 2509 Void TComPrediction::predBiSegDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 ) 2510 { 2511 assert( biSegPattern ); 2512 const Pel *piMask = getPredictorPtr( COMPONENT_Y, false ); 2513 assert( piMask ); 2514 Int srcStride = 2*uiWidth + 1; 2515 const Pel *ptrSrc = piMask+srcStride+1; 2516 2452 2517 Int refDC1, refDC2; 2453 2518 const Int iTR = ( patternStride - 1 ) - srcStride; … … 2476 2541 } 2477 2542 2478 Void TComPrediction::xAssignBiSegDCs( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel valDC1, Pel valDC2 ) 2479 { 2543 Void TComPrediction::assignBiSegDCs( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel valDC1, Pel valDC2 ) 2544 { 2545 assert( biSegPattern ); 2480 2546 if( dstStride == patternStride ) 2481 2547 { 2482 2548 for( UInt k = 0; k < (patternStride * patternStride); k++ ) 2483 2549 { 2484 if( true == biSegPattern[k] ) 2485 { 2486 ptrDst[k] = valDC2; 2487 } 2488 else 2489 { 2490 ptrDst[k] = valDC1; 2491 } 2550 if( true == biSegPattern[k] ) { ptrDst[k] = valDC2; } 2551 else { ptrDst[k] = valDC1; } 2492 2552 } 2493 2553 } … … 2499 2559 for( UInt uiX = 0; uiX < patternStride; uiX++ ) 2500 2560 { 2501 if( true == biSegPattern[uiX] ) 2502 { 2503 piTemp[uiX] = valDC2; 2504 } 2505 else 2506 { 2507 piTemp[uiX] = valDC1; 2508 } 2561 if( true == biSegPattern[uiX] ) { piTemp[uiX] = valDC2; } 2562 else { piTemp[uiX] = valDC1; } 2509 2563 } 2510 2564 piTemp += dstStride; … … 2513 2567 } 2514 2568 } 2515 2516 #if H_3D_DIM_DMM 2517 2518 Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge ) 2519 { 2520 pcContourWedge->clear(); 2521 2522 // get copy of co-located texture luma block 2523 TComYuv cTempYuv; 2524 cTempYuv.create( uiWidth, uiHeight ); 2525 cTempYuv.clear(); 2526 Pel* piRefBlkY = cTempYuv.getLumaAddr(); 2527 xCopyTextureLumaBlock( pcCU, uiAbsPartIdx, piRefBlkY, uiWidth, uiHeight ); 2528 piRefBlkY = cTempYuv.getLumaAddr(); 2529 2530 // find contour for texture luma block 2531 UInt iDC = 0; 2532 2533 iDC = piRefBlkY[ 0 ]; 2534 iDC += piRefBlkY[ uiWidth - 1 ]; 2535 iDC += piRefBlkY[ uiWidth * (uiHeight - 1) ]; 2536 iDC += piRefBlkY[ uiWidth * (uiHeight - 1) + uiWidth - 1 ]; 2537 iDC = iDC >> 2; 2538 2539 piRefBlkY = cTempYuv.getLumaAddr(); 2540 2541 Bool* pabContourPattern = pcContourWedge->getPattern(); 2542 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 2543 { 2544 pabContourPattern[k] = (piRefBlkY[k] > iDC) ? true : false; 2545 } 2546 2547 cTempYuv.destroy(); 2548 } 2549 2550 2551 Void TComPrediction::xCopyTextureLumaBlock( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight ) 2552 { 2553 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getTexturePic()->getPicYuvRec(); 2554 assert( pcPicYuvRef != NULL ); 2555 Int iRefStride = pcPicYuvRef->getStride(); 2556 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiAbsPartIdx ); 2557 2558 for ( Int y = 0; y < uiHeight; y++ ) 2559 { 2560 ::memcpy(piDestBlockY, piRefY, sizeof(Pel)*uiWidth); 2561 piDestBlockY += uiWidth; 2562 piRefY += iRefStride; 2563 } 2564 } 2565 #endif 2566 2567 2568 #if H_3D_DIM_SDC 2569 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 2570 ,UInt uiIntraMode 2571 ,Bool orgDC 2572 ) 2573 { 2574 Int iSumDepth[2]; 2575 memset(iSumDepth, 0, sizeof(Int)*2); 2576 Int iSumPix[2]; 2577 memset(iSumPix, 0, sizeof(Int)*2); 2578 2579 for( Int i = 0; i < uiNumSegments; i++ ) 2580 { 2581 rpSegMeans[i] = 0; 2582 } 2583 2584 if ( !orgDC ) 2585 { 2586 Pel* pLeftTop = pOrig; 2587 Pel* pRightTop = pOrig + (uiSize-1); 2588 Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1))); 2589 Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1)); 2590 2591 rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2; 2592 return; 2593 } 2594 2595 Int subSamplePix; 2596 if ( uiSize == 64 || uiSize == 32 ) 2597 { 2598 subSamplePix = 2; 2599 } 2600 else 2601 { 2602 subSamplePix = 1; 2603 } 2604 2605 for (Int y=0; y<uiSize; y+=subSamplePix) 2606 { 2607 for (Int x=0; x<uiSize; x+=subSamplePix) 2608 { 2609 UChar ucSegment = pMask?(UChar)pMask[x]:0; 2610 assert( ucSegment < uiNumSegments ); 2611 2612 iSumDepth[ucSegment] += pOrig[x]; 2613 iSumPix[ucSegment] += 1; 2614 } 2615 2616 pOrig += uiStride*subSamplePix; 2617 pMask += uiMaskStride*subSamplePix; 2618 } 2619 2620 // compute mean for each segment 2621 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) 2622 { 2623 if( iSumPix[ucSeg] > 0 ) 2624 { 2625 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 2626 } 2627 else 2628 { 2629 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 2630 } 2631 } 2632 } 2633 #endif // H_3D_DIM_SDC 2634 #endif 2635 2569 #endif 2636 2570 //! \} -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComPrediction.h
r1200 r1209 144 144 Void xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ); 145 145 #endif 146 #if H_3D_DIM147 // depth intra functions148 Void xPredBiSegDCs ( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 );149 Void xAssignBiSegDCs ( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel valDC1, Pel valDC2 );150 #if H_3D_DIM_DMM151 UInt xPredWedgeFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx );152 Void xPredContourFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge );153 Void xCopyTextureLumaBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight );154 #endif155 #endif156 146 157 147 Void destroy(); … … 174 164 Void predIntraAng ( const ComponentID compID, UInt uiDirMode, Pel *piOrg /* Will be null for decoding */, UInt uiOrgStride, Pel* piPred, UInt uiStride, TComTU &rTu, Bool bAbove, Bool bLeft, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM = false ); 175 165 176 #if H_3D_DIM 177 // Depth intra 178 Void predIntraLumaDepth ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false 179 , TComWedgelet* dmm4Segmentation = NULL 180 ); 166 #if NH_3D_DMM 167 Void predIntraLumaDmm ( TComDataCU* pcCU, UInt uiAbsPartIdx, DmmID dmmType, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight ); 168 Void predContourFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool* segPattern ); 169 Void predBiSegDCs ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 ); 170 Void assignBiSegDCs ( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel valDC1, Pel valDC2 ); 171 #endif 172 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC 173 #if NH_3D_SDC 174 Void predConstantSDC ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& predDC ); 175 #endif 176 #else // PM: should be obsolete after cleanup 181 177 #if H_3D_DIM_SDC 182 Void analyzeSegmentsSDC ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 183 ,UInt uiIntraMode 184 ,Bool orgDC=false 185 ); 178 Void analyzeSegmentsSDC ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride, UInt uiIntraMode, Bool orgDC=false ); 186 179 #endif 187 180 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComRdCost.cpp
r1200 r1209 511 511 } 512 512 513 #if H_3D_FAST_DEPTH_INTRA 514 515 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth) 513 #if NH_3D_ENC_DEPTH 514 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth, UInt maxCuWidth) 516 515 { 517 516 Int temp = 0; … … 525 524 } 526 525 527 Int cuMaxLog2Size = g_aucConvertToBit[ g_uiMaxCUWidth]+2;526 Int cuMaxLog2Size = g_aucConvertToBit[maxCuWidth]+2; 528 527 529 528 if ( width == 4 ) -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComRdCost.h
r1200 r1209 212 212 Distortion calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ); 213 213 214 #if H_3D_FAST_DEPTH_INTRA215 UInt calcVAR(Pel* pi0, Int stride, Int width, Int height, Int cuDepth );214 #if NH_3D_ENC_DEPTH 215 UInt calcVAR(Pel* pi0, Int stride, Int width, Int height, Int cuDepth, UInt maxCuWidth ); 216 216 #endif 217 217 -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComRom.cpp
r1200 r1209 253 253 } 254 254 } 255 #if H_3D_DIM_DMM 255 256 #if NH_3D_DMM 256 257 if( !g_dmmWedgeLists.empty() ) 257 258 { 258 for( UInt ui = 0; ui < g_dmmWedgeLists.size(); ui++ ) 259 { 260 g_dmmWedgeLists[ui].clear(); 261 } 259 for( UInt ui = 0; ui < g_dmmWedgeLists.size(); ui++ ) { g_dmmWedgeLists[ui].clear(); } 262 260 g_dmmWedgeLists.clear(); 263 261 } 264 if( !g_dmmWedgeRefLists.empty() )265 {266 for( UInt ui = 0; ui < g_dmmWedgeRefLists.size(); ui++ )267 {268 g_dmmWedgeRefLists[ui].clear();269 }270 g_dmmWedgeRefLists.clear();271 }272 262 if( !g_dmmWedgeNodeLists.empty() ) 273 263 { 274 for( UInt ui = 0; ui < g_dmmWedgeNodeLists.size(); ui++ ) 275 { 276 g_dmmWedgeNodeLists[ui].clear(); 277 } 264 for( UInt ui = 0; ui < g_dmmWedgeNodeLists.size(); ui++ ) { g_dmmWedgeNodeLists[ui].clear(); } 278 265 g_dmmWedgeNodeLists.clear(); 279 266 } … … 523 510 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, DM 524 511 { 0, 1, 2, 2, 2, 2, 3, 5, 7, 8, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31, DM_CHROMA_IDX}; 525 #if H_3D_DIM_DMM512 #if NH_3D_DMM 526 513 // ==================================================================================================================== 527 514 // Depth coding modes … … 539 526 { //2x2 4x4 8x8 16x16 32x32 64x64 540 527 0, 7, 10, 9, 9, 13 }; 541 const UChar g_dmm3IntraTabIdxBits[6] = 542 { //2x2 4x4 8x8 16x16 32x32 64x64 543 0, 4, 7, 8, 8, 0 }; 528 544 529 Bool g_wedgePattern[32*32]; 545 530 extern std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; 546 extern std::vector< std::vector<TComWedgeRef> > g_dmmWedgeRefLists;547 531 extern std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists; 548 532 #endif … … 753 737 #endif 754 738 #endif 755 #if H_3D_DIM_DMM739 #if NH_3D_DMM 756 740 std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; 757 std::vector< std::vector<TComWedgeRef> > g_dmmWedgeRefLists;758 741 std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists; 742 759 743 Void initWedgeLists( Bool initNodeList ) 760 744 { 761 745 if( !g_dmmWedgeLists.empty() ) return; 762 for( UInt ui = g_aucConvertToBit[D IM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]); ui++ )763 { 764 UInt uiWedgeBlockSize = ((UInt)D IM_MIN_SIZE)<<ui;746 for( UInt ui = g_aucConvertToBit[DMM_MIN_SIZE]; ui < (g_aucConvertToBit[DMM_MAX_SIZE]); ui++ ) 747 { 748 UInt uiWedgeBlockSize = ((UInt)DMM_MIN_SIZE)<<ui; 765 749 std::vector<TComWedgelet> acWedgeList; 766 750 std::vector<TComWedgeRef> acWedgeRefList; 767 751 createWedgeList( uiWedgeBlockSize, uiWedgeBlockSize, acWedgeList, acWedgeRefList, g_dmmWedgeResolution[ui] ); 768 752 g_dmmWedgeLists.push_back( acWedgeList ); 769 g_dmmWedgeRefLists.push_back( acWedgeRefList ); 753 770 754 if( initNodeList ) 771 755 { … … 827 811 } 828 812 } 813 829 814 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes ) 830 815 { … … 867 852 } 868 853 } 854 869 855 Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList ) 870 856 { … … 900 886 if( bValid ) 901 887 { 902 cWedgelet.findClosestAngle();903 888 racWedgeList.push_back( cWedgelet ); 904 889 TComWedgeRef cWedgeRef; … … 907 892 } 908 893 } 909 #endif //H_3D_DIM_DMM 894 WedgeList* getWedgeListScaled( UInt blkSize ) 895 { 896 return &g_dmmWedgeLists[ g_aucConvertToBit[( 16 >= blkSize ) ? blkSize : 16] ]; 897 } 898 WedgeNodeList* getWedgeNodeListScaled( UInt blkSize ) 899 { 900 return &g_dmmWedgeNodeLists[ g_aucConvertToBit[( 16 >= blkSize ) ? blkSize : 16] ]; 901 } 902 #endif //NH_3D_DMM 910 903 //! \} -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComRom.h
r1200 r1209 39 39 #include<stdio.h> 40 40 #include<iostream> 41 #if H_3D_DIM41 #if NH_3D_DMM 42 42 #include "TComWedgelet.h" 43 43 #endif … … 91 91 extern const UChar g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH]; 92 92 extern const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]; 93 #if H_3D_DIM 93 94 94 // ==================================================================================================================== 95 95 // Depth coding modes 96 96 // ==================================================================================================================== 97 __inline Void mapDepthModeToIntraDir( UInt& intraMode ) { if( isDimMode( intraMode ) ) intraMode = DC_IDX; } 98 __inline Void mapDepthModeToIntraDir( Int& intraMode ) { if( isDimMode( intraMode ) ) intraMode = DC_IDX; } 99 #if H_3D_DIM_SDC || H_3D_DIM_DLT 100 __inline UInt numBitsForValue( UInt value ) { UInt bits = 0; while (value != 0) { value >>= 1; bits++; } return bits; }; 101 #endif 102 #if H_3D_DIM_DMM 97 #if NH_3D_DMM 103 98 extern const WedgeResolution g_dmmWedgeResolution [6]; 104 99 extern const UChar g_dmm1TabIdxBits [6]; 105 extern const UChar g_dmm3IntraTabIdxBits[6];106 100 extern Bool g_wedgePattern[32*32]; 107 101 extern std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; 108 extern std::vector< std::vector<TComWedgeRef> > g_dmmWedgeRefLists;109 102 extern std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists; 103 110 104 Void initWedgeLists( Bool initNodeList = false ); 111 105 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes ); 112 106 Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList ); 113 #endif 107 108 WedgeList* getWedgeListScaled ( UInt blkSize ); 109 WedgeNodeList* getWedgeNodeListScaled( UInt blkSize ); 110 111 __inline Void mapDmmToIntraDir( UInt& intraMode ) { if( isDmmMode( intraMode ) ) intraMode = DC_IDX; } 112 __inline Void mapDmmToIntraDir( Int& intraMode ) { if( isDmmMode( intraMode ) ) intraMode = DC_IDX; } 113 #endif 114 #if H_3D_DIM_SDC || H_3D_DIM_DLT 115 __inline UInt numBitsForValue( UInt value ) { UInt bits = 0; while (value != 0) { value >>= 1; bits++; } return bits; }; 114 116 #endif 115 117 // ==================================================================================================================== -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComSlice.h
r1200 r1209 2706 2706 Int getNumCurCmpLIds( ) const { return (Int) m_inCmpRefViewIdcs.size(); } 2707 2707 TComPic* getIvPic( Bool depthFlag, Int viewIndex) const { return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } 2708 #endif2709 #if H_3D2710 2708 TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } 2711 2709 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComWedgelet.cpp
r1196 r1209 45 45 using namespace std; 46 46 47 #if H_3D_DIM_DMM47 #if NH_3D_DMM 48 48 TComWedgelet::TComWedgelet( UInt uiWidth, UInt uiHeight ) : m_uhXs ( 0 ), 49 49 m_uhYs ( 0 ), … … 64 64 m_eWedgeRes( rcWedge.m_eWedgeRes ), 65 65 m_bIsCoarse( rcWedge.m_bIsCoarse ), 66 m_uiAng ( rcWedge.m_uiAng ),67 66 m_uiWidth ( rcWedge.m_uiWidth ), 68 67 m_uiHeight ( rcWedge.m_uiHeight ), 69 m_pbPattern( (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ) ) 70 ,m_pbScaledPattern( g_wedgePattern )68 m_pbPattern( (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ) ), 69 m_pbScaledPattern( g_wedgePattern ) 71 70 { 72 71 ::memcpy( m_pbPattern, rcWedge.m_pbPattern, sizeof(Bool) * (m_uiWidth * m_uiHeight)); … … 97 96 { 98 97 ::memset( m_pbPattern, 0, (m_uiWidth * m_uiHeight) * sizeof(Bool) ); 99 }100 101 Void TComWedgelet::findClosestAngle()102 {103 UInt uiAng=0,uiOptAng=0;104 UInt uiMinD=MAX_UINT;105 UInt uiTmpD=0;106 Int angTable[9] = {0, 2, 5, 9, 13, 17, 21, 26, 32};107 108 UChar uhXs = m_uhXs;109 UChar uhYs = m_uhYs;110 UChar uhXe = m_uhXe;111 UChar uhYe = m_uhYe;112 113 for(uiAng=2; uiAng<=34; uiAng++)114 {115 Int iSign = (uiAng<VER_IDX && uiAng>HOR_IDX ) ? -1 : 1;116 Int iVer = uiAng>17 ? 32 : angTable[(uiAng>10) ? (uiAng-10) : (10-uiAng)];117 Int iHor = uiAng<19 ? 32 : angTable[(uiAng>26) ? (uiAng-26) : (26-uiAng)];118 119 uiTmpD = abs(iVer*iSign*(uhXs-uhXe) - iHor*(uhYe-uhYs));120 121 if( uiTmpD < uiMinD )122 {123 uiMinD = uiTmpD;124 uiOptAng = uiAng;125 }126 }127 m_uiAng = uiOptAng;128 98 } 129 99 … … 205 175 m_eWedgeRes = rcWedge.m_eWedgeRes; 206 176 m_bIsCoarse = rcWedge.m_bIsCoarse; 207 m_uiAng = rcWedge.m_uiAng;208 177 m_uiWidth = rcWedge.m_uiWidth; 209 178 m_uiHeight = rcWedge.m_uiHeight; … … 295 264 } 296 265 297 Bool* TComWedgelet::get ScaledPattern(UInt uiDstSize)266 Bool* TComWedgelet::getPatternScaled( UInt dstSize ) 298 267 { 299 268 Bool *pbSrcPat = this->getPattern(); 300 269 UInt uiSrcSize = this->getStride(); 301 270 302 Int scale = (g_aucConvertToBit[uiDstSize] - g_aucConvertToBit[uiSrcSize]); 303 assert(scale>=0); 304 for (Int y=0; y<uiDstSize; y++) 305 { 306 for (Int x=0; x<uiDstSize; x++) 307 { 308 Int srcX = x>>scale; 309 Int srcY = y>>scale; 310 m_pbScaledPattern[y*uiDstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ]; 311 } 312 } 313 return m_pbScaledPattern; 314 } 271 if( 16 >= dstSize ) 272 { 273 assert( dstSize == uiSrcSize ); 274 return pbSrcPat; 275 } 276 else 277 { 278 Int scale = (g_aucConvertToBit[dstSize] - g_aucConvertToBit[uiSrcSize]); 279 assert(scale>=0); 280 for (Int y=0; y<dstSize; y++) 281 { 282 for (Int x=0; x<dstSize; x++) 283 { 284 Int srcX = x>>scale; 285 Int srcY = y>>scale; 286 m_pbScaledPattern[y*dstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ]; 287 } 288 } 289 return m_pbScaledPattern; 290 } 291 } 292 293 Void TComWedgelet::getPatternScaledCopy( UInt dstSize, Bool* dstBuf ) 294 { 295 Bool *pbSrcPat = this->getPattern(); 296 UInt uiSrcSize = this->getStride(); 297 298 if( 16 >= dstSize ) 299 { 300 assert( dstSize == uiSrcSize ); 301 memcpy( dstBuf, pbSrcPat, (dstSize*dstSize) ); 302 } 303 else 304 { 305 Int scale = (g_aucConvertToBit[dstSize] - g_aucConvertToBit[uiSrcSize]); 306 assert(scale>=0); 307 for (Int y=0; y<dstSize; y++) 308 { 309 for (Int x=0; x<dstSize; x++) 310 { 311 Int srcX = x>>scale; 312 Int srcY = y>>scale; 313 dstBuf[y*dstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ]; 314 } 315 } 316 } 317 } 318 315 319 316 320 TComWedgeNode::TComWedgeNode() 317 321 { 318 m_uiPatternIdx = DMM_NO_WEDGE INDEX;322 m_uiPatternIdx = DMM_NO_WEDGE_IDX; 319 323 for( UInt uiPos = 0; uiPos < DMM_NUM_WEDGE_REFINES; uiPos++ ) 320 324 { 321 m_uiRefineIdx[uiPos] = DMM_NO_WEDGE INDEX;325 m_uiRefineIdx[uiPos] = DMM_NO_WEDGE_IDX; 322 326 } 323 327 } … … 341 345 m_uiRefineIdx[uiPos] = uiIdx; 342 346 } 343 #endif // H_3D_DIM_DMM347 #endif //NH_3D_DMM -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TComWedgelet.h
r1196 r1209 43 43 #include <vector> 44 44 45 #if H_3D_DIM46 #define D IM_OFFSET (NUM_INTRA_MODE+1) // offset for DMM and RBC mode numbers (PM: not consistent with spec, but non-overlapping with chroma, see DM_CHROMA_IDX)47 #define D IM_MIN_SIZE 4 // min. block size for DMM and RBC modes48 #define D IM_MAX_SIZE 32 // max. block size for DMM and RBC modes45 #if NH_3D_DMM 46 #define DMM_OFFSET (NUM_INTRA_MODE+1) // offset for DMM and RBC mode numbers 47 #define DMM_MIN_SIZE 4 // min. block size for DMM and RBC modes 48 #define DMM_MAX_SIZE 32 // max. block size for DMM and RBC modes 49 49 50 enum D IM_IDX50 enum DmmID 51 51 { 52 52 DMM1_IDX = 0, 53 53 DMM4_IDX = 1, 54 NUM_DMM = 2, 55 DMM_NO_IDX = MAX_UINT 54 56 }; 55 57 56 #define DMM_NUM_TYPE 2 57 #define DIM_NUM_TYPE (DMM_NUM_TYPE) 58 #define DIM_NO_IDX MAX_UINT 58 __inline DmmID getDmmType( Int intraMode ) 59 { 60 Int dmmType = intraMode-DMM_OFFSET; 61 return (dmmType >= 0 && dmmType < NUM_DMM) ? (DmmID)dmmType : DMM_NO_IDX; 62 } 63 __inline Bool isDmmMode( Int intraMode ) { return ((UInt)getDmmType( intraMode ) < NUM_DMM); } 59 64 60 __inline UInt getDimType ( Int intraMode )61 {62 Int dimType = intraMode-DIM_OFFSET;63 return (dimType >= 0 && dimType < DIM_NUM_TYPE) ? (UInt)dimType : DIM_NO_IDX;64 }65 __inline Bool isDimMode ( Int intraMode ) { return (getDimType( intraMode ) < DIM_NUM_TYPE); }66 #endif67 65 68 #if H_3D_DIM_DMM 69 #define DMM_NO_WEDGE INDEX MAX_UINT66 // Wedgelets 67 #define DMM_NO_WEDGE_IDX MAX_UINT 70 68 #define DMM_NUM_WEDGE_REFINES 8 71 69 … … 90 88 WedgeResolution m_eWedgeRes; // start/end pos resolution 91 89 Bool m_bIsCoarse; 92 UInt m_uiAng;93 90 94 91 UInt m_uiWidth; … … 121 118 UChar getOri () { return m_uhOri; } 122 119 Bool getIsCoarse() { return m_bIsCoarse; } 123 UInt getAng () { return m_uiAng; }124 Bool* getScaledPattern(UInt uiWidth);125 120 126 121 Void generateWedgePatternByRotate(const TComWedgelet &rcWedge, Int rotate); 127 122 Void setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false ); 128 Void findClosestAngle();129 123 130 124 Bool checkNotPlain(); 131 125 Bool checkIdentical( Bool* pbRefPattern ); 132 126 Bool checkInvIdentical( Bool* pbRefPattern ); 127 128 Bool* getPatternScaled ( UInt dstSize ); 129 Void getPatternScaledCopy( UInt dstSize, Bool* dstBuf ); 133 130 134 131 }; // END CLASS DEFINITION TComWedgelet … … 162 159 }; // END CLASS DEFINITION TComWedgeRef 163 160 164 // type definition wedgelet reference list165 typedef std::vector<TComWedgeRef> WedgeRefList;166 161 167 162 // ==================================================================================================================== … … 187 182 // type definition wedgelet node list 188 183 typedef std::vector<TComWedgeNode> WedgeNodeList; 189 #endif // H_3D_DIM_DMM184 #endif //NH_3D_DMM 190 185 191 192 // ====================================================================================================================193 // Function definition roftoi (mathematically correct rounding of float to int)194 // ====================================================================================================================195 __inline Int roftoi( Double value )196 {197 (value < -0.5) ? (value -= 0.5) : (value += 0.5);198 return ( (Int)value );199 }200 186 #endif // __TCOMWEDGELET__ -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibCommon/TypeDef.h
r1201 r1209 69 69 #if NH_3D 70 70 #define NH_3D_VSO 1 71 #endif 71 #define NH_3D_DMM 1 // Depth modeling modes 72 #define NH_3D_SDC 1 // Segment-wise DC coding for intra and inter 73 #define NH_3D_ENC_DEPTH 1 // Encoder optimizations for depth, incl. 74 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 75 // LG_ZEROINTRADEPTHRESI_A0087 76 // HHI_DMM4_ENC_I0066 77 // H_3D_FAST_DEPTH_INTRA 78 #endif 79 80 #define TEMP_SDC_CLEANUP 1 // PM: consider these cleanups for DMM and SDC 72 81 73 82 #if H_3D -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1200 r1209 3389 3389 #endif 3390 3390 #if H_3D_INTER_SDC 3391 Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )3392 {3393 assert(0);3394 }3395 3396 3391 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3397 3392 { -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecCAVLC.h
r1200 r1209 123 123 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 124 124 #endif 125 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 126 Void parseDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); }; 127 #endif 125 128 #if H_3D_INTER_SDC 126 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );127 129 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 128 130 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecCu.cpp
r1200 r1209 1009 1009 1010 1010 //===== get prediction signal ===== 1011 #if H_3D_DIM1012 if( isDimMode( uiLumaPredMode ) )1013 { 1014 m_pcPrediction->predIntraLumaD epth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight );1011 #if NH_3D_DMM 1012 if( bIsLuma && isDmmMode( uiChFinalMode ) ) 1013 { 1014 m_pcPrediction->predIntraLumaDmm( pcCU, uiAbsPartIdx, getDmmType( uiChFinalMode ), piPred, uiStride, uiWidth, uiHeight ); 1015 1015 } 1016 1016 else 1017 1017 { 1018 1018 #endif 1019 1020 1019 m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions ); 1021 #if H_3D_DIM1020 #if NH_3D_DMM 1022 1021 } 1023 1022 #endif … … 1040 1039 #endif 1041 1040 #if H_3D 1042 Bool useDltFlag = (isD imMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps());1041 Bool useDltFlag = (isDmmMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()); 1043 1042 1044 1043 if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) || useDltFlag ) … … 1158 1157 } 1159 1158 } 1160 #if H_3D_DIM1161 mapDepthModeToIntraDir( uiChromaPredMode );1162 #endif1163 1164 1159 1165 1160 Void … … 1191 1186 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1192 1187 { 1188 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 1189 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 1190 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 1191 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 1192 1193 Bool bAboveAvail = false; 1194 Bool bLeftAvail = false; 1195 UInt uiWidth = pcCU->getWidth ( 0 ); 1196 UInt uiHeight = pcCU->getHeight( 0 ); 1197 UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ); 1198 1199 UInt sdcDepth = 0; 1200 UInt uiStride; 1201 Pel* piReco; 1202 Pel* piPred; 1203 Pel* piResi; 1204 1205 UInt uiZOrder; 1206 Pel* piRecIPred; 1207 UInt uiRecIPredStride; 1208 1209 Pel apDCPredValues[2]; 1210 UInt uiNumSegments; 1211 1212 Bool* pbMask = NULL; 1213 UInt uiMaskStride = 0; 1214 1215 #if NH_3D_DMM 1216 TComWedgelet* dmm4Segmentation = NULL; 1217 if( isDmmMode( uiLumaPredMode ) ) 1218 { 1219 assert( uiWidth == uiHeight ); 1220 assert( uiWidth >= DMM_MIN_SIZE && uiWidth <= DMM_MAX_SIZE ); 1221 assert( !((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) ); 1222 1223 uiNumSegments = 2; 1224 1225 uiStride = pcRecoYuv->getStride( COMPONENT_Y ); 1226 piReco = pcRecoYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 1227 piPred = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 1228 piResi = pcResiYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 1229 1230 piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); 1231 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y ); 1232 1233 //===== init availability pattern ===== 1234 #if !TEMP_SDC_CLEANUP // PM: please migrate together with below "initPattern" and remove macro 1235 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); 1236 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1237 #endif 1238 1239 // get partition 1240 pbMask = new Bool[ uiWidth*uiHeight ]; 1241 uiMaskStride = uiWidth; 1242 switch( getDmmType( uiLumaPredMode ) ) 1243 { 1244 case( DMM1_IDX ): { (getWedgeListScaled( uiWidth )->at( pcCU->getDmm1WedgeTabIdx( uiAbsPartIdx ) )).getPatternScaledCopy( uiWidth, pbMask ); } break; 1245 case( DMM4_IDX ): { m_pcPrediction->predContourFromTex( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask ); } break; 1246 default: assert(0); 1247 } 1248 1249 // get predicted partition values 1250 Pel predDC1 = 0, predDC2 = 0; 1251 m_pcPrediction->predBiSegDCs( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask, uiMaskStride, predDC1, predDC2 ); 1252 1253 // set prediction signal 1254 Pel* pDst = piPred; 1255 m_pcPrediction->assignBiSegDCs( pDst, uiStride, pbMask, uiMaskStride, predDC1, predDC2 ); 1256 apDCPredValues[0] = predDC1; 1257 apDCPredValues[1] = predDC2; 1258 } 1259 else // regular HEVC intra modes 1260 { 1261 #endif 1262 uiNumSegments = 1; 1263 1264 UInt numParts = 1; 1265 UInt uiSubPartIdx = uiAbsPartIdx; 1266 1267 if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1) 1268 { 1269 numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); 1270 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1271 uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()); 1272 } 1273 1274 for ( Int i = 0; i < numParts; i++ ) 1275 { 1276 uiStride = pcRecoYuv->getStride (); 1277 piReco = pcRecoYuv->getLumaAddr( uiSubPartIdx ); 1278 piPred = pcPredYuv->getLumaAddr( uiSubPartIdx ); 1279 piResi = pcResiYuv->getLumaAddr( uiSubPartIdx ); 1280 1281 uiZOrder = pcCU->getZorderIdxInCU() + uiSubPartIdx; 1282 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1283 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1284 1285 AOF( uiWidth == uiHeight ); 1286 1287 //===== init availability pattern ===== 1288 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiSubPartIdx ); 1289 pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1290 1291 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1292 1293 if ( numParts > 1 ) 1294 { 1295 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1296 { 1297 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1298 { 1299 piReco [ uiX ] = ClipY( piPred[ uiX ] ); 1300 piRecIPred [ uiX ] = piReco[ uiX ]; 1301 } 1302 piPred += uiStride; 1303 piReco += uiStride; 1304 piRecIPred += uiRecIPredStride; 1305 } 1306 } 1307 uiSubPartIdx += ( (uiWidth * uiWidth) >> 4 ); 1308 } 1309 1310 // reset to full block 1311 uiWidth = pcCU->getWidth( 0 ); 1312 uiHeight = pcCU->getHeight( 0 ); 1313 1314 piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 1315 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1316 piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 1317 1318 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1319 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1320 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1321 1322 m_pcPrediction->predConstantSDC( piPred, uiStride, uiWidth, apDCPredValues[0] ); apDCPredValues[1] = 0; 1323 #if NH_3D_DMM 1324 } 1325 #endif 1326 #else 1193 1327 UInt uiWidth = pcCU->getWidth ( 0 ); 1194 1328 UInt uiHeight = pcCU->getHeight ( 0 ); … … 1242 1376 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1243 1377 //===== get prediction signal ===== 1244 if( isD imMode( uiLumaPredMode ) )1378 if( isDmmMode( uiLumaPredMode ) ) 1245 1379 { 1246 1380 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, false, dmm4Segmentation ); … … 1292 1426 UInt uiMaskStride = 0; 1293 1427 1294 if( getD imType( uiLumaPredMode ) == DMM1_IDX )1428 if( getDmmType( uiLumaPredMode ) == DMM1_IDX ) 1295 1429 { 1296 1430 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); … … 1304 1438 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); 1305 1439 } 1306 if( getD imType( uiLumaPredMode ) == DMM4_IDX )1440 if( getDmmType( uiLumaPredMode ) == DMM4_IDX ) 1307 1441 { 1308 1442 uiNumSegments = 2; … … 1312 1446 // get DC prediction for each segment 1313 1447 Pel apDCPredValues[2]; 1314 if ( getD imType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )1448 if ( getDmmType( uiLumaPredMode ) == DMM1_IDX || getDmmType( uiLumaPredMode ) == DMM4_IDX ) 1315 1449 { 1316 1450 apDCPredValues[0] = pcCU->getDmmPredictor( 0 ); … … 1321 1455 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode); 1322 1456 } 1457 #endif 1323 1458 1324 1459 // reconstruct residual based on mask + DC residuals … … 1379 1514 pRecCr += uiStrideC; 1380 1515 } 1516 #if NH_3D_DMM 1517 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 1518 if( pbMask ) { delete[] pbMask; } 1519 #else 1381 1520 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 1521 #endif 1522 #endif 1382 1523 } 1383 1524 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecEntropy.cpp
r1200 r1209 970 970 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 971 971 } 972 #endif 972 973 #if H_3D_INTER_SDC 973 974 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) … … 978 979 } 979 980 #endif 980 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 981 { 982 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 983 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 984 985 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 986 { 987 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 988 { 989 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 990 { 991 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); 992 } 993 } 994 } 995 else 981 #if NH_3D 982 if( pcCU->getSlice()->getIsDepth() ) 983 { 984 #if H_3D_DIM_SDC || H_3D_INTER_SDC 985 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 996 986 { 997 987 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth ); 998 988 return; 999 989 } 990 #endif 991 #if NH_3D_DMM 992 if( pcCU->isIntra( uiAbsPartIdx ) ) 993 { 994 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 995 UInt uiPartOffset = ( pcCU->getPic()->getNumPartitionsInCtu() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 996 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 997 { 998 if( isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx + uiPartOffset*iPart ) ) ) 999 { 1000 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); 1001 } 1002 } 1003 } 1004 #endif 1000 1005 } 1001 1006 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecEntropy.h
r1200 r1209 91 91 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 92 #endif 93 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 94 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0; 95 #endif 93 96 #if H_3D_INTER_SDC 94 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;95 97 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 96 98 #endif … … 180 182 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 181 183 #endif 184 182 185 #if H_3D_INTER_SDC 183 186 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecSbac.cpp
r1200 r1209 106 106 , m_ChromaQpAdjFlagSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 107 , m_ChromaQpAdjIdcSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_IDC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 #if H_3D_DIM 109 , m_cDepthIntraModeSCModel ( 1, 1, NUM_DEPTH_INTRA_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 109 #if NH_3D_DMM 110 , m_cNotDmmFlagSCModel ( 1, 1, NUM_NOTDMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 #endif 113 #if NH_3D_DMM || NH_3D_SDC 114 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 #endif 113 116 #if H_3D_DIM_SDC 114 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 #endif 117 #endif 118 #if H_3D_DIM_SDC 119 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 117 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 118 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 120 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 120 121 #endif 121 122 #if H_3D_DBBP 122 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)123 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 123 124 #endif 124 125 … … 197 198 m_ChromaQpAdjFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 198 199 m_ChromaQpAdjIdcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 199 #if H_3D_DIM 200 m_cDepthIntraModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE ); 201 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 202 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA ); 203 m_cAngleFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 200 #if NH_3D_DMM 201 m_cNotDmmFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_NOTDMM_FLAG ); 202 m_cDmmModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_MODE ); 203 #endif 204 #if NH_3D_DMM || NH_3D_SDC 205 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA ); 206 #endif 204 207 #if H_3D_DIM_SDC 205 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 206 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 207 #endif 208 #endif 209 #if H_3D_DIM_SDC 210 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 208 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 209 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 210 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 211 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 211 212 #endif 212 213 #if H_3D_DBBP 213 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG );214 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG ); 214 215 #endif 215 216 … … 247 248 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 248 249 #endif 249 #if H_3D_DIM250 m_cDepthIntraModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE );251 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );252 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );253 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );254 250 #if H_3D_DIM_SDC 255 251 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 256 252 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 257 #endif258 #endif259 #if H_3D_DIM_SDC260 253 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 254 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 261 255 #endif 262 256 #if H_3D_DBBP … … 433 427 } 434 428 } 435 436 #if H_3D_DIM437 Void TDecSbac::xReadExGolombLevel( UInt& ruiSymbol, ContextModel& rcSCModel )438 {439 UInt uiSymbol;440 UInt uiCount = 0;441 do442 {443 m_pcTDecBinIf->decodeBin( uiSymbol, rcSCModel );444 uiCount++;445 }446 while( uiSymbol && ( uiCount != 3 ) );447 ruiSymbol = uiCount - 1;448 449 if( uiSymbol )450 {451 xReadEpExGolomb( uiSymbol, 0 );452 ruiSymbol += uiSymbol + 1;453 }454 455 return;456 }457 458 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg )459 {460 UInt absValDeltaDC = 0;461 xReadExGolombLevel( absValDeltaDC, m_cDdcDataSCModel.get(0, 0, 0) );462 rValDeltaDC = (Pel)absValDeltaDC + ( uiNumSeg > 1 ? 0 : 1 );463 464 if( rValDeltaDC != 0 )465 {466 UInt uiSign;467 m_pcTDecBinIf->decodeBinEP( uiSign );468 if ( uiSign )469 {470 rValDeltaDC = -rValDeltaDC;471 }472 }473 }474 475 476 #if H_3D_DIM_DMM477 Void TDecSbac::xParseDmm1WedgeIdx( UInt& ruiTabIdx, Int iNumBit )478 {479 UInt uiSymbol, uiIdx = 0;480 for( Int i = 0; i < iNumBit; i++ )481 {482 m_pcTDecBinIf->decodeBinEP( uiSymbol );483 uiIdx += uiSymbol << i;484 }485 ruiTabIdx = uiIdx;486 }487 #endif488 489 490 #endif491 492 429 493 430 /** Parse I_PCM information. … … 1019 956 for (j=0;j<partNum;j++) 1020 957 { 1021 #if H_3D_DIM958 #if NH_3D_DMM 1022 959 if( pcCU->getSlice()->getIntraSdcWedgeFlag() || pcCU->getSlice()->getIntraContourFlag() ) 1023 960 { 1024 parseIntraDepth( pcCU, absPartIdx+partOffset*j, depth ); 1025 } 1026 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 961 xParseIntraDepthMode( pcCU, absPartIdx+partOffset*j, depth ); 962 xParseDmmData ( pcCU, absPartIdx+partOffset*j, depth ); 963 } 964 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1027 965 { 1028 966 #endif … … 1032 970 DTRACE_CU("prev_intra_luma_pred_flag", symbol) 1033 971 #endif 1034 #if H_3D_DIM972 #if NH_3D_DMM 1035 973 } 1036 974 #endif … … 1038 976 for (j=0;j<partNum;j++) 1039 977 { 1040 #if H_3D_DIM1041 if( pcCU->get LumaIntraDir(absPartIdx+partOffset*j ) < NUM_INTRA_MODE )978 #if NH_3D_DMM 979 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1042 980 { 1043 981 #endif … … 1084 1022 } 1085 1023 pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, (UChar)intraPredMode, absPartIdx+partOffset*j, depth ); 1086 #if H_3D_DIM1024 #if NH_3D_DMM 1087 1025 } 1088 1026 #endif … … 1120 1058 pcCU->setIntraDirSubParts( CHANNEL_TYPE_CHROMA, uiSymbol, uiAbsPartIdx, uiDepth ); 1121 1059 } 1122 1123 #if H_3D_DIM1124 Void TDecSbac::parseIntraDepth( TComDataCU* pcCU, UInt absPartIdx, UInt depth )1125 {1126 parseIntraDepthMode( pcCU, absPartIdx, depth );1127 1128 UInt dir = pcCU->getLumaIntraDir( absPartIdx );1129 UInt dimType = getDimType( dir );1130 1131 switch( dimType )1132 {1133 #if H_3D_DIM_DMM1134 case( DMM1_IDX ):1135 {1136 UInt uiTabIdx = 0;1137 xParseDmm1WedgeIdx( uiTabIdx, g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );1138 1139 assert( uiTabIdx < g_dmmWedgeLists[ g_aucConvertToBit[ pcCU->getDMM1BasePatternWidth( pcCU->getWidth( absPartIdx ) )]].size());1140 1141 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth );1142 } break;1143 case( DMM4_IDX ): break;1144 #endif1145 default: break;1146 }1147 1148 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );1149 }1150 1151 Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )1152 {1153 UInt uiSymbol, uiIsDimMode;1154 1155 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed1156 {1157 m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, 0 ) );1158 }1159 else1160 {1161 uiSymbol = 1;1162 }1163 uiIsDimMode = uiSymbol ? 0 : 1;1164 pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth );1165 1166 //decode DMM index1167 if( uiIsDimMode )1168 {1169 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag() )1170 {1171 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );1172 if( !uiSymbol )1173 {1174 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );1175 }1176 else1177 {1178 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );1179 }1180 }1181 else if ( pcCU->getSlice()->getIntraSdcWedgeFlag() )1182 {1183 pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );1184 }1185 else if( pcCU->getSlice()->getIntraContourFlag() )1186 {1187 pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );1188 }1189 }1190 }1191 #endif1192 1060 1193 1061 Void TDecSbac::parseInterDir( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ) … … 2472 2340 #endif 2473 2341 2474 #if H_3D_INTER_SDC2342 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 2475 2343 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2476 2344 { 2477 if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2478 { 2345 #if H_3D_DIM_SDC || H_3D_INTER_SDC 2346 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2347 #endif 2348 #if NH_3D_DMM 2349 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2350 #endif 2479 2351 assert( 0 ); 2480 }2481 2352 2482 2353 UInt symbol = 1; 2483 UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1; 2484 2354 #if H_3D_DIM_SDC 2485 2355 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2486 2356 { 2487 2488 2357 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) ); 2489 2358 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); … … 2491 2360 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth ); 2492 2361 } 2362 #endif 2363 UInt uiNumSegments = 1; 2364 #if NH_3D_DMM 2365 uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2366 #endif 2493 2367 2494 2368 for( UInt segment = 0; segment < uiNumSegments; segment++ ) … … 2497 2371 if( symbol ) 2498 2372 { 2499 xParseD imDeltaDC( valDeltaDC, uiNumSegments );2373 xParseDeltaDC( valDeltaDC, uiNumSegments ); 2500 2374 } 2501 2375 2502 2376 if( pcCU->isIntra( absPartIdx ) ) 2503 2377 { 2504 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2505 2378 #if H_3D_DIM_SDC 2506 2379 if( pcCU->getSDCFlag( absPartIdx ) ) 2507 2380 { … … 2510 2383 else 2511 2384 { 2512 pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC ); 2513 } 2514 } 2385 #endif 2386 #if NH_3D_DMM 2387 pcCU->setDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx, valDeltaDC ); 2388 #endif 2389 #if H_3D_DIM_SDC 2390 } 2391 #endif 2392 } 2393 #if H_3D_INTER_SDC 2515 2394 else 2516 2395 { 2517 2396 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2518 2397 } 2519 } 2520 } 2521 2398 #endif 2399 } 2400 } 2401 2402 Void TDecSbac::xParseDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg ) 2403 { 2404 UInt absValDeltaDC = 0; 2405 xReadExGolombLevelDdc( absValDeltaDC ); 2406 rValDeltaDC = (Pel)absValDeltaDC + ( uiNumSeg > 1 ? 0 : 1 ); 2407 2408 if( rValDeltaDC != 0 ) 2409 { 2410 UInt uiSign; 2411 m_pcTDecBinIf->decodeBinEP( uiSign RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_SIGN_EP) ); 2412 if ( uiSign ) 2413 { 2414 rValDeltaDC = -rValDeltaDC; 2415 } 2416 } 2417 } 2418 2419 Void TDecSbac::xReadExGolombLevelDdc( UInt& ruiSymbol ) 2420 { 2421 UInt uiSymbol; 2422 UInt uiCount = 0; 2423 do 2424 { 2425 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDdcDataSCModel.get(0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_PREFIX) ); 2426 uiCount++; 2427 } 2428 while( uiSymbol && ( uiCount != 3 ) ); 2429 ruiSymbol = uiCount - 1; 2430 2431 if( uiSymbol ) 2432 { 2433 xReadEpExGolomb( uiSymbol, 0 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTADC_SUFFIX_EP) ); 2434 ruiSymbol += uiSymbol + 1; 2435 } 2436 2437 return; 2438 } 2439 #endif 2440 #if NH_3D_DMM 2441 Void TDecSbac::xParseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2442 { 2443 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, 0, absPartIdx, depth ); 2444 2445 UInt uiSymbol; 2446 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 2447 { 2448 m_pcTDecBinIf->decodeBin( uiSymbol, m_cNotDmmFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__NOTDMM_FLAG) ); 2449 } 2450 else 2451 { 2452 uiSymbol = 1; 2453 } 2454 2455 //decode DMM mode index 2456 if( !uiSymbol ) 2457 { 2458 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag() ) 2459 { 2460 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmmModeSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DMMMODE) ); 2461 if( !uiSymbol ) 2462 { 2463 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, DMM_OFFSET, absPartIdx, depth ); 2464 } 2465 else 2466 { 2467 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, ( 1+ DMM_OFFSET ), absPartIdx, depth ); 2468 } 2469 } 2470 else if( pcCU->getSlice()->getIntraSdcWedgeFlag() ) 2471 { 2472 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, DMM_OFFSET, absPartIdx, depth ); 2473 } 2474 else if( pcCU->getSlice()->getIntraContourFlag() ) 2475 { 2476 pcCU->setIntraDirSubParts( CHANNEL_TYPE_LUMA, ( 1+ DMM_OFFSET ), absPartIdx, depth ); 2477 } 2478 } 2479 } 2480 2481 Void TDecSbac::xParseDmmData( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2482 { 2483 UInt dir = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ); 2484 switch( getDmmType( dir ) ) 2485 { 2486 case( DMM1_IDX ): 2487 { 2488 UInt uiTabIdx = 0; 2489 xParseDmm1WedgeIdx( uiTabIdx, g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 2490 assert( uiTabIdx < getWedgeListScaled( pcCU->getWidth( absPartIdx ) )->size() ); 2491 pcCU->setDmm1WedgeTabIdxSubParts( uiTabIdx, absPartIdx, depth ); 2492 } break; 2493 case( DMM4_IDX ): break; 2494 default: break; 2495 } 2496 } 2497 2498 Void TDecSbac::xParseDmm1WedgeIdx( UInt& ruiTabIdx, Int iNumBit ) 2499 { 2500 UInt uiSymbol, uiIdx = 0; 2501 for( Int i = 0; i < iNumBit; i++ ) 2502 { 2503 m_pcTDecBinIf->decodeBinEP( uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DMM1_BITS_EP) ); 2504 uiIdx += uiSymbol << i; 2505 } 2506 ruiTabIdx = uiIdx; 2507 } 2508 #endif 2509 #if H_3D_INTER_SDC 2522 2510 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2523 2511 { -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibDecoder/TDecSbac.h
r1200 r1209 107 107 Void xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 108 108 #endif 109 #if H_3D_DIM 110 Void xReadExGolombLevel ( UInt& ruiSymbol, ContextModel& rcSCModel ); 111 Void xParseDimDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg ); 112 #if H_3D_DIM_DMM 109 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 110 Void xReadExGolombLevelDdc( UInt& ruiSymbol ); 111 Void xParseDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg ); 112 #endif 113 #if NH_3D_DMM 114 Void xParseIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 115 Void xParseDmmData ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 113 116 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 114 117 #endif … … 116 119 Void xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 117 120 #endif 118 #endif119 121 #if H_3D_INTER_SDC 120 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );121 122 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 123 #endif … … 134 135 #if H_3D 135 136 Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 137 #endif 138 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 139 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 136 140 #endif 137 141 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 150 154 Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 151 155 Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 152 153 #if H_3D_DIM154 Void parseIntraDepth ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );155 Void parseIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );156 #endif157 158 156 Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ); 159 157 Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ); … … 227 225 ContextModel3DBuffer m_ChromaQpAdjFlagSCModel; 228 226 ContextModel3DBuffer m_ChromaQpAdjIdcSCModel; 229 #if H_3D_DIM 230 ContextModel3DBuffer m_cDepthIntraModeSCModel; 231 ContextModel3DBuffer m_cDdcFlagSCModel; 227 #if NH_3D_DMM 228 ContextModel3DBuffer m_cNotDmmFlagSCModel; 229 ContextModel3DBuffer m_cDmmModeSCModel; 230 #endif 231 #if NH_3D_DMM || NH_3D_SDC 232 232 ContextModel3DBuffer m_cDdcDataSCModel; 233 ContextModel3DBuffer m_cAngleFlagSCModel; 233 #endif 234 234 #if H_3D_DIM_SDC 235 235 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 236 236 ContextModel3DBuffer m_cSDCResidualSCModel; 237 #endif238 #endif239 #if H_3D_DIM_SDC240 237 ContextModel3DBuffer m_cSDCFlagSCModel; 238 ContextModel3DBuffer m_cDdcFlagSCModel; 241 239 #endif 242 240 #if H_3D_DBBP -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncCavlc.cpp
r1200 r1209 2887 2887 assert(0); 2888 2888 } 2889 2890 2889 #if H_3D_INTER_SDC 2891 Void TEncCavlc::code DeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx )2890 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2892 2891 { 2893 2892 assert(0); 2894 2893 } 2895 2896 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )2897 {2898 assert(0);2899 }2900 2901 2894 #endif 2902 2895 -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncCavlc.h
r1200 r1209 126 126 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 127 127 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 128 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 129 Void codeDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/ ) { assert(0); }; 130 #endif 128 131 #if H_3D_ARP 129 132 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 132 135 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 133 136 #endif 137 134 138 #if H_3D_INTER_SDC 135 Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx );136 139 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 137 140 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncCu.cpp
r1200 r1209 733 733 } 734 734 #endif 735 #if H_3D_DIM_ENC735 #if NH_3D_ENC_DEPTH 736 736 if( rpcBestCU->getSlice()->getIsDepth() && rpcBestCU->getSlice()->isIRAP() ) 737 737 { … … 1075 1075 1076 1076 if((rpcBestCU->getSlice()->getSliceType() == I_SLICE) || 1077 ((!m_pcEncCfg->getDisableIntraPUsInInterSlices()) && (1077 ((!m_pcEncCfg->getDisableIntraPUsInInterSlices()) && ( // avoid very complex intra if it is unlikely 1078 1078 (rpcBestCU->getCbf( 0, COMPONENT_Y ) != 0) || 1079 1079 ((rpcBestCU->getCbf( 0, COMPONENT_Cb ) != 0) && (numberValidComponents > COMPONENT_Cb)) || 1080 ((rpcBestCU->getCbf( 0, COMPONENT_Cr ) != 0) && (numberValidComponents > COMPONENT_Cr))) 1081 // avoid very complex intra if it is unlikely 1082 #if H_3D_DIM_ENC 1080 ((rpcBestCU->getCbf( 0, COMPONENT_Cr ) != 0) && (numberValidComponents > COMPONENT_Cr)) 1081 #if NH_3D_ENC_DEPTH 1083 1082 || rpcBestCU->getSlice()->getIsDepth() 1084 1083 #endif 1085 )) 1084 ))) 1086 1085 { 1087 #if H_3D_DIM1086 #if NH_3D_ENC_DEPTH 1088 1087 Bool bOnlyIVP = false; 1089 1088 Bool bUseIVP = true; 1090 if( rpcBestCU->getSlice()->getIsDepth() && !(rpcBestCU->getSlice()->isIRAP()) && 1091 rpcBestCU->getSlice()->getSliceType() != I_SLICE && 1092 rpcBestCU->getCbf( 0, TEXT_LUMA ) == 0 && 1093 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) == 0 && 1094 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) == 0 1095 ) 1089 if( (rpcBestCU->getSlice()->getSliceType() != I_SLICE) && 1090 !( (rpcBestCU->getCbf( 0, COMPONENT_Y ) != 0) || 1091 ((rpcBestCU->getCbf( 0, COMPONENT_Cb ) != 0) && (numberValidComponents > COMPONENT_Cb)) || 1092 ((rpcBestCU->getCbf( 0, COMPONENT_Cr ) != 0) && (numberValidComponents > COMPONENT_Cr)) ) && 1093 (rpcBestCU->getSlice()->getIsDepth() && !(rpcBestCU->getSlice()->isIRAP())) ) 1096 1094 { 1097 1095 bOnlyIVP = true; … … 1100 1098 if( bUseIVP ) 1101 1099 { 1102 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bOnlyIVP );1100 xCheckRDCostIntra( rpcBestCU, rpcTempCU, intraCost, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug), bOnlyIVP ); 1103 1101 #else 1104 1102 xCheckRDCostIntra( rpcBestCU, rpcTempCU, intraCost, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug) ); … … 1122 1120 { 1123 1121 Double tmpIntraCost; 1124 #if H_3D_DIM1125 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN, bOnlyIVP );1122 #if NH_3D_ENC_DEPTH 1123 xCheckRDCostIntra( rpcBestCU, rpcTempCU, tmpIntraCost, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug), bOnlyIVP ); 1126 1124 #else 1127 1125 xCheckRDCostIntra( rpcBestCU, rpcTempCU, tmpIntraCost, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug) ); … … 1135 1133 #endif 1136 1134 } 1137 #if H_3D1135 #if NH_3D_ENC_DEPTH 1138 1136 } 1139 1137 #endif … … 2654 2652 #endif 2655 2653 2656 #if H_3D_DIM2657 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize, Bool bOnlyIVP )2658 #else2659 2654 Void TEncCu::xCheckRDCostIntra( TComDataCU *&rpcBestCU, 2660 2655 TComDataCU *&rpcTempCU, 2661 2656 Double &cost, 2662 2657 PartSize eSize 2663 DEBUG_STRING_FN_DECLARE(sDebug) ) 2664 #endif 2658 DEBUG_STRING_FN_DECLARE(sDebug) 2659 #if NH_3D_ENC_DEPTH 2660 , Bool bOnlyIVP 2661 #endif 2662 ) 2665 2663 { 2666 2664 DEBUG_STRING_NEW(sTest) … … 2690 2688 Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE]; 2691 2689 2692 m_pcPredSearch->estIntraPredLumaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], resiLuma DEBUG_STRING_PASS_INTO(sTest) ); 2690 m_pcPredSearch->estIntraPredLumaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], resiLuma DEBUG_STRING_PASS_INTO(sTest) 2691 #if NH_3D_ENC_DEPTH 2692 , bOnlyIVP 2693 #endif 2694 ); 2693 2695 2694 2696 m_ppcRecoYuvTemp[uiDepth]->copyToPicComponent(COMPONENT_Y, rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getCtuRsAddr(), rpcTempCU->getZorderIdxInCtu() ); … … 2696 2698 if (rpcBestCU->getPic()->getChromaFormat()!=CHROMA_400) 2697 2699 { 2698 #if H_3D_DIM2699 m_pcPredSearch->estIntraPredQT ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma, bOnlyIVP );2700 #else2701 2700 m_pcPredSearch->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], resiLuma DEBUG_STRING_PASS_INTO(sTest) ); 2702 #endif2703 2701 } 2704 2702 #if H_3D_DIM_SDC -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncCu.h
r1200 r1209 162 162 Void xCheckRDCostDIS ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 163 163 #endif 164 #if H_3D_DIM165 Void xCheckRDCostIntra ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bOnlyIVP );166 #else167 164 Void xCheckRDCostIntra ( TComDataCU *&rpcBestCU, 168 165 TComDataCU *&rpcTempCU, … … 170 167 PartSize ePartSize 171 168 DEBUG_STRING_FN_DECLARE(sDebug) 169 #if NH_3D_ENC_DEPTH 170 , Bool bOnlyIVP 171 #endif 172 172 ); 173 #endif174 173 Void xCheckDQP ( TComDataCU* pcCU ); 175 174 -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncEntropy.cpp
r1200 r1209 722 722 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 723 723 } 724 725 724 #endif 725 #if H_3D_INTER_SDC 726 726 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) 727 727 { … … 730 730 assert( pcCU->getSlice()->getIsDepth() ); 731 731 } 732 733 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 732 #endif 733 #if NH_3D 734 if( pcCU->getSlice()->getIsDepth() ) 735 { 736 #if H_3D_DIM_SDC || H_3D_INTER_SDC 737 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 738 { 739 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx ); 740 return; 741 } 742 #endif 743 #if NH_3D_DMM 744 if( pcCU->isIntra(uiAbsPartIdx) ) 734 745 { 735 746 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 736 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 737 738 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 739 { 747 UInt uiPartOffset = ( pcCU->getPic()->getNumPartitionsInCtu() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 740 748 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 741 749 { 742 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE)750 if( isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx + uiPartOffset*iPart ) ) ) 743 751 { 744 752 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); … … 746 754 } 747 755 } 748 else 749 { 750 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx ); 751 return; 752 } 753 } 754 #endif 755 756 #endif 757 } 758 #endif 756 759 757 760 if( pcCU->isIntra(uiAbsPartIdx) ) … … 840 843 } 841 844 845 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 846 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ) 847 { 848 m_pcEntropyCoderIf->codeDeltaDC( pcCU, absPartIdx ); 849 } 850 #endif 842 851 #if H_3D_INTER_SDC 843 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx )844 {845 m_pcEntropyCoderIf->codeDeltaDC( pcCU, absPartIdx );846 }847 848 852 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 849 853 { -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncEntropy.h
r1200 r1209 84 84 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 85 85 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 86 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 87 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 88 #endif 86 89 #if H_3D_ARP 87 90 virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 91 94 #endif 92 95 #if H_3D_INTER_SDC 93 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;94 96 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 95 97 #endif … … 179 181 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 180 182 #endif 183 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 184 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 185 #endif 181 186 #if H_3D_INTER_SDC 182 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx );183 187 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 184 188 #endif -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncSbac.cpp
r1200 r1209 101 101 , m_ChromaQpAdjFlagSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 102 102 , m_ChromaQpAdjIdcSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_IDC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 103 #if H_3D_DIM 104 , m_cDepthIntraModeSCModel ( 1, 1, NUM_DEPTH_INTRA_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 105 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 103 104 #if NH_3D_DMM 105 , m_cNotDmmFlagSCModel ( 1, 1, NUM_NOTDMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 #endif 108 #if NH_3D_DMM || NH_3D_SDC 106 109 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 #endif 108 111 #if H_3D_DIM_SDC 109 112 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 113 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 #endif112 #endif113 #if H_3D_DIM_SDC114 114 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 116 #endif 116 117 #if H_3D_DBBP … … 181 182 m_ChromaQpAdjFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 182 183 m_ChromaQpAdjIdcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 183 #if H_3D_DIM 184 m_cDepthIntraModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE ); 185 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 184 185 #if NH_3D_DMM 186 m_cNotDmmFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_NOTDMM_FLAG ); 187 m_cDmmModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_MODE ); 188 #endif 189 #if NH_3D_DMM || NH_3D_SDC 186 190 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 187 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 191 #endif 188 192 #if H_3D_DIM_SDC 189 193 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 190 194 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 191 #endif192 #endif193 #if H_3D_DIM_SDC194 195 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 196 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 195 197 #endif 196 198 #if H_3D_DBBP … … 274 276 curCost += m_ChromaQpAdjFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 275 277 curCost += m_ChromaQpAdjIdcSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 276 #if H_3D_DIM 277 if( m_pcSlice->getIntraSdcWedgeFlag() || m_pcSlice->getIntraContourFlag() ) 278 { 279 curCost += m_cDepthIntraModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE ); 280 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG ); 281 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 282 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 283 } 278 #if NH_3D_DMM 279 curCost += m_cNotDmmFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_NOTDMM_FLAG ); 280 curCost += m_cDmmModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM_MODE ); 281 #endif 282 #if NH_3D_DMM || NH_3D_SDC 283 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 284 284 #endif 285 285 … … 308 308 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 309 309 #endif 310 #if H_3D_DIM311 m_cDepthIntraModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE );312 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );313 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );314 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );315 310 #if H_3D_DIM_SDC 316 311 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 317 312 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 318 #endif319 #endif320 #if H_3D_DIM_SDC321 313 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 314 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 322 315 #endif 323 316 #if H_3D_DBBP … … 530 523 } 531 524 } 532 #if H_3D_DIM533 Void TEncSbac::xWriteExGolombLevel( UInt uiSymbol, ContextModel& rcSCModel )534 {535 if( uiSymbol )536 {537 m_pcBinIf->encodeBin( 1, rcSCModel );538 UInt uiCount = 0;539 Bool bNoExGo = ( uiSymbol < 3 );540 541 while( --uiSymbol && ++uiCount < 3 )542 {543 m_pcBinIf->encodeBin( 1, rcSCModel );544 }545 if( bNoExGo )546 {547 m_pcBinIf->encodeBin( 0, rcSCModel );548 }549 else550 {551 xWriteEpExGolomb( uiSymbol, 0 );552 }553 }554 else555 {556 m_pcBinIf->encodeBin( 0, rcSCModel );557 }558 559 return;560 }561 562 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )563 {564 xWriteExGolombLevel( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ), m_cDdcDataSCModel.get(0, 0, 0) );565 if( valDeltaDC != 0 )566 {567 UInt uiSign = valDeltaDC > 0 ? 0 : 1;568 m_pcBinIf->encodeBinEP( uiSign );569 }570 }571 572 #if H_3D_DIM_DMM573 Void TEncSbac::xCodeDmm1WedgeIdx( UInt uiTabIdx, Int iNumBit )574 {575 for ( Int i = 0; i < iNumBit; i++ )576 {577 m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 );578 }579 }580 581 #endif582 #endif583 584 525 // SBAC RD 585 526 Void TEncSbac::load ( const TEncSbac* pSrc) … … 601 542 } 602 543 603 #if H_3D_DIM604 Void TEncSbac::loadIntraDepth Mode( TEncSbac* pSrc)544 #if NH_3D_DMM 545 Void TEncSbac::loadIntraDepthDmm( const TEncSbac* pSrc ) 605 546 { 606 547 m_pcBinIf->copyState( pSrc->m_pcBinIf ); 607 608 this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel ); 609 this->m_cDdcFlagSCModel .copyFrom( &pSrc->m_cDdcFlagSCModel ); 610 this->m_cAngleFlagSCModel .copyFrom( &pSrc->m_cAngleFlagSCModel ); 548 this->m_cNotDmmFlagSCModel.copyFrom( &pSrc->m_cNotDmmFlagSCModel ); 549 this->m_cDmmModeSCModel .copyFrom( &pSrc->m_cDmmModeSCModel ); 611 550 } 612 551 #endif … … 1098 1037 { 1099 1038 dir[j] = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ); 1100 #if H_3D_DIM1039 #if NH_3D_DMM 1101 1040 if( pcCU->getSlice()->getIntraSdcWedgeFlag() || pcCU->getSlice()->getIntraContourFlag() ) 1102 1041 { 1103 codeIntraDepth( pcCU, absPartIdx+partOffset*j ); 1104 } 1105 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1042 xCodeIntraDepthMode( pcCU, absPartIdx+partOffset*j ); 1043 xCodeDmmData ( pcCU, absPartIdx+partOffset*j ); 1044 } 1045 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1106 1046 { 1107 1047 #endif … … 1118 1058 DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 1119 1059 #endif 1120 #if H_3D_DIM1060 #if NH_3D_DMM 1121 1061 } 1122 1062 #endif … … 1125 1065 for (j=0;j<partNum;j++) 1126 1066 { 1127 #if H_3D_DIM1128 if( pcCU->get LumaIntraDir(absPartIdx+partOffset*j ) < NUM_INTRA_MODE )1067 #if NH_3D_DMM 1068 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1129 1069 { 1130 1070 #endif … … 1163 1103 #endif 1164 1104 } 1165 #if H_3D_DIM1105 #if NH_3D_DMM 1166 1106 } 1167 1107 #endif … … 1206 1146 return; 1207 1147 } 1208 1209 #if H_3D_DIM1210 Void TEncSbac::codeIntraDepth( TComDataCU* pcCU, UInt absPartIdx )1211 {1212 codeIntraDepthMode( pcCU, absPartIdx );1213 1214 UInt dir = pcCU->getLumaIntraDir( absPartIdx );1215 UInt dimType = getDimType( dir );1216 1217 switch( dimType )1218 {1219 #if H_3D_DIM_DMM1220 case( DMM1_IDX ):1221 {1222 xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );1223 } break;1224 case( DMM4_IDX ): break;1225 #endif1226 default: break;1227 }1228 }1229 1230 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )1231 {1232 UInt dir = pcCU->getLumaIntraDir( absPartIdx );1233 1234 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed1235 {1236 m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, 0 ) );1237 }1238 if( isDimMode( dir ) )1239 {1240 UInt uiCodeIdx = 0;1241 1242 switch( getDimType( dir ) )1243 {1244 case DMM1_IDX: uiCodeIdx = 0; break;1245 case DMM4_IDX: uiCodeIdx = 1; break;1246 default: break;1247 }1248 //mode coding1249 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag())1250 {1251 m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );1252 }1253 }1254 }1255 #endif1256 1148 1257 1149 Void TEncSbac::codeInterDir( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 2595 2487 } 2596 2488 2489 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 2490 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2491 { 2492 #if H_3D_DIM_SDC || H_3D_INTER_SDC 2493 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2494 #endif 2495 #if NH_3D_DMM 2496 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2497 #endif 2498 assert( 0 ); 2499 2500 UInt uiNumSegments = 1; 2501 #if NH_3D_DMM 2502 uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2503 #endif 2504 2505 UInt hasDeltaDC = 1; 2506 #if H_3D_DIM_SDC 2507 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2508 { 2509 if( uiNumSegments == 1 ) 2510 { 2511 hasDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0; 2512 } 2513 else 2514 { 2515 hasDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0; 2516 } 2517 m_pcBinIf->encodeBin( hasDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) ); 2518 } 2519 #endif 2520 2521 if( hasDeltaDC ) 2522 { 2523 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2524 { 2525 Pel deltaDC = 0; 2526 if( pcCU->isIntra( absPartIdx ) ) 2527 { 2528 #if H_3D_DIM_SDC 2529 if( pcCU->getSDCFlag( absPartIdx ) ) 2530 { 2531 deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx ); 2532 } 2533 else 2534 { 2535 #endif 2536 #if NH_3D_DMM 2537 deltaDC = pcCU->getDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx ); 2538 #endif 2539 #if H_3D_DIM_SDC 2540 } 2541 #endif 2542 } 2597 2543 #if H_3D_INTER_SDC 2598 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )2599 {2600 if( !( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) )2601 {2602 assert( 0 );2603 }2604 2605 UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1;2606 UInt dimDeltaDC = 1;2607 2608 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))2609 {2610 if( uiNumSegments == 1 )2611 {2612 dimDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0;2613 }2614 2544 else 2615 2545 { 2616 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0;2617 }2618 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );2619 }2620 2621 if( dimDeltaDC )2622 {2623 for( UInt segment = 0; segment < uiNumSegments; segment++ )2624 {2625 Pel deltaDC = 0;2626 2627 if( pcCU->isIntra( absPartIdx ) )2628 {2629 UInt dir = pcCU->getLumaIntraDir( absPartIdx );2630 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset( segment, absPartIdx ) : pcCU->getDimDeltaDC( getDimType( dir ), segment, absPartIdx );2631 }2632 else2633 {2634 2546 deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx ); 2635 2547 } 2636 2637 xCodeDimDeltaDC( deltaDC, uiNumSegments ); 2638 } 2639 } 2640 } 2641 2548 #endif 2549 xCodeDeltaDC( deltaDC, uiNumSegments ); 2550 } 2551 } 2552 } 2553 2554 Void TEncSbac::xCodeDeltaDC( Pel valDeltaDC, UInt uiNumSeg ) 2555 { 2556 xWriteExGolombLevelDdc( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ) ); 2557 if( valDeltaDC != 0 ) 2558 { 2559 UInt uiSign = valDeltaDC > 0 ? 0 : 1; 2560 m_pcBinIf->encodeBinEP( uiSign ); 2561 } 2562 } 2563 2564 Void TEncSbac::xWriteExGolombLevelDdc( UInt uiSymbol ) 2565 { 2566 if( uiSymbol ) 2567 { 2568 m_pcBinIf->encodeBin( 1, m_cDdcDataSCModel.get(0, 0, 0) ); 2569 UInt uiCount = 0; 2570 Bool bNoExGo = ( uiSymbol < 3 ); 2571 2572 while( --uiSymbol && ++uiCount < 3 ) 2573 { 2574 m_pcBinIf->encodeBin( 1, m_cDdcDataSCModel.get(0, 0, 0) ); 2575 } 2576 if( bNoExGo ) 2577 { 2578 m_pcBinIf->encodeBin( 0, m_cDdcDataSCModel.get(0, 0, 0) ); 2579 } 2580 else 2581 { 2582 xWriteEpExGolomb( uiSymbol, 0 ); 2583 } 2584 } 2585 else 2586 { 2587 m_pcBinIf->encodeBin( 0, m_cDdcDataSCModel.get(0, 0, 0) ); 2588 } 2589 2590 return; 2591 } 2592 #endif 2593 2594 #if NH_3D_DMM 2595 Void TEncSbac::xCodeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 2596 { 2597 UInt dir = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ); 2598 2599 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 2600 { 2601 m_pcBinIf->encodeBin( isDmmMode( dir ) ? 0 : 1, m_cNotDmmFlagSCModel.get( 0, 0, 0 ) ); 2602 } 2603 if( isDmmMode( dir ) ) 2604 { 2605 UInt uiCodeIdx = 0; 2606 2607 switch( getDmmType( dir ) ) 2608 { 2609 case DMM1_IDX: uiCodeIdx = 0; break; 2610 case DMM4_IDX: uiCodeIdx = 1; break; 2611 default: break; 2612 } 2613 //mode coding 2614 if( pcCU->getSlice()->getIntraSdcWedgeFlag() && pcCU->getSlice()->getIntraContourFlag()) 2615 { 2616 m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDmmModeSCModel.get( 0, 0, 0 ) ); 2617 } 2618 } 2619 } 2620 2621 Void TEncSbac::xCodeDmmData( TComDataCU* pcCU, UInt absPartIdx ) 2622 { 2623 UInt dir = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ); 2624 switch( getDmmType( dir ) ) 2625 { 2626 case( DMM1_IDX ): { xCodeDmm1WedgeIdx( pcCU->getDmm1WedgeTabIdx( absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); } break; 2627 case( DMM4_IDX ): break; 2628 default: break; 2629 } 2630 } 2631 2632 Void TEncSbac::xCodeDmm1WedgeIdx( UInt uiTabIdx, Int iNumBit ) 2633 { 2634 for ( Int i = 0; i < iNumBit; i++ ) 2635 { 2636 m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 ); 2637 } 2638 } 2639 #endif 2640 2641 #if H_3D_INTER_SDC 2642 2642 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2643 2643 { -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncSbac.h
r1200 r1209 80 80 Void load ( const TEncSbac* pSrc ); 81 81 Void loadIntraDirMode ( const TEncSbac* pScr, const ChannelType chType ); 82 #if H_3D_DIM83 Void loadIntraDepth Mode ( TEncSbac* pScr);82 #if NH_3D_DMM 83 Void loadIntraDepthDmm ( const TEncSbac* pSrc ); 84 84 #endif 85 85 Void store ( TEncSbac* pDest ) const; … … 115 115 Void xWriteEpExGolomb ( UInt uiSymbol, UInt uiCount ); 116 116 Void xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 117 #if H_3D_DIM 118 Void xWriteExGolombLevel ( UInt uiSymbol, ContextModel& rcSCModel ); 119 Void xCodeDimDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); 120 #if H_3D_DIM_DMM 117 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 118 Void xWriteExGolombLevelDdc( UInt uiSymbol ); 119 Void xCodeDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); 120 #endif 121 #if NH_3D_DMM 122 Void xCodeIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx ); 123 Void xCodeDmmData ( TComDataCU* pcCU, UInt absPartIdx ); 121 124 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 122 125 #endif 123 #endif 126 124 127 125 128 Void xCopyFrom ( const TEncSbac* pSrc ); … … 146 149 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 147 150 #endif 151 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC 152 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 153 #endif 148 154 #if H_3D_INTER_SDC 149 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx );150 155 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 151 156 #endif … … 165 170 Void codeQtRootCbfZero ( ); 166 171 Void codeIntraDirLumaAng ( TComDataCU* pcCU, UInt absPartIdx, Bool isMultiple); 167 168 172 Void codeIntraDirChroma ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 169 170 #if H_3D_DIM171 Void codeIntraDepth ( TComDataCU* pcCU, UInt absPartIdx );172 Void codeIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx );173 #endif174 175 173 Void codeInterDir ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 176 174 Void codeRefFrmIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); … … 249 247 ContextModel3DBuffer m_ChromaQpAdjFlagSCModel; 250 248 ContextModel3DBuffer m_ChromaQpAdjIdcSCModel; 251 #if H_3D_DIM 252 ContextModel3DBuffer m_cDepthIntraModeSCModel; 253 ContextModel3DBuffer m_cDdcFlagSCModel; 249 250 #if NH_3D_DMM 251 ContextModel3DBuffer m_cNotDmmFlagSCModel; 252 ContextModel3DBuffer m_cDmmModeSCModel; 253 #endif 254 #if NH_3D_DMM || NH_3D_SDC 254 255 ContextModel3DBuffer m_cDdcDataSCModel; 255 ContextModel3DBuffer m_cAngleFlagSCModel; 256 #endif 256 257 #if H_3D_DIM_SDC 257 258 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 258 259 ContextModel3DBuffer m_cSDCResidualSCModel; 259 #endif260 #endif261 #if H_3D_DIM_SDC262 260 ContextModel3DBuffer m_cSDCFlagSCModel; 261 ContextModel3DBuffer m_cDdcFlagSCModel; 263 262 #endif 264 263 #if H_3D_DBBP -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncSearch.cpp
r1200 r1209 1053 1053 #if H_3D_DIM_SDC 1054 1054 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 1055 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE)1055 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) ) 1056 1056 { 1057 1057 m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 ); … … 1071 1071 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 1072 1072 { 1073 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE)1073 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiPart * uiQNumParts ) ) ) 1074 1074 { 1075 1075 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts ); … … 1081 1081 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 1082 1082 } 1083 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE)1083 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ) ) ) 1084 1084 { 1085 1085 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx ); … … 1168 1168 DEBUG_STRING_FN_DECLARE(sDebug) 1169 1169 ,Int default0Save1Load2 1170 #if H_3D_DIM_ENC1171 , Bool zeroResi1170 #if NH_3D_ENC_DEPTH 1171 , Bool zeroResiFlag 1172 1172 #endif 1173 1173 … … 1244 1244 1245 1245 //===== get prediction signal ===== 1246 #if H_3D_DIM1247 if( isDimMode( uiLumaPredMode ) )1248 { 1249 predIntraLumaD epth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true);1246 #if NH_3D_DMM 1247 if( bIsLuma && isDmmMode( uiChFinalMode ) ) 1248 { 1249 predIntraLumaDmm( pcCU, uiAbsPartIdx, getDmmType( uiChFinalMode ), piPred, uiStride, uiWidth, uiHeight ); 1250 1250 } 1251 1251 else 1252 1252 { 1253 1253 #endif 1254 1255 1254 predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions ); 1256 #if H_3D_DIM1255 #if NH_3D_DMM 1257 1256 } 1258 1257 #endif … … 1301 1300 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1302 1301 { 1303 #if H_3D_DIM_ENC1304 if( zeroResi )1302 #if NH_3D_ENC_DEPTH 1303 if( zeroResiFlag ) 1305 1304 { 1306 1305 memset( pResi, 0, sizeof( Pel ) * uiWidth ); … … 1318 1317 pResi += uiStride; 1319 1318 pPred += uiStride; 1320 #if H_3D_DIM_ENC1319 #if NH_3D_ENC_DEPTH 1321 1320 } 1322 1321 #endif … … 1492 1491 ruiDist += m_pcRdCost->getDistPart( bitDepth, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, compID ); 1493 1492 } 1494 #if H_3D_DIM1495 mapDepthModeToIntraDir( uiChromaPredMode );1496 #endif1497 1498 1499 1493 1500 1494 … … 1514 1508 Double& dRDCost, 1515 1509 TComTU& rTu 1516 #if H_3D_DIM_ENC 1517 , Bool zeroResi 1510 DEBUG_STRING_FN_DECLARE(sDebug) 1511 #if NH_3D_ENC_DEPTH 1512 , Bool zeroResiFlag 1518 1513 #endif 1519 DEBUG_STRING_FN_DECLARE(sDebug))1514 ) 1520 1515 { 1521 1516 TComDataCU *pcCU = rTu.getCU(); … … 1568 1563 } 1569 1564 #endif 1570 #if H_3D_DIM1571 if( isD imMode( pcCU->getLumaIntraDir(uiAbsPartIdx ) ) )1565 #if NH_3D_DMM 1566 if( isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ) ) ) 1572 1567 { 1573 1568 bCheckSplit = false; … … 1712 1707 pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1713 1708 } 1714 #if H_3D_DIM_ENC1715 xIntraCoding LumaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcOrgYuv, pcPredYuv, pcResiYuv, uiSingleDistY, 0, zeroResi);1709 #if NH_3D_ENC_DEPTH 1710 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag ); 1716 1711 #else 1717 1712 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug)); … … 1982 1977 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) 1983 1978 { 1979 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 1980 Bool bAboveAvail = false; 1981 Bool bLeftAvail = false; 1982 UInt uiWidth = pcCU->getWidth ( 0 ); 1983 UInt uiHeight = pcCU->getHeight( 0 ); 1984 UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ); 1985 1986 UInt sdcDepth = 0; 1987 UInt uiStride; 1988 Pel* piOrg; 1989 Pel* piPred; 1990 Pel* piReco; 1991 1992 UInt uiZOrder; 1993 Pel* piRecIPred; 1994 UInt uiRecIPredStride; 1995 1996 Pel apDCPredValues[2]; 1997 Pel apDCOrigValues[2]; 1998 UInt uiNumSegments; 1999 2000 Bool* pbMask = NULL; 2001 UInt uiMaskStride = 0; 2002 #if NH_3D_DMM 2003 TComWedgelet* dmm4Segmentation = NULL; 2004 if( isDmmMode( uiLumaPredMode ) ) 2005 { 2006 assert( uiWidth == uiHeight ); 2007 assert( uiWidth >= DMM_MIN_SIZE && uiWidth <= DMM_MAX_SIZE ); 2008 assert( !(( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1) ); 2009 2010 uiNumSegments = 2; 2011 2012 uiStride = pcOrgYuv ->getStride( COMPONENT_Y ); 2013 piOrg = pcOrgYuv ->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 2014 piPred = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 2015 piReco = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 2016 2017 piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); 2018 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y ); 2019 2020 //===== init availability pattern ===== 2021 #if !TEMP_SDC_CLEANUP // PM: please migrate together with below "initPattern" and remove macro 2022 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); 2023 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 2024 #endif 2025 2026 // get partition 2027 pbMask = new Bool[ uiWidth*uiHeight ]; 2028 uiMaskStride = uiWidth; 2029 switch( getDmmType( uiLumaPredMode ) ) 2030 { 2031 case( DMM1_IDX ): { (getWedgeListScaled( uiWidth )->at( pcCU->getDmm1WedgeTabIdx( uiAbsPartIdx ) )).getPatternScaledCopy( uiWidth, pbMask ); } break; 2032 case( DMM4_IDX ): { predContourFromTex( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask ); } break; 2033 default: assert(0); 2034 } 2035 2036 // get predicted partition values 2037 Pel predDC1 = 0, predDC2 = 0; 2038 predBiSegDCs( pcCU, uiAbsPartIdx, uiWidth, uiHeight, pbMask, uiMaskStride, predDC1, predDC2 ); 2039 2040 // set prediction signal 2041 Pel* pDst = piPred; 2042 assignBiSegDCs( pDst, uiStride, pbMask, uiMaskStride, predDC1, predDC2 ); 2043 apDCPredValues[0] = predDC1; 2044 apDCPredValues[1] = predDC2; 2045 2046 // get original partition values 2047 xCalcBiSegDCs( piOrg, uiStride, pbMask, uiMaskStride, apDCOrigValues[0], apDCOrigValues[1], 0, (uiMaskStride > 16) ); 2048 } 2049 else // regular HEVC intra modes 2050 { 2051 #endif 2052 uiNumSegments = 1; 2053 2054 UInt numParts = 1; 2055 UInt uiSubPartIdx = uiAbsPartIdx; 2056 2057 if( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 ) 2058 { 2059 numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 2060 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 2061 uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 2062 } 2063 2064 for ( Int i = 0; i < numParts; i++ ) 2065 { 2066 uiStride = pcOrgYuv ->getStride (); 2067 piOrg = pcOrgYuv ->getLumaAddr( uiSubPartIdx ); 2068 piPred = pcPredYuv->getLumaAddr( uiSubPartIdx ); 2069 piReco = pcPredYuv->getLumaAddr( uiSubPartIdx ); 2070 2071 uiZOrder = pcCU->getZorderIdxInCU() + uiSubPartIdx; 2072 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 2073 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 2074 2075 AOF( uiWidth == uiHeight ); 2076 2077 //===== init availability pattern ===== 2078 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiSubPartIdx ); 2079 pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 2080 2081 predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 2082 2083 if ( numParts > 1 ) 2084 { 2085 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 2086 { 2087 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 2088 { 2089 piPred [ uiX ] = ClipY( piPred[ uiX ] ); 2090 piRecIPred [ uiX ] = piPred[ uiX ]; 2091 } 2092 piPred += uiStride; 2093 piRecIPred += uiRecIPredStride; 2094 } 2095 } 2096 2097 uiSubPartIdx += ( ( uiWidth * uiWidth ) >> 4 ); 2098 } 2099 2100 // reset to full block 2101 uiWidth = pcCU->getWidth( 0 ); 2102 uiHeight = pcCU->getHeight( 0 ); 2103 2104 uiStride = pcOrgYuv ->getStride (); 2105 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 2106 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2107 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2108 2109 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 2110 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 2111 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 2112 2113 // get predicted and original DC 2114 predConstantSDC( piPred, uiStride, uiWidth, apDCPredValues[0] ); apDCPredValues[1] = 0; 2115 xCalcConstantSDC( piOrg, uiStride, uiWidth, apDCOrigValues[0] ); apDCOrigValues[1] = 0; 2116 #if NH_3D_DMM 2117 } 2118 #endif 2119 #else 1984 2120 UInt uiLumaPredMode = pcCU ->getLumaIntraDir( uiAbsPartIdx ); 1985 2121 UInt uiWidth = pcCU ->getWidth ( 0 ); … … 2024 2160 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 2025 2161 //===== get prediction signal ===== 2026 if( isD imMode( uiLumaPredMode ) )2027 { 2028 UInt dimType = getD imType ( uiLumaPredMode );2162 if( isDmmMode( uiLumaPredMode ) ) 2163 { 2164 UInt dimType = getDmmType ( uiLumaPredMode ); 2029 2165 UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx); 2030 2166 UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth; … … 2089 2225 UInt uiMaskStride = 0; 2090 2226 2091 if( getD imType( uiLumaPredMode ) == DMM1_IDX )2227 if( getDmmType( uiLumaPredMode ) == DMM1_IDX ) 2092 2228 { 2093 2229 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); … … 2100 2236 uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride(); 2101 2237 } 2102 if( getD imType( uiLumaPredMode ) == DMM4_IDX )2238 if( getDmmType( uiLumaPredMode ) == DMM4_IDX ) 2103 2239 { 2104 2240 uiNumSegments = 2; … … 2109 2245 // get DC prediction for each segment 2110 2246 Pel apDCPredValues[2]; 2111 if ( getD imType( uiLumaPredMode ) == DMM1_IDX || getDimType( uiLumaPredMode ) == DMM4_IDX )2247 if ( getDmmType( uiLumaPredMode ) == DMM1_IDX || getDmmType( uiLumaPredMode ) == DMM4_IDX ) 2112 2248 { 2113 2249 apDCPredValues[0] = pcCU->getDmmPredictor( 0 ); … … 2123 2259 Pel apDCOrigValues[2]; 2124 2260 analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true ); 2261 #endif 2125 2262 2126 2263 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) … … 2203 2340 } 2204 2341 2342 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 2343 #if NH_3D_DMM 2344 if( pbMask ) { delete[] pbMask; } 2345 #endif 2346 #endif 2347 2205 2348 //===== determine distortion ===== 2206 2349 #if H_3D_VSO … … 2229 2372 // encode pred direction + DC residual data 2230 2373 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2231 #if H_3D_DIM_SDC2232 2374 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2233 #endif2234 2375 2235 2376 Bool bDummy = false; … … 2243 2384 #endif 2244 2385 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2386 #if !TEMP_SDC_CLEANUP // PM: should be obsolete after cleanup 2245 2387 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 2388 #endif 2246 2389 } 2247 2390 #endif … … 2789 2932 TComYuv* pcRecoYuv, 2790 2933 Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE] 2791 #if H_3D_DIM 2934 DEBUG_STRING_FN_DECLARE(sDebug) 2935 #if NH_3D_ENC_DEPTH 2792 2936 , Bool bOnlyIVP 2793 2937 #endif 2794 2795 DEBUG_STRING_FN_DECLARE(sDebug)) 2938 ) 2796 2939 { 2797 2940 const UInt uiDepth = pcCU->getDepth(0); … … 2865 3008 initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) ); 2866 3009 } 2867 #if H_3D_DIM3010 #if NH_3D_ENC_DEPTH 2868 3011 if( bOnlyIVP ) 2869 3012 { … … 2987 3130 } 2988 3131 } 2989 #if H_3D_DIM2990 } 2991 #endif 2992 2993 #if H_3D_DIM2994 //===== determine set of depth intra modes to be tested =====2995 if( m_pcEncCfg->getIsDepth() && uiWidth >= DIM_MIN_SIZE && uiWidth <= DIM_MAX_SIZE && uiWidth == uiHeight )2996 {2997 if( bOnlyIVP )2998 { 2999 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight);3000 xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, dmm4Segmentation);3001 3002 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3003 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, dmm4Segmentation->getPattern(), dmm4Segmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );3004 pcCU->setDimDeltaDC( DMM4_IDX, 0, uiPartOffset, deltaDC1 );3005 pcCU->setDimDeltaDC( DMM4_IDX, 1, uiPartOffset, deltaDC2 );3006 3007 uiRdModeList[ numModesForFullRD++ ] = (DMM4_IDX+DIM_OFFSET);3008 dmm4Segmentation->destroy(); delete dmm4Segmentation;3009 }3010 else3011 {3012 #if H_3D_FAST_DEPTH_INTRA 3013 Int threshold = max(((pcCU->getQP(0))>>3)-1,3);3014 Int varThreshold = (Int)( threshold * threshold - 8);3015 UInt varCU = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0));3016 #endif 3017 3018 #if H_3D_DIM_DMM 3019 if( ( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) || pcCU->getSlice()->getIntraContourFlag() )3020 #if H_3D_FAST_DEPTH_INTRA 3021 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)3022 #endif 3023 )3024 {3025 UInt uiStart, uiEnd;3026 if( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) && pcCU->getSlice()->getIntraContourFlag())3132 #if NH_3D_ENC_DEPTH 3133 } 3134 #endif 3135 3136 #if NH_3D_DMM 3137 if( m_pcEncCfg->getIsDepth() ) 3138 { 3139 const TComRectangle &puRect=tuRecurseWithPU.getRect(COMPONENT_Y); 3140 const UInt uiAbsPartIdx=tuRecurseWithPU.GetAbsPartIdxTU(); 3141 3142 Pel* piOrg = pcOrgYuv ->getAddr( COMPONENT_Y, uiAbsPartIdx ); 3143 Pel* piPred = pcPredYuv->getAddr( COMPONENT_Y, uiAbsPartIdx ); 3144 UInt uiStride = pcPredYuv->getStride( COMPONENT_Y ); 3145 3146 if( puRect.width >= DMM_MIN_SIZE && puRect.width <= DMM_MAX_SIZE && puRect.width == puRect.height && 3147 ((m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag()) || pcCU->getSlice()->getIntraContourFlag()) ) 3148 { 3149 #if NH_3D_ENC_DEPTH 3150 if( bOnlyIVP ) 3151 { 3152 Bool* dmm4Pattern = new Bool[ puRect.width*puRect.height ]; 3153 UInt patternStride = puRect.width; 3154 predContourFromTex( pcCU, uiPartOffset, puRect.width, puRect.height, dmm4Pattern ); 3155 3156 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3157 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, dmm4Pattern, patternStride, puRect.width, puRect.height, deltaDC1, deltaDC2 ); 3158 pcCU->setDmmDeltaDC( DMM4_IDX, 0, uiPartOffset, deltaDC1 ); 3159 pcCU->setDmmDeltaDC( DMM4_IDX, 1, uiPartOffset, deltaDC2 ); 3160 3161 uiRdModeList[ numModesForFullRD++ ] = (DMM4_IDX+DMM_OFFSET); 3162 delete[] dmm4Pattern; 3163 } 3164 else 3165 { 3166 Int threshold = max(((pcCU->getQP(0))>>3)-1,3); 3167 Int varThreshold = (Int)( threshold * threshold - 8 ); 3168 UInt varCU = m_pcRdCost->calcVAR( piOrg, uiStride, puRect.width, puRect.height, pcCU->getDepth(0), pcCU->getSlice()->getSPS()->getMaxCUWidth() ); 3169 if( uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold ) 3027 3170 { 3028 uiStart = 0; 3029 uiEnd = 2; 3171 #endif 3172 UInt startIdx = ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) ? 0 : 1; 3173 UInt endIdx = ( pcCU->getSlice()->getIntraContourFlag() ) ? 1 : 0; 3174 for( UInt dmmType = startIdx; dmmType <= endIdx; dmmType++ ) 3175 { 3176 #if H_3D_FCO 3177 if ( !(pcCU->getSlice()->getIvPic(false, pcCU->getSlice()->getViewIndex() )->getReconMark()) && (DMM4_IDX == dmmType ) ) { continue; } 3178 #endif 3179 Bool* biSegPattern = new Bool[ puRect.width*puRect.height ]; 3180 UInt patternStride = puRect.width; 3181 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3182 switch( dmmType ) 3183 { 3184 case( DMM1_IDX ): 3185 { 3186 UInt uiTabIdx = 0; 3187 xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, puRect.width, puRect.height, uiTabIdx ); 3188 pcCU->setDmm1WedgeTabIdxSubParts( uiTabIdx, uiPartOffset, uiDepth + uiInitTrDepth ); 3189 (getWedgeListScaled( puRect.width )->at( pcCU->getDmm1WedgeTabIdx( uiAbsPartIdx ) )).getPatternScaledCopy( puRect.width, biSegPattern ); 3190 } break; 3191 case( DMM4_IDX ): 3192 { 3193 predContourFromTex( pcCU, uiPartOffset, puRect.width, puRect.height, biSegPattern ); 3194 } break; 3195 default: assert(0); 3196 } 3197 3198 if( biSegPattern ) 3199 { 3200 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegPattern, patternStride, puRect.width, puRect.height, deltaDC1, deltaDC2 ); 3201 pcCU->setDmmDeltaDC( (DmmID)dmmType, 0, uiPartOffset, deltaDC1 ); 3202 pcCU->setDmmDeltaDC( (DmmID)dmmType, 1, uiPartOffset, deltaDC2 ); 3203 3204 uiRdModeList[ numModesForFullRD++ ] = (dmmType+DMM_OFFSET); 3205 delete[] biSegPattern; 3206 } 3207 } 3208 #if NH_3D_ENC_DEPTH 3030 3209 } 3031 else if( ( m_pcEncCfg->getUseDMM() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) ) 3032 { 3033 uiStart = 0; 3034 uiEnd = 1; 3035 } 3036 else if( pcCU->getSlice()->getIntraContourFlag() ) 3037 { 3038 uiStart = 1; 3039 uiEnd = 2; 3040 } 3041 else 3042 { 3043 uiStart = 0; 3044 uiEnd = 0; 3045 } 3046 for( UInt dmmType = uiStart; dmmType < uiEnd; dmmType++ ) 3047 { 3048 #if H_3D_FCO 3049 TComPic* picTexture = pcCU->getSlice()->getIvPic(false, pcCU->getSlice()->getViewIndex() ); 3050 #if H_3D_FCO 3051 if ( !picTexture->getReconMark() && (DMM4_IDX == dmmType ) ) 3052 #else 3053 if ( !picTexture->getReconMark() && (DMM3_IDX == dmmType || DMM4_IDX == dmmType ) ) 3054 #endif 3055 { 3056 continue; 3057 } 3058 #endif 3059 UInt uiTabIdx = 0; 3060 TComWedgelet* biSegmentation = NULL; 3061 Pel deltaDC1 = 0; Pel deltaDC2 = 0; 3062 switch( dmmType ) 3063 { 3064 case( DMM1_IDX ): 3065 { 3066 xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx ); 3067 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 3068 biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ? 3069 &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 3070 } break; 3071 3072 case( DMM4_IDX ): 3073 { 3074 { 3075 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); 3076 xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, biSegmentation ); 3077 } 3078 } break; 3079 default: assert(0); 3080 } 3081 3082 if( biSegmentation ) 3083 { 3084 if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){ 3085 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3086 } 3087 else 3088 { 3089 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 ); 3090 } 3091 pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 ); 3092 pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 ); 3093 3094 uiRdModeList[ numModesForFullRD++ ] = (dmmType +DIM_OFFSET); 3095 if( DMM4_IDX == dmmType ) { biSegmentation->destroy(); delete biSegmentation; } 3096 } 3097 } 3098 } 3099 #if H_3D_DIM 3100 } 3101 #endif 3102 #endif 3103 } 3104 #endif 3105 3210 } 3211 #endif 3212 } 3213 } 3214 #endif 3106 3215 3107 3216 //===== check modes (using r-d costs) ===== … … 3226 3335 } 3227 3336 #endif 3228 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3229 Bool bTestZeroResi = false; 3230 #if H_3D_DIM_ENC 3231 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP(); 3232 #endif 3337 #if NH_3D_ENC_DEPTH 3338 UInt zeroResiTest = (pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP()) ? 1 : 0; 3233 3339 #if H_3D_DIM_SDC 3234 3340 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset); 3235 #endif3236 3341 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3237 3342 { … … 3239 3344 } 3240 3345 #endif 3241 3242 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3243 for( UInt testZeroResi = 0; testZeroResi <= (bTestZeroResi ? 1 : 0) ; testZeroResi++ ) 3346 for( UInt zeroResi = 0; zeroResi <= zeroResiTest; zeroResi++ ) 3244 3347 { 3245 3348 #endif 3246 3247 3349 DEBUG_STRING_NEW(sMode) 3248 3350 // set context models … … 3280 3382 3281 3383 #if HHI_RQT_INTRA_SPEEDUP 3282 #if H_3D_DIM_ENC3283 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) );3384 #if NH_3D_ENC_DEPTH 3385 xRecurIntraCodingLumaQT( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaPU, uiPUDistY, true, dPUCost, tuRecurseWithPU DEBUG_STRING_PASS_INTO(sMode), (zeroResi != 0) ); 3284 3386 #if H_3D_FAST_INTRA_SDC 3285 3387 if( dPUCost < dBestPUCostConv ) … … 3295 3397 #endif 3296 3398 #else 3297 #if H_3D_DIM_ENC3298 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost, (testZeroResi != 0) );3399 #if NH_3D_ENC_DEPTH 3400 xRecurIntraCodingLumaQT( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaPU, uiPUDistY, dPUCost, tuRecurseWithPU DEBUG_STRING_PASS_INTO(sMode), (zeroResi != 0) ); 3299 3401 #else 3300 3402 xRecurIntraCodingLumaQT( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaPU, uiPUDistY, dPUCost, tuRecurseWithPU DEBUG_STRING_PASS_INTO(sMode) ); … … 3374 3476 } 3375 3477 #endif 3376 #if H_3D_DIM_ENC || H_3D_DIM_SDC3478 #if NH_3D_ENC_DEPTH 3377 3479 } 3480 #endif 3481 #if H_3D_DIM_SDC 3378 3482 } // SDC residual loop 3379 #endif3380 #if H_3D_DIM_SDC3381 3483 } // SDC loop 3382 3484 #endif … … 7017 7119 // Reload only contexts required for coding intra mode information 7018 7120 m_pcRDGoOnSbacCoder->loadIntraDirMode( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST], chType ); 7019 #if H_3D_DIM 7020 m_pcRDGoOnSbacCoder->loadIntraDepthMode( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 7121 #if NH_3D_DMM 7122 if( pcCU->getSlice()->getIsDepth() && isLuma(chType) ) 7123 { 7124 m_pcRDGoOnSbacCoder->loadIntraDepthDmm( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 7125 } 7021 7126 #endif 7022 7127 … … 7401 7506 } 7402 7507 7403 #if H_3D_DIM7508 #if NH_3D_DMM 7404 7509 // ------------------------------------------------------------------------------------------------------------------- 7405 7510 // Depth intra search 7406 7511 // ------------------------------------------------------------------------------------------------------------------- 7407 Void TEncSearch::xCalcBiSegDCs( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2 )7512 Void TEncSearch::xCalcBiSegDCs( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2, Pel defaultVal, Bool subSamp ) 7408 7513 { 7409 valDC1 = ( 1<<( g_bitDepthY - 1) );7410 valDC2 = ( 1<<( g_bitDepthY - 1) );7514 valDC1 = defaultVal; 7515 valDC2 = defaultVal; 7411 7516 7412 7517 UInt uiDC1 = 0; 7413 7518 UInt uiDC2 = 0; 7414 7519 UInt uiNumPixDC1 = 0, uiNumPixDC2 = 0; 7415 if( srcStride == patternStride ) 7416 { 7417 for( UInt k = 0; k < (patternStride * patternStride); k++ ) 7418 { 7419 if( true == biSegPattern[k] ) 7420 { 7421 uiDC2 += ptrSrc[k]; 7520 7521 Int subSamplePix = subSamp ? 2 : 1; 7522 7523 Pel* piTemp = ptrSrc; 7524 for( UInt uiY = 0; uiY < patternStride; uiY += subSamplePix ) 7525 { 7526 for( UInt uiX = 0; uiX < patternStride; uiX += subSamplePix ) 7527 { 7528 if( true == biSegPattern[uiX] ) 7529 { 7530 uiDC2 += piTemp[uiX]; 7422 7531 uiNumPixDC2++; 7423 7532 } 7424 7533 else 7425 7534 { 7426 uiDC1 += p trSrc[k];7535 uiDC1 += piTemp[uiX]; 7427 7536 uiNumPixDC1++; 7428 7537 } 7429 7538 } 7430 } 7431 else 7432 { 7433 Pel* piTemp = ptrSrc; 7434 for( UInt uiY = 0; uiY < patternStride; uiY++ ) 7435 { 7436 for( UInt uiX = 0; uiX < patternStride; uiX++ ) 7437 { 7438 if( true == biSegPattern[uiX] ) 7439 { 7440 uiDC2 += piTemp[uiX]; 7441 uiNumPixDC2++; 7442 } 7443 else 7444 { 7445 uiDC1 += piTemp[uiX]; 7446 uiNumPixDC1++; 7447 } 7448 } 7449 piTemp += srcStride; 7450 biSegPattern += patternStride; 7451 } 7539 piTemp += subSamplePix*srcStride; 7540 biSegPattern += subSamplePix*patternStride; 7452 7541 } 7453 7542 … … 7456 7545 } 7457 7546 7458 #if H_3D_DIM_DMM7459 7547 Void TEncSearch::xSearchDmmDeltaDCs( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ) 7460 7548 { 7461 7549 assert( biSegPattern ); 7550 Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 7551 7462 7552 Pel origDC1 = 0; Pel origDC2 = 0; 7463 xCalcBiSegDCs ( piOrig, uiStride, biSegPattern, patternStride, origDC1, origDC2 ); 7464 xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 ); 7465 7466 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( uiWidth, uiHeight, m_piYuvExt ); // no filtering for DMM 7467 Int maskStride = 2*uiWidth + 1; 7468 Int* ptrSrc = piMask+maskStride+1; 7553 xCalcBiSegDCs ( piOrig, uiStride, biSegPattern, patternStride, origDC1, origDC2, (1<<(bitDepthY-1)) ); 7554 assignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 ); 7555 7469 7556 Pel predDC1 = 0; Pel predDC2 = 0; 7470 xPredBiSegDCs( ptrSrc, maskStride, biSegPattern, patternStride, predDC1, predDC2 );7557 predBiSegDCs( pcCU, uiAbsPtIdx, uiWidth, uiHeight, biSegPattern, patternStride, predDC1, predDC2 ); 7471 7558 7472 7559 rDeltaDC1 = origDC1 - predDC1; 7473 7560 rDeltaDC2 = origDC2 - predDC2; 7474 7561 7475 #if H_3D_VSO7562 #if NH_3D_VSO 7476 7563 if( m_pcRdCost->getUseVSO() ) 7477 7564 { … … 7492 7579 // limit search range to [0, IBDI_MAX] 7493 7580 if( fullDeltaDC1 < 0 && uiDeltaDC1Max > abs(predDC1) ) { uiDeltaDC1Max = abs(predDC1); } 7494 if( fullDeltaDC1 >= 0 && uiDeltaDC1Max > ((1 << g_bitDepthY)-1) - abs(predDC1) ) { uiDeltaDC1Max = ((1 << g_bitDepthY)-1) - abs(predDC1); }7581 if( fullDeltaDC1 >= 0 && uiDeltaDC1Max > ((1<<bitDepthY)-1) - abs(predDC1) ) { uiDeltaDC1Max = ((1<<bitDepthY)-1) - abs(predDC1); } 7495 7582 7496 7583 if( fullDeltaDC2 < 0 && uiDeltaDC2Max > abs(predDC2) ) { uiDeltaDC2Max = abs(predDC2); } 7497 if( fullDeltaDC2 >= 0 && uiDeltaDC2Max > ((1 << g_bitDepthY)-1) - abs(predDC2) ) { uiDeltaDC2Max = ((1 << g_bitDepthY)-1) - abs(predDC2); }7584 if( fullDeltaDC2 >= 0 && uiDeltaDC2Max > ((1<<bitDepthY)-1) - abs(predDC2) ) { uiDeltaDC2Max = ((1<<bitDepthY)-1) - abs(predDC2); } 7498 7585 7499 7586 // init dist with original segment DCs 7500 xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 );7587 assignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 ); 7501 7588 7502 7589 Dist uiOrgDist = RDO_DIST_MAX; 7503 7590 if( m_pcRdCost->getUseEstimatedVSD() ) 7504 7591 { 7505 uiOrgDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );7592 uiOrgDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, bitDepthY, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7506 7593 } 7507 7594 else 7508 7595 { 7509 uiOrgDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );7596 uiOrgDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, bitDepthY, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7510 7597 } 7511 7598 … … 7517 7604 for( UInt uiQStepDC1 = 0; uiQStepDC1 < uiDeltaDC1Max; uiQStepDC1 += 4 ) 7518 7605 { 7519 Pel testDC1 = Clip Y( predDC1 + ((Int)(uiQStepDC1) * (( fullDeltaDC1 < 0 ) ? -1 : 1)));7606 Pel testDC1 = ClipBD( predDC1 + ((Int)(uiQStepDC1) * (( fullDeltaDC1 < 0 ) ? -1 : 1)), bitDepthY ); 7520 7607 for( UInt uiQStepDC2 = 0; uiQStepDC2 < uiDeltaDC2Max; uiQStepDC2 += 4 ) 7521 7608 { 7522 Pel testDC2 = ClipY( predDC2 + ((Int)(uiQStepDC2) * (( fullDeltaDC2 < 0 ) ? -1 : 1)) ); 7523 7524 xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 ); 7609 Pel testDC2 = ClipBD( predDC2 + ((Int)(uiQStepDC2) * (( fullDeltaDC2 < 0 ) ? -1 : 1)), bitDepthY ); 7610 assignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 ); 7525 7611 7526 7612 Dist uiAct4Dist = RDO_DIST_MAX; 7527 7613 if( m_pcRdCost->getUseEstimatedVSD() ) 7528 7614 { 7529 uiAct4Dist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );7615 uiAct4Dist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, bitDepthY, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7530 7616 } 7531 7617 else 7532 7618 { 7533 uiAct4Dist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );7619 uiAct4Dist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, bitDepthY, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7534 7620 } 7535 7621 … … 7546 7632 for( UInt uiQStepDC1 = (UInt)max(0, ((Int)uiBestQStepDC1-3)); uiQStepDC1 <= (uiBestQStepDC1+3); uiQStepDC1++ ) 7547 7633 { 7548 Pel testDC1 = Clip Y( predDC1 + ((Int)(uiQStepDC1) * (( fullDeltaDC1 < 0 ) ? -1 : 1)));7634 Pel testDC1 = ClipBD( predDC1 + ((Int)(uiQStepDC1) * (( fullDeltaDC1 < 0 ) ? -1 : 1)), bitDepthY ); 7549 7635 for( UInt uiQStepDC2 = (UInt)max(0, ((Int)uiBestQStepDC2-3)); uiQStepDC2 <= (uiBestQStepDC2+3); uiQStepDC2++ ) 7550 7636 { 7551 Pel testDC2 = ClipY( predDC2 + ((Int)(uiQStepDC2) * (( fullDeltaDC2 < 0 ) ? -1 : 1)) ); 7552 7553 xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 ); 7637 Pel testDC2 = ClipBD( predDC2 + ((Int)(uiQStepDC2) * (( fullDeltaDC2 < 0 ) ? -1 : 1)), bitDepthY ); 7638 assignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 ); 7554 7639 7555 7640 Dist uiActDist = RDO_DIST_MAX; 7556 7641 if( m_pcRdCost->getUseEstimatedVSD() ) 7557 7642 { 7558 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );7643 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, bitDepthY, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7559 7644 } 7560 7645 else 7561 7646 { 7562 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false );7647 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, bitDepthY, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7563 7648 } 7564 7649 … … 7577 7662 7578 7663 #if H_3D_DIM_DLT 7579 rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), Clip Y(predDC1 + rDeltaDC1)) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );7580 rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), Clip Y(predDC2 + rDeltaDC2)) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );7664 rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipBD(predDC1 + rDeltaDC1), bitDepthY ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ); 7665 rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipBD(predDC2 + rDeltaDC2), bitDepthY ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ); 7581 7666 #endif 7582 7667 } … … 7585 7670 { 7586 7671 ruiTabIdx = 0; 7672 Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 7587 7673 7588 7674 // local pred buffer 7589 7675 TComYuv cPredYuv; 7590 cPredYuv.create( uiWidth, uiHeight );7676 cPredYuv.create( uiWidth, uiHeight, CHROMA_400 ); 7591 7677 cPredYuv.clear(); 7592 7678 7593 UInt uiPredStride = cPredYuv.getStride( );7594 Pel* piPred = cPredYuv.get LumaAddr();7679 UInt uiPredStride = cPredYuv.getStride( COMPONENT_Y ); 7680 Pel* piPred = cPredYuv.getAddr( COMPONENT_Y ); 7595 7681 7596 7682 Pel refDC1 = 0; Pel refDC2 = 0; 7597 WedgeList* pacWedgeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 7598 WedgeNodeList* pacWedgeNodeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeNodeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 7683 7684 WedgeList* pacWedgeList = getWedgeListScaled ( uiWidth ); 7685 WedgeNodeList* pacWedgeNodeList = getWedgeNodeListScaled( uiWidth ); 7599 7686 7600 7687 // coarse wedge search … … 7604 7691 { 7605 7692 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())); 7606 Bool *pbPattern = pc CU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();7607 UInt uiStride = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();7608 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2 );7609 xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );7693 Bool *pbPattern = pcWedgelet->getPatternScaled(uiWidth); 7694 UInt uiStride = uiWidth; 7695 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2, (1<<(bitDepthY-1)) ); 7696 assignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7610 7697 7611 7698 Dist uiActDist = RDO_DIST_MAX; 7612 #if H_3D_VSO7699 #if NH_3D_VSO 7613 7700 if( m_pcRdCost->getUseVSO() ) 7614 7701 { 7615 7702 if( m_pcRdCost->getUseEstimatedVSD() ) 7616 7703 { 7617 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7704 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false ); 7618 7705 } 7619 7706 else 7620 7707 { 7621 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7708 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false ); 7622 7709 } 7623 7710 } … … 7625 7712 #endif 7626 7713 { 7627 uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );7714 uiActDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, COMPONENT_Y, DF_SAD ); 7628 7715 } 7629 7716 … … 7640 7727 for( UInt uiRefId = 0; uiRefId < DMM_NUM_WEDGE_REFINES; uiRefId++ ) 7641 7728 { 7642 if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != DMM_NO_WEDGE INDEX )7729 if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != DMM_NO_WEDGE_IDX ) 7643 7730 { 7644 7731 TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))); 7645 Bool *pbPattern = pc CU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();7646 UInt uiStride = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();7647 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2 );7648 xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );7732 Bool *pbPattern = pcWedgelet->getPatternScaled(uiWidth); 7733 UInt uiStride = uiWidth; 7734 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2, (1<<(bitDepthY-1)) ); 7735 assignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7649 7736 Dist uiActDist = RDO_DIST_MAX; 7650 #if H_3D_VSO7737 #if NH_3D_VSO 7651 7738 if( m_pcRdCost->getUseVSO() ) 7652 7739 { 7653 if( m_pcRdCost->getUseEstimatedVSD() ) //PM: use VSO instead of VSD here?7654 { 7655 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7740 if( m_pcRdCost->getUseEstimatedVSD() ) 7741 { 7742 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false ); 7656 7743 } 7657 7744 else 7658 7745 { 7659 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7746 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false ); 7660 7747 } 7661 7748 } … … 7663 7750 #endif 7664 7751 { 7665 uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );7752 uiActDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, COMPONENT_Y, DF_SAD ); 7666 7753 } 7667 7754 … … 7681 7768 7682 7769 #endif 7683 #endif 7684 7770 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC 7771 #if NH_3D_SDC 7772 Void TEncSearch::xCalcConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC ) 7773 { 7774 valDC = 0; 7775 UInt uiDC = 0; 7776 UInt uiNumPixDC = 0; 7777 7778 Int subSamplePix = ( uiSize > 16 ) ? 2 : 1; 7779 7780 Pel* piTemp = ptrSrc; 7781 for( UInt uiY = 0; uiY < uiSize; uiY += subSamplePix ) 7782 { 7783 for( UInt uiX = 0; uiX < uiSize; uiX += subSamplePix ) 7784 { 7785 uiDC += piTemp[uiX]; 7786 uiNumPixDC++; 7787 } 7788 piTemp += subSamplePix*srcStride; 7789 } 7790 7791 if( uiNumPixDC > 0 ) { valDC = uiDC / uiNumPixDC; } 7792 } 7793 #endif 7794 #endif 7685 7795 //! \} -
branches/HTM-14.1-update-dev1-HHI/source/Lib/TLibEncoder/TEncSearch.h
r1200 r1209 179 179 TComYuv* pcRecoYuv, 180 180 Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE] 181 #if H_3D_DIM 181 DEBUG_STRING_FN_DECLARE(sDebug) 182 #if NH_3D_ENC_DEPTH 182 183 , Bool bOnlyIVP 183 184 #endif 184 DEBUG_STRING_FN_DECLARE(sDebug));185 ); 185 186 186 187 Void estIntraPredChromaQT ( TComDataCU* pcCU, … … 282 283 DEBUG_STRING_FN_DECLARE(sTest) 283 284 ,Int default0Save1Load2 = 0 284 #if H_3D_DIM_ENC285 , Bool zeroResi = false285 #if NH_3D_ENC_DEPTH 286 , Bool zeroResiFlag = false 286 287 #endif 287 288 ); … … 300 301 #endif 301 302 Double& dRDCost, 302 #if H_3D_DIM_ENC303 , Bool zeroResi = false304 #endif305 303 TComTU &rTu 306 DEBUG_STRING_FN_DECLARE(sDebug)); 304 DEBUG_STRING_FN_DECLARE(sDebug) 305 #if NH_3D_ENC_DEPTH 306 , Bool zeroResiFlag = false 307 #endif 308 ); 307 309 308 310 Void xSetIntraResultLumaQT ( TComYuv* pcRecoYuv, … … 345 347 Void xIntraCodingDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ); 346 348 #endif 347 #if H_3D_DIM 349 348 350 // ------------------------------------------------------------------------------------------------------------------- 349 351 // Depth intra search 350 352 // ------------------------------------------------------------------------------------------------------------------- 351 Void xCalcBiSegDCs ( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2 ); 352 #if H_3D_DIM_DMM 353 #if NH_3D_DMM 354 Void xCalcBiSegDCs ( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2, Pel defaultVal, Bool subSamp = false ); 353 355 Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); 354 356 Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); … … 356 358 #if H_3D_DIM_SDC 357 359 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); 360 #endif 361 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC 362 #if NH_3D_SDC 363 Void xCalcConstantSDC ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC ); 358 364 #endif 359 365 #endif
Note: See TracChangeset for help on using the changeset viewer.