Changeset 646 in 3DVCSoftware for branches/HTM-8.2-dev0-Cleanup/source/Lib
- Timestamp:
- 19 Oct 2013, 02:18:06 (12 years ago)
- Location:
- branches/HTM-8.2-dev0-Cleanup/source/Lib
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-Cleanup/source/Lib/TAppCommon/TAppComCamPara.cpp
r637 r646 615 615 { 616 616 UInt uiFoundLine = -1; 617 #if H_3D_FIX_REN_WARNING618 617 if ( !xGetCameraDataRow( iView, uiFrame, uiFoundLine ) && xIsIn( m_aiSortedBaseViews, iView )) 619 #else620 if ( !xGetCameraDataRow( iView, uiFrame, uiFoundLine ) )621 #endif622 618 { 623 619 AOT( m_aadCameraParameters[ uiFoundLine ].size() < 6 ); … … 635 631 Int iDummy; 636 632 637 #if H_3D_FIX_REN_WARNING638 633 if( !xGetLeftRightView( iView, m_aiSortedBaseViews, iLeftView, iRightView, iDummy, iDummy ) || 639 #else640 if( !xGetLeftRightView( iView, m_aiViewsInCfgFile, iLeftView, iRightView, iDummy, iDummy ) ||641 #endif642 634 xGetCameraDataRow( iLeftView, uiFrame, uiLeftViewLine ) || 643 635 xGetCameraDataRow( iRightView, uiFrame, uiRightViewLine ) 644 636 ) 645 637 { 646 #if H_3D_FIX_REN_WARNING647 638 std::cerr << "No left or no right base view next to view " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl; 648 #else649 std::cerr << "No Left or no Right View next to View " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl;650 #endif651 639 AOT(true); 652 640 exit( EXIT_FAILURE ); … … 1352 1340 } 1353 1341 } 1354 #if H_3D_FIX_REN_WARNING 1342 1355 1343 Bool bIgnoreFirst = true; 1356 1344 for( UInt uiERView = 0; uiERView < m_aiSynthViews.size() && !m_bSetupFromCoded; uiERView++ ) … … 1371 1359 std::cout << std::endl; 1372 1360 } 1373 #endif1374 1361 1375 1362 Bool bInterpolateFirst = true; … … 1390 1377 if ( bInterpolateFirst ) 1391 1378 { 1392 #if H_3D_FIX_REN_WARNING1393 1379 std::cout << "Interpolating camera parameters for virtual view(s): " ; 1394 #else1395 std::cout << "Interpolating Camera Parameters for View(s) " ;1396 #endif1397 1380 bInterpolateFirst = false; 1398 1381 } … … 1498 1481 } 1499 1482 1500 #if H_3D_FIX_REN_WARNING1501 1483 Bool 1502 1484 TAppComCamPara::xIsIn( std::vector<Int>& rVec, Int iElem) … … 1509 1491 return bFound; 1510 1492 } 1511 #endif1512 1493 1513 1494 Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ) -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TAppCommon/TAppComCamPara.h
r637 r646 131 131 Void xSetupBaseViewsFromCoded (); 132 132 Void xSetupBaseViews ( Char* pchBaseViewNumbers, UInt uiNumBaseViews ); 133 #if H_3D_FIX_REN_WARNING134 133 Bool xIsIn ( std::vector<Int>& rVec, Int iNumber); 135 #endif136 137 134 138 135 // functions for getting and setting scales and offsets -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/ContextTables.h
r622 r646 112 112 #if H_3D_DIM_DMM 113 113 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 114 #if !SEC_DMM2_E0146_HHIFIX115 #define NUM_DMM2_DATA_CTX 1 ///< number of context models for DMM2 data116 #endif117 114 #define NUM_DMM3_DATA_CTX 1 ///< number of context models for DMM3 data 118 115 #endif … … 127 124 #endif 128 125 129 #if LGE_INTER_SDC_E0156126 #if H_3D_INTER_SDC 130 127 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 131 128 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual … … 390 387 #endif 391 388 #if H_3D_DIM 392 #if ZJU_DEPTH_INTRA_MODE_E0204393 389 static const UChar 394 390 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = … … 398 394 {64, 0, CNU, CNU, 168, 109, 0, 0} 399 395 }; 400 #else 401 static const UChar 402 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = 403 { 404 {0, 0, 64, 0, CNU, 0, CNU, 0}, 405 {0, 64, 0, CNU, 0, CNU, 0, 0}, 406 {64, 0, CNU, 0, CNU, 0, 0, 0} 407 }; 408 #endif 396 409 397 static const UChar 410 398 INIT_DDC_FLAG[3][NUM_DDC_FLAG_CTX] = … … 429 417 { CNU }, 430 418 }; 431 #if !SEC_DMM2_E0146_HHIFIX432 static const UChar433 INIT_DMM2_DATA[3][NUM_DMM2_DATA_CTX] =434 {435 { CNU },436 { CNU },437 { CNU },438 };439 #endif440 419 static const UChar 441 420 INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] = … … 473 452 #endif 474 453 475 #if LGE_INTER_SDC_E0156454 #if H_3D_INTER_SDC 476 455 static const UChar 477 456 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
r630 r646 120 120 m_dmmWedgeTabIdx[i] = NULL; 121 121 } 122 #if !SEC_DMM2_E0146_HHIFIX123 m_dmm2DeltaEnd = NULL;124 #endif125 122 m_dmm3IntraTabIdx = NULL; 126 123 #endif … … 153 150 m_pbICFlag = NULL; 154 151 #endif 155 #if LGE_INTER_SDC_E0156152 #if H_3D_INTER_SDC 156 153 m_pbInterSDCFlag = NULL; 157 154 for( Int i = 0; i < 4; i++ ) … … 274 271 m_dmmWedgeTabIdx[i] = (UInt*)xMalloc(UInt, uiNumPartition); 275 272 } 276 #if !SEC_DMM2_E0146_HHIFIX277 m_dmm2DeltaEnd = (Int* )xMalloc(Int, uiNumPartition);278 #endif279 273 m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 280 274 #endif … … 292 286 #endif 293 287 #endif 294 #if LGE_INTER_SDC_E0156288 #if H_3D_INTER_SDC 295 289 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 296 290 for( Int i = 0; i < 4; i++ ) … … 305 299 m_acCUMvField[1].setNumPartition(uiNumPartition ); 306 300 } 307 #if LGE_INTER_SDC_E0156301 #if H_3D_INTER_SDC 308 302 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth); 309 303 #endif … … 410 404 if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; } 411 405 } 412 #if !SEC_DMM2_E0146_HHIFIX413 if ( m_dmm2DeltaEnd ) { xFree( m_dmm2DeltaEnd ); m_dmm2DeltaEnd = NULL; }414 #endif415 406 if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; } 416 407 #endif … … 428 419 #endif 429 420 #endif 430 #if LGE_INTER_SDC_E0156421 #if H_3D_INTER_SDC 431 422 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 432 423 for(Int i = 0; i < 4; i++ ) … … 436 427 #endif 437 428 } 438 #if LGE_INTER_SDC_E0156429 #if H_3D_INTER_SDC 439 430 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; } 440 431 #endif … … 575 566 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 576 567 #endif 577 #if LGE_INTER_SDC_E0156568 #if H_3D_INTER_SDC 578 569 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 579 570 #endif … … 631 622 memset( m_dmmWedgeTabIdx[i] + firstElement, 0, numElements * sizeof( *m_dmmWedgeTabIdx[i] ) ); 632 623 } 633 #if !SEC_DMM2_E0146_HHIFIX634 memset( m_dmm2DeltaEnd + firstElement, 0, numElements * sizeof( *m_dmm2DeltaEnd ) );635 #endif636 624 memset( m_dmm3IntraTabIdx + firstElement, 0, numElements * sizeof( *m_dmm3IntraTabIdx ) ); 637 625 #endif … … 649 637 #endif 650 638 #endif 651 #if LGE_INTER_SDC_E0156639 #if H_3D_INTER_SDC 652 640 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 653 641 for( Int i = 0; i < 4; i++ ) … … 811 799 m_dmmWedgeTabIdx[i] [ui] = 0; 812 800 } 813 #if !SEC_DMM2_E0146_HHIFIX814 m_dmm2DeltaEnd [ui] = 0;815 #endif816 801 m_dmm3IntraTabIdx [ui] = 0; 817 802 #endif … … 822 807 #endif 823 808 #endif 824 #if LGE_INTER_SDC_E0156809 #if H_3D_INTER_SDC 825 810 m_pbInterSDCFlag[ui] = false; 826 811 for( Int i = 0; i < 4; i++ ) … … 925 910 memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition ); 926 911 } 927 #if !SEC_DMM2_E0146_HHIFIX928 memset( m_dmm2DeltaEnd , 0, sizeof(Int ) * m_uiNumPartition );929 #endif930 912 memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition ); 931 913 #endif … … 943 925 #endif 944 926 #endif 945 #if LGE_INTER_SDC_E0156927 #if H_3D_INTER_SDC 946 928 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 947 929 for( Int i = 0; i < 4; i++ ) … … 1010 992 m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui]; 1011 993 } 1012 #if !SEC_DMM2_E0146_HHIFIX1013 m_dmm2DeltaEnd [ui] = pcCU->m_dmm2DeltaEnd [uiPartOffset+ui];1014 #endif1015 994 m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui]; 1016 995 #endif … … 1021 1000 #endif 1022 1001 #endif 1023 #if LGE_INTER_SDC_E01561002 #if H_3D_INTER_SDC 1024 1003 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 1025 1004 for( Int i = 0; i < 4; i++ ) … … 1167 1146 m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart; 1168 1147 } 1169 #if !SEC_DMM2_E0146_HHIFIX1170 m_dmm2DeltaEnd = pcCU->getDmm2DeltaEnd() + uiPart;1171 #endif1172 1148 m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart; 1173 1149 #endif … … 1185 1161 #endif 1186 1162 #endif 1187 #if LGE_INTER_SDC_E01561163 #if H_3D_INTER_SDC 1188 1164 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1189 1165 for( Int i = 0; i < 4; i++ ) … … 1366 1342 memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition ); 1367 1343 } 1368 #if !SEC_DMM2_E0146_HHIFIX1369 memcpy( m_dmm2DeltaEnd + uiOffset, pcCU->getDmm2DeltaEnd() , sizeof(Int ) * uiNumPartition );1370 #endif1371 1344 memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition ); 1372 1345 #endif … … 1384 1357 #endif 1385 1358 #endif 1386 #if LGE_INTER_SDC_E01561359 #if H_3D_INTER_SDC 1387 1360 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1388 1361 for( Int i = 0; i < 4; i++ ) … … 1496 1469 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition ); 1497 1470 } 1498 #if !SEC_DMM2_E0146_HHIFIX1499 memcpy( rpcCU->getDmm2DeltaEnd() + m_uiAbsIdxInLCU, m_dmm2DeltaEnd , sizeof(Int ) * m_uiNumPartition );1500 #endif1501 1471 memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition ); 1502 1472 #endif … … 1514 1484 #endif 1515 1485 #endif 1516 #if LGE_INTER_SDC_E01561486 #if H_3D_INTER_SDC 1517 1487 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1518 1488 for( Int i = 0;i < 4; i++ ) … … 1612 1582 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart ); 1613 1583 } 1614 #if !SEC_DMM2_E0146_HHIFIX1615 memcpy( rpcCU->getDmm2DeltaEnd() + uiPartOffset, m_dmm2DeltaEnd , sizeof(Int ) * uiQNumPart );1616 #endif1617 1584 memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart ); 1618 1585 #endif … … 1630 1597 #endif 1631 1598 #endif 1632 #if LGE_INTER_SDC_E01561599 #if H_3D_INTER_SDC 1633 1600 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1634 1601 for( Int i = 0; i < 4; i++ ) … … 2351 2318 #endif 2352 2319 2353 #if LGE_INTER_SDC_E01562320 #if H_3D_INTER_SDC 2354 2321 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2355 2322 { … … 5007 4974 + ( iPartWidth/m_pcPic->getMinCUWidth() )/2]; 5008 4975 } 5009 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01705010 Void TComDataCU::compressMV( int scale)4976 #if H_3D 4977 Void TComDataCU::compressMV(Int scale) 5011 4978 #else 5012 4979 Void TComDataCU::compressMV() 5013 4980 #endif 5014 4981 { 5015 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01704982 #if H_3D 5016 4983 Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize; 5017 4984 #else … … 5720 5687 TComMv defaultDV(0, 0); 5721 5688 pDInfo->m_acNBDV = defaultDV; 5722 #if NBDV_DEFAULT_VIEWIDX_BUGFIX 5689 5723 5690 Int valid = 0; 5724 5691 Int viewIndex = 0; … … 5771 5738 #endif 5772 5739 } 5773 #else5774 pDInfo->m_aVIdxCan = 0;5775 #if H_3D_NBDV_REF5776 TComPic* picDepth = NULL;5777 picDepth = getSlice()->getIvPic( true, 0 );5778 assert(picDepth!=NULL);5779 5780 if (picDepth && bDepthRefine)5781 {5782 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view5783 }5784 pDInfo->m_acDoNBDV = defaultDV;5785 #endif5786 #endif5787 5740 return false; 5788 5741 } … … 6308 6261 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 6309 6262 } 6310 #if !SEC_DMM2_E0146_HHIFIX6311 Void TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth )6312 {6313 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);6314 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; }6315 }6316 #endif6317 6263 Void TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 6318 6264 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.h
r622 r646 208 208 #if H_3D_DIM_DMM 209 209 UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 210 #if !SEC_DMM2_E0146_HHIFIX211 Int* m_dmm2DeltaEnd;212 #endif213 210 UInt* m_dmm3IntraTabIdx; 214 211 #endif … … 225 222 #endif 226 223 #endif 227 #if LGE_INTER_SDC_E0156224 #if H_3D_INTER_SDC 228 225 Bool* m_pbInterSDCFlag; 229 226 Int* m_apSegmentInterDCOffset[4]; … … 545 542 Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); 546 543 547 #if !SEC_DMM2_E0146_HHIFIX548 Int* getDmm2DeltaEnd () { return m_dmm2DeltaEnd; }549 Int getDmm2DeltaEnd ( UInt uiIdx ) { return m_dmm2DeltaEnd[uiIdx]; }550 Void setDmm2DeltaEnd ( UInt uiIdx, Int iD ) { m_dmm2DeltaEnd[uiIdx] = iD; }551 Void setDmm2DeltaEndSubParts ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );552 #endif553 554 544 UInt* getDmm3IntraTabIdx () { return m_dmm3IntraTabIdx; } 555 545 UInt getDmm3IntraTabIdx ( UInt uiIdx ) { return m_dmm3IntraTabIdx[uiIdx]; } … … 588 578 #endif 589 579 #endif 590 #if LGE_INTER_SDC_E0156580 #if H_3D_INTER_SDC 591 581 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 592 582 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } … … 626 616 Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } 627 617 Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } 628 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170629 Void compressMV ( int scale);618 #if H_3D 619 Void compressMV ( Int scale ); 630 620 #else 631 621 Void compressMV (); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPattern.h
r608 r646 102 102 Bool m_bICFlag; 103 103 #endif 104 #if LGE_INTER_SDC_E0156104 #if H_3D_INTER_SDC 105 105 Bool m_bSDCMRSADFlag; 106 106 #endif … … 119 119 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } 120 120 #endif 121 #if LGE_INTER_SDC_E0156121 #if H_3D_INTER_SDC 122 122 Bool getSDCMRSADFlag() { return m_bSDCMRSADFlag; } 123 123 Void setSDCMRSADFlag( Bool bSDCMRSADFlag ) { m_bSDCMRSADFlag = bSDCMRSADFlag; } -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.cpp
r630 r646 157 157 deleteSEIs(m_SEIs); 158 158 } 159 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170160 Void TComPic::compressMotion( int scale)159 #if H_3D 160 Void TComPic::compressMotion(Int scale) 161 161 #else 162 162 Void TComPic::compressMotion() … … 167 167 { 168 168 TComDataCU* pcCU = pPicSym->getCU(uiCUAddr); 169 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170169 #if H_3D 170 170 pcCU->compressMV(scale); 171 171 #else -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPic.h
r608 r646 186 186 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 187 187 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } 188 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170189 Void compressMotion( int scale);188 #if H_3D 189 Void compressMotion(Int scale); 190 190 #else 191 191 Void compressMotion(); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.cpp
r630 r646 39 39 #include "TComPrediction.h" 40 40 41 #if SHARP_ILLUCOMP_REFINE_E004642 #define IC_REG_COST_SHIFT 743 #define IC_CONST_SHIFT 544 #define IC_SHIFT_DIFF 1245 #endif46 47 41 //! \ingroup TLibCommon 48 42 //! \{ … … 69 63 if (m_pDepthBlock != NULL) 70 64 free(m_pDepthBlock); 71 #if NTT_VSP_COMMON_E0207_E020872 65 m_cYuvDepthOnVsp.destroy(); 73 #endif74 66 #endif 75 67 … … 129 121 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 130 122 #endif 131 #if NTT_VSP_COMMON_E0207_E0208123 #if H_3D_VSP 132 124 m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 133 125 #endif … … 143 135 } 144 136 #if H_3D_IC 145 #if SHARP_ILLUCOMP_REFINE_E0046146 137 m_uiaShift[0] = 0; 147 138 for( Int i = 1; i < 64; i++ ) … … 149 140 m_uiaShift[i] = ( (1 << 15) + i/2 ) / i; 150 141 } 151 #else152 for( Int i = 1; i < 64; i++ )153 {154 m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i;155 }156 #endif157 142 #endif 158 143 } … … 456 441 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 457 442 } break; 458 #if !SEC_DMM2_E0146_HHIFIX459 case( DMM2_IDX ):460 {461 UInt uiTabIdx = 0;462 if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }463 else464 {465 uiTabIdx = xPredWedgeFromIntra( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm2DeltaEnd( uiAbsPartIdx ) );466 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, uiAbsPartIdx, (pcCU->getDepth(0) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1)) );467 }468 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);469 } break;470 #endif471 443 case( DMM3_IDX ): 472 444 { … … 709 681 #endif 710 682 , bICFlag ); 711 #if SHARP_ILLUCOMP_REFINE_E0046712 683 bICFlag = bICFlag && (iWidth > 8); 713 #endif714 684 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 715 685 #if H_3D_ARP … … 772 742 } 773 743 #endif 774 775 #if NTT_VSP_COMMON_E0207_E0208776 744 // fetch virtual depth map 777 #if NTT_VSP_VECTOR_CLIP_E0208778 745 pcBaseViewDepthPicYuv->extendPicBorder(); 779 #endif780 746 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp ); 781 747 // sub-PU based compensation 782 748 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 783 749 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 784 #else785 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();786 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];787 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];788 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );789 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );790 #endif791 792 750 } 793 751 #endif … … 1005 963 if ( yFrac == 0 ) 1006 964 { 1007 #if MTK_CLIPPING_ALIGN_IC_E0168965 #if H_3D_IC 1008 966 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi || bICFlag 1009 967 #else … … 1017 975 else if ( xFrac == 0 ) 1018 976 { 1019 #if MTK_CLIPPING_ALIGN_IC_E0168977 #if H_3D_IC 1020 978 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag 1021 979 #else … … 1040 998 #endif 1041 999 ); 1042 #if MTK_CLIPPING_ALIGN_IC_E01681000 #if H_3D_IC 1043 1001 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi || bICFlag 1044 1002 #else … … 1054 1012 if( bICFlag ) 1055 1013 { 1056 #if SHARP_ILLUCOMP_REFINE_E00461057 1014 Int a, b, i, j; 1058 1015 const Int iShift = IC_CONST_SHIFT; 1059 1016 1060 1017 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 1061 #else1062 Int a, b, iShift, i, j;1063 1064 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA );1065 #endif1066 1018 1067 1019 … … 1070 1022 for ( j = 0; j < width; j++ ) 1071 1023 { 1072 #if !MTK_CLIPPING_ALIGN_IC_E01681073 if( bi )1074 {1075 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;1076 dst[j] = ( ( a*dst[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1 << iIFshift ) - IF_INTERNAL_OFFS;1077 }1078 else1079 #endif1080 1024 dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 1081 1025 } 1082 1026 dst += dstStride; 1083 1027 } 1084 #if MTK_CLIPPING_ALIGN_IC_E0168 1028 1085 1029 if(bi) 1086 1030 { … … 1097 1041 } 1098 1042 } 1099 #endif1100 1043 } 1101 1044 #endif … … 1148 1091 if ( yFrac == 0 ) 1149 1092 { 1150 #if MTK_CLIPPING_ALIGN_IC_E01681093 #if H_3D_IC 1151 1094 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1152 1095 #else … … 1157 1100 #endif 1158 1101 ); 1159 #if MTK_CLIPPING_ALIGN_IC_E01681102 #if H_3D_IC 1160 1103 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1161 1104 #else … … 1169 1112 else if ( xFrac == 0 ) 1170 1113 { 1171 #if MTK_CLIPPING_ALIGN_IC_E01681114 #if H_3D_IC 1172 1115 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1173 1116 #else … … 1178 1121 #endif 1179 1122 ); 1180 #if MTK_CLIPPING_ALIGN_IC_E01681123 #if H_3D_IC 1181 1124 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1182 1125 #else … … 1195 1138 #endif 1196 1139 ); 1197 #if MTK_CLIPPING_ALIGN_IC_E01681140 #if H_3D_IC 1198 1141 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1199 1142 #else … … 1210 1153 #endif 1211 1154 ); 1212 #if MTK_CLIPPING_ALIGN_IC_E01681155 #if H_3D_IC 1213 1156 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1214 1157 #else … … 1224 1167 if( bICFlag ) 1225 1168 { 1226 #if SHARP_ILLUCOMP_REFINE_E00461227 1169 Int a, b, i, j; 1228 1170 const Int iShift = IC_CONST_SHIFT; 1229 1171 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb 1230 #else1231 Int a, b, iShift, i, j;1232 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb1233 #endif1234 1172 for ( i = 0; i < cxHeight; i++ ) 1235 1173 { 1236 1174 for ( j = 0; j < cxWidth; j++ ) 1237 1175 { 1238 #if !MTK_CLIPPING_ALIGN_IC_E01681239 if( bi )1240 {1241 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;1242 dstCb[j] = ( ( a*dstCb[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;1243 }1244 else1245 #endif1246 1176 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b ); 1247 1177 } 1248 1178 dstCb += dstStride; 1249 1179 } 1250 #if SHARP_ILLUCOMP_REFINE_E00461251 1180 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr 1252 #else1253 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr1254 #endif1255 1181 for ( i = 0; i < cxHeight; i++ ) 1256 1182 { 1257 1183 for ( j = 0; j < cxWidth; j++ ) 1258 1184 { 1259 #if !MTK_CLIPPING_ALIGN_IC_E01681260 if( bi )1261 {1262 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;1263 dstCr[j] = ( ( a*dstCr[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;1264 }1265 else1266 #endif1267 1185 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b ); 1268 1186 } 1269 1187 dstCr += dstStride; 1270 1188 } 1271 #if MTK_CLIPPING_ALIGN_IC_E0168 1189 1272 1190 if(bi) 1273 1191 { … … 1289 1207 } 1290 1208 } 1291 #endif1292 1209 } 1293 1210 #endif … … 1438 1355 } 1439 1356 1440 #if !SHARP_ILLUCOMP_REFINE_E00461441 /** Function for counting leading number of zeros/ones1442 * \param x input value1443 \ This function counts leading number of zeros for positive numbers and1444 \ leading number of ones for negative numbers. This can be implemented in1445 \ single instructure cycle on many processors.1446 */1447 1448 Short CountLeadingZerosOnes (Short x)1449 {1450 Short clz;1451 Short i;1452 1453 if(x == 0)1454 {1455 clz = 0;1456 }1457 else1458 {1459 if (x == -1)1460 {1461 clz = 15;1462 }1463 else1464 {1465 if(x < 0)1466 {1467 x = ~x;1468 }1469 clz = 15;1470 for(i = 0;i < 15;++i)1471 {1472 if(x)1473 {1474 clz --;1475 }1476 x = x >> 1;1477 }1478 }1479 }1480 return clz;1481 }1482 #endif1483 1357 1484 1358 /** Function for deriving LM illumination compensation. 1485 1359 */ 1486 #if SHARP_ILLUCOMP_REFINE_E00461487 1360 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ) 1488 #else1489 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType )1490 #endif1491 1361 { 1492 1362 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); … … 1516 1386 1517 1387 Int x = 0, y = 0, xx = 0, xy = 0; 1518 #if SHARP_ILLUCOMP_REFINE_E00461519 1388 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 1520 #endif1521 1389 1522 1390 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) … … 1540 1408 } 1541 1409 1542 #if SHARP_ILLUCOMP_REFINE_E00461543 1410 for( j = 0; j < uiWidth; j+=2 ) 1544 #else1545 for( j = 0; j < uiWidth; j++ )1546 #endif1547 1411 { 1548 1412 x += pRef[j]; 1549 1413 y += pRec[j]; 1550 #if SHARP_ILLUCOMP_REFINE_E00461551 1414 xx += (pRef[j] * pRef[j])>>precShift; 1552 1415 xy += (pRef[j] * pRec[j])>>precShift; 1553 #else 1554 xx += pRef[j] * pRef[j]; 1555 xy += pRef[j] * pRec[j]; 1556 #endif 1557 } 1558 #if SHARP_ILLUCOMP_REFINE_E0046 1416 } 1559 1417 iCountShift += g_aucConvertToBit[ uiWidth ] + 1; 1560 #else1561 iCountShift += g_aucConvertToBit[ uiWidth ] + 2;1562 #endif1563 1418 } 1564 1419 … … 1584 1439 } 1585 1440 1586 #if SHARP_ILLUCOMP_REFINE_E00461587 1441 for( i = 0; i < uiHeight; i+=2 ) 1588 #else1589 for( i = 0; i < uiHeight; i++ )1590 #endif1591 1442 { 1592 1443 x += pRef[0]; 1593 1444 y += pRec[0]; 1594 #if SHARP_ILLUCOMP_REFINE_E0046 1445 1595 1446 xx += (pRef[0] * pRef[0])>>precShift; 1596 1447 xy += (pRef[0] * pRec[0])>>precShift; … … 1598 1449 pRef += iRefStride*2; 1599 1450 pRec += iRecStride*2; 1600 #else 1601 xx += pRef[0] * pRef[0]; 1602 xy += pRef[0] * pRec[0]; 1603 1604 pRef += iRefStride; 1605 pRec += iRecStride; 1606 #endif 1607 } 1608 #if SHARP_ILLUCOMP_REFINE_E0046 1451 } 1609 1452 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 ); 1610 #else 1611 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1612 #endif 1613 } 1614 1615 #if SHARP_ILLUCOMP_REFINE_E0046 1453 } 1454 1616 1455 xy += xx >> IC_REG_COST_SHIFT; 1617 1456 xx += xx >> IC_REG_COST_SHIFT; … … 1620 1459 const Int iShift = IC_CONST_SHIFT; 1621 1460 { 1622 #else1623 Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;1624 1625 if( iTempShift > 0 )1626 {1627 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1628 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1629 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1630 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1631 iCountShift -= iTempShift;1632 }1633 1634 iShift = 13;1635 1636 if( iCountShift == 0 )1637 {1638 a = 1;1639 b = 0;1640 iShift = 0;1641 }1642 else1643 {1644 Int a1 = ( xy << iCountShift ) - y * x;1645 Int a2 = ( xx << iCountShift ) - x * x;1646 #endif1647 1461 { 1648 1462 const Int iShiftA2 = 6; 1649 #if !SHARP_ILLUCOMP_REFINE_E00461650 const Int iShiftA1 = 15;1651 #endif1652 1463 const Int iAccuracyShift = 15; 1653 1464 … … 1657 1468 Int a2s = a2; 1658 1469 1659 #if SHARP_ILLUCOMP_REFINE_E00461660 1470 a1 = Clip3(0, 2*a2, a1); 1661 1471 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1662 1472 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 1663 #else1664 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;1665 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;1666 #endif1667 1473 1668 1474 if( iScaleShiftA1 < 0 ) … … 1683 1489 a1s = a1 >> iScaleShiftA1; 1684 1490 1685 #if SHARP_ILLUCOMP_REFINE_E00461686 1491 a = a1s * m_uiaShift[ a2s ]; 1687 1492 a = a >> iScaleShiftA; 1688 #else1689 if (a2s >= 1)1690 {1691 a = a1s * m_uiaShift[ a2s - 1];1692 }1693 else1694 {1695 a = 0;1696 }1697 1698 if( iScaleShiftA < 0 )1699 {1700 a = a << -iScaleShiftA;1701 }1702 else1703 {1704 a = a >> iScaleShiftA;1705 }1706 1707 a = Clip3( -( 1 << 15 ), ( 1 << 15 ) - 1, a );1708 1709 Int minA = -(1 << (6));1710 Int maxA = (1 << 6) - 1;1711 if( a <= maxA && a >= minA )1712 {1713 // do nothing1714 }1715 else1716 {1717 Short n = CountLeadingZerosOnes( a );1718 a = a >> (9-n);1719 iShift -= (9-n);1720 }1721 #endif1722 1493 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1723 1494 } … … 1727 1498 1728 1499 #if H_3D_VSP 1729 1730 #if NTT_VSP_COMMON_E0207_E02081731 1500 // not fully support iRatioTxtPerDepth* != 1 1732 1501 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) … … 1736 1505 1737 1506 Int refDepStride = picRefDepth->getStride(); 1738 1739 #if NTT_VSP_VECTOR_CLIP_E02081740 1507 1741 1508 Int refDepOffset = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride; … … 1757 1524 refDepth += refDepOffset; 1758 1525 1759 #else // NTT_VSP_VECTOR_CLIP_E02081760 1761 Int widthDepth = picRefDepth->getWidth();1762 Int heightDepth = picRefDepth->getHeight();1763 Int posX, posY;1764 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture1765 posX /= ratioTxtPerDepthX; // texture position -> depth postion1766 posY /= ratioTxtPerDepthY;1767 1768 posX = Clip3(0, widthDepth-width, posX + ((mv->getHor()+2)>>2));1769 posY = Clip3(0, heightDepth-height, posY + ((mv->getVer()+2)>>2));1770 1771 Pel *refDepth = picRefDepth->getLumaAddr() + posX + posY * refDepStride;1772 1773 #endif // NTT_VSP_VECTOR_CLIP_E02081774 1775 1526 Int depStride = yuvDepth->getStride(); 1776 1527 Pel *depth = yuvDepth->getLumaAddr(); 1777 1778 #if NTT_VSP_ADAPTIVE_SPLIT_E02071779 1528 1780 1529 if( width<8 || height<8 ) … … 1915 1664 } 1916 1665 1917 #else // NTT_VSP_ADAPTIVE_SPLIT_E0207 1918 1919 Int rightOffset = nTxtPerDepthX - 1; 1920 Int depStrideBlock = depStride * nTxtPerDepthY; 1921 Int refDepStrideBlock = refDepStride * nTxtPerDepthY; 1922 Pel *refDepthTop = refDepth; 1923 Pel *refDepthBot = refDepthTop + (nTxtPerDepthY-1)*refDepStride; 1924 1925 for( Int y=0; y<height; y+= nTxtPerDepthY ) 1926 { 1927 for( Int x=0; x<width; x+=nTxtPerDepthX ) 1928 { 1929 Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x]; 1930 1931 if( maxDepth < refDepthTop[x+rightOffset] ) 1932 { 1933 maxDepth = refDepthTop[x+rightOffset]; 1934 } 1935 if( maxDepth < refDepthBot[x+rightOffset] ) 1936 { 1937 maxDepth = refDepthBot[x+rightOffset]; 1938 } 1939 1940 depth[x] = maxDepth; 1941 1942 } 1943 refDepthTop += refDepStrideBlock; 1944 refDepthBot += refDepStrideBlock; 1945 depth += depStrideBlock; 1946 } 1947 1948 #endif // NTT_VSP_ADAPTIVE_SPLIT_E0207 1666 1949 1667 } 1950 1668 … … 1964 1682 Pel *dst = yuvDst->getLumaAddr(partAddr); 1965 1683 Pel *depth = yuvDepth->getLumaAddr(); 1966 1967 #if !(NTT_VSP_DC_BUGFIX_E0208)1968 Int widthLuma = picRef->getWidth();1969 Int posX, posY;1970 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture1971 #endif1972 1684 1973 1685 #if H_3D_VSP_BLOCKSIZE == 1 … … 2042 1754 Int xFrac = disparity & 0x3; 2043 1755 2044 #if NTT_VSP_DC_BUGFIX_E02082045 2046 1756 dv.setHor( disparity ); 2047 1757 cu->clipMv( dv ); … … 2059 1769 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2060 1770 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2061 2062 #else // NTT_VSP_DC_BUGFIX_E02082063 2064 for( Int j=0; j < nTxtPerDepthX; j++ )2065 {2066 Int refOffset = xTxt+j + (disparity >> 2);2067 #if H_3D_VSP_CONSTRAINED2068 if(refOffset<minRelativePos || refOffset>maxRelativePos)2069 {2070 xFrac = 0;2071 }2072 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2073 #endif2074 Int absX = posX + refOffset;2075 2076 if (xFrac == 0)2077 {2078 absX = Clip3(0, widthLuma-1, absX);2079 }2080 else2081 {2082 absX = Clip3(4, widthLuma-5, absX);2083 }2084 2085 refOffset = absX - posX;2086 assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 );2087 2088 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2089 }2090 2091 #endif // NTT_VSP_DC_BUGFIX_E02082092 2093 1771 } 2094 1772 ref += refStrideBlock; … … 2122 1800 Pel *depth = yuvDepth->getLumaAddr(); 2123 1801 2124 #if !(NTT_VSP_DC_BUGFIX_E0208)2125 Int widthChroma = picRef->getWidth() >> 1;2126 Int posX, posY;2127 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture2128 posX >>= 1;2129 posY >>= 1;2130 #endif2131 2132 1802 #if H_3D_VSP_BLOCKSIZE == 1 2133 1803 #if H_3D_VSP_CONSTRAINED … … 2194 1864 Int xFrac = disparity & 0x7; 2195 1865 2196 #if NTT_VSP_DC_BUGFIX_E02082197 2198 1866 dv.setHor( disparity ); 2199 1867 cu->clipMv( dv ); … … 2214 1882 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2215 1883 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2216 2217 #else // NTT_VSP_DC_BUGFIX_E02082218 2219 for( Int j=0; j < nTxtPerDepthX; j++ )2220 {2221 Int refOffset = xTxt+j + (disparity >> 3);2222 #if H_3D_VSP_CONSTRAINED2223 if(refOffset<minRelativePos || refOffset>maxRelativePos)2224 {2225 xFrac = 0;2226 }2227 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2228 #endif2229 Int absX = posX + refOffset;2230 2231 if (xFrac == 0)2232 {2233 absX = Clip3(0, widthChroma-1, absX);2234 }2235 else2236 {2237 absX = Clip3(4, widthChroma-5, absX);2238 }2239 2240 refOffset = absX - posX;2241 assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 );2242 assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 );2243 2244 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2245 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2246 }2247 2248 #endif // NTT_VSP_DC_BUGFIX_E02082249 1884 } 2250 1885 refCb += refStrideBlock; … … 2254 1889 depth += depStrideBlock; 2255 1890 } 2256 2257 } 2258 #else // NTT_VSP_COMMON_E0207_E0208 2259 2260 // Input: 2261 // refPic: Ref picture. Full picture, with padding 2262 // posX, posY: PU position, texture 2263 // sizeX, sizeY: PU size 2264 // partAddr: z-order index 2265 // dv: disparity vector. derived from neighboring blocks 2266 // 2267 // Output: dstPic, PU predictor 64x64 2268 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr,Int posX, Int posY 2269 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi ) 2270 { 2271 Int widthLuma; 2272 Int heightLuma; 2273 2274 if (isDepth) 2275 { 2276 widthLuma = pPicBaseDepth->getWidth(); 2277 heightLuma = pPicBaseDepth->getHeight(); 2278 } 2279 else 2280 { 2281 widthLuma = refPic->getWidth(); 2282 heightLuma = refPic->getHeight(); 2283 } 2284 2285 #if H_3D_VSP_BLOCKSIZE != 1 2286 Int widthDepth = pPicBaseDepth->getWidth(); 2287 Int heightDepth = pPicBaseDepth->getHeight(); 2288 #endif 2289 2290 #if H_3D_VSP_CONSTRAINED 2291 Int widthDepth = pPicBaseDepth->getWidth(); 2292 Int heightDepth = pPicBaseDepth->getHeight(); 2293 #endif 2294 2295 Int nTxtPerDepthX = widthLuma / ( pPicBaseDepth->getWidth() ); // texture pixel # per depth pixel 2296 Int nTxtPerDepthY = heightLuma / ( pPicBaseDepth->getHeight() ); 2297 2298 Int refStride = refPic->getStride(); 2299 Int dstStride = dstPic->getStride(); 2300 Int depStride = pPicBaseDepth->getStride(); 2301 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + ((dv->getHor()+2)>>2)); 2302 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + ((dv->getVer()+2)>>2)); 2303 Pel *ref = refPic->getLumaAddr() + posX + posY * refStride; 2304 Pel *dst = dstPic->getLumaAddr(partAddr); 2305 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; 2306 2307 #if H_3D_VSP_BLOCKSIZE != 1 2308 #if H_3D_VSP_BLOCKSIZE == 2 2309 Int dW = sizeX>>1; 2310 Int dH = sizeY>>1; 2311 #endif 2312 #if H_3D_VSP_BLOCKSIZE == 4 2313 Int dW = sizeX>>2; 2314 Int dH = sizeY>>2; 2315 #endif 2316 { 2317 Pel* depthi = depth; 2318 for (Int j = 0; j < dH; j++) 2319 { 2320 for (Int i = 0; i < dW; i++) 2321 { 2322 Pel* depthTmp; 2323 #if H_3D_VSP_BLOCKSIZE == 2 2324 if (depthPosX + (i<<1) < widthDepth) 2325 depthTmp = depthi + (i << 1); 2326 else 2327 depthTmp = depthi + (widthDepth - depthPosX - 1); 2328 #endif 2329 #if H_3D_VSP_BLOCKSIZE == 4 2330 if (depthPosX + (i<<2) < widthDepth) 2331 depthTmp = depthi + (i << 2); 2332 else 2333 depthTmp = depthi + (widthDepth - depthPosX - 1); 2334 #endif 2335 Int maxV = 0; 2336 for (Int blockj = 0; blockj < H_3D_VSP_BLOCKSIZE; blockj+=(H_3D_VSP_BLOCKSIZE-1)) 2337 { 2338 Int iX = 0; 2339 for (Int blocki = 0; blocki < H_3D_VSP_BLOCKSIZE; blocki+=(H_3D_VSP_BLOCKSIZE-1)) 2340 { 2341 if (maxV < depthTmp[iX]) 2342 maxV = depthTmp[iX]; 2343 #if H_3D_VSP_BLOCKSIZE == 2 2344 if (depthPosX + (i<<1) + blocki < widthDepth - 1) 2345 #else // H_3D_VSP_BLOCKSIZE == 4 2346 if (depthPosX + (i<<2) + blocki < widthDepth - 1) 2347 #endif 2348 iX = (H_3D_VSP_BLOCKSIZE-1); 2349 } 2350 #if H_3D_VSP_BLOCKSIZE == 2 2351 if (depthPosY + (j<<1) + blockj < heightDepth - 1) 2352 #else // H_3D_VSP_BLOCKSIZE == 4 2353 if (depthPosY + (j<<2) + blockj < heightDepth - 1) 2354 #endif 2355 depthTmp += depStride * (H_3D_VSP_BLOCKSIZE-1); 2356 } 2357 m_pDepthBlock[i+j*dW] = maxV; 2358 } // end of i < dW 2359 #if H_3D_VSP_BLOCKSIZE == 2 2360 if (depthPosY + ((j+1)<<1) < heightDepth) 2361 depthi += (depStride << 1); 2362 else 2363 depthi = depth + (heightDepth-depthPosY-1)*depStride; 2364 #endif 2365 #if H_3D_VSP_BLOCKSIZE == 4 2366 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 2367 depthi += (depStride << 2); 2368 else 2369 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 2370 #endif 2371 } 2372 } 2373 #endif // H_3D_VSP_BLOCKSIZE != 1 2374 2375 #if H_3D_VSP_BLOCKSIZE == 1 2376 #if H_3D_VSP_CONSTRAINED 2377 //get LUT based horizontal reference range 2378 Int range = xGetConstrainedSize(sizeX, sizeY); 2379 2380 // The minimum depth value 2381 Int minRelativePos = MAX_INT; 2382 Int maxRelativePos = MIN_INT; 2383 2384 Pel* depthTemp, *depthInitial=depth; 2385 for (Int yTxt = 0; yTxt < sizeY; yTxt++) 2386 { 2387 for (Int xTxt = 0; xTxt < sizeX; xTxt++) 2388 { 2389 if (depthPosX+xTxt < widthDepth) 2390 depthTemp = depthInitial + xTxt; 2391 else 2392 depthTemp = depthInitial + (widthDepth - depthPosX - 1); 2393 2394 Int disparity = pShiftLUT[ *depthTemp ]; // << iShiftPrec; 2395 Int disparityInt = disparity >> 2; 2396 2397 if( disparity <= 0) 2398 { 2399 if (minRelativePos > disparityInt+xTxt) 2400 minRelativePos = disparityInt+xTxt; 2401 } 2402 else 2403 { 2404 if (maxRelativePos < disparityInt+xTxt) 2405 maxRelativePos = disparityInt+xTxt; 2406 } 2407 } 2408 if (depthPosY+yTxt < heightDepth) 2409 depthInitial = depthInitial + depStride; 2410 } 2411 2412 Int disparity_tmp = pShiftLUT[ *depth ]; // << iShiftPrec; 2413 if (disparity_tmp <= 0) 2414 maxRelativePos = minRelativePos + range -1 ; 2415 else 2416 minRelativePos = maxRelativePos - range +1 ; 2417 #endif 2418 #endif // H_3D_VSP_BLOCKSIZE == 1 2419 2420 #if H_3D_VSP_BLOCKSIZE != 1 2421 Int yDepth = 0; 2422 #endif 2423 for ( Int yTxt = 0; yTxt < sizeY; yTxt += nTxtPerDepthY ) 2424 { 2425 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth++ ) 2426 { 2427 Pel repDepth = 0; // to store the depth value used for warping 2428 #if H_3D_VSP_BLOCKSIZE == 1 2429 repDepth = depth[xDepth]; 2430 #endif 2431 #if H_3D_VSP_BLOCKSIZE == 2 2432 repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW]; 2433 #endif 2434 #if H_3D_VSP_BLOCKSIZE == 4 2435 repDepth = m_pDepthBlock[(xTxt>>2) + (yTxt>>2)*dW]; 2436 #endif 2437 2438 assert( repDepth >= 0 && repDepth <= 255 ); 2439 Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec ?? 2440 Int refOffset = xTxt + (disparity >> 2); 2441 Int xFrac = disparity & 0x3; 2442 #if H_3D_VSP_CONSTRAINED 2443 if(refOffset<minRelativePos || refOffset>maxRelativePos) 2444 xFrac = 0; 2445 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2446 #endif 2447 Int absX = posX + refOffset; 2448 2449 if (xFrac == 0) 2450 absX = Clip3(0, widthLuma-1, absX); 2451 else 2452 absX = Clip3(4, widthLuma-5, absX); 2453 2454 refOffset = absX - posX; 2455 2456 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2457 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi ); 2458 } 2459 ref += refStride*nTxtPerDepthY; 2460 dst += dstStride*nTxtPerDepthY; 2461 depth += depStride; 2462 #if H_3D_VSP_BLOCKSIZE != 1 2463 yDepth++; 2464 #endif 2465 2466 } 2467 } 2468 2469 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*dv, UInt partAddr, Int posX, Int posY 2470 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi) 2471 { 2472 Int refStride = refPic->getCStride(); 2473 Int dstStride = dstPic->getCStride(); 2474 Int depStride = pPicBaseDepth->getStride(); 2475 2476 Int widthChroma, heightChroma; 2477 if( isDepth) 2478 { 2479 widthChroma = pPicBaseDepth->getWidth()>>1; 2480 heightChroma = pPicBaseDepth->getHeight()>>1; 2481 } 2482 else 2483 { 2484 widthChroma = refPic->getWidth()>>1; 2485 heightChroma = refPic->getHeight()>>1; 2486 } 2487 2488 // Below is only for Texture chroma component 2489 2490 Int widthDepth = pPicBaseDepth->getWidth(); 2491 Int heightDepth = pPicBaseDepth->getHeight(); 2492 2493 Int nTxtPerDepthX, nTxtPerDepthY; // Number of texture samples per one depth sample 2494 Int nDepthPerTxtX, nDepthPerTxtY; // Number of depth samples per one texture sample 2495 2496 Int depthPosX; // Starting position in depth image 2497 Int depthPosY; 2498 2499 if ( widthChroma > widthDepth ) 2500 { 2501 nTxtPerDepthX = widthChroma / widthDepth; 2502 nDepthPerTxtX = 1; 2503 depthPosX = posX / nTxtPerDepthX + ((dv->getHor()+2)>>2); 2504 } 2505 else 2506 { 2507 nTxtPerDepthX = 1; 2508 nDepthPerTxtX = widthDepth / widthChroma; 2509 depthPosX = posX * nDepthPerTxtX + ((dv->getHor()+2)>>2); 2510 } 2511 depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX); 2512 if ( heightChroma > heightDepth ) 2513 { 2514 nTxtPerDepthY = heightChroma / heightDepth; 2515 nDepthPerTxtY = 1; 2516 depthPosY = posY / nTxtPerDepthY + ((dv->getVer()+2)>>2); 2517 } 2518 else 2519 { 2520 nTxtPerDepthY = 1; 2521 nDepthPerTxtY = heightDepth / heightChroma; 2522 depthPosY = posY * nDepthPerTxtY + ((dv->getVer()+2)>>2); 2523 } 2524 depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY); 2525 2526 Pel *refCb = refPic->getCbAddr() + posX + posY * refStride; 2527 Pel *refCr = refPic->getCrAddr() + posX + posY * refStride; 2528 Pel *dstCb = dstPic->getCbAddr(partAddr); 2529 Pel *dstCr = dstPic->getCrAddr(partAddr); 2530 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; // move the pointer to the current depth pixel position 2531 2532 Int refStrideBlock = refStride * nTxtPerDepthY; 2533 Int dstStrideBlock = dstStride * nTxtPerDepthY; 2534 Int depStrideBlock = depStride * nDepthPerTxtY; 2535 2536 if ( widthChroma > widthDepth ) // We assume 2537 { 2538 assert( heightChroma > heightDepth ); 2539 printf("This branch should never been reached.\n"); 2540 exit(0); 2541 } 2542 else 2543 { 2544 #if H_3D_VSP_BLOCKSIZE == 1 2545 Int dW = sizeX; 2546 Int dH = sizeY; 2547 Int sW = 2; // search window size 2548 Int sH = 2; 2549 #endif 2550 #if H_3D_VSP_BLOCKSIZE == 2 2551 Int dW = sizeX; 2552 Int dH = sizeY; 2553 Int sW = 2; // search window size 2554 Int sH = 2; 2555 #endif 2556 #if H_3D_VSP_BLOCKSIZE == 4 2557 Int dW = sizeX>>1; 2558 Int dH = sizeY>>1; 2559 Int sW = 4; // search window size 2560 Int sH = 4; 2561 #endif 2562 2563 { 2564 Pel* depthi = depth; 2565 for (Int j = 0; j < dH; j++) 2566 { 2567 for (Int i = 0; i < dW; i++) 2568 { 2569 Pel* depthTmp; 2570 #if H_3D_VSP_BLOCKSIZE == 1 2571 depthTmp = depthi + (i << 1); 2572 #endif 2573 #if H_3D_VSP_BLOCKSIZE == 2 2574 if (depthPosX + (i<<1) < widthDepth) 2575 depthTmp = depthi + (i << 1); 2576 else 2577 depthTmp = depthi + (widthDepth - depthPosX - 1); 2578 #endif 2579 #if H_3D_VSP_BLOCKSIZE == 4 2580 if (depthPosX + (i<<2) < widthDepth) 2581 depthTmp = depthi + (i << 2); 2582 else 2583 depthTmp = depthi + (widthDepth - depthPosX - 1); 2584 #endif 2585 Int maxV = 0; 2586 for (Int blockj = 0; blockj < sH; blockj+=(sH-1)) 2587 { 2588 Int iX = 0; 2589 for (Int blocki = 0; blocki < sW; blocki+=(sW-1)) 2590 { 2591 if (maxV < depthTmp[iX]) 2592 maxV = depthTmp[iX]; 2593 if (depthPosX + i*sW + blocki < widthDepth - 1) 2594 iX = (sW-1); 2595 } 2596 if (depthPosY + j*sH + blockj < heightDepth - 1) 2597 depthTmp += depStride * (sH-1); 2598 } 2599 m_pDepthBlock[i+j*dW] = maxV; 2600 } // end of i < dW 2601 #if H_3D_VSP_BLOCKSIZE == 1 2602 if (depthPosY + ((j+1)<<1) < heightDepth) 2603 depthi += (depStride << 1); 2604 else 2605 depthi = depth + (heightDepth-1)*depStride; 2606 #endif 2607 #if H_3D_VSP_BLOCKSIZE == 2 2608 if (depthPosY + ((j+1)<<1) < heightDepth) 2609 depthi += (depStride << 1); 2610 else 2611 depthi = depth + (heightDepth-depthPosY-1)*depStride; 2612 #endif 2613 #if H_3D_VSP_BLOCKSIZE == 4 2614 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 2615 depthi += (depStride << 2); 2616 else 2617 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 2618 #endif 2619 } 2620 } 2621 2622 2623 #if H_3D_VSP_BLOCKSIZE == 1 2624 #if H_3D_VSP_CONSTRAINED 2625 //get LUT based horizontal reference range 2626 Int range = xGetConstrainedSize(sizeX, sizeY, false); 2627 2628 // The minimum depth value 2629 Int minRelativePos = MAX_INT; 2630 Int maxRelativePos = MIN_INT; 2631 2632 Int depthTmp; 2633 for (Int yTxt=0; yTxt<sizeY; yTxt++) 2634 { 2635 for (Int xTxt=0; xTxt<sizeX; xTxt++) 2636 { 2637 depthTmp = m_pDepthBlock[xTxt+yTxt*dW]; 2638 Int disparity = pShiftLUT[ depthTmp ]; // << iShiftPrec; 2639 Int disparityInt = disparity >> 3;//in chroma resolution 2640 2641 if (disparityInt < 0) 2642 { 2643 if (minRelativePos > disparityInt+xTxt) 2644 minRelativePos = disparityInt+xTxt; 2645 } 2646 else 2647 { 2648 if (maxRelativePos < disparityInt+xTxt) 2649 maxRelativePos = disparityInt+xTxt; 2650 } 2651 } 2652 } 2653 2654 depthTmp = m_pDepthBlock[0]; 2655 Int disparity_tmp = pShiftLUT[ depthTmp ]; // << iShiftPrec; 2656 if ( disparity_tmp < 0 ) 2657 maxRelativePos = minRelativePos + range - 1; 2658 else 2659 minRelativePos = maxRelativePos - range + 1; 2660 2661 #endif // H_3D_VSP_CONSTRAINED 2662 #endif // H_3D_VSP_BLOCKSIZE == 1 2663 2664 // (sizeX, sizeY) is Chroma block size 2665 for ( Int yTxt = 0, yDepth = 0; yTxt < sizeY; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY ) 2666 { 2667 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX ) 2668 { 2669 Pel repDepth = 0; // to store the depth value used for warping 2670 #if H_3D_VSP_BLOCKSIZE == 1 2671 repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW]; 2672 #endif 2673 #if H_3D_VSP_BLOCKSIZE == 2 2674 repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW]; 2675 #endif 2676 #if H_3D_VSP_BLOCKSIZE == 4 2677 repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW]; 2678 #endif 2679 2680 // calculate the offset in the reference picture 2681 Int disparity = pShiftLUT[ repDepth ]; // Remove << iShiftPrec; 2682 Int refOffset = xTxt + (disparity >> 3); // in integer pixel in chroma image 2683 Int xFrac = disparity & 0x7; 2684 #if H_3D_VSP_CONSTRAINED 2685 if(refOffset < minRelativePos || refOffset > maxRelativePos) 2686 xFrac = 0; 2687 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2688 #endif 2689 Int absX = posX + refOffset; 2690 2691 if (xFrac == 0) 2692 absX = Clip3(0, widthChroma-1, absX); 2693 else 2694 absX = Clip3(4, widthChroma-5, absX); 2695 2696 refOffset = absX - posX; 2697 2698 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 2699 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 2700 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2701 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2702 } 2703 refCb += refStrideBlock; 2704 refCr += refStrideBlock; 2705 dstCb += dstStrideBlock; 2706 dstCr += dstStrideBlock; 2707 depth += depStrideBlock; 2708 } 2709 } 2710 2711 } 2712 2713 #endif // NTT_VSP_COMMON_E0207_E0208 1891 } 1892 2714 1893 2715 1894 #if H_3D_VSP_CONSTRAINED … … 2789 1968 2790 1969 #if H_3D_DIM_DMM 2791 #if !SEC_DMM2_E0146_HHIFIX2792 UInt TComPrediction::xPredWedgeFromIntra( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd )2793 {2794 UInt uiThisBlockSize = uiWidth;2795 2796 TComDataCU* pcTempCU;2797 UInt uiTempPartIdx;2798 // 1st: try continue above wedgelet2799 pcTempCU = pcCU->getPUAbove( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );2800 if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )2801 {2802 UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );2803 if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )2804 {2805 // get offset between current and reference block2806 UInt uiOffsetX = 0, uiOffsetY = 0;2807 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );2808 2809 // get reference wedgelet2810 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];2811 TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );2812 2813 // find wedgelet, if direction is suitable for continue wedge2814 if( pcRefWedgelet->checkPredDirAbovePossible( uiThisBlockSize, uiOffsetX ) )2815 {2816 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2817 pcRefWedgelet->getPredDirStartEndAbove( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetX, iDeltaEnd );2818 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2819 }2820 }2821 }2822 2823 // 2nd: try continue left wedglelet2824 pcTempCU = pcCU->getPULeft( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );2825 if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )2826 {2827 UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );2828 if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )2829 {2830 // get offset between current and reference block2831 UInt uiOffsetX = 0, uiOffsetY = 0;2832 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );2833 2834 // get reference wedgelet2835 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];2836 TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );2837 2838 // find wedgelet, if direction is suitable for continue wedge2839 if( pcRefWedgelet->checkPredDirLeftPossible( uiThisBlockSize, uiOffsetY ) )2840 {2841 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2842 pcRefWedgelet->getPredDirStartEndLeft( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetY, iDeltaEnd );2843 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2844 }2845 }2846 }2847 2848 // 3rd: (default) make wedglet from intra dir and max slope point2849 Int iSlopeX = 0, iSlopeY = 0;2850 UInt uiStartPosX = 0, uiStartPosY = 0;2851 if( xGetWedgeIntraDirPredData( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY ) )2852 {2853 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2854 xGetWedgeIntraDirStartEnd( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, iDeltaEnd );2855 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2856 }2857 2858 return 0;2859 }2860 #endif2861 2862 1970 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx ) 2863 1971 { … … 2896 2004 } 2897 2005 2898 #if SCU_HS_DMM4_REMOVE_DIV_E0242 2899 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2; 2900 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2; 2901 #else 2902 iDC /= (uiWidth*uiHeight); 2903 #endif 2006 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2; // 2007 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2; // iDC /= (uiWidth*uiHeight); 2008 2904 2009 piRefBlkY = cTempYuv.getLumaAddr(); 2905 2010 … … 2928 2033 } 2929 2034 } 2930 2931 #if !SEC_DMM2_E0146_HHIFIX 2932 Void TComPrediction::xGetBlockOffset( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ) 2933 { 2934 ruiOffsetX = 0; 2935 ruiOffsetY = 0; 2936 2937 // get offset between current and above/left block 2938 UInt uiThisOriginX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 2939 UInt uiThisOriginY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 2940 2941 UInt uiNumPartInRefCU = pcRefCU->getTotalNumPart(); 2942 UInt uiMaxDepthRefCU = 0; 2943 while( uiNumPartInRefCU > 1 ) 2944 { 2945 uiNumPartInRefCU >>= 2; 2946 uiMaxDepthRefCU++; 2947 } 2948 2949 UInt uiDepthRefPU = (pcRefCU->getDepth(uiRefAbsPartIdx)) + (pcRefCU->getPartitionSize(uiRefAbsPartIdx) == SIZE_2Nx2N ? 0 : 1); 2950 UInt uiShifts = (uiMaxDepthRefCU - uiDepthRefPU)*2; 2951 UInt uiRefBlockOriginPartIdx = (uiRefAbsPartIdx>>uiShifts)<<uiShifts; 2952 2953 UInt uiRefOriginX = pcRefCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 2954 UInt uiRefOriginY = pcRefCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 2955 2956 if( (uiThisOriginX - uiRefOriginX) > 0 ) { ruiOffsetX = (UInt)(uiThisOriginX - uiRefOriginX); } 2957 if( (uiThisOriginY - uiRefOriginY) > 0 ) { ruiOffsetY = (UInt)(uiThisOriginY - uiRefOriginY); } 2958 } 2959 2960 Bool TComPrediction::xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY ) 2961 { 2962 riSlopeX = 0, riSlopeY = 0, ruiStartPosX = 0, ruiStartPosY = 0; 2963 2964 // 1st step: get wedge start point (max. slope) 2965 Int* piSource = pcCU->getPattern()->getAdiOrgBuf( uiBlockSize, uiBlockSize, m_piYuvExt ); 2966 Int iSourceStride = ( uiBlockSize<<1 ) + 1; 2967 2968 UInt uiSlopeMaxAbove = 0, uiPosSlopeMaxAbove = 0; 2969 for( UInt uiPosHor = 0; uiPosHor < (uiBlockSize-1); uiPosHor++ ) 2970 { 2971 if( abs( piSource[uiPosHor+1] - piSource[uiPosHor] ) > uiSlopeMaxAbove ) 2972 { 2973 uiSlopeMaxAbove = abs( piSource[uiPosHor+1] - piSource[uiPosHor] ); 2974 uiPosSlopeMaxAbove = uiPosHor; 2975 } 2976 } 2977 2978 UInt uiSlopeMaxLeft = 0, uiPosSlopeMaxLeft = 0; 2979 for( UInt uiPosVer = 0; uiPosVer < (uiBlockSize-1); uiPosVer++ ) 2980 { 2981 if( abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ) > uiSlopeMaxLeft ) 2982 { 2983 uiSlopeMaxLeft = abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ); 2984 uiPosSlopeMaxLeft = uiPosVer; 2985 } 2986 } 2987 2988 if( uiSlopeMaxAbove == 0 && uiSlopeMaxLeft == 0 ) 2989 { 2990 return false; 2991 } 2992 2993 ruiStartPosX = ( uiSlopeMaxAbove > uiSlopeMaxLeft ) ? uiPosSlopeMaxAbove : 0; 2994 ruiStartPosY = ( uiSlopeMaxLeft >= uiSlopeMaxAbove ) ? uiPosSlopeMaxLeft : 0; 2995 2996 // 2nd step: derive wedge direction 2997 Int uiPreds[3] = {-1, -1, -1}; 2998 Int iMode = -1; 2999 Int iPredNum = pcCU->getIntraDirLumaPredictor( uiAbsPartIdx, uiPreds, &iMode ); 3000 3001 UInt uiDirMode = 0; 3002 if( iMode >= 0 ) { iPredNum = iMode; } 3003 if( iPredNum == 1 ) { uiDirMode = uiPreds[0]; } 3004 if( iPredNum == 2 ) { uiDirMode = uiPreds[1]; } 3005 3006 if( uiDirMode < 2 ) { return false; } // no planar & DC 3007 3008 Bool modeHor = (uiDirMode < 18); 3009 Bool modeVer = !modeHor; 3010 Int intraPredAngle = modeVer ? (Int)uiDirMode - VER_IDX : modeHor ? -((Int)uiDirMode - HOR_IDX) : 0; 3011 Int absAng = abs(intraPredAngle); 3012 Int signAng = intraPredAngle < 0 ? -1 : 1; 3013 Int angTable[9] = {0,2,5,9,13,17,21,26,32}; 3014 absAng = angTable[absAng]; 3015 intraPredAngle = signAng * absAng; 3016 3017 // 3rd step: set slope for direction 3018 if( modeHor ) 3019 { 3020 riSlopeX = ( intraPredAngle > 0 ) ? -32 : 32; 3021 riSlopeY = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle; 3022 } 3023 else if( modeVer ) 3024 { 3025 riSlopeX = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle; 3026 riSlopeY = ( intraPredAngle > 0 ) ? -32 : 32; 3027 } 3028 3029 return true; 3030 } 3031 3032 Void TComPrediction::xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd ) 3033 { 3034 ruhXs = 0; 3035 ruhYs = 0; 3036 ruhXe = 0; 3037 ruhYe = 0; 3038 3039 // scaling of start pos and block size to wedge resolution 3040 UInt uiScaledStartPosX = 0; 3041 UInt uiScaledStartPosY = 0; 3042 UInt uiScaledBlockSize = 0; 3043 WedgeResolution eWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiBlockSize]]; 3044 switch( eWedgeRes ) 3045 { 3046 case( DOUBLE_PEL ): { uiScaledStartPosX = (uiPMSPosX>>1); uiScaledStartPosY = (uiPMSPosY>>1); uiScaledBlockSize = (uiBlockSize>>1); break; } 3047 case( FULL_PEL ): { uiScaledStartPosX = uiPMSPosX; uiScaledStartPosY = uiPMSPosY; uiScaledBlockSize = uiBlockSize; break; } 3048 case( HALF_PEL ): { uiScaledStartPosX = (uiPMSPosX<<1); uiScaledStartPosY = (uiPMSPosY<<1); uiScaledBlockSize = (uiBlockSize<<1); break; } 3049 } 3050 Int iMaxPos = (Int)uiScaledBlockSize - 1; 3051 3052 // case above 3053 if( uiScaledStartPosX > 0 && uiScaledStartPosY == 0 ) 3054 { 3055 ruhXs = (UChar)uiScaledStartPosX; 3056 ruhYs = 0; 3057 3058 if( iDeltaY == 0 ) 3059 { 3060 if( iDeltaX < 0 ) 3061 { 3062 ruhXe = 0; 3063 ruhYe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos ); 3064 return; 3065 } 3066 else 3067 { 3068 ruhXe = (UChar)iMaxPos; 3069 ruhYe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos ); 3070 std::swap( ruhXs, ruhXe ); 3071 std::swap( ruhYs, ruhYe ); 3072 return; 3073 } 3074 } 3075 3076 // regular case 3077 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) ); 3078 3079 if( iVirtualEndX < 0 ) 3080 { 3081 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) + iDeltaEnd; 3082 if( iYe < (Int)uiScaledBlockSize ) 3083 { 3084 ruhXe = 0; 3085 ruhYe = (UChar)std::max( iYe, 0 ); 3086 return; 3087 } 3088 else 3089 { 3090 ruhXe = (UChar)std::min( (iYe - iMaxPos), iMaxPos ); 3091 ruhYe = (UChar)iMaxPos; 3092 return; 3093 } 3094 } 3095 else if( iVirtualEndX > iMaxPos ) 3096 { 3097 Int iYe = roftoi( (Double)(iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 3098 if( iYe < (Int)uiScaledBlockSize ) 3099 { 3100 ruhXe = (UChar)iMaxPos; 3101 ruhYe = (UChar)std::max( iYe, 0 ); 3102 std::swap( ruhXs, ruhXe ); 3103 std::swap( ruhYs, ruhYe ); 3104 return; 3105 } 3106 else 3107 { 3108 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3109 ruhYe = (UChar)iMaxPos; 3110 return; 3111 } 3112 } 3113 else 3114 { 3115 Int iXe = iVirtualEndX + iDeltaEnd; 3116 if( iXe < 0 ) 3117 { 3118 ruhXe = 0; 3119 ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 ); 3120 return; 3121 } 3122 else if( iXe > iMaxPos ) 3123 { 3124 ruhXe = (UChar)iMaxPos; 3125 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3126 std::swap( ruhXs, ruhXe ); 3127 std::swap( ruhYs, ruhYe ); 3128 return; 3129 } 3130 else 3131 { 3132 ruhXe = (UChar)iXe; 3133 ruhYe = (UChar)iMaxPos; 3134 return; 3135 } 3136 } 3137 } 3138 3139 // case left 3140 if( uiScaledStartPosY > 0 && uiScaledStartPosX == 0 ) 3141 { 3142 ruhXs = 0; 3143 ruhYs = (UChar)uiScaledStartPosY; 3144 3145 if( iDeltaX == 0 ) 3146 { 3147 if( iDeltaY < 0 ) 3148 { 3149 ruhXe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos ); 3150 ruhYe = 0; 3151 std::swap( ruhXs, ruhXe ); 3152 std::swap( ruhYs, ruhYe ); 3153 return; 3154 } 3155 else 3156 { 3157 ruhXe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos ); 3158 ruhYe = (UChar)iMaxPos; 3159 return; 3160 } 3161 } 3162 3163 // regular case 3164 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iMaxPos * ((Double)iDeltaY / (Double)iDeltaX) ); 3165 3166 if( iVirtualEndY < 0 ) 3167 { 3168 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) - iDeltaEnd; 3169 if( iXe < (Int)uiScaledBlockSize ) 3170 { 3171 ruhXe = (UChar)std::max( iXe, 0 ); 3172 ruhYe = 0; 3173 std::swap( ruhXs, ruhXe ); 3174 std::swap( ruhYs, ruhYe ); 3175 return; 3176 } 3177 else 3178 { 3179 ruhXe = (UChar)iMaxPos; 3180 ruhYe = (UChar)std::min( (iXe - iMaxPos), iMaxPos ); 3181 std::swap( ruhXs, ruhXe ); 3182 std::swap( ruhYs, ruhYe ); 3183 return; 3184 } 3185 } 3186 else if( iVirtualEndY > (uiScaledBlockSize-1) ) 3187 { 3188 Int iXe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) + iDeltaEnd; 3189 if( iXe < (Int)uiScaledBlockSize ) 3190 { 3191 ruhXe = (UChar)std::max( iXe, 0 ); 3192 ruhYe = (UChar)(uiScaledBlockSize-1); 3193 return; 3194 } 3195 else 3196 { 3197 ruhXe = (UChar)iMaxPos; 3198 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3199 std::swap( ruhXs, ruhXe ); 3200 std::swap( ruhYs, ruhYe ); 3201 return; 3202 } 3203 } 3204 else 3205 { 3206 Int iYe = iVirtualEndY - iDeltaEnd; 3207 if( iYe < 0 ) 3208 { 3209 ruhXe = (UChar)std::max( (iMaxPos + iYe), 0 ); 3210 ruhYe = 0; 3211 std::swap( ruhXs, ruhXe ); 3212 std::swap( ruhYs, ruhYe ); 3213 return; 3214 } 3215 else if( iYe > iMaxPos ) 3216 { 3217 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3218 ruhYe = (UChar)iMaxPos; 3219 return; 3220 } 3221 else 3222 { 3223 ruhXe = (UChar)iMaxPos; 3224 ruhYe = (UChar)iYe; 3225 std::swap( ruhXs, ruhXe ); 3226 std::swap( ruhYs, ruhYe ); 3227 return; 3228 } 3229 } 3230 } 3231 3232 // case origin 3233 if( uiScaledStartPosX == 0 && uiScaledStartPosY == 0 ) 3234 { 3235 if( iDeltaX*iDeltaY < 0 ) 3236 { 3237 return; 3238 } 3239 3240 ruhXs = 0; 3241 ruhYs = 0; 3242 3243 if( iDeltaY == 0 ) 3244 { 3245 ruhXe = (UChar)iMaxPos; 3246 ruhYe = 0; 3247 std::swap( ruhXs, ruhXe ); 3248 std::swap( ruhYs, ruhYe ); 3249 return; 3250 } 3251 3252 if( iDeltaX == 0 ) 3253 { 3254 ruhXe = 0; 3255 ruhYe = (UChar)iMaxPos; 3256 return; 3257 } 3258 3259 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) ); 3260 3261 if( iVirtualEndX > iMaxPos ) 3262 { 3263 Int iYe = roftoi( (Double)((Int)iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 3264 if( iYe < (Int)uiScaledBlockSize ) 3265 { 3266 ruhXe = (UChar)(uiScaledBlockSize-1); 3267 ruhYe = (UChar)std::max( iYe, 0 ); 3268 std::swap( ruhXs, ruhXe ); 3269 std::swap( ruhYs, ruhYe ); 3270 return; 3271 } 3272 else 3273 { 3274 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3275 ruhYe = (UChar)(uiScaledBlockSize-1); 3276 return; 3277 } 3278 } 3279 else 3280 { 3281 Int iXe = iVirtualEndX + iDeltaEnd; 3282 if( iXe < 0 ) 3283 { 3284 ruhXe = 0; 3285 ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 ); 3286 return; 3287 } 3288 else if( iXe > iMaxPos ) 3289 { 3290 ruhXe = (UChar)(uiScaledBlockSize-1); 3291 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3292 std::swap( ruhXs, ruhXe ); 3293 std::swap( ruhYs, ruhYe ); 3294 return; 3295 } 3296 else 3297 { 3298 ruhXe = (UChar)iXe; 3299 ruhYe = (UChar)(uiScaledBlockSize-1); 3300 return; 3301 } 3302 } 3303 } 3304 } 3305 3306 UInt TComPrediction::xGetWedgePatternIdx( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ) 3307 { 3308 WedgeRefList* pcWedgeRefList = &g_dmmWedgeRefLists[(g_aucConvertToBit[uiBlockSize])]; 3309 for( UInt uiIdx = 0; uiIdx < pcWedgeRefList->size(); uiIdx++ ) 3310 { 3311 TComWedgeRef* pcTestWedgeRef = &(pcWedgeRefList->at(uiIdx)); 3312 if( pcTestWedgeRef->getStartX() == uhXs && pcTestWedgeRef->getStartY() == uhYs && pcTestWedgeRef->getEndX() == uhXe && pcTestWedgeRef->getEndY() == uhYe ) 3313 { 3314 return pcTestWedgeRef->getRefIdx(); 3315 } 3316 } 3317 return 0; 3318 } 3319 #endif 3320 #endif 2035 #endif 2036 3321 2037 #if H_3D_DIM_RBC 3322 2038 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC ) … … 3348 2064 #if H_3D_DIM_SDC 3349 2065 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 3350 #if KWU_SDC_SIMPLE_DC_E01173351 2066 ,UInt uiIntraMode 3352 2067 ,Bool orgDC 3353 #endif3354 2068 ) 3355 2069 { … … 3359 2073 memset(iSumPix, 0, sizeof(Int)*2); 3360 2074 3361 #if KWU_SDC_SIMPLE_DC_E01173362 2075 if (orgDC == false) 3363 2076 { … … 3385 2098 return; 3386 2099 } 3387 #endif3388 2100 3389 2101 Int subSamplePix; -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComPrediction.h
r622 r646 76 76 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 77 77 #if H_3D_IC 78 #if SHARP_ILLUCOMP_REFINE_E004679 78 UInt m_uiaShift[ 64 ]; // Table for multiplication to substitue of division operation 80 #else81 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation82 #endif83 79 #endif 84 80 … … 88 84 Int xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true); 89 85 #endif 90 #if NTT_VSP_COMMON_E0207_E020891 86 TComYuv m_cYuvDepthOnVsp; 92 #endif93 87 #endif 94 88 … … 126 120 127 121 #if H_3D_VSP 128 #if NTT_VSP_COMMON_E0207_E0208129 122 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int txtPerDepthX=1, Int txtPerDepthY=1 ); 130 123 Void xPredInterLumaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 131 124 Void xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 132 #else133 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi );134 Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi );135 #endif136 125 #endif 137 126 … … 140 129 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 141 130 #if H_3D_IC 142 #if SHARP_ILLUCOMP_REFINE_E0046143 131 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ); 144 #else145 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType );146 #endif147 132 #endif 148 133 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); … … 154 139 Void xAssignBiSegDCs ( Pel* ptrDst, UInt dstStride, Bool* biSegPattern, Int patternStride, Pel valDC1, Pel valDC2 ); 155 140 #if H_3D_DIM_DMM 156 #if !SEC_DMM2_E0146_HHIFIX157 UInt xPredWedgeFromIntra ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 );158 #endif159 141 UInt xPredWedgeFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx ); 160 142 Void xPredContourFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge ); 161 162 143 Void xCopyTextureLumaBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight ); 163 164 #if !SEC_DMM2_E0146_HHIFIX165 Void xGetBlockOffset ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY );166 Bool xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY );167 Void xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd = 0 );168 UInt xGetWedgePatternIdx ( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe );169 #endif170 144 #endif 171 145 #if H_3D_DIM_RBC … … 196 170 #if H_3D_DIM_SDC 197 171 Void analyzeSegmentsSDC ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 198 #if KWU_SDC_SIMPLE_DC_E0117199 172 ,UInt uiIntraMode 200 173 ,Bool orgDC=false 201 #endif202 174 ); 203 175 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.cpp
r635 r646 542 542 cDtParam.bUseIC = false; 543 543 #endif 544 #if LGE_INTER_SDC_E0156544 #if H_3D_INTER_SDC 545 545 cDtParam.bUseSDCMRSAD = false; 546 546 #endif … … 605 605 dist = (Dist) (iDWeight * distDepth + iVSOWeight * dist ) / ( iDWeight + iVSOWeight); 606 606 } 607 #if H_3D_FIX_UINT_WARNING 607 608 608 return (UInt) dist; 609 #else610 return dist;611 #endif612 613 609 } 614 610 #endif … … 652 648 } 653 649 #endif 654 #if LGE_INTER_SDC_E0156650 #if H_3D_INTER_SDC 655 651 if( pcDtParam->bUseSDCMRSAD ) 656 652 { … … 692 688 } 693 689 #endif 694 #if LGE_INTER_SDC_E0156690 #if H_3D_INTER_SDC 695 691 if( pcDtParam->bUseSDCMRSAD ) 696 692 { … … 735 731 } 736 732 #endif 737 #if LGE_INTER_SDC_E0156733 #if H_3D_INTER_SDC 738 734 if( pcDtParam->bUseSDCMRSAD ) 739 735 { … … 782 778 } 783 779 #endif 784 #if LGE_INTER_SDC_E0156780 #if H_3D_INTER_SDC 785 781 if( pcDtParam->bUseSDCMRSAD ) 786 782 { … … 838 834 } 839 835 #endif 840 #if LGE_INTER_SDC_E0156836 #if H_3D_INTER_SDC 841 837 if( pcDtParam->bUseSDCMRSAD ) 842 838 { … … 886 882 } 887 883 #endif 888 #if LGE_INTER_SDC_E0156884 #if H_3D_INTER_SDC 889 885 if( pcDtParam->bUseSDCMRSAD ) 890 886 { … … 944 940 } 945 941 #endif 946 #if LGE_INTER_SDC_E0156942 #if H_3D_INTER_SDC 947 943 if( pcDtParam->bUseSDCMRSAD ) 948 944 { … … 1016 1012 } 1017 1013 #endif 1018 #if LGE_INTER_SDC_E01561014 #if H_3D_INTER_SDC 1019 1015 if( pcDtParam->bUseSDCMRSAD ) 1020 1016 { … … 1081 1077 } 1082 1078 #endif 1083 #if LGE_INTER_SDC_E01561079 #if H_3D_INTER_SDC 1084 1080 if( pcDtParam->bUseSDCMRSAD ) 1085 1081 { … … 1185 1181 } 1186 1182 #endif 1187 #if LGE_INTER_SDC_E01561183 #if H_3D_INTER_SDC 1188 1184 if( pcDtParam->bUseSDCMRSAD ) 1189 1185 { … … 1261 1257 #endif 1262 1258 1263 #if H_3D_IC || LGE_INTER_SDC_E01561259 #if H_3D_IC || H_3D_INTER_SDC 1264 1260 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1265 1261 { … … 3513 3509 } 3514 3510 #endif 3515 #if LGE_INTER_SDC_E01563511 #if H_3D_INTER_SDC 3516 3512 if( pcDtParam->bUseSDCMRSAD ) 3517 3513 { … … 3616 3612 } 3617 3613 3618 #if H_3D_IC || LGE_INTER_SDC_E01563614 #if H_3D_IC || H_3D_INTER_SDC 3619 3615 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3620 3616 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComRdCost.h
r635 r646 94 94 Bool bUseIC; 95 95 #endif 96 #if LGE_INTER_SDC_E015696 #if H_3D_INTER_SDC 97 97 Bool bUseSDCMRSAD; 98 98 #endif … … 136 136 iStrideVir = 0; 137 137 #endif 138 #if LGE_INTER_SDC_E0156138 #if H_3D_INTER_SDC 139 139 bUseSDCMRSAD = false; 140 140 #endif … … 283 283 static UInt xGetSSE64 ( DistParam* pcDtParam ); 284 284 static UInt xGetSSE16N ( DistParam* pcDtParam ); 285 #if H_3D_IC || LGE_INTER_SDC_E0156285 #if H_3D_IC || H_3D_INTER_SDC 286 286 static UInt xGetSADic ( DistParam* pcDtParam ); 287 287 static UInt xGetSAD4ic ( DistParam* pcDtParam ); … … 311 311 312 312 #if AMP_SAD 313 #if H_3D_IC || LGE_INTER_SDC_E0156313 #if H_3D_IC || H_3D_INTER_SDC 314 314 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 315 315 static UInt xGetSAD24ic ( DistParam* pcDtParam ); … … 322 322 #endif 323 323 324 #if H_3D_IC || LGE_INTER_SDC_E0156324 #if H_3D_IC || H_3D_INTER_SDC 325 325 static UInt xGetHADsic ( DistParam* pcDtParam ); 326 326 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp
r635 r646 1950 1950 m_depthRefinementFlag [ i ] = false; 1951 1951 #endif 1952 #if LGE_INTER_SDC_E01561952 #if H_3D_INTER_SDC 1953 1953 m_bInterSDCFlag [ i ] = false; 1954 1954 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h
r622 r646 653 653 Bool m_ivMvScalingFlag; 654 654 #endif 655 #if LGE_INTER_SDC_E0156655 #if H_3D_INTER_SDC 656 656 Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; 657 657 #endif … … 943 943 Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } 944 944 Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } 945 #if LGE_INTER_SDC_E0156945 #if H_3D_INTER_SDC 946 946 Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } 947 947 Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.cpp
r622 r646 175 175 } 176 176 177 #if !SEC_DMM2_E0146_HHIFIX178 Bool TComWedgelet::checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset )179 {180 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];181 UInt uiContDStartEndMax = 0;182 UInt uiContDStartEndOffset = 0;183 switch( eContDWedgeRes )184 {185 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }186 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }187 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }188 }189 190 if( m_uhOri == 2 || m_uhOri == 3 || m_uhOri == 4 )191 {192 UInt uiThisStartEndMax = 0;193 switch( m_eWedgeRes )194 {195 case( DOUBLE_PEL ): { uiThisStartEndMax = (m_uiWidth>>1); break; }196 case( FULL_PEL ): { uiThisStartEndMax = m_uiWidth; break; }197 case( HALF_PEL ): { uiThisStartEndMax = (m_uiWidth<<1); break; }198 }199 200 UChar uhStartX = m_uhXs;201 UChar uhStartY = m_uhYs;202 UChar uhEndX = m_uhXe;203 UChar uhEndY = m_uhYe;204 205 if( 2 == m_uhOri )206 {207 std::swap( uhStartX, uhEndX );208 std::swap( uhStartY, uhEndY );209 }210 211 UInt uiScaledEndX = (UInt)uhEndX;212 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;213 if( iDeltaRes > 0 ) { uiScaledEndX <<= iDeltaRes; }214 if( iDeltaRes < 0 ) { uiScaledEndX >>= -iDeltaRes; }215 216 if( ((UInt)uhEndY == (uiThisStartEndMax-1)) && ((uiScaledEndX-uiContDStartEndOffset) > 0 && (uiScaledEndX-uiContDStartEndOffset) < (uiContDStartEndMax-1)) )217 {218 return true;219 }220 }221 222 return false;223 }224 225 Bool TComWedgelet::checkPredDirLeftPossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset )226 {227 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];228 UInt uiContDStartEndMax = 0;229 UInt uiContDStartEndOffset = 0;230 switch( eContDWedgeRes )231 {232 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }233 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }234 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }235 }236 237 if( m_uhOri == 1 || m_uhOri == 2 || m_uhOri == 5 )238 {239 UInt uiThisStartEndMax = 0;240 switch( m_eWedgeRes )241 {242 case( DOUBLE_PEL ): { uiThisStartEndMax = (m_uiHeight>>1); break; }243 case( FULL_PEL ): { uiThisStartEndMax = m_uiHeight; break; }244 case( HALF_PEL ): { uiThisStartEndMax = (m_uiHeight<<1); break; }245 }246 247 UChar uhStartX = m_uhXs;248 UChar uhStartY = m_uhYs;249 UChar uhEndX = m_uhXe;250 UChar uhEndY = m_uhYe;251 252 if( 1 == m_uhOri || 5 == m_uhOri )253 {254 std::swap( uhStartX, uhEndX );255 std::swap( uhStartY, uhEndY );256 }257 258 UInt uiScaledEndY = (UInt)uhEndY;259 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;260 if( iDeltaRes > 0 ) { uiScaledEndY <<= iDeltaRes; }261 if( iDeltaRes < 0 ) { uiScaledEndY >>= -iDeltaRes; }262 263 if( ((UInt)uhEndX == (uiThisStartEndMax-1)) && ((uiScaledEndY-uiContDStartEndOffset) > 0 && (uiScaledEndY-uiContDStartEndOffset) < (uiContDStartEndMax-1)) )264 {265 return true;266 }267 }268 269 return false;270 }271 272 Void TComWedgelet::getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd )273 {274 ruhXs = 0;275 ruhYs = 0;276 ruhXe = 0;277 ruhYe = 0;278 279 // get start/end of reference (=this) wedgelet280 UInt uiRefStartX = (UInt)getStartX();281 UInt uiRefStartY = (UInt)getStartY();282 UInt uiRefEndX = (UInt)getEndX();283 UInt uiRefEndY = (UInt)getEndY();284 285 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];286 UInt uiContDStartEndMax = 0;287 UInt uiContDStartEndOffset = 0;288 switch( eContDWedgeRes )289 {290 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }291 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }292 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }293 }294 Int iContDMaxPos = (Int)uiContDStartEndMax - 1;295 296 // swap if start/end if line orientation is not from top to bottom297 if( 2 == (UInt)getOri() )298 {299 std::swap( uiRefStartX, uiRefEndX );300 std::swap( uiRefStartY, uiRefEndY );301 }302 303 // calc slopes304 Int iA_DeltaX = (Int)uiRefEndX - (Int)uiRefStartX;305 Int iA_DeltaY = (Int)uiRefEndY - (Int)uiRefStartY;306 307 // get aligned end x value of ref wedge308 UInt uiScaledRefEndX = uiRefEndX;309 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;310 if( iDeltaRes > 0 ) { uiScaledRefEndX <<= iDeltaRes; }311 if( iDeltaRes < 0 ) { uiScaledRefEndX >>= -iDeltaRes; }312 313 assert( uiScaledRefEndX >= uiContDStartEndOffset );314 Int iAlignedRefEndX = (Int)uiScaledRefEndX - (Int)uiContDStartEndOffset;315 316 // special for straight vertical wedge317 if( iA_DeltaX == 0 )318 {319 ruhXs = (UChar)iAlignedRefEndX;320 ruhYs = 0;321 322 Int iXe = iAlignedRefEndX + iDeltaEnd;323 if( iXe < 0 )324 {325 ruhXe = 0;326 ruhYe = (UChar)min( max( (iContDMaxPos + iXe), 0 ), iContDMaxPos );327 328 return;329 }330 else if( iXe > iContDMaxPos )331 {332 ruhXe = (UChar)iContDMaxPos;333 ruhYe = (UChar)min( max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 ), iContDMaxPos );334 335 std::swap( ruhXs, ruhXe );336 std::swap( ruhYs, ruhYe );337 return;338 }339 else340 {341 ruhXe = (UChar)iXe;342 ruhYe = (UChar)iContDMaxPos;343 344 return;345 }346 }347 348 // special for straight horizontal short bottom line349 if( iA_DeltaY == 0 )350 {351 switch( (UInt)getOri() )352 {353 case( 2 ):354 {355 ruhXs = (UChar)(iAlignedRefEndX-1);356 ruhYs = 0;357 ruhXe = 0;358 ruhYe = (UChar)min( max( iDeltaEnd, 0 ), iContDMaxPos );359 360 return;361 }362 case( 3 ):363 {364 ruhXs = (UChar)(iAlignedRefEndX+1);365 ruhYs = 0;366 ruhXe = (UChar)iContDMaxPos;367 ruhYe = (UChar)min( max( -iDeltaEnd, 0 ), iContDMaxPos );368 369 std::swap( ruhXs, ruhXe );370 std::swap( ruhYs, ruhYe );371 return;372 }373 default:374 {375 assert( 0 );376 return;377 }378 }379 }380 381 // set start point depending on slope382 if( abs( iA_DeltaX ) >= abs( iA_DeltaY ) ) { if( iA_DeltaX < 0 ) { ruhXs = (UChar)(iAlignedRefEndX-1); ruhYs = 0; }383 if( iA_DeltaX > 0 ) { ruhXs = (UChar)(iAlignedRefEndX+1); ruhYs = 0; } }384 else { ruhXs = (UChar)(iAlignedRefEndX); ruhYs = 0; }385 386 // calc end point and determine orientation387 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iContDMaxPos * ((Double)iA_DeltaX / (Double)iA_DeltaY) );388 389 if( iVirtualEndX < 0 )390 {391 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iA_DeltaY / (Double)iA_DeltaX) ) + iDeltaEnd;392 if( iYe < (Int)uiContDStartEndMax )393 {394 ruhXe = 0;395 ruhYe = (UChar)max( iYe, 0 );396 397 return;398 }399 else400 {401 ruhXe = (UChar)min( (iYe - iContDMaxPos), iContDMaxPos );402 ruhYe = (UChar)iContDMaxPos;403 404 return;405 }406 }407 else if( iVirtualEndX > iContDMaxPos )408 {409 Int iYe = roftoi( (Double)(iContDMaxPos - (Int)ruhXs) * ((Double)iA_DeltaY / (Double)iA_DeltaX) ) - iDeltaEnd;410 if( iYe < (Int)uiContDStartEndMax )411 {412 ruhXe = (UChar)iContDMaxPos;413 ruhYe = (UChar)max( iYe, 0 );414 415 std::swap( ruhXs, ruhXe );416 std::swap( ruhYs, ruhYe );417 return;418 }419 else420 {421 ruhXe = (UChar)max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 );422 ruhYe = (UChar)iContDMaxPos;423 424 return;425 }426 }427 else428 {429 Int iXe = iVirtualEndX + iDeltaEnd;430 if( iXe < 0 )431 {432 ruhXe = 0;433 ruhYe = (UChar)max( (iContDMaxPos + iXe), 0 );434 435 return;436 }437 else if( iXe > iContDMaxPos )438 {439 ruhXe = (UChar)iContDMaxPos;440 ruhYe = (UChar)max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 );441 442 std::swap( ruhXs, ruhXe );443 std::swap( ruhYs, ruhYe );444 return;445 }446 else447 {448 ruhXe = (UChar)iXe;449 ruhYe = (UChar)iContDMaxPos;450 451 return;452 }453 }454 }455 456 Void TComWedgelet::getPredDirStartEndLeft( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd )457 {458 ruhXs = 0;459 ruhYs = 0;460 ruhXe = 0;461 ruhYe = 0;462 463 // get start/end of reference (=this) wedgelet464 UInt uiRefStartX = (UInt)getStartX();465 UInt uiRefStartY = (UInt)getStartY();466 UInt uiRefEndX = (UInt)getEndX();467 UInt uiRefEndY = (UInt)getEndY();468 469 WedgeResolution eContDWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiPredDirBlockSize]];470 UInt uiContDStartEndMax = 0;471 UInt uiContDStartEndOffset = 0;472 switch( eContDWedgeRes )473 {474 case( DOUBLE_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize>>1); uiContDStartEndOffset = (uiPredDirBlockOffset>>1); break; }475 case( FULL_PEL ): { uiContDStartEndMax = uiPredDirBlockSize; uiContDStartEndOffset = uiPredDirBlockOffset; break; }476 case( HALF_PEL ): { uiContDStartEndMax = (uiPredDirBlockSize<<1); uiContDStartEndOffset = (uiPredDirBlockOffset<<1); break; }477 }478 Int iContDMaxPos = (Int)uiContDStartEndMax - 1;479 480 // swap if start/end if line orientation is not from left to right481 if( 1 == (UInt)getOri() || 5 == (UInt)getOri() )482 {483 std::swap( uiRefStartX, uiRefEndX );484 std::swap( uiRefStartY, uiRefEndY );485 }486 487 Int iL_DeltaX = (Int)uiRefEndX - (Int)uiRefStartX;488 Int iL_DeltaY = (Int)uiRefEndY - (Int)uiRefStartY;489 490 UInt uiScaledRefEndY = uiRefEndY;491 Int iDeltaRes = (Int)eContDWedgeRes - (Int)m_eWedgeRes;492 if( iDeltaRes > 0 ) { uiScaledRefEndY <<= iDeltaRes; }493 if( iDeltaRes < 0 ) { uiScaledRefEndY >>= -iDeltaRes; }494 495 assert( uiScaledRefEndY >= uiContDStartEndOffset );496 Int iAlignedRefEndY = (Int)uiScaledRefEndY - (Int)uiContDStartEndOffset;497 498 // special for straight horizontal wedge499 if( iL_DeltaY == 0 )500 {501 ruhXs = 0;502 ruhYs = (UChar)iAlignedRefEndY;503 504 Int iYe = iAlignedRefEndY - iDeltaEnd;505 if( iYe < 0 )506 {507 ruhXe = (UChar)min( max( (iContDMaxPos + iYe), 0 ), iContDMaxPos );508 ruhYe = 0;509 510 std::swap( ruhXs, ruhXe );511 std::swap( ruhYs, ruhYe );512 return;513 }514 else if( iYe > iContDMaxPos )515 {516 ruhXe = (UChar)min( max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 ), iContDMaxPos );517 ruhYe = (UChar)iContDMaxPos;518 519 return;520 }521 else522 {523 ruhXe = (UChar)iContDMaxPos;524 ruhYe = (UChar)iYe;525 526 std::swap( ruhXs, ruhXe );527 std::swap( ruhYs, ruhYe );528 return;529 }530 }531 532 // special for straight vertical short right line533 if( iL_DeltaX == 0 )534 {535 switch( (UInt)getOri() )536 {537 case( 1 ):538 {539 ruhXs = 0;540 ruhYs = (UChar)(iAlignedRefEndY+1);541 ruhXe = (UChar)min( max( iDeltaEnd, 0 ), iContDMaxPos );542 ruhYe = (UChar)iContDMaxPos;543 544 return;545 }546 case( 2 ):547 {548 ruhXs = 0;549 ruhYs = (UChar)(iAlignedRefEndY-1);550 ruhXe = (UChar)min( max( -iDeltaEnd, 0 ), iContDMaxPos );551 ruhYe = 0;552 553 std::swap( ruhXs, ruhXe );554 std::swap( ruhYs, ruhYe );555 return;556 }557 default:558 {559 assert( 0 );560 return;561 }562 }563 }564 565 // set start point depending on slope566 if( abs( iL_DeltaY ) >= abs( iL_DeltaX ) ) { if( iL_DeltaY < 0 ) { ruhYs = (UChar)(iAlignedRefEndY-1); ruhXs = 0; }567 if( iL_DeltaY > 0 ) { ruhYs = (UChar)(iAlignedRefEndY+1); ruhXs = 0; } }568 else { ruhYs = (UChar)(iAlignedRefEndY); ruhXs = 0; }569 570 // calc end point and determine orientation571 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iContDMaxPos * ((Double)iL_DeltaY / (Double)iL_DeltaX) );572 573 if( iVirtualEndY < 0 )574 {575 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iL_DeltaX / (Double)iL_DeltaY) ) - iDeltaEnd;576 if( iXe < (Int)uiContDStartEndMax )577 {578 ruhXe = (UChar)max( iXe, 0 );579 ruhYe = 0;580 581 std::swap( ruhXs, ruhXe );582 std::swap( ruhYs, ruhYe );583 return;584 }585 else586 {587 ruhXe = (UChar)iContDMaxPos;588 ruhYe = (UChar)min( (iXe - iContDMaxPos), iContDMaxPos );589 590 std::swap( ruhXs, ruhXe );591 std::swap( ruhYs, ruhYe );592 return;593 }594 }595 else if( iVirtualEndY > iContDMaxPos )596 {597 Int iXe = roftoi( (Double)(iContDMaxPos - (Int)ruhYs ) * ((Double)iL_DeltaX / (Double)iL_DeltaY) ) + iDeltaEnd;598 if( iXe < (Int)uiContDStartEndMax )599 {600 ruhXe = (UChar)max( iXe, 0 );601 ruhYe = (UChar)iContDMaxPos;602 603 return;604 }605 else606 {607 ruhXe = (UChar)iContDMaxPos;608 ruhYe = (UChar)max( (iContDMaxPos - (iXe - iContDMaxPos)), 0 );609 610 std::swap( ruhXs, ruhXe );611 std::swap( ruhYs, ruhYe );612 return;613 }614 }615 else616 {617 Int iYe = iVirtualEndY - iDeltaEnd;618 if( iYe < 0 )619 {620 ruhXe = (UChar)max( (iContDMaxPos + iYe), 0 );621 ruhYe = 0;622 623 std::swap( ruhXs, ruhXe );624 std::swap( ruhYs, ruhYe );625 return;626 }627 else if( iYe > iContDMaxPos )628 {629 ruhXe = (UChar)max( (iContDMaxPos - (iYe - iContDMaxPos)), 0 );630 ruhYe = (UChar)iContDMaxPos;631 632 return;633 }634 else635 {636 ruhXe = (UChar)iContDMaxPos;637 ruhYe = (UChar)iYe;638 639 std::swap( ruhXs, ruhXe );640 std::swap( ruhYs, ruhYe );641 return;642 }643 }644 }645 #endif646 647 177 Void TComWedgelet::xGenerateWedgePattern() 648 178 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComWedgelet.h
r622 r646 50 50 enum DIM_IDX 51 51 { 52 #if SEC_DMM2_E0146_HHIFIX53 52 DMM1_IDX = 0, 54 53 DMM3_IDX = 1, 55 54 DMM4_IDX = 2, 56 55 RBC_IDX = 3 57 #else58 DMM1_IDX = 0,59 DMM2_IDX = 3,60 DMM3_IDX = 1,61 DMM4_IDX = 2,62 RBC_IDX = 463 #endif64 56 }; 65 #if SEC_DMM2_E0146_HHIFIX 57 66 58 #define DMM_NUM_TYPE 3 67 #else68 #define DMM_NUM_TYPE 469 #endif70 59 #define RBC_NUM_TYPE 1 71 60 #define DIM_NUM_TYPE (DMM_NUM_TYPE+RBC_NUM_TYPE) … … 86 75 #define DMM_NO_WEDGEINDEX MAX_UINT 87 76 #define DMM_NUM_WEDGE_REFINES 8 88 #if !SEC_DMM2_E0146_HHIFIX89 #define DMM2_DELTAEND_MAX 490 #endif91 77 #define DMM3_SIMPLIFY_TR 1 92 78 … … 151 137 Bool checkInvIdentical( Bool* pbRefPattern ); 152 138 153 #if !SEC_DMM2_E0146_HHIFIX154 // functions for DMM2 prediction155 Bool checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );156 Bool checkPredDirLeftPossible ( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );157 Void getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );158 Void getPredDirStartEndLeft ( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );159 #endif160 139 }; // END CLASS DEFINITION TComWedgelet 161 140 -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h
r643 r646 97 97 // Unifying rounding offset, for IC part, JCT3V-D0135 98 98 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 99 // SHARP_ILLUCOMP_REFINE_E0046 100 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 99 101 100 102 #if H_3D_NBDV … … 103 105 // MERL_D0166: Reference view selection in NBDV & Bi-VSP 104 106 // MERL_C0152: Basic VSP 107 // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV 105 108 #endif 106 109 … … 112 115 // LG_D0092: Multiple VSP candidate allowed 113 116 // MTK_VSP_FIX_ALIGN_WD_E0172 117 // NTT_VSP_ADAPTIVE_SPLIT_E0207 adaptive sub-PU partitioning in VSP, JCT3V-E0207 118 // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208 119 // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208 114 120 #define H_3D_IV_MERGE 1 // Inter-view motion merge candidate 115 121 // HHI_INTER_VIEW_MOTION_PRED … … 139 145 // FIX_SDC_ENC_RD_WVSO_D0163 140 146 // MTK_SAMPLE_BASED_SDC_D0110 147 // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs 148 // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode 149 // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC 150 // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal 151 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding 152 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 141 153 #define H_3D_FCO_E0163 0 // Flexible coding order for 3D 142 154 143 155 156 157 // OTHERS 158 // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170 159 160 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation 161 144 162 ///////////////////////////////////////////////////////////////////////////////////////// 145 163 /////////////////////////////////// HTM-8.0 INTEGRATIONS ////////////////////////////// 146 164 ///////////////////////////////////////////////////////////////////////////////////////// 147 165 148 #define SHARP_ILLUCOMP_REFINE_E0046 1149 166 #define MTK_FAST_TEXTURE_ENCODING_E0173 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173 150 #define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 1 // Progressive MV Compression, JCT3V-E0170 151 #define LGE_INTER_SDC_E0156 1 // Enable inter SDC for depth coding 152 153 #if H_3D_IC 154 #define MTK_CLIPPING_ALIGN_IC_E0168 1 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 155 #endif 167 156 168 157 169 #if H_3D_NBDV 158 #define NBDV_DEFAULT_VIEWIDX_BUGFIX 1 // Bug fix for invalid default view index for NBDV159 170 #define MTK_RVS_BUGFIX_E0172 1 // Bug fix for issues caused by reference view selection, JCT3V-E0172 160 171 #define MTK_TEXTURE_MRGCAND_BUGFIX_E0182 1 // Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 … … 172 183 173 184 #if H_3D_DIM 174 #define SEC_DMM2_E0146_HHIFIX 1 // Removal of DMM2 from DMMs175 #define ZJU_DEPTH_INTRA_MODE_E0204 1 // Simplified Binarization for depth_intra_mode176 #define KWU_SDC_SIMPLE_DC_E0117 1 // Simplified DC calculation for SDC177 #define SCU_HS_DMM4_REMOVE_DIV_E0242 1 // DMM4 Division Removal178 185 #define SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX 1 // Fast DMM and RBC Mode Selection 179 #endif180 181 #if H_3D_VSP182 #define NTT_VSP_COMMON_E0207_E0208 1 // common part of JCT3V-E0207 and JCT3V-E0208183 #if NTT_VSP_COMMON_E0207_E0208184 #define NTT_VSP_DC_BUGFIX_E0208 1 // bugfix for sub-PU based DC in VSP, JCT3V-E0208185 #define NTT_VSP_VECTOR_CLIP_E0208 1 // disparity vector clipping on fetching depth map in VSP, JCT3V-E0208186 #define NTT_VSP_ADAPTIVE_SPLIT_E0207 1 // adaptive sub-PU partitioning in VSP, JCT3V-E0207187 #endif188 186 #endif 189 187 … … 193 191 #define H_3D_FCO_VSP_DONBDV_E0163 0 // Adaptive depth reference for flexible coding order 194 192 #endif 195 196 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation197 198 /// FIXES199 #define H_3D_FIX_BVSP 1 // DV from NBDV instead of DoNBDV should be used200 #define H_3D_FIX_TICKET_036 1 // fix for ticket #36201 #define H_3D_FIX_REN 1 // fix of erroneous inpainting for renderer202 #define H_3D_FIX_REN_WARNING 1 // fix of warning related to camera parameter precision203 204 #define H_3D_FIX_UINT_WARNING 1 // explicit in VSD205 193 #endif // H_3D 206 194 … … 281 269 #endif 282 270 271 ///// ***** ILLUMATION COMPENSATION ********* 272 273 274 #if H_3D_IC 275 #define IC_REG_COST_SHIFT 7 276 #define IC_CONST_SHIFT 5 277 #define IC_SHIFT_DIFF 12 278 #endif 279 283 280 ///////////////////////////////////////////////////////////////////////////////////////// 284 281 /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// … … 505 502 506 503 #if H_3D_VSO_DIST_INT 507 #if H_3D_FIX_TICKET_036508 504 typedef Int64 Dist; ///< RDO distortion 509 #else510 typedef Int Dist; ///< RDO distortion511 #endif512 505 typedef Int64 Dist64; 513 506 #define RDO_DIST_MIN MIN_INT -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecCAVLC.cpp
r622 r646 1253 1253 } 1254 1254 #endif 1255 #if LGE_INTER_SDC_E01561255 #if H_3D_INTER_SDC 1256 1256 READ_FLAG( uiCode, "depth_inter_SDC_flag" ); pcVPS->setInterSDCFlag( i, uiCode ? true : false ); 1257 1257 #endif … … 1640 1640 } 1641 1641 #endif 1642 #if LGE_INTER_SDC_E01561642 #if H_3D_INTER_SDC 1643 1643 READ_FLAG( uiCode, "depth_inter_SDC_flag" ); pcVPS->setInterSDCFlag( i, uiCode ? true : false ); 1644 1644 #endif … … 2651 2651 } 2652 2652 #endif 2653 #if LGE_INTER_SDC_E01562653 #if H_3D_INTER_SDC 2654 2654 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2655 2655 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecCAVLC.h
r622 r646 117 117 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 118 118 #endif 119 #if LGE_INTER_SDC_E0156119 #if H_3D_INTER_SDC 120 120 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 121 121 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecCu.cpp
r622 r646 458 458 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth ); 459 459 #endif 460 #if LGE_INTER_SDC_E0156460 #if H_3D_INTER_SDC 461 461 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 462 462 #endif … … 525 525 { 526 526 case MODE_INTER: 527 #if LGE_INTER_SDC_E0156527 #if H_3D_INTER_SDC 528 528 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 529 529 { … … 534 534 #endif 535 535 xReconInter( m_ppcCU[uiDepth], uiDepth ); 536 #if LGE_INTER_SDC_E0156536 #if H_3D_INTER_SDC 537 537 } 538 538 #endif … … 578 578 } 579 579 580 #if LGE_INTER_SDC_E0156580 #if H_3D_INTER_SDC 581 581 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 582 582 { … … 895 895 // get DC prediction for each segment 896 896 Pel apDCPredValues[2]; 897 #if KWU_SDC_SIMPLE_DC_E0117898 897 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode); 899 #else900 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride);901 #endif902 898 903 899 // reconstruct residual based on mask + DC residuals -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecCu.h
r608 r646 118 118 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 119 119 #endif 120 #if LGE_INTER_SDC_E0156120 #if H_3D_INTER_SDC 121 121 Void xReconInterSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 122 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecEntropy.cpp
r622 r646 650 650 #endif 651 651 652 #if LGE_INTER_SDC_E0156652 #if H_3D_INTER_SDC 653 653 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 654 654 { … … 683 683 } 684 684 685 #if LGE_INTER_SDC_E0156685 #if H_3D_INTER_SDC 686 686 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 687 687 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecEntropy.h
r608 r646 91 91 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 92 #endif 93 #if LGE_INTER_SDC_E015693 #if H_3D_INTER_SDC 94 94 virtual Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 95 95 virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; … … 170 170 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 171 171 #endif 172 #if LGE_INTER_SDC_E0156172 #if H_3D_INTER_SDC 173 173 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 174 174 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecGop.cpp
r608 r646 226 226 rpcPic->destroyNonDBFilterInfo(); 227 227 } 228 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170228 #if H_3D 229 229 rpcPic->compressMotion(2); 230 230 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecSbac.cpp
r622 r646 89 89 #if H_3D_DIM_DMM 90 90 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #if !SEC_DMM2_E0146_HHIFIX92 , m_cDmm2DataSCModel ( 1, 1, NUM_DMM2_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)93 #endif94 91 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 95 92 #endif … … 102 99 #endif 103 100 #endif 104 #if LGE_INTER_SDC_E0156101 #if H_3D_INTER_SDC 105 102 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 103 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 179 176 #if H_3D_DIM_DMM 180 177 m_cDmm1DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM1_DATA ); 181 #if !SEC_DMM2_E0146_HHIFIX182 m_cDmm2DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM2_DATA );183 #endif184 178 m_cDmm3DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM3_DATA ); 185 179 #endif … … 192 186 #endif 193 187 #endif 194 #if LGE_INTER_SDC_E0156188 #if H_3D_INTER_SDC 195 189 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 196 190 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 255 249 #if H_3D_DIM_DMM 256 250 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 257 #if !SEC_DMM2_E0146_HHIFIX258 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );259 #endif260 251 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA ); 261 252 #endif … … 268 259 #endif 269 260 #endif 270 #if LGE_INTER_SDC_E0156261 #if H_3D_INTER_SDC 271 262 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 272 263 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 444 435 ruiTabIdx = uiIdx; 445 436 } 446 #if !SEC_DMM2_E0146_HHIFIX 447 Void TDecSbac::xParseDmm2Offset( Int& riOffset ) 448 { 449 Int iDeltaEnd = 0; 450 if( DMM2_DELTAEND_MAX > 0 ) 451 { 452 UInt uiFlag = 0; 453 m_pcTDecBinIf->decodeBin( uiFlag, m_cDmm2DataSCModel.get(0, 0, 0) ); 454 455 if( uiFlag ) 456 { 457 UInt uiAbsValMinus1; 458 UInt uiSymbol; 459 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm2DataSCModel.get(0, 0, 0) ); uiAbsValMinus1 = uiSymbol; 460 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm2DataSCModel.get(0, 0, 0) ); uiAbsValMinus1 |= uiSymbol << 1; 461 iDeltaEnd = uiAbsValMinus1 + 1; 462 UInt uiSign; 463 m_pcTDecBinIf->decodeBinEP( uiSign ); 464 if( uiSign ) 465 { 466 iDeltaEnd = -iDeltaEnd; 467 } 468 } 469 } 470 riOffset = iDeltaEnd; 471 } 472 #endif 437 473 438 Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit ) 474 439 { … … 1175 1140 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth ); 1176 1141 } break; 1177 #if !SEC_DMM2_E0146_HHIFIX1178 case( DMM2_IDX ):1179 {1180 Int iOffset = 0;1181 xParseDmm2Offset( iOffset );1182 pcCU->setDmm2DeltaEndSubParts( iOffset, absPartIdx, depth );1183 } break;1184 #endif1185 1142 case( DMM3_IDX ): 1186 1143 { … … 1283 1240 else 1284 1241 { 1285 #if ZJU_DEPTH_INTRA_MODE_E0204 1286 UInt maxBinNum = 0; 1287 m_pcTDecBinIf->decodeBinEP(symbol); 1288 if( symbol == 1 ) 1289 { 1290 maxBinNum = 3; 1291 } 1292 else 1293 { 1294 maxBinNum = 2; 1295 symbol = 1; 1296 } 1297 while( binNum<maxBinNum && symbol ) 1298 { 1299 ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum ); 1300 m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode)); 1301 modeCode = (modeCode<<1)+symbol; 1302 binNum++; 1303 } 1304 if( maxBinNum == 3 ) 1305 { 1306 if ( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1307 else if ( modeCode == 2 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1308 else if ( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1309 else if ( modeCode == 7 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1310 } 1311 else 1312 { 1313 if ( modeCode == 0 ) { dir = 5; sdcFlag = 0;} 1314 else if ( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1315 else if ( modeCode == 3 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1316 } 1317 #else 1318 ctxDepthMode = puIdx*3 ; 1319 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1320 modeCode = (modeCode<<1) + symbol; 1321 if( !symbol ) 1322 { 1323 ctxDepthMode = puIdx*3 + 1; 1324 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1325 modeCode = (modeCode<<1) + symbol; 1326 if( symbol ) 1327 { 1328 ctxDepthMode = puIdx*3 + 2; 1329 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1330 modeCode = (modeCode<<1) + symbol; 1331 } 1242 UInt maxBinNum = 0; 1243 m_pcTDecBinIf->decodeBinEP(symbol); 1244 if( symbol == 1 ) 1245 { 1246 maxBinNum = 3; 1332 1247 } 1333 1248 else 1334 1249 { 1335 ctxDepthMode = puIdx*3 + 1; 1336 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1337 modeCode = (modeCode<<1) + symbol; 1338 if( !symbol ) 1339 { 1340 ctxDepthMode = puIdx*3 + 2; 1341 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1342 modeCode = (modeCode<<1) + symbol; 1343 } 1344 else 1345 { 1346 binNum = 0; 1347 #if LGE_SDC_REMOVE_DC_E0158 1348 #if !SEC_DMM2_E0146_HHIFIX 1349 while( symbol && binNum < 2 ) 1350 #endif 1351 #else 1352 #if SEC_DMM2_E0146_HHIFIX 1353 while( symbol && binNum < 2 ) 1354 #else 1355 while( symbol && binNum < 3 ) 1356 #endif 1357 #endif 1358 { 1359 ctxDepthMode = puIdx*3 + 2; 1360 m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) ); 1361 modeCode = (modeCode<<1) + symbol; 1362 binNum++; 1363 } 1364 } 1365 } 1366 if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1367 else if( modeCode == 2 ) { dir = 5; sdcFlag = 0;} 1368 else if( modeCode == 3 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1369 else if( modeCode == 4 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1370 else if( modeCode == 5 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1371 else if( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1372 #if LGE_SDC_REMOVE_DC_E0158 1373 #if SEC_DMM2_E0146_HHIFIX 1374 else if( modeCode == 7 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1375 #else 1376 else if( modeCode == 14 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1377 else if( modeCode == 15 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;} 1378 #endif 1379 #else 1380 else if( modeCode == 14 ) { dir = DC_IDX; sdcFlag = 1;} 1381 #if SEC_DMM2_E0146_HHIFIX 1382 else if( modeCode == 15 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1383 #else 1384 else if( modeCode == 30 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1385 else if( modeCode == 31 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;} 1386 #endif 1387 #endif 1388 #endif 1250 maxBinNum = 2; 1251 symbol = 1; 1252 } 1253 while( binNum<maxBinNum && symbol ) 1254 { 1255 ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum ); 1256 m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode)); 1257 modeCode = (modeCode<<1)+symbol; 1258 binNum++; 1259 } 1260 if( maxBinNum == 3 ) 1261 { 1262 if ( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1263 else if ( modeCode == 2 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1264 else if ( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1265 else if ( modeCode == 7 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1266 } 1267 else 1268 { 1269 if ( modeCode == 0 ) { dir = 5; sdcFlag = 0;} 1270 else if ( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1271 else if ( modeCode == 3 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1272 } 1389 1273 } 1390 1274 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); … … 2338 2222 #endif 2339 2223 2340 #if LGE_INTER_SDC_E01562224 #if H_3D_INTER_SDC 2341 2225 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2342 2226 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibDecoder/TDecSbac.h
r622 r646 102 102 #if H_3D_DIM_DMM 103 103 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 104 #if !SEC_DMM2_E0146_HHIFIX105 Void xParseDmm2Offset ( Int& riOffset );106 #endif107 104 Void xParseDmm3WedgeIdx ( UInt& ruiIntraIdx, Int iNumBit ); 108 105 #endif … … 114 111 #endif 115 112 #endif 116 #if LGE_INTER_SDC_E0156113 #if H_3D_INTER_SDC 117 114 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 118 115 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); … … 216 213 #if H_3D_DIM_DMM 217 214 ContextModel3DBuffer m_cDmm1DataSCModel; 218 #if !SEC_DMM2_E0146_HHIFIX219 ContextModel3DBuffer m_cDmm2DataSCModel;220 #endif221 215 ContextModel3DBuffer m_cDmm3DataSCModel; 222 216 #endif … … 229 223 #endif 230 224 #endif 231 #if LGE_INTER_SDC_E0156225 #if H_3D_INTER_SDC 232 226 ContextModel3DBuffer m_cInterSDCFlagSCModel; 233 227 ContextModel3DBuffer m_cInterSDCResidualSCModel; -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCavlc.cpp
r622 r646 968 968 } 969 969 #endif 970 #if LGE_INTER_SDC_E0156970 #if H_3D_INTER_SDC 971 971 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" ); 972 972 #endif … … 1309 1309 } 1310 1310 #endif 1311 #if LGE_INTER_SDC_E01561311 #if H_3D_INTER_SDC 1312 1312 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" ); 1313 1313 #endif … … 2282 2282 } 2283 2283 2284 #if LGE_INTER_SDC_E01562284 #if H_3D_INTER_SDC 2285 2285 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2286 2286 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCavlc.h
r622 r646 133 133 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 134 134 #endif 135 #if LGE_INTER_SDC_E0156135 #if H_3D_INTER_SDC 136 136 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 137 137 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCfg.h
r638 r646 417 417 Bool m_bUseIC; 418 418 #endif 419 #if LGE_INTER_SDC_E0156419 #if H_3D_INTER_SDC 420 420 bool m_bInterSDC; 421 421 #endif … … 528 528 Bool getUseIC () { return m_bUseIC; } 529 529 #endif 530 #if LGE_INTER_SDC_E0156530 #if H_3D_INTER_SDC 531 531 Void setInterSDCEnable ( Bool bVal ) { m_bInterSDC = bVal; } 532 532 Bool getInterSDCEnable () { return m_bInterSDC; } -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncCu.cpp
r643 r646 1653 1653 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1654 1654 #endif 1655 #if LGE_INTER_SDC_E01561655 #if H_3D_INTER_SDC 1656 1656 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1657 1657 #endif … … 1948 1948 1949 1949 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1950 #if LGE_INTER_SDC_E01561950 #if H_3D_INTER_SDC 1951 1951 TComDataCU *rpcTempCUPre = rpcTempCU; 1952 1952 #endif … … 1954 1954 xCheckDQP( rpcTempCU ); 1955 1955 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 1956 #if LGE_INTER_SDC_E01561956 #if H_3D_INTER_SDC 1957 1957 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1958 1958 { … … 1990 1990 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 1991 1991 { 1992 #if LGE_INTER_SDC_E01561992 #if H_3D_INTER_SDC 1993 1993 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) ) 1994 1994 { … … 1999 1999 #endif 2000 2000 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 2001 #if LGE_INTER_SDC_E01562001 #if H_3D_INTER_SDC 2002 2002 } 2003 2003 #endif … … 2203 2203 #endif 2204 2204 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2205 #if LGE_INTER_SDC_E01562205 #if H_3D_INTER_SDC 2206 2206 TComDataCU *rpcTempCUPre = rpcTempCU; 2207 2207 #endif 2208 2208 xCheckDQP( rpcTempCU ); 2209 2209 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2210 #if LGE_INTER_SDC_E01562210 #if H_3D_INTER_SDC 2211 2211 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2212 2212 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncEntropy.cpp
r608 r646 662 662 #endif 663 663 664 #if LGE_INTER_SDC_E0156664 #if H_3D_INTER_SDC 665 665 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 666 666 { … … 824 824 } 825 825 826 #if LGE_INTER_SDC_E0156826 #if H_3D_INTER_SDC 827 827 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 828 828 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncEntropy.h
r608 r646 94 94 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 95 95 #endif 96 #if LGE_INTER_SDC_E015696 #if H_3D_INTER_SDC 97 97 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 98 98 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; … … 185 185 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 186 186 #endif 187 #if LGE_INTER_SDC_E0156187 #if H_3D_INTER_SDC 188 188 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 189 189 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncGOP.cpp
r637 r646 1894 1894 pcPic->destroyNonDBFilterInfo(); 1895 1895 } 1896 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01701896 #if H_3D 1897 1897 pcPic->compressMotion(2); 1898 1898 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSbac.cpp
r622 r646 95 95 #if H_3D_DIM_DMM 96 96 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !SEC_DMM2_E0146_HHIFIX98 , m_cDmm2DataSCModel ( 1, 1, NUM_DMM2_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)99 #endif100 97 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 101 98 #endif … … 108 105 #endif 109 106 #endif 110 #if LGE_INTER_SDC_E0156107 #if H_3D_INTER_SDC 111 108 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 109 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 177 174 #if H_3D_DIM_DMM 178 175 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 179 #if !SEC_DMM2_E0146_HHIFIX180 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );181 #endif182 176 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA ); 183 177 #endif … … 190 184 #endif 191 185 #endif 192 #if LGE_INTER_SDC_E0156186 #if H_3D_INTER_SDC 193 187 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 194 188 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 232 226 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 233 227 #endif 234 #if LGE_INTER_SDC_E0156228 #if H_3D_INTER_SDC 235 229 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 236 230 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 268 262 #if H_3D_DIM_DMM 269 263 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); 270 #if !SEC_DMM2_E0146_HHIFIX271 curCost += m_cDmm2DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM2_DATA );272 #endif273 264 curCost += m_cDmm3DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM3_DATA ); 274 265 #endif … … 340 331 #if H_3D_DIM_DMM 341 332 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 342 #if !SEC_DMM2_E0146_HHIFIX343 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );344 #endif345 333 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA ); 346 334 #endif … … 353 341 #endif 354 342 #endif 355 #if LGE_INTER_SDC_E0156343 #if H_3D_INTER_SDC 356 344 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 357 345 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); … … 548 536 } 549 537 } 550 551 #if !SEC_DMM2_E0146_HHIFIX552 Void TEncSbac::xCodeDmm2Offset( Int iOffset )553 {554 if( DMM2_DELTAEND_MAX > 0 )555 {556 m_pcBinIf->encodeBin( (iOffset != 0) , m_cDmm2DataSCModel.get(0, 0, 0) );557 if( iOffset != 0 )558 {559 UInt uiAbsValMinus1 = abs(iOffset)-1;560 m_pcBinIf->encodeBin( (uiAbsValMinus1 & 0x01), m_cDmm2DataSCModel.get(0, 0, 0) );561 m_pcBinIf->encodeBin( (uiAbsValMinus1 & 0x02) >> 1, m_cDmm2DataSCModel.get(0, 0, 0) );562 563 UInt uiSign = (iOffset > 0) ? 0 : 1;564 m_pcBinIf->encodeBinEP( uiSign );565 }566 }567 }568 #endif569 538 570 539 Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit ) … … 1240 1209 xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 1241 1210 } break; 1242 #if !SEC_DMM2_E0146_HHIFIX1243 case( DMM2_IDX ):1244 {1245 xCodeDmm2Offset( pcCU->getDmm2DeltaEnd( absPartIdx ) );1246 } break;1247 #endif1248 1211 case( DMM3_IDX ): 1249 1212 { … … 1294 1257 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1295 1258 { 1296 #if ZJU_DEPTH_INTRA_MODE_E02041297 1259 UInt codeWordTable[3][7] = {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}}; 1298 1260 UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}}; 1299 #else1300 #if LGE_SDC_REMOVE_DC_E01581301 #if SEC_DMM2_E0146_HHIFIX1302 UInt codeWordTable[3][7] = {{0, 0, 0, 2, 0,6, 7},{0, 2, 3, 4, 5, 6, 7},{0, 1, 0, 0, 0, 0, 0}};1303 UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{2, 3, 3, 3, 3, 3, 3},{1, 1, 0, 0, 0, 0, 0}};1304 #else1305 UInt codeWordTable[3][8] = { { 0, 0, 0, 2, 0, 6, 0, 7 }, { 0, 2, 3, 4, 5, 6, 15, 14 }, { 0, 1, 0, 0, 0, 0, 0, 0 } };1306 UInt codeWordLenTable[3][8] = { { 0, 1, 0, 2, 0, 3, 0, 3 }, { 2, 3, 3, 3, 3, 3, 4, 4 }, { 1, 1, 0, 0, 0, 0, 0, 0 } };1307 #endif1308 #else1309 #if SEC_DMM2_E0146_HHIFIX1310 UInt codeWordTable[3][8] = {{0, 0, 0, 2, 0,6, 0, 7},{0, 2, 3, 4, 5, 6, 14, 15},{0, 2, 0, 0, 0, 0, 3, 0}};1311 UInt codeWordLenTable[3][8] = {{0, 1, 0, 2, 0,3, 0, 3},{2, 3, 3, 3, 3, 3, 4, 4},{1, 2, 0, 0, 0, 0, 2, 0}};1312 #else1313 UInt codeWordTable[3][9] = {{0, 0, 0, 2, 0,6, 0, 0, 7},{0, 2, 3, 4, 5, 6, 14, 31, 30},{0, 2, 0, 0, 0, 0, 3, 0, 0}};1314 UInt codeWordLenTable[3][9] = {{0, 1, 0, 2, 0,3, 0, 0, 3},{2, 3, 3, 3, 3, 3, 4, 5, 5},{1, 2, 0, 0, 0, 0, 2, 0, 0}};1315 #endif1316 #endif1317 #endif1318 1261 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 1319 1262 UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 ); … … 1332 1275 case DMM3_IDX: codeIdx = 5; break; 1333 1276 #if LGE_SDC_REMOVE_DC_E0158 1334 #if SEC_DMM2_E0146_HHIFIX1335 1277 case RBC_IDX: codeIdx = 6; break; 1336 1278 #else 1337 case DMM2_IDX: codeIdx = 6; break;1338 1279 case RBC_IDX: codeIdx = 7; break; 1339 #endif1340 #else1341 #if SEC_DMM2_E0146_HHIFIX1342 case RBC_IDX: codeIdx = 7; break;1343 #else1344 case DMM2_IDX: codeIdx = 7; break;1345 case RBC_IDX: codeIdx = 8; break;1346 #endif1347 1280 #endif 1348 1281 default: break; … … 1363 1296 } 1364 1297 #endif 1365 #if ZJU_DEPTH_INTRA_MODE_E02041366 1298 if( puIdx==1 ) 1367 1299 { … … 1375 1307 } 1376 1308 } 1377 #endif1378 1309 //mode coding 1379 1310 for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ ) … … 2304 2235 } 2305 2236 2306 #if LGE_INTER_SDC_E01562237 #if H_3D_INTER_SDC 2307 2238 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2308 2239 { -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSbac.h
r622 r646 121 121 #if H_3D_DIM_DMM 122 122 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 123 #if !SEC_DMM2_E0146_HHIFIX124 Void xCodeDmm2Offset ( Int iOffset );125 #endif126 123 Void xCodeDmm3WedgeIdx ( UInt uiIntraIdx, Int iNumBit ); 127 124 #endif … … 160 157 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 161 158 #endif 162 #if LGE_INTER_SDC_E0156159 #if H_3D_INTER_SDC 163 160 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 164 161 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); … … 256 253 #if H_3D_DIM_DMM 257 254 ContextModel3DBuffer m_cDmm1DataSCModel; 258 #if !SEC_DMM2_E0146_HHIFIX259 ContextModel3DBuffer m_cDmm2DataSCModel;260 #endif261 255 ContextModel3DBuffer m_cDmm3DataSCModel; 262 256 #endif … … 269 263 #endif 270 264 #endif 271 #if LGE_INTER_SDC_E0156265 #if H_3D_INTER_SDC 272 266 ContextModel3DBuffer m_cInterSDCFlagSCModel; 273 267 ContextModel3DBuffer m_cInterSDCResidualSCModel; -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.cpp
r630 r646 41 41 #include "TEncSearch.h" 42 42 #include <math.h> 43 #if LGE_INTER_SDC_E015643 #if H_3D_INTER_SDC 44 44 #include <memory.h> 45 45 #endif … … 323 323 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 324 324 #endif 325 #if LGE_INTER_SDC_E0156325 #if H_3D_INTER_SDC 326 326 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 327 327 #endif … … 755 755 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 756 756 #endif 757 #if LGE_INTER_SDC_E0156757 #if H_3D_INTER_SDC 758 758 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 759 759 #endif … … 1900 1900 // get DC prediction for each segment 1901 1901 Pel apDCPredValues[2]; 1902 #if KWU_SDC_SIMPLE_DC_E01171903 1902 analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode ); 1904 #else1905 analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride );1906 #endif1907 1903 1908 1904 // get original DC for each segment 1909 1905 Pel apDCOrigValues[2]; 1910 #if KWU_SDC_SIMPLE_DC_E01171911 1906 analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true ); 1912 #else1913 analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride );1914 #endif1915 1907 1916 1908 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) … … 2884 2876 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 2885 2877 } break; 2886 #if !SEC_DMM2_E0146_HHIFIX2887 case( DMM2_IDX ):2888 {2889 if( uiWidth > 4 )2890 {2891 Int dmm2DeltaEnd = 0;2892 xSearchDmm2Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, dmm2DeltaEnd );2893 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth );2894 pcCU->setDmm2DeltaEndSubParts( dmm2DeltaEnd, uiPartOffset, uiDepth + uiInitTrDepth );2895 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);2896 }2897 } break;2898 #endif2899 2878 case( DMM3_IDX ): 2900 2879 { … … 3588 3567 cDistParam.bUseIC = false; 3589 3568 #endif 3590 #if LGE_INTER_SDC_E01563569 #if H_3D_INTER_SDC 3591 3570 cDistParam.bUseSDCMRSAD = false; 3592 3571 #endif … … 4713 4692 pcPatternKey->setICFlag( bICFlag ); 4714 4693 #endif 4715 #if LGE_INTER_SDC_E01564694 #if H_3D_INTER_SDC 4716 4695 if ( pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 4717 4696 { … … 4869 4848 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 4870 4849 #endif 4871 #if LGE_INTER_SDC_E01564850 #if H_3D_INTER_SDC 4872 4851 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 4873 4852 #endif … … 5478 5457 } 5479 5458 5480 #if LGE_INTER_SDC_E01565459 #if H_3D_INTER_SDC 5481 5460 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 5482 5461 { … … 6801 6780 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6802 6781 #endif 6803 #if LGE_INTER_SDC_E01566782 #if H_3D_INTER_SDC 6804 6783 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 6805 6784 #endif … … 7327 7306 return; 7328 7307 } 7329 7330 #if !SEC_DMM2_E0146_HHIFIX7331 Void TEncSearch::xSearchDmm2Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )7332 {7333 ruiTabIdx = 0;7334 riWedgeDeltaEnd = 0;7335 7336 // local pred buffer7337 TComYuv cPredYuv;7338 cPredYuv.create( uiWidth, uiHeight );7339 cPredYuv.clear();7340 7341 UInt uiPredStride = cPredYuv.getStride();7342 Pel* piPred = cPredYuv.getLumaAddr();7343 7344 7345 // regular wedge search7346 Dist uiBestDist = RDO_DIST_MAX;7347 UInt uiBestTabIdx = 0;7348 Int iBestDeltaEnd = 0;7349 7350 UInt uiIdx = 0;7351 Pel refDC1 = 0; Pel refDC2 = 0;7352 for( Int iTestDeltaEnd = -DMM2_DELTAEND_MAX; iTestDeltaEnd <= DMM2_DELTAEND_MAX; iTestDeltaEnd++ )7353 {7354 uiIdx = xPredWedgeFromIntra( pcCU, uiAbsPtIdx, uiWidth, uiHeight, iTestDeltaEnd );7355 TComWedgelet* pcWedgelet = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiIdx]);7356 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );7357 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );7358 7359 Dist uiActDist = RDO_DIST_MAX;7360 #if H_3D_VSO7361 if( m_pcRdCost->getUseVSO() )7362 {7363 if( m_pcRdCost->getUseEstimatedVSD() )7364 {7365 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7366 }7367 else7368 {7369 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false );7370 }7371 }7372 else7373 #endif7374 {7375 uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD );7376 }7377 7378 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )7379 {7380 uiBestDist = uiActDist;7381 uiBestTabIdx = uiIdx;7382 iBestDeltaEnd = iTestDeltaEnd;7383 }7384 else if( uiIdx == uiBestTabIdx && abs(iTestDeltaEnd) < abs(iBestDeltaEnd) )7385 {7386 iBestDeltaEnd = iTestDeltaEnd;7387 }7388 }7389 7390 ruiTabIdx = uiBestTabIdx;7391 riWedgeDeltaEnd = iBestDeltaEnd;7392 7393 cPredYuv.destroy();7394 return;7395 }7396 #endif7397 7308 7398 7309 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncSearch.h
r622 r646 213 213 TComYuv*& rpcYuvRec, 214 214 Bool bSkipRes ); 215 #if LGE_INTER_SDC_E0156215 #if H_3D_INTER_SDC 216 216 Void encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, 217 217 TComYuv* pcOrg, … … 352 352 Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); 353 353 Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); 354 #if !SEC_DMM2_E0146_HHIFIX355 Void xSearchDmm2Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd );356 #endif357 354 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 358 355 Void xSearchDmm3Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir ); -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibEncoder/TEncTop.cpp
r637 r646 407 407 if( picLastCoded ) 408 408 { 409 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170410 409 picLastCoded->compressMotion(1); 411 #else412 picLastCoded->compressMotion();413 #endif414 410 } 415 411 #endif -
branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibRenderer/TRenTop.cpp
r608 r646 1033 1033 for ( ; iInterPolPos <= xCeil (iShiftedPos ) -1 ; iInterPolPos++) 1034 1034 { 1035 #if H_3D_FIX_REN1036 1035 if ( ( iInterPolPos >= 0 ) && ( iInterPolPos < iOutputWidth ) ) 1037 1036 { … … 1050 1049 } 1051 1050 } 1052 #else1053 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)1054 {1055 if ( ( iInterPolPos >= 0 ) && ( iInterPolPos < iOutputWidth ) )1056 {1057 apcOutputData[uiCurPlane][iInterPolPos] = apcInputData[uiCurPlane][iPosX];1058 }1059 }1060 #endif1061 1051 } 1062 1052 } … … 1304 1294 else 1305 1295 { 1306 #if H_3D_FIX_REN1307 1296 pcAlphaData[iXPos] = pcFilledData[iXPos]; 1308 #else1309 pcAlphaData[iXPos] = REN_IS_FILLED;1310 #endif1311 1297 } 1312 1298 }
Note: See TracChangeset for help on using the changeset viewer.