Changeset 598 in 3DVCSoftware for branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon
- Timestamp:
- 29 Aug 2013, 13:55:40 (12 years ago)
- Location:
- branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/ContextTables.h
r531 r598 124 124 #define SDC_NUM_RESIDUAL_CTX 1 125 125 #endif 126 127 #if LGE_INTER_SDC_E0156 128 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 129 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual 130 #define NUM_INTER_SDC_RESIDUAL_CTX 1 ///< number of context models for abs of inter SDC residual 131 #endif 126 132 // ==================================================================================================================== 127 133 // Tables … … 453 459 #endif 454 460 461 #if LGE_INTER_SDC_E0156 462 static const UChar 463 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = 464 { 465 { CNU }, 466 { 154 }, 467 { 154 }, 468 }; 469 470 static const UChar 471 INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] = 472 { 473 { CNU }, 474 { 154 }, 475 { 154 }, 476 }; 477 478 static const UChar 479 INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] = 480 { 481 { CNU }, 482 { 154 }, 483 { 154 }, 484 }; 485 #endif 455 486 //! \} 456 487 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r597 r598 154 154 m_pbICFlag = NULL; 155 155 #endif 156 #if LGE_INTER_SDC_E0156 157 m_pbInterSDCFlag = NULL; 158 for( Int i = 0; i < 4; i++ ) 159 { 160 m_apSegmentInterDCOffset[i] = NULL; 161 } 162 m_pucInterSDCMask = NULL; 163 #endif 156 164 } 157 165 … … 286 294 #endif 287 295 #endif 296 #if LGE_INTER_SDC_E0156 297 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 298 for( Int i = 0; i < 4; i++ ) 299 { 300 m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition); 301 } 302 #endif 288 303 } 289 304 else … … 292 307 m_acCUMvField[1].setNumPartition(uiNumPartition ); 293 308 } 294 309 #if LGE_INTER_SDC_E0156 310 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth); 311 #endif 295 312 m_sliceStartCU = (UInt* )xMalloc(UInt, uiNumPartition); 296 313 m_sliceSegmentStartCU = (UInt* )xMalloc(UInt, uiNumPartition); … … 414 431 #endif 415 432 #endif 416 } 417 433 #if LGE_INTER_SDC_E0156 434 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 435 for(Int i = 0; i < 4; i++ ) 436 { 437 if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; } 438 } 439 #endif 440 } 441 #if LGE_INTER_SDC_E0156 442 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; } 443 #endif 418 444 m_pcCUAboveLeft = NULL; 419 445 m_pcCUAboveRight = NULL; … … 554 580 #if H_3D_DIM_SDC 555 581 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 582 #endif 583 #if LGE_INTER_SDC_E0156 584 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 556 585 #endif 557 586 } … … 626 655 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 627 656 #endif 657 #endif 658 #if LGE_INTER_SDC_E0156 659 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 660 for( Int i = 0; i < 4; i++ ) 661 { 662 memset( m_apSegmentInterDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentInterDCOffset[i] ) ); 663 } 628 664 #endif 629 665 } … … 794 830 #endif 795 831 #endif 832 #if LGE_INTER_SDC_E0156 833 m_pbInterSDCFlag[ui] = false; 834 for( Int i = 0; i < 4; i++ ) 835 { 836 m_apSegmentInterDCOffset[i][ui] = 0; 837 } 838 #endif 796 839 } 797 840 } … … 908 951 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 909 952 #endif 953 #endif 954 #if LGE_INTER_SDC_E0156 955 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 956 for( Int i = 0; i < 4; i++ ) 957 { 958 memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition ); 959 } 910 960 #endif 911 961 … … 983 1033 #endif 984 1034 #endif 1035 #if LGE_INTER_SDC_E0156 1036 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 1037 for( Int i = 0; i < 4; i++ ) 1038 { 1039 m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ]; 1040 } 1041 #endif 985 1042 } 986 1043 } … … 1141 1198 #endif 1142 1199 #endif 1200 #if LGE_INTER_SDC_E0156 1201 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1202 for( Int i = 0; i < 4; i++ ) 1203 { 1204 m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart; 1205 } 1206 #endif 1143 1207 m_puhDepth=pcCU->getDepth() + uiPart; 1144 1208 m_puhWidth=pcCU->getWidth() + uiPart; … … 1340 1404 #endif 1341 1405 #endif 1406 #if LGE_INTER_SDC_E0156 1407 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1408 for( Int i = 0; i < 4; i++ ) 1409 { 1410 memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition); 1411 } 1412 #endif 1342 1413 1343 1414 memcpy( m_puhDepth + uiOffset, pcCU->getDepth(), iSizeInUchar ); … … 1465 1536 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1466 1537 #endif 1538 #endif 1539 #if LGE_INTER_SDC_E0156 1540 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1541 for( Int i = 0;i < 4; i++ ) 1542 { 1543 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition); 1544 } 1467 1545 #endif 1468 1546 memcpy( rpcCU->getDepth() + m_uiAbsIdxInLCU, m_puhDepth, iSizeInUchar ); … … 1576 1654 #endif 1577 1655 #endif 1656 #if LGE_INTER_SDC_E0156 1657 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1658 for( Int i = 0; i < 4; i++ ) 1659 { 1660 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart); 1661 } 1662 #endif 1578 1663 memcpy( rpcCU->getDepth() + uiPartOffset, m_puhDepth, iSizeInUchar ); 1579 1664 memcpy( rpcCU->getWidth() + uiPartOffset, m_puhWidth, iSizeInUchar ); … … 2289 2374 } 2290 2375 #endif 2376 2377 #if LGE_INTER_SDC_E0156 2378 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2379 { 2380 setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2381 } 2382 2383 UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx ) 2384 { 2385 return 0; 2386 } 2387 2388 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ) 2389 { 2390 UInt uiWidth = pcCU->getWidth ( 0 ); 2391 UInt uiHeight = pcCU->getHeight( 0 ); 2392 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 2393 UInt uiXOffset = 0, uiYOffset = 0; 2394 2395 switch( uiPartitionSize ) 2396 { 2397 case SIZE_2NxN: 2398 uiXOffset = uiWidth; uiYOffset = uiHeight >> 1; break; 2399 case SIZE_2NxnU: 2400 uiXOffset = uiWidth; uiYOffset = uiHeight >> 2; break; 2401 case SIZE_2NxnD: 2402 uiXOffset = uiWidth; uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 ); break; 2403 case SIZE_Nx2N: 2404 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break; 2405 case SIZE_nLx2N: 2406 uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break; 2407 case SIZE_nRx2N: 2408 uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break; 2409 case SIZE_NxN: 2410 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1; break; 2411 default: 2412 assert( uiPartitionSize == SIZE_2Nx2N ); 2413 uiXOffset = uiWidth; uiYOffset = uiHeight; break; 2414 } 2415 2416 UInt uiPelX, uiPelY; 2417 2418 memset( pMask, 0, uiWidth*uiHeight ); 2419 2420 //mask 2421 if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU ) 2422 { 2423 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ ) 2424 { 2425 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 2426 { 2427 pMask[uiPelX + uiPelY*uiWidth] = 0; 2428 } 2429 } 2430 2431 for( ; uiPelY < uiHeight; uiPelY++ ) 2432 { 2433 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 2434 { 2435 pMask[uiPelX + uiPelY*uiWidth] = 1; 2436 } 2437 } 2438 } 2439 else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N ) 2440 { 2441 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 2442 { 2443 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ ) 2444 { 2445 pMask[uiPelX + uiPelY*uiWidth] = 0; 2446 } 2447 2448 for( ; uiPelX < uiWidth; uiPelX++ ) 2449 { 2450 pMask[uiPelX + uiPelY*uiWidth] = 1; 2451 } 2452 } 2453 } 2454 else if( uiPartitionSize == SIZE_NxN ) 2455 { 2456 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ ) 2457 { 2458 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ ) 2459 { 2460 pMask[uiPelX + uiPelY*uiWidth] = 0; 2461 } 2462 2463 for( ; uiPelX < uiWidth; uiPelX++ ) 2464 { 2465 pMask[uiPelX + uiPelY*uiWidth] = 1; 2466 } 2467 } 2468 2469 for( ; uiPelY < uiHeight; uiPelY++ ) 2470 { 2471 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ ) 2472 { 2473 pMask[uiPelX + uiPelY*uiWidth] = 2; 2474 } 2475 2476 for( ; uiPelX < uiWidth; uiPelX++ ) 2477 { 2478 pMask[uiPelX + uiPelY*uiWidth] = 3; 2479 } 2480 } 2481 } 2482 2483 } 2484 #endif 2485 2291 2486 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) 2292 2487 { … … 3481 3676 abCandIsInter[iCount] = true; 3482 3677 puhInterDirNeighbours[iCount] = pcTextureCU->getInterDir( uiPartIdxCenter ); 3678 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 3679 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3680 if (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) 3681 #else 3483 3682 if( ( puhInterDirNeighbours[iCount] & 1 ) == 1 ) 3484 { 3683 #endif 3684 { 3685 #if !MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 3485 3686 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3687 #endif 3486 3688 TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv(); 3487 3689 … … 3500 3702 if ( getSlice()->isInterB() ) 3501 3703 { 3704 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 3705 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3706 if (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) 3707 #else 3502 3708 if( ( puhInterDirNeighbours[iCount] & 2 ) == 2 ) 3709 #endif 3503 3710 { 3711 #if !MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 3504 3712 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3713 #endif 3505 3714 TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv(); 3506 3715 #if H_3D_IC … … 3513 3722 } 3514 3723 } 3724 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 3725 puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0; 3726 puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0; 3727 #endif 3515 3728 #if H_3D_NBDV 3516 3729 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); … … 4866 5079 + ( iPartWidth/m_pcPic->getMinCUWidth() )/2]; 4867 5080 } 4868 5081 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 5082 Void TComDataCU::compressMV(int scale) 5083 #else 4869 5084 Void TComDataCU::compressMV() 4870 { 5085 #endif 5086 { 5087 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 5088 Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize; 5089 #else 4871 5090 Int scaleFactor = 4 * AMVP_DECIMATION_FACTOR / m_unitSize; 5091 #endif 4872 5092 if (scaleFactor > 0) 4873 5093 { … … 5827 6047 } 5828 6048 #endif 6049 #if MTK_FAST_TEXTURE_ENCODING_E0173 6050 Void 6051 TComDataCU::getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD) 6052 { 6053 TComSlice* pcSlice = getSlice (); 6054 Int iViewIndex = pDInfo->m_aVIdxCan; 6055 //--- get base CU/PU and check prediction mode --- 6056 TComPic* pcBasePic = pcSlice->getIvPic( false, iViewIndex ); 6057 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 6058 6059 UInt uiPartAddr; 6060 Int iWidth; 6061 Int iHeight; 6062 getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 6063 6064 Int iCurrPosX, iCurrPosY; 6065 pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 6066 6067 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 6068 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 6069 6070 Bool depthRefineFlag = false; 6071 #if H_3D_NBDV_REF 6072 depthRefineFlag = m_pcSlice->getVPS()->getDepthRefinementFlag( m_pcSlice->getLayerIdInVps() ); 6073 #endif // H_3D_NBDV_REF 6074 6075 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 6076 6077 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 6078 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 )); 6079 Int iBaseLPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX - (iWidth >> 1) + ( (cDv.getHor() + 2 ) >> 2 ) ); 6080 Int iBaseLPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 )); 6081 Int iBaseRPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + (iWidth >> 1) + 1 + ( (cDv.getHor() + 2 ) >> 2 ) ); 6082 Int iBaseRPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 )); 6083 Int iBaseUPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 6084 Int iBaseUPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY - (iHeight >> 1) + ( (cDv.getVer() + 2 ) >> 2 )); 6085 Int iBaseDPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 6086 Int iBaseDPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + (iHeight >> 1) + 1 + ( (cDv.getVer() + 2 ) >> 2 )); 6087 6088 Int iBaseCUAddr; 6089 Int iBaseAbsPartIdx; 6090 Int iBaseLCUAddr; 6091 Int iBaseLAbsPartIdx; 6092 Int iBaseRCUAddr; 6093 Int iBaseRAbsPartIdx; 6094 Int iBaseUCUAddr; 6095 Int iBaseUAbsPartIdx; 6096 Int iBaseDCUAddr; 6097 Int iBaseDAbsPartIdx; 6098 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 6099 pcBaseRec->getCUAddrAndPartIdx( iBaseLPosX , iBaseLPosY , iBaseLCUAddr, iBaseLAbsPartIdx ); 6100 pcBaseRec->getCUAddrAndPartIdx( iBaseRPosX , iBaseRPosY , iBaseRCUAddr, iBaseRAbsPartIdx ); 6101 pcBaseRec->getCUAddrAndPartIdx( iBaseUPosX , iBaseUPosY , iBaseUCUAddr, iBaseUAbsPartIdx ); 6102 pcBaseRec->getCUAddrAndPartIdx( iBaseDPosX , iBaseDPosY , iBaseDCUAddr, iBaseDAbsPartIdx ); 6103 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 6104 TComDataCU* pcBaseLCU = pcBasePic->getCU( iBaseLCUAddr ); 6105 TComDataCU* pcBaseRCU = pcBasePic->getCU( iBaseRCUAddr ); 6106 TComDataCU* pcBaseUCU = pcBasePic->getCU( iBaseUCUAddr ); 6107 TComDataCU* pcBaseDCU = pcBasePic->getCU( iBaseDCUAddr ); 6108 bIVFMerge = pcBaseLCU->getMergeFlag( iBaseLAbsPartIdx ) && pcBaseCU->getMergeFlag( iBaseAbsPartIdx ) && pcBaseRCU->getMergeFlag( iBaseRAbsPartIdx ) && pcBaseUCU->getMergeFlag( iBaseUAbsPartIdx ) && pcBaseDCU->getMergeFlag( iBaseDAbsPartIdx ); 6109 Int aiDepthL[5]; //depth level 6110 aiDepthL[0] = pcBaseCU->getDepth(iBaseAbsPartIdx); 6111 aiDepthL[1] = pcBaseLCU->getDepth(iBaseLAbsPartIdx); 6112 aiDepthL[2] = pcBaseRCU->getDepth(iBaseRAbsPartIdx); 6113 aiDepthL[3] = pcBaseUCU->getDepth(iBaseUAbsPartIdx); 6114 aiDepthL[4] = pcBaseDCU->getDepth(iBaseDAbsPartIdx); 6115 for (Int i = 0; i < 5; i++) 6116 { 6117 if (iIVFMaxD < aiDepthL[i]) 6118 iIVFMaxD = aiDepthL[i]; 6119 } 6120 } 6121 #endif 5829 6122 #if H_3D_IV_MERGE 5830 6123 Bool … … 6027 6320 #endif 6028 6321 6322 #if H_3D_FIX 6029 6323 #if H_3D_IC 6030 6324 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) … … 6080 6374 return false; 6081 6375 } 6376 #endif 6082 6377 #if H_3D_DIM_DMM 6083 6378 Void TComDataCU::setDmmWedgeTabIdxSubParts( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ) … … 6718 7013 } 6719 7014 #endif 7015 #else 7016 #if H_3D_IC 7017 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 7018 { 7019 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) ); 7020 } 7021 7022 Bool TComDataCU::isICFlagRequired( UInt uiAbsPartIdx ) 7023 { 7024 UInt uiPartAddr; 7025 UInt iNumbPart; 7026 7027 if( !( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ) 7028 { 7029 return false; 7030 } 7031 7032 if( getSlice()->getIcSkipParseFlag() ) 7033 { 7034 if( getMergeFlag( uiAbsPartIdx ) && getMergeIndex( uiAbsPartIdx ) == 0 ) 7035 { 7036 return false; 7037 } 7038 } 7039 7040 if( getMergeFlag( uiAbsPartIdx ) ) 7041 { 7042 return true; 7043 } 7044 7045 7046 Int iWidth, iHeight; 7047 7048 iNumbPart = ( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ? 1 : ( getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ) ); 7049 7050 for(UInt i = 0; i < iNumbPart; i++) 7051 { 7052 getPartIndexAndSize( i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true ); 7053 uiPartAddr += uiAbsPartIdx; 7054 7055 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 7056 { 7057 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 7058 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 7059 7060 if( ( getInterDir( uiPartAddr ) & ( uiRefIdx+1 ) ) && iBestRefIdx >= 0 && getSlice()->getViewIndex() != getSlice()->getRefPic( eRefList, iBestRefIdx )->getViewIndex() ) 7061 { 7062 return true; 7063 } 7064 } 7065 } 7066 7067 return false; 7068 } 7069 #if H_3D_DIM_DMM 7070 Void TComDataCU::setDmmWedgeTabIdxSubParts( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ) 7071 { 7072 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 7073 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 7074 } 7075 Void TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth ) 7076 { 7077 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 7078 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; } 7079 } 7080 Void TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 7081 { 7082 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 7083 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm3IntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; } 7084 } 7085 #endif 7086 #if H_3D_DIM_RBC 7087 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ) 7088 { 7089 Int iWidth; 7090 Int iHeight; 7091 if( uiDepth == 0 ) 7092 { 7093 iWidth = 64; 7094 iHeight = 64; 7095 } 7096 else if( uiDepth == 1 ) 7097 { 7098 iWidth = 32; 7099 iHeight = 32; 7100 } 7101 else if( uiDepth == 2 ) 7102 { 7103 iWidth = 16; 7104 iHeight = 16; 7105 } 7106 else if( uiDepth == 3 ) 7107 { 7108 iWidth = 8; 7109 iHeight = 8; 7110 } 7111 else // uiDepth == 4 7112 { 7113 iWidth = 4; 7114 iHeight = 4; 7115 } 7116 7117 Int iPtr = 0; 7118 Int iX, iY; 7119 Int iDir = -1; 7120 Int iDiffX = 0, iDiffY = 0; 7121 7122 // 1. Edge Code -> Vert & Horz Edges 7123 Bool* pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight ); 7124 7125 for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ ) 7126 pbEdge [ ui ] = false; 7127 7128 // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7) 7129 // Code : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6) 7130 const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 }, 7131 { 1, 5, 7, 2, 3, 4, 6 }, 7132 { 2, 4, 5, 0, 1, 6, 7 }, 7133 { 3, 7, 6, 1, 0, 5, 4 }, 7134 { 4, 0, 2, 6, 5, 3, 1 }, 7135 { 5, 2, 1, 4, 7, 0, 3 }, 7136 { 6, 3, 0, 7, 4, 1, 2 }, 7137 { 7, 1, 3, 5, 6, 2, 0 }}; 7138 7139 UChar ucCode = pucEdgeCode[iPtr++]; 7140 7141 if( !bLeft ) 7142 { 7143 iX = ucStartPos; 7144 iY = 0; 7145 7146 switch(ucCode) 7147 { 7148 case 0: // bottom 7149 iDir = 3; 7150 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7151 break; 7152 case 2: // left-bottom 7153 iDir = 6; 7154 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7155 break; 7156 case 1: // right-bottom 7157 iDir = 7; 7158 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7159 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7160 break; 7161 case 4: // left 7162 iDir = 0; 7163 assert(false); 7164 break; 7165 case 3: // right 7166 iDir = 1; 7167 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7168 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7169 break; 7170 } 7171 } 7172 else 7173 { 7174 iX = 0; 7175 iY = ucStartPos; 7176 7177 switch(ucCode) 7178 { 7179 case 0: // right 7180 iDir = 1; 7181 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7182 break; 7183 case 1: // right-top 7184 iDir = 5; 7185 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7186 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7187 break; 7188 case 2: // right-bottom 7189 iDir = 7; 7190 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7191 break; 7192 case 3: // top 7193 iDir = 2; 7194 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7195 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7196 break; 7197 case 4: // bottom 7198 iDir = 3; 7199 assert(false); 7200 break; 7201 } 7202 } 7203 7204 switch( iDir ) 7205 { 7206 case 0: // left 7207 iDiffX = -1; 7208 iDiffY = 0; 7209 break; 7210 case 1: // right 7211 iDiffX = +1; 7212 iDiffY = 0; 7213 break; 7214 case 2: // top 7215 iDiffX = 0; 7216 iDiffY = -1; 7217 break; 7218 case 3: // bottom 7219 iDiffX = 0; 7220 iDiffY = +1; 7221 break; 7222 case 4: // left-top 7223 iDiffX = -1; 7224 iDiffY = -1; 7225 break; 7226 case 5: // right-top 7227 iDiffX = +1; 7228 iDiffY = -1; 7229 break; 7230 case 6: // left-bottom 7231 iDiffX = -1; 7232 iDiffY = +1; 7233 break; 7234 case 7: // right-bottom 7235 iDiffX = +1; 7236 iDiffY = +1; 7237 break; 7238 } 7239 7240 iX += iDiffX; 7241 iY += iDiffY; 7242 7243 while( iPtr < ucNumEdge ) 7244 { 7245 ucCode = pucEdgeCode[iPtr++]; 7246 7247 Int iNewDir = tableDir[iDir][ucCode]; 7248 7249 switch( iNewDir ) 7250 { 7251 case 0: // left 7252 iDiffX = -1; 7253 iDiffY = 0; 7254 break; 7255 case 1: // right 7256 iDiffX = +1; 7257 iDiffY = 0; 7258 break; 7259 case 2: // top 7260 iDiffX = 0; 7261 iDiffY = -1; 7262 break; 7263 case 3: // bottom 7264 iDiffX = 0; 7265 iDiffY = +1; 7266 break; 7267 case 4: // left-top 7268 iDiffX = -1; 7269 iDiffY = -1; 7270 break; 7271 case 5: // right-top 7272 iDiffX = +1; 7273 iDiffY = -1; 7274 break; 7275 case 6: // left-bottom 7276 iDiffX = -1; 7277 iDiffY = +1; 7278 break; 7279 case 7: // right-bottom 7280 iDiffX = +1; 7281 iDiffY = +1; 7282 break; 7283 } 7284 7285 switch( iDir ) 7286 { 7287 case 0: // left 7288 switch( ucCode ) 7289 { 7290 case 0: 7291 case 2: 7292 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7293 break; 7294 case 1: 7295 case 3: 7296 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7297 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7298 break; 7299 case 4: 7300 case 6: 7301 // no 7302 break; 7303 case 5: 7304 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7305 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7306 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7307 break; 7308 } 7309 break; 7310 case 1: // right 7311 switch( ucCode ) 7312 { 7313 case 0: 7314 case 2: 7315 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7316 break; 7317 case 1: 7318 case 3: 7319 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7320 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7321 break; 7322 case 4: 7323 case 6: 7324 // no 7325 break; 7326 case 5: 7327 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7328 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7329 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7330 break; 7331 } 7332 break; 7333 case 2: // top 7334 switch( ucCode ) 7335 { 7336 case 0: 7337 case 2: 7338 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7339 break; 7340 case 1: 7341 case 3: 7342 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7343 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7344 break; 7345 case 4: 7346 case 6: 7347 // no 7348 break; 7349 case 5: 7350 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7351 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7352 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7353 break; 7354 } 7355 break; 7356 case 3: // bottom 7357 switch( ucCode ) 7358 { 7359 case 0: 7360 case 2: 7361 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7362 break; 7363 case 1: 7364 case 3: 7365 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7366 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7367 break; 7368 case 4: 7369 case 6: 7370 // no 7371 break; 7372 case 5: 7373 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7374 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7375 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7376 break; 7377 } 7378 break; 7379 case 4: // left-top 7380 switch( ucCode ) 7381 { 7382 case 0: 7383 case 1: 7384 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7385 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7386 break; 7387 case 2: 7388 case 4: 7389 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7390 break; 7391 case 3: 7392 case 5: 7393 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7394 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7395 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7396 break; 7397 case 6: 7398 // no 7399 break; 7400 } 7401 break; 7402 case 5: // right-top 7403 switch( ucCode ) 7404 { 7405 case 0: 7406 case 1: 7407 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7408 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7409 break; 7410 case 2: 7411 case 4: 7412 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7413 break; 7414 case 3: 7415 case 5: 7416 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7417 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7418 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7419 break; 7420 case 6: 7421 // no 7422 break; 7423 } 7424 break; 7425 case 6: // left-bottom 7426 switch( ucCode ) 7427 { 7428 case 0: 7429 case 1: 7430 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7431 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7432 break; 7433 case 2: 7434 case 4: 7435 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7436 break; 7437 case 3: 7438 case 5: 7439 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7440 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7441 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7442 break; 7443 case 6: 7444 // no 7445 break; 7446 } 7447 break; 7448 case 7: // right-bottom 7449 switch( ucCode ) 7450 { 7451 case 0: 7452 case 1: 7453 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7454 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7455 break; 7456 case 2: 7457 case 4: 7458 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7459 break; 7460 case 3: 7461 case 5: 7462 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7463 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7464 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7465 break; 7466 case 6: 7467 // no 7468 break; 7469 } 7470 break; 7471 } 7472 7473 assert( iX >= 0 && iX <= iWidth ); 7474 assert( iY >= 0 && iY <= iHeight ); 7475 7476 iX += iDiffX; 7477 iY += iDiffY; 7478 iDir = iNewDir; 7479 } 7480 7481 // finalize edge chain 7482 if( iX == iWidth-1 ) 7483 { 7484 if( iY == 0 ) 7485 { 7486 if( iDir == 1 ) 7487 { 7488 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7489 } 7490 else if( iDir == 5 ) 7491 { 7492 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7493 } 7494 else 7495 { 7496 assert(false); 7497 } 7498 } 7499 else if( iY == iHeight-1 ) 7500 { 7501 if( iDir == 3 ) 7502 { 7503 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7504 } 7505 else if( iDir == 7 ) 7506 { 7507 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7508 } 7509 else 7510 { 7511 assert(false); 7512 } 7513 } 7514 else 7515 { 7516 if( iDir == 1 ) 7517 { 7518 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7519 } 7520 else if( iDir == 3 ) 7521 { 7522 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7523 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7524 } 7525 else if( iDir == 5 ) 7526 { 7527 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7528 } 7529 else if( iDir == 7 ) 7530 { 7531 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7532 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7533 } 7534 else 7535 { 7536 assert(false); 7537 } 7538 } 7539 } 7540 else if( iX == 0 ) 7541 { 7542 if( iY == 0 ) 7543 { 7544 if( iDir == 2 ) 7545 { 7546 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7547 } 7548 else if( iDir == 4 ) 7549 { 7550 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7551 } 7552 else 7553 { 7554 assert(false); 7555 } 7556 } 7557 else if( iY == iHeight-1 ) 7558 { 7559 if( iDir == 0 ) 7560 { 7561 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7562 } 7563 else if( iDir == 6 ) 7564 { 7565 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7566 } 7567 else 7568 { 7569 assert(false); 7570 } 7571 } 7572 else 7573 { 7574 if( iDir == 0 ) 7575 { 7576 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7577 } 7578 else if( iDir == 2 ) 7579 { 7580 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7581 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7582 } 7583 else if( iDir == 4 ) 7584 { 7585 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7586 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7587 } 7588 else if( iDir == 6 ) 7589 { 7590 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7591 } 7592 else 7593 { 7594 assert(false); 7595 } 7596 } 7597 } 7598 else if( iY == 0 ) 7599 { 7600 if( iDir == 1 ) 7601 { 7602 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7603 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7604 } 7605 else if( iDir == 2 ) 7606 { 7607 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7608 } 7609 else if( iDir == 4 ) 7610 { 7611 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7612 } 7613 else if( iDir == 5 ) 7614 { 7615 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7616 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7617 } 7618 else 7619 { 7620 assert(false); 7621 } 7622 } 7623 else if( iY == iHeight-1 ) 7624 { 7625 if( iDir == 0 ) 7626 { 7627 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7628 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7629 } 7630 else if( iDir == 3 ) 7631 { 7632 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7633 } 7634 else if( iDir == 6 ) 7635 { 7636 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7637 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7638 } 7639 else if( iDir == 7 ) 7640 { 7641 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7642 } 7643 else 7644 { 7645 assert(false); 7646 } 7647 } 7648 else 7649 { 7650 printf("reconPartiton: wrong termination\n"); 7651 assert(false); 7652 } 7653 7654 // Reconstruct Region from Chain Code 7655 Bool* pbVisit = (Bool*) xMalloc( Bool, iWidth * iHeight ); 7656 Int* piStack = (Int* ) xMalloc( Int, iWidth * iHeight ); 7657 7658 for( UInt ui = 0; ui < iWidth * iHeight; ui++ ) 7659 { 7660 pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next) 7661 pbVisit [ ui ] = false; 7662 } 7663 7664 iPtr = 0; 7665 piStack[iPtr++] = (0 << 8) | (0); 7666 pbRegion[ 0 ] = false; 7667 7668 while(iPtr > 0) 7669 { 7670 Int iTmp = piStack[--iPtr]; 7671 Int iX1, iY1; 7672 iX1 = iTmp & 0xff; 7673 iY1 = (iTmp >> 8) & 0xff; 7674 7675 pbVisit[ iX1 + iY1 * iWidth ] = true; 7676 7677 assert( iX1 >= 0 && iX1 < iWidth ); 7678 assert( iY1 >= 0 && iY1 < iHeight ); 7679 7680 if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] ) 7681 { 7682 piStack[iPtr++] = (iY1 << 8) | (iX1 - 1); 7683 pbRegion[ iX1 - 1 + iY1 * iWidth ] = false; 7684 } 7685 if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] ) 7686 { 7687 piStack[iPtr++] = (iY1 << 8) | (iX1 + 1); 7688 pbRegion[ iX1 + 1 + iY1 * iWidth ] = false; 7689 } 7690 if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] ) 7691 { 7692 piStack[iPtr++] = ((iY1 - 1) << 8) | iX1; 7693 pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false; 7694 } 7695 if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] ) 7696 { 7697 piStack[iPtr++] = ((iY1 + 1) << 8) | iX1; 7698 pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false; 7699 } 7700 } 7701 7702 xFree( pbEdge ); 7703 xFree( pbVisit ); 7704 xFree( piStack ); 7705 } 7706 #endif 7707 #endif 6720 7708 #endif 6721 7709 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.h
r597 r598 226 226 #endif 227 227 #endif 228 #if LGE_INTER_SDC_E0156 229 Bool* m_pbInterSDCFlag; 230 Int* m_apSegmentInterDCOffset[4]; 231 UChar* m_pucInterSDCMask; 232 #endif 228 233 229 234 // ------------------------------------------------------------------------------------------------------------------- … … 508 513 #endif //H_3D_NBDV_REF 509 514 #endif 515 #if MTK_FAST_TEXTURE_ENCODING_E0173 516 Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); 517 #endif 510 518 #if H_3D_IV_MERGE 511 519 Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc ); … … 586 594 #endif 587 595 #endif 596 #if LGE_INTER_SDC_E0156 597 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 598 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } 599 Void setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 600 UInt getCtxInterSDCFlag ( UInt uiAbsPartIdx ); 601 Int* getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; } 602 Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; } 603 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } 604 605 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); 606 607 UChar* getInterSDCMask () { return m_pucInterSDCMask; } 608 #endif 588 609 589 610 // ------------------------------------------------------------------------------------------------------------------- … … 611 632 Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } 612 633 Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } 613 634 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 635 Void compressMV (int scale); 636 #else 614 637 Void compressMV (); 615 638 #endif 616 639 // ------------------------------------------------------------------------------------------------------------------- 617 640 // utility functions for neighbouring information -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPattern.h
r504 r598 102 102 Bool m_bICFlag; 103 103 #endif 104 #if LGE_INTER_SDC_E0156 105 Bool m_bSDCMRSADFlag; 106 #endif 104 107 static const UChar m_aucIntraFilter[5]; 105 108 … … 115 118 Bool getICFlag() { return m_bICFlag; } 116 119 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } 120 #endif 121 #if LGE_INTER_SDC_E0156 122 Bool getSDCMRSADFlag() { return m_bSDCMRSADFlag; } 123 Void setSDCMRSADFlag( Bool bSDCMRSADFlag ) { m_bSDCMRSADFlag = bSDCMRSADFlag; } 117 124 #endif 118 125 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPic.cpp
r597 r598 146 146 deleteSEIs(m_SEIs); 147 147 } 148 148 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 149 Void TComPic::compressMotion(int scale) 150 #else 149 151 Void TComPic::compressMotion() 152 #endif 150 153 { 151 154 TComPicSym* pPicSym = getPicSym(); … … 153 156 { 154 157 TComDataCU* pcCU = pPicSym->getCU(uiCUAddr); 158 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 159 pcCU->compressMV(scale); 160 #else 155 161 pcCU->compressMV(); 162 #endif 156 163 } 157 164 } -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPic.h
r597 r598 36 36 */ 37 37 38 38 39 #ifndef __TCOMPIC__ 39 40 #define __TCOMPIC__ … … 185 186 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 186 187 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } 187 188 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 189 Void compressMotion(int scale); 190 #else 188 191 Void compressMotion(); 192 #endif 189 193 UInt getCurrSliceIdx() { return m_uiCurrSliceIdx; } 190 194 Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r597 r598 39 39 #include "TComPrediction.h" 40 40 41 #if SHARP_ILLUCOMP_REFINE_E0046 42 #define IC_REG_COST_SHIFT 7 43 #define IC_CONST_SHIFT 5 44 #define IC_SHIFT_DIFF 12 45 #endif 46 41 47 //! \ingroup TLibCommon 42 48 //! \{ … … 137 143 } 138 144 #if H_3D_IC 145 #if SHARP_ILLUCOMP_REFINE_E0046 146 m_uiaShift[0] = 0; 139 147 for( Int i = 1; i < 64; i++ ) 140 148 { 149 m_uiaShift[i] = ( (1 << 15) + i/2 ) / i; 150 } 151 #else 152 for( Int i = 1; i < 64; i++ ) 153 { 141 154 m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i; 142 155 } 156 #endif 143 157 #endif 144 158 } … … 685 699 #endif 686 700 , bICFlag ); 701 #if SHARP_ILLUCOMP_REFINE_E0046 702 bICFlag = bICFlag && (iWidth > 8); 703 #endif 687 704 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 688 705 #if H_3D_ARP … … 970 987 if ( yFrac == 0 ) 971 988 { 989 #if MTK_CLIPPING_ALIGN_IC_E0168 990 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi || bICFlag 991 #else 972 992 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi 993 #endif 973 994 #if H_3D_ARP 974 995 , filterType … … 978 999 else if ( xFrac == 0 ) 979 1000 { 1001 #if MTK_CLIPPING_ALIGN_IC_E0168 1002 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag 1003 #else 980 1004 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi 1005 #endif 981 1006 #if H_3D_ARP 982 1007 , filterType … … 997 1022 #endif 998 1023 ); 1024 #if MTK_CLIPPING_ALIGN_IC_E0168 1025 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi || bICFlag 1026 #else 999 1027 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi 1028 #endif 1000 1029 #if H_3D_ARP 1001 1030 , filterType … … 1007 1036 if( bICFlag ) 1008 1037 { 1038 #if SHARP_ILLUCOMP_REFINE_E0046 1039 Int a, b, i, j; 1040 const Int iShift = IC_CONST_SHIFT; 1041 1042 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 1043 #else 1009 1044 Int a, b, iShift, i, j; 1010 1045 1011 1046 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA ); 1047 #endif 1048 1012 1049 1013 1050 for ( i = 0; i < height; i++ ) … … 1015 1052 for ( j = 0; j < width; j++ ) 1016 1053 { 1054 #if !MTK_CLIPPING_ALIGN_IC_E0168 1017 1055 if( bi ) 1018 1056 { … … 1021 1059 } 1022 1060 else 1061 #endif 1023 1062 dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 1024 1063 } 1025 1064 dst += dstStride; 1026 1065 } 1066 #if MTK_CLIPPING_ALIGN_IC_E0168 1067 if(bi) 1068 { 1069 Pel *dst2 = dstPic->getLumaAddr( partAddr ); 1070 Int shift = IF_INTERNAL_PREC - g_bitDepthY; 1071 for (i = 0; i < height; i++) 1072 { 1073 for (j = 0; j < width; j++) 1074 { 1075 Short val = dst2[j] << shift; 1076 dst2[j] = val - (Short)IF_INTERNAL_OFFS; 1077 } 1078 dst2 += dstStride; 1079 } 1080 } 1081 #endif 1027 1082 } 1028 1083 #endif … … 1075 1130 if ( yFrac == 0 ) 1076 1131 { 1132 #if MTK_CLIPPING_ALIGN_IC_E0168 1133 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1134 #else 1077 1135 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi 1136 #endif 1078 1137 #if H_3D_ARP 1079 1138 , filterType 1080 1139 #endif 1081 1140 ); 1141 #if MTK_CLIPPING_ALIGN_IC_E0168 1142 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1143 #else 1082 1144 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi 1145 #endif 1083 1146 #if H_3D_ARP 1084 1147 , filterType … … 1088 1151 else if ( xFrac == 0 ) 1089 1152 { 1153 #if MTK_CLIPPING_ALIGN_IC_E0168 1154 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1155 #else 1090 1156 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi 1157 #endif 1091 1158 #if H_3D_ARP 1092 1159 , filterType 1093 1160 #endif 1094 1161 ); 1162 #if MTK_CLIPPING_ALIGN_IC_E0168 1163 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1164 #else 1095 1165 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi 1166 #endif 1096 1167 #if H_3D_ARP 1097 1168 , filterType … … 1106 1177 #endif 1107 1178 ); 1179 #if MTK_CLIPPING_ALIGN_IC_E0168 1180 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1181 #else 1108 1182 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi 1183 #endif 1109 1184 #if H_3D_ARP 1110 1185 , filterType … … 1117 1192 #endif 1118 1193 ); 1194 #if MTK_CLIPPING_ALIGN_IC_E0168 1195 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1196 #else 1119 1197 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi 1198 #endif 1120 1199 #if H_3D_ARP 1121 1200 , filterType … … 1127 1206 if( bICFlag ) 1128 1207 { 1208 #if SHARP_ILLUCOMP_REFINE_E0046 1209 Int a, b, i, j; 1210 const Int iShift = IC_CONST_SHIFT; 1211 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb 1212 #else 1129 1213 Int a, b, iShift, i, j; 1130 1214 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb 1215 #endif 1131 1216 for ( i = 0; i < cxHeight; i++ ) 1132 1217 { 1133 1218 for ( j = 0; j < cxWidth; j++ ) 1134 1219 { 1220 #if !MTK_CLIPPING_ALIGN_IC_E0168 1135 1221 if( bi ) 1136 1222 { … … 1139 1225 } 1140 1226 else 1227 #endif 1141 1228 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b ); 1142 1229 } 1143 1230 dstCb += dstStride; 1144 1231 } 1232 #if SHARP_ILLUCOMP_REFINE_E0046 1233 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr 1234 #else 1145 1235 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr 1236 #endif 1146 1237 for ( i = 0; i < cxHeight; i++ ) 1147 1238 { 1148 1239 for ( j = 0; j < cxWidth; j++ ) 1149 1240 { 1241 #if !MTK_CLIPPING_ALIGN_IC_E0168 1150 1242 if( bi ) 1151 1243 { … … 1154 1246 } 1155 1247 else 1248 #endif 1156 1249 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b ); 1157 1250 } 1158 1251 dstCr += dstStride; 1159 1252 } 1253 #if MTK_CLIPPING_ALIGN_IC_E0168 1254 if(bi) 1255 { 1256 Pel* dstCb2 = dstPic->getCbAddr( partAddr ); 1257 Pel* dstCr2 = dstPic->getCrAddr( partAddr ); 1258 Int shift = IF_INTERNAL_PREC - g_bitDepthC; 1259 for (i = 0; i < cxHeight; i++) 1260 { 1261 for (j = 0; j < cxWidth; j++) 1262 { 1263 Short val = dstCb2[j] << shift; 1264 dstCb2[j] = val - (Short)IF_INTERNAL_OFFS; 1265 1266 val = dstCr2[j] << shift; 1267 dstCr2[j] = val - (Short)IF_INTERNAL_OFFS; 1268 } 1269 dstCb2 += dstStride; 1270 dstCr2 += dstStride; 1271 } 1272 } 1273 #endif 1160 1274 } 1161 1275 #endif … … 1306 1420 } 1307 1421 1422 #if !SHARP_ILLUCOMP_REFINE_E0046 1308 1423 /** Function for counting leading number of zeros/ones 1309 1424 * \param x input value … … 1347 1462 return clz; 1348 1463 } 1464 #endif 1349 1465 1350 1466 /** Function for deriving LM illumination compensation. 1351 1467 */ 1468 #if SHARP_ILLUCOMP_REFINE_E0046 1469 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ) 1470 #else 1352 1471 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType ) 1472 #endif 1353 1473 { 1354 1474 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); … … 1378 1498 1379 1499 Int x = 0, y = 0, xx = 0, xy = 0; 1500 #if SHARP_ILLUCOMP_REFINE_E0046 1501 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 1502 #endif 1380 1503 1381 1504 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) … … 1399 1522 } 1400 1523 1524 #if SHARP_ILLUCOMP_REFINE_E0046 1525 for( j = 0; j < uiWidth; j+=2 ) 1526 #else 1401 1527 for( j = 0; j < uiWidth; j++ ) 1528 #endif 1402 1529 { 1403 1530 x += pRef[j]; 1404 1531 y += pRec[j]; 1532 #if SHARP_ILLUCOMP_REFINE_E0046 1533 xx += (pRef[j] * pRef[j])>>precShift; 1534 xy += (pRef[j] * pRec[j])>>precShift; 1535 #else 1405 1536 xx += pRef[j] * pRef[j]; 1406 1537 xy += pRef[j] * pRec[j]; 1407 } 1538 #endif 1539 } 1540 #if SHARP_ILLUCOMP_REFINE_E0046 1541 iCountShift += g_aucConvertToBit[ uiWidth ] + 1; 1542 #else 1408 1543 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1544 #endif 1409 1545 } 1410 1546 … … 1430 1566 } 1431 1567 1568 #if SHARP_ILLUCOMP_REFINE_E0046 1569 for( i = 0; i < uiHeight; i+=2 ) 1570 #else 1432 1571 for( i = 0; i < uiHeight; i++ ) 1572 #endif 1433 1573 { 1434 1574 x += pRef[0]; 1435 1575 y += pRec[0]; 1576 #if SHARP_ILLUCOMP_REFINE_E0046 1577 xx += (pRef[0] * pRef[0])>>precShift; 1578 xy += (pRef[0] * pRec[0])>>precShift; 1579 1580 pRef += iRefStride*2; 1581 pRec += iRecStride*2; 1582 #else 1436 1583 xx += pRef[0] * pRef[0]; 1437 1584 xy += pRef[0] * pRec[0]; … … 1439 1586 pRef += iRefStride; 1440 1587 pRec += iRecStride; 1441 } 1588 #endif 1589 } 1590 #if SHARP_ILLUCOMP_REFINE_E0046 1591 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 ); 1592 #else 1442 1593 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1443 } 1444 1594 #endif 1595 } 1596 1597 #if SHARP_ILLUCOMP_REFINE_E0046 1598 xy += xx >> IC_REG_COST_SHIFT; 1599 xx += xx >> IC_REG_COST_SHIFT; 1600 Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift); 1601 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 1602 const Int iShift = IC_CONST_SHIFT; 1603 { 1604 #else 1445 1605 Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1446 1606 … … 1466 1626 Int a1 = ( xy << iCountShift ) - y * x; 1467 1627 Int a2 = ( xx << iCountShift ) - x * x; 1468 1628 #endif 1469 1629 { 1470 1630 const Int iShiftA2 = 6; 1631 #if !SHARP_ILLUCOMP_REFINE_E0046 1471 1632 const Int iShiftA1 = 15; 1633 #endif 1472 1634 const Int iAccuracyShift = 15; 1473 1635 … … 1477 1639 Int a2s = a2; 1478 1640 1641 #if SHARP_ILLUCOMP_REFINE_E0046 1642 a1 = Clip3(0, 2*a2, a1); 1643 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1644 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 1645 #else 1479 1646 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1480 1647 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1648 #endif 1481 1649 1482 1650 if( iScaleShiftA1 < 0 ) … … 1492 1660 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1493 1661 1662 1494 1663 a2s = a2 >> iScaleShiftA2; 1495 1664 1496 1665 a1s = a1 >> iScaleShiftA1; 1497 1666 1667 #if SHARP_ILLUCOMP_REFINE_E0046 1668 a = a1s * m_uiaShift[ a2s ]; 1669 a = a >> iScaleShiftA; 1670 #else 1498 1671 if (a2s >= 1) 1499 1672 { … … 1528 1701 iShift -= (9-n); 1529 1702 } 1530 1703 #endif 1531 1704 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1532 1705 } -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.h
r597 r598 76 76 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 77 77 #if H_3D_IC 78 #if SHARP_ILLUCOMP_REFINE_E0046 79 UInt m_uiaShift[ 64 ]; // Table for multiplication to substitue of division operation 80 #else 78 81 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation 82 #endif 79 83 #endif 80 84 … … 136 140 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 137 141 #if H_3D_IC 142 #if SHARP_ILLUCOMP_REFINE_E0046 143 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ); 144 #else 138 145 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType ); 146 #endif 139 147 #endif 140 148 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRdCost.cpp
r537 r598 505 505 cDtParam.bUseIC = false; 506 506 #endif 507 #if LGE_INTER_SDC_E0156 508 cDtParam.bUseSDCMRSAD = false; 509 #endif 507 510 #if WEIGHTED_CHROMA_DISTORTION 508 511 if (eText == TEXT_CHROMA_U) … … 608 611 } 609 612 #endif 613 #if LGE_INTER_SDC_E0156 614 if( pcDtParam->bUseSDCMRSAD ) 615 { 616 return xGetSADic( pcDtParam ); 617 } 618 #endif 610 619 Pel* piOrg = pcDtParam->pOrg; 611 620 Pel* piCur = pcDtParam->pCur; … … 638 647 #if H_3D_IC 639 648 if( pcDtParam->bUseIC ) 649 { 650 return xGetSAD4ic( pcDtParam ); 651 } 652 #endif 653 #if LGE_INTER_SDC_E0156 654 if( pcDtParam->bUseSDCMRSAD ) 640 655 { 641 656 return xGetSAD4ic( pcDtParam ); … … 675 690 #if H_3D_IC 676 691 if( pcDtParam->bUseIC ) 692 { 693 return xGetSAD8ic( pcDtParam ); 694 } 695 #endif 696 #if LGE_INTER_SDC_E0156 697 if( pcDtParam->bUseSDCMRSAD ) 677 698 { 678 699 return xGetSAD8ic( pcDtParam ); … … 716 737 #if H_3D_IC 717 738 if( pcDtParam->bUseIC ) 739 { 740 return xGetSAD16ic( pcDtParam ); 741 } 742 #endif 743 #if LGE_INTER_SDC_E0156 744 if( pcDtParam->bUseSDCMRSAD ) 718 745 { 719 746 return xGetSAD16ic( pcDtParam ); … … 770 797 } 771 798 #endif 799 #if LGE_INTER_SDC_E0156 800 if( pcDtParam->bUseSDCMRSAD ) 801 { 802 return xGetSAD12ic( pcDtParam ); 803 } 804 #endif 772 805 Pel* piOrg = pcDtParam->pOrg; 773 806 Pel* piCur = pcDtParam->pCur; … … 808 841 #if H_3D_IC 809 842 if( pcDtParam->bUseIC ) 843 { 844 return xGetSAD16Nic( pcDtParam ); 845 } 846 #endif 847 #if LGE_INTER_SDC_E0156 848 if( pcDtParam->bUseSDCMRSAD ) 810 849 { 811 850 return xGetSAD16Nic( pcDtParam ); … … 860 899 #if H_3D_IC 861 900 if( pcDtParam->bUseIC ) 901 { 902 return xGetSAD32ic( pcDtParam ); 903 } 904 #endif 905 #if LGE_INTER_SDC_E0156 906 if( pcDtParam->bUseSDCMRSAD ) 862 907 { 863 908 return xGetSAD32ic( pcDtParam ); … … 930 975 } 931 976 #endif 977 #if LGE_INTER_SDC_E0156 978 if( pcDtParam->bUseSDCMRSAD ) 979 { 980 return xGetSAD24ic( pcDtParam ); 981 } 982 #endif 932 983 Pel* piOrg = pcDtParam->pOrg; 933 984 Pel* piCur = pcDtParam->pCur; … … 985 1036 #if H_3D_IC 986 1037 if( pcDtParam->bUseIC ) 1038 { 1039 return xGetSAD64ic( pcDtParam ); 1040 } 1041 #endif 1042 #if LGE_INTER_SDC_E0156 1043 if( pcDtParam->bUseSDCMRSAD ) 987 1044 { 988 1045 return xGetSAD64ic( pcDtParam ); … … 1087 1144 } 1088 1145 #endif 1146 #if LGE_INTER_SDC_E0156 1147 if( pcDtParam->bUseSDCMRSAD ) 1148 { 1149 return xGetSAD48ic( pcDtParam ); 1150 } 1151 #endif 1089 1152 Pel* piOrg = pcDtParam->pOrg; 1090 1153 Pel* piCur = pcDtParam->pCur; … … 1157 1220 #endif 1158 1221 1159 #if H_3D_IC 1222 #if H_3D_IC || LGE_INTER_SDC_E0156 1160 1223 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1161 1224 { … … 3409 3472 } 3410 3473 #endif 3474 #if LGE_INTER_SDC_E0156 3475 if( pcDtParam->bUseSDCMRSAD ) 3476 { 3477 return xGetHADsic( pcDtParam ); 3478 } 3479 #endif 3411 3480 Pel* piOrg = pcDtParam->pOrg; 3412 3481 Pel* piCur = pcDtParam->pCur; … … 3506 3575 } 3507 3576 3508 #if H_3D_IC 3577 #if H_3D_IC || LGE_INTER_SDC_E0156 3509 3578 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3510 3579 { -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRdCost.h
r537 r598 94 94 Bool bUseIC; 95 95 #endif 96 #if LGE_INTER_SDC_E0156 97 Bool bUseSDCMRSAD; 98 #endif 96 99 Int iRows; 97 100 Int iCols; … … 133 136 iStrideVir = 0; 134 137 #endif 138 #if LGE_INTER_SDC_E0156 139 bUseSDCMRSAD = false; 140 #endif 135 141 } 136 142 }; … … 274 280 static UInt xGetSSE64 ( DistParam* pcDtParam ); 275 281 static UInt xGetSSE16N ( DistParam* pcDtParam ); 276 #if H_3D_IC 282 #if H_3D_IC || LGE_INTER_SDC_E0156 277 283 static UInt xGetSADic ( DistParam* pcDtParam ); 278 284 static UInt xGetSAD4ic ( DistParam* pcDtParam ); … … 302 308 303 309 #if AMP_SAD 304 #if H_3D_IC 310 #if H_3D_IC || LGE_INTER_SDC_E0156 305 311 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 306 312 static UInt xGetSAD24ic ( DistParam* pcDtParam ); … … 313 319 #endif 314 320 315 #if H_3D_IC 321 #if H_3D_IC || LGE_INTER_SDC_E0156 316 322 static UInt xGetHADsic ( DistParam* pcDtParam ); 317 323 #endif -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r597 r598 1542 1542 #if H_3D_NBDV_REF 1543 1543 m_depthRefinementFlag [ i ] = false; 1544 #endif 1545 #if LGE_INTER_SDC_E0156 1546 m_bInterSDCFlag [ i ] = false; 1544 1547 #endif 1545 1548 } -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComSlice.h
r542 r598 507 507 Bool m_ivMvScalingFlag; 508 508 #endif 509 #if LGE_INTER_SDC_E0156 510 Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; 511 #endif 509 512 510 513 #endif … … 716 719 Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } 717 720 Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } 721 #endif 722 #if LGE_INTER_SDC_E0156 723 Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } 724 Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } 718 725 #endif 719 726 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TypeDef.h
r597 r598 96 96 // Unifying rounding offset, for IC part, JCT3V-D0135 97 97 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 98 #define H_3D_FIX 1 // Bug Fix 99 #define SHARP_ILLUCOMP_REFINE_E0046 1 100 #define MTK_FAST_TEXTURE_ENCODING_E0173 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173 101 #if H_3D_FIX 102 #if H_3D_IC 103 #define MTK_CLIPPING_ALIGN_IC_E0168 1 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 104 #endif 105 #else 106 #define MTK_CLIPPING_ALIGN_IC_E0168 1 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 107 #endif 108 #define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 1 // Progressive MV Compression, JCT3V-E0170 109 #define LGE_INTER_SDC_E0156 1 // Enable inter SDC for depth coding 110 98 111 #if H_3D_NBDV 99 112 #define H_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation
Note: See TracChangeset for help on using the changeset viewer.