Changeset 655 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 23 Oct 2013, 23:01:30 (11 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r625 r655 61 61 #if H_MV 62 62 #define NV_VERSION "8.1" ///< Current software version 63 #define HM_VERSION "1 1.0" ///<63 #define HM_VERSION "12.0" ///< 64 64 #else 65 #define NV_VERSION "1 1.0" ///< Current software version65 #define NV_VERSION "12.0" ///< Current software version 66 66 #endif 67 67 … … 187 187 } 188 188 189 #if H_MV5190 189 template <typename T> 191 190 __inline T gCeilLog2( T val ) … … 196 195 return ceilLog2; 197 196 } 198 #endif199 197 200 198 #define RemoveBitIncrement( exp ) ( exp >> ( g_bitDepthY - 8 ) ) -
trunk/source/Lib/TLibCommon/ContextTables.h
r622 r655 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] = -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r622 r655 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 { … … 2689 2656 // check prediction mode 2690 2657 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 2691 #if LGE_SDC_REMOVE_DC_E01582692 2658 if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) ) 2693 #else2694 if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )2695 #endif2696 2659 return true; 2697 2660 … … 3569 3532 UInt uiPartIdxCenter; 3570 3533 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 3534 #if H_3D_FCO 3535 TComPic * pcTexturePic = m_pcSlice->getTexturePic(); 3536 TComDataCU *pcTextureCU = 0; 3537 if ( pcTexturePic ) 3538 pcTextureCU = pcTexturePic->getCU( getAddr() ); 3539 #else 3571 3540 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 3541 #endif 3572 3542 3543 #if H_3D_FCO 3544 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 3545 #else 3573 3546 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 3547 #endif 3574 3548 { 3575 3549 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); … … 4830 4804 4831 4805 // use coldir. 4832 #if H_MV54833 4806 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 4834 #else4835 #if H_MV4836 TComPic *pColPic;4837 if (getSlice()->getAltCollocatedIndicationFlag() )4838 {4839 pColPic = getSlice()->getPicFromRefPicSetInterLayer( getSlice()->getActiveMotionPredRefLayerId( getSlice()->getCollocatedRefLayerIdx() ));4840 }4841 else4842 {4843 pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());4844 }4845 #else4846 TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());4847 #endif4848 #endif4849 4807 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 4850 4808 if(pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE) … … 4996 4954 + ( iPartWidth/m_pcPic->getMinCUWidth() )/2]; 4997 4955 } 4998 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01704999 Void TComDataCU::compressMV( int scale)4956 #if H_3D 4957 Void TComDataCU::compressMV(Int scale) 5000 4958 #else 5001 4959 Void TComDataCU::compressMV() 5002 4960 #endif 5003 4961 { 5004 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E01704962 #if H_3D 5005 4963 Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize; 5006 4964 #else … … 5509 5467 xDeriveCenterIdx(uiPartIdx, uiPartIdxCenter ); 5510 5468 5511 ///*** Derive bottom right neighbour position ***5512 #if !SEC_SIMPLIFIED_NBDV_E01425513 Int iLCUIdxRBNb = -1;5514 Int iPartIdxRBNb = -1;5515 xDeriveRightBottomNbIdx(iLCUIdxRBNb, iPartIdxRBNb );5516 #endif5517 5518 5469 ///*** Search temporal candidate pictures for disparity vector *** 5519 5470 const Int iNumCandPics = getPic()->getNumDdvCandPics(); … … 5533 5484 } 5534 5485 5535 #if !SEC_SIMPLIFIED_NBDV_E0142 5536 // Check BR and Center 5537 for(Int curPosition = 0; curPosition < 2; curPosition++) 5538 { 5539 #endif 5540 Bool bCheck = false; 5541 #if !SEC_SIMPLIFIED_NBDV_E0142 5542 if ( curPosition == 0 && iLCUIdxRBNb >= 0 ) 5543 #if MTK_NBDV_TN_FIX_E0172 5544 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5486 Bool bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5487 5488 if( bCheck ) 5489 { 5490 clipMv(cColMv); 5491 pDInfo->m_acNBDV = cColMv; 5492 pDInfo->m_aVIdxCan = iTargetViewIdx; 5493 5494 #if H_3D_NBDV_REF 5495 TComPic* picDepth = NULL; 5496 #if H_3D_FCO_VSP_DONBDV_E0163 5497 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5498 if ( picDepth->getPicYuvRec() != NULL ) 5499 { 5500 cColMv.setZero(); 5501 } 5502 else // Go back with virtual depth 5503 { 5504 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5505 } 5506 5507 assert(picDepth != NULL); 5545 5508 #else 5546 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5547 #endif 5548 5549 if (curPosition == 1 ) 5550 #endif 5551 #if MTK_NBDV_TN_FIX_E0172 5552 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5553 #else 5554 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5555 #endif 5556 5557 if( bCheck ) 5558 { 5559 clipMv(cColMv); 5560 pDInfo->m_acNBDV = cColMv; 5561 pDInfo->m_aVIdxCan = iTargetViewIdx; 5562 5563 #if H_3D_NBDV_REF 5564 TComPic* picDepth = NULL; 5565 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5566 assert(picDepth != NULL); 5567 if (picDepth && bDepthRefine) 5568 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv ); 5569 5570 pDInfo->m_acDoNBDV = cColMv; 5509 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5510 assert(picDepth != NULL); 5511 #endif 5512 if (picDepth && bDepthRefine) 5513 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv ); 5514 5515 pDInfo->m_acDoNBDV = cColMv; 5571 5516 #endif //H_3D_NBDV_REF 5572 return true; 5573 } 5574 #if !SEC_SIMPLIFIED_NBDV_E0142 5575 } 5576 #endif 5517 return true; 5518 } 5577 5519 } 5578 5520 } … … 5587 5529 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT 5588 5530 #if H_3D_NBDV_REF 5589 , bDepthRefine5531 , bDepthRefine 5590 5532 #endif 5591 5533 ) ) … … 5599 5541 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE 5600 5542 #if H_3D_NBDV_REF 5601 , bDepthRefine5602 #endif 5603 ) )5543 , bDepthRefine 5544 #endif 5545 ) ) 5604 5546 return true; 5605 5547 } 5606 5607 #if !SEC_SIMPLIFIED_NBDV_E01425608 //// ******* Get disparity from above right block ******* /////5609 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true);5610 if(pcTmpCU != NULL )5611 {5612 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0);5613 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVERIGHT5614 #if H_3D_NBDV_REF5615 , bDepthRefine5616 #endif5617 ) )5618 return true;5619 }5620 5621 //// ******* Get disparity from below left block ******* /////5622 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true);5623 if( pcTmpCU != NULL )5624 {5625 bCheckMcpDv = true;5626 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFTBELOW5627 #if H_3D_NBDV_REF5628 , bDepthRefine5629 #endif5630 ) )5631 return true;5632 }5633 5634 //// ******* Get disparity from above left block ******* /////5635 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true);5636 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));5637 5638 if( pcTmpCU != NULL )5639 {5640 bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1);5641 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVELEFT5642 #if H_3D_NBDV_REF5643 , bDepthRefine5644 #endif5645 ) )5646 return true;5647 }5648 #endif5649 5548 5650 5549 //// ******* Search MCP blocks ******* ///// … … 5662 5561 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 5663 5562 #if H_3D_NBDV_REF 5563 #if H_3D_FCO_VSP_DONBDV_E0163 5564 TComPic* picDepth = NULL; 5565 5566 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5567 if ( picDepth->getPicYuvRec() != NULL ) 5568 { 5569 cDispVec.setZero(); 5570 } 5571 else // Go back with virtual depth 5572 { 5573 picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); 5574 } 5575 5576 assert(picDepth != NULL); 5577 #else 5664 5578 TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); 5665 5579 assert(picDepth!=NULL); 5580 #endif 5666 5581 5667 5582 if (picDepth && bDepthRefine) … … 5679 5594 TComMv defaultDV(0, 0); 5680 5595 pDInfo->m_acNBDV = defaultDV; 5681 #if NBDV_DEFAULT_VIEWIDX_BUGFIX 5596 5682 5597 Int valid = 0; 5683 5598 Int viewIndex = 0; … … 5707 5622 #if H_3D_NBDV_REF 5708 5623 TComPic* picDepth = NULL; 5624 #if H_3D_FCO_VSP_DONBDV_E0163 5625 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5626 if ( picDepth->getPicYuvRec() != NULL ) 5627 { 5628 defaultDV.setZero(); 5629 } 5630 else // Go back with virtual depth 5631 { 5632 picDepth = getSlice()->getIvPic( true, viewIndex ); 5633 } 5634 5635 assert(picDepth != NULL); 5636 #else 5709 5637 picDepth = getSlice()->getIvPic( true, viewIndex ); 5710 5638 assert(picDepth!=NULL); 5711 5639 #endif 5712 5640 if (picDepth && bDepthRefine) 5713 5641 { … … 5717 5645 #endif 5718 5646 } 5719 #else5720 pDInfo->m_aVIdxCan = 0;5721 #if H_3D_NBDV_REF5722 TComPic* picDepth = NULL;5723 picDepth = getSlice()->getIvPic( true, 0 );5724 assert(picDepth!=NULL);5725 5726 if (picDepth && bDepthRefine)5727 {5728 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view5729 }5730 pDInfo->m_acDoNBDV = defaultDV;5731 #endif5732 #endif5733 5647 return false; 5734 5648 } … … 5740 5654 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(); 5741 5655 5742 #if NTT_DoNBDV_VECTOR_CLIP_E01415743 5656 Int depthStartPosX = Clip3(0, iPictureWidth - 1, iBlkX + ((mv->getHor()+2)>>2)); 5744 5657 Int depthStartPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((mv->getVer()+2)>>2)); 5745 5658 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2)); 5746 5659 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5747 #else5748 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2));5749 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2));5750 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2));5751 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2));5752 #endif5753 5660 5754 5661 Pel* depthTL = pcBaseViewDepthPicYuv->getLumaAddr(); … … 5812 5719 TComPic* picDepth = NULL; 5813 5720 assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); 5721 #if H_3D_FCO_VSP_DONBDV_E0163 5722 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); 5723 if ( picDepth->getPicYuvRec() != NULL ) 5724 { 5725 cMvPred.setZero(); 5726 } 5727 else// Go back with virtual depth 5728 { 5729 picDepth = getSlice()->getIvPic (true, refViewIdx ); 5730 } 5731 assert(picDepth != NULL); 5732 #else 5814 5733 picDepth = getSlice()->getIvPic (true, refViewIdx ); 5815 5734 assert(picDepth != NULL); 5816 5735 #endif 5817 5736 UInt uiPartIdx = 0; //Notes from MTK: Please confirm that using 0 as partition index and partition address is correct for CU-level DoNBDV 5818 5737 UInt uiPartAddr = 0; //QC: confirmed … … 5829 5748 assert( uiMvpDvPos < IDV_CANDS ); 5830 5749 paIDVInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.getIDVHor(), cMvPred.getIDVVer() ); 5831 //Notes from QC: DvMCP is implemented in a way that doesn E½t carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design.5750 //Notes from QC: DvMCP is implemented in a way that doesnot carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design. 5832 5751 paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = cMvPred.getIDVVId(); 5833 5752 paIDVInfo->m_bAvailab[iList][ uiMvpDvPos ] = true; … … 5901 5820 } 5902 5821 #endif 5903 #if MTK_NBDV_TN_FIX_E0172 5822 5904 5823 Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5905 #else5906 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )5907 #endif5908 5824 { 5909 5825 … … 5921 5837 if(pColCU->getSlice()->isInterB()) 5922 5838 { 5923 5839 eColRefPicList = RefPicList(ilist); 5924 5840 } 5925 5841 … … 5939 5855 else 5940 5856 { 5941 #if MTK_NBDV_TN_FIX_E01725942 5857 if(getPic()->isTempIVRefValid(currCandPic, ilist, iColRefIdx)) 5943 5858 { 5944 #endif 5945 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx); 5946 rcMv.setIDVFlag(0); 5947 iTargetViewIdx = iColRefViewIdx ; 5948 iStartViewIdx = iColViewIdx ; 5949 return true; 5950 #if MTK_NBDV_TN_FIX_E0172 5951 } 5952 #endif 5859 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx); 5860 rcMv.setIDVFlag(0); 5861 iTargetViewIdx = iColRefViewIdx ; 5862 iStartViewIdx = iColViewIdx ; 5863 return true; 5864 } 5953 5865 } 5954 5866 } … … 5957 5869 } 5958 5870 #endif 5959 #if MTK_FAST_TEXTURE_ENCODING_E01735871 #if H_3D_FAST_TEXTURE_ENCODING 5960 5872 Void 5961 5873 TComDataCU::getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD) … … 6242 6154 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 6243 6155 } 6244 #if !SEC_DMM2_E0146_HHIFIX6245 Void TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth )6246 {6247 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);6248 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; }6249 }6250 #endif6251 6156 Void TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 6252 6157 { -
trunk/source/Lib/TLibCommon/TComDataCU.h
r622 r655 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]; … … 489 486 #endif 490 487 ); 491 #if MTK_NBDV_TN_FIX_E0172492 488 Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 493 #else494 Bool xGetColDisMV ( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );495 #endif496 489 Bool getDisMvpCandNBDV ( DisInfo* pDInfo 497 490 #if H_3D_NBDV_REF … … 505 498 #endif //H_3D_NBDV_REF 506 499 #endif 507 #if MTK_FAST_TEXTURE_ENCODING_E0173500 #if H_3D_FAST_TEXTURE_ENCODING 508 501 Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); 509 502 #endif … … 545 538 Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); 546 539 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 540 UInt* getDmm3IntraTabIdx () { return m_dmm3IntraTabIdx; } 555 541 UInt getDmm3IntraTabIdx ( UInt uiIdx ) { return m_dmm3IntraTabIdx[uiIdx]; } … … 588 574 #endif 589 575 #endif 590 #if LGE_INTER_SDC_E0156576 #if H_3D_INTER_SDC 591 577 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 592 578 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } … … 626 612 Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } 627 613 Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } 628 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170629 Void compressMV ( int scale);614 #if H_3D 615 Void compressMV ( Int scale ); 630 616 #else 631 617 Void compressMV (); -
trunk/source/Lib/TLibCommon/TComMv.h
r622 r655 40 40 41 41 #include "CommonDef.h" 42 #include <cstdlib> 42 43 43 44 //! \ingroup TLibCommon -
trunk/source/Lib/TLibCommon/TComPattern.h
r608 r655 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; } -
trunk/source/Lib/TLibCommon/TComPic.cpp
r608 r655 50 50 , m_bUsedByCurr (false) 51 51 , m_bIsLongTerm (false) 52 , m_bIsUsedAsLongTerm (false)53 52 , m_apcPicSym (NULL) 54 53 , m_pcPicYuvPred (NULL) … … 118 117 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int)); 119 118 119 /* initialize the texture to depth reference status */ 120 #if H_3D_FCO 121 for (int j=0; j<2; j++) 122 { 123 for (int i=0; i<MAX_NUM_REF; i++) 124 { 125 m_aiTexToDepRef[j][i] = -1; 126 } 127 } 128 #endif 129 120 130 return; 121 131 } … … 146 156 deleteSEIs(m_SEIs); 147 157 } 148 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170149 Void TComPic::compressMotion( int scale)158 #if H_3D 159 Void TComPic::compressMotion(Int scale) 150 160 #else 151 161 Void TComPic::compressMotion() … … 156 166 { 157 167 TComDataCU* pcCU = pPicSym->getCU(uiCUAddr); 158 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170168 #if H_3D 159 169 pcCU->compressMV(scale); 160 170 #else … … 661 671 return numDdvCandPics; 662 672 } 663 #endif 664 #if MTK_NBDV_TN_FIX_E0172 673 665 674 Void TComPic::checkTemporalIVRef() 666 675 { … … 716 725 return m_abTIVRINCurrRL[currCandPic][iColRefDir][iColRefIdx]; 717 726 } 718 #endif 719 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 727 720 728 Void TComPic::checkTextureRef( ) 721 729 { 722 730 TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); 723 731 TComPic* pcTextPic = pcCurrSlice->getTexturePic(); 732 #if H_3D_FCO 733 if ( pcTextPic ) 734 { 735 #endif 736 724 737 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 725 738 … … 743 756 744 757 } 758 #if H_3D_FCO 759 } 760 #endif 761 745 762 } 746 763 -
trunk/source/Lib/TLibCommon/TComPic.h
r608 r655 61 61 Bool m_bUsedByCurr; // Used by current picture 62 62 Bool m_bIsLongTerm; // IS long term picture 63 Bool m_bIsUsedAsLongTerm; // long term picture is used as reference before64 63 TComPicSym* m_apcPicSym; // Symbol 65 64 … … 83 82 Window m_defaultDisplayWindow; 84 83 84 bool m_isTop; 85 bool m_isField; 86 85 87 std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink; 86 88 … … 104 106 RefPicList m_eRapRefList; 105 107 Int m_iNumDdvCandPics; 106 #endif107 #if MTK_NBDV_TN_FIX_E0172108 108 Bool m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists 109 #endif110 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182111 109 Int m_aiTexToDepRef [2][MAX_NUM_REF]; 112 110 #endif … … 186 184 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 187 185 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } 188 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170189 Void compressMotion( int scale);186 #if H_3D 187 Void compressMotion(Int scale); 190 188 #else 191 189 Void compressMotion(); … … 212 210 TComPicYuv* getYuvPicBufferForIndependentBoundaryProcessing() {return m_pNDBFilterYuvTmp;} 213 211 std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter (Int sliceID) { return m_vSliceCUDataLink[sliceID];} 212 213 214 /* field coding parameters*/ 215 216 Void setTopField(bool b) {m_isTop = b;} 217 bool isTopField() {return m_isTop;} 218 Void setField(bool b) {m_isField = b;} 219 bool isField() {return m_isField;} 214 220 215 221 #if H_MV … … 224 230 UInt getRapRefIdx() {return m_uiRapRefIdx; } 225 231 RefPicList getRapRefList() {return m_eRapRefList; } 226 #endif 227 #if MTK_NBDV_TN_FIX_E0172 228 Void checkTemporalIVRef(); 229 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 230 #endif 231 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 232 Void checkTextureRef( ); 233 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 232 Void checkTemporalIVRef(); 233 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 234 Void checkTextureRef( ); 235 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 234 236 #endif 235 237 /** transfer ownership of seis to this picture */ -
trunk/source/Lib/TLibCommon/TComPicSym.cpp
r608 r655 61 61 ,m_uiNumAllocatedSlice (0) 62 62 ,m_apcTComDataCU (NULL) 63 ,m_iTileBoundaryIndependenceIdr (0)64 63 ,m_iNumColumnsMinus1 (0) 65 64 ,m_iNumRowsMinus1(0) -
trunk/source/Lib/TLibCommon/TComPicSym.h
r608 r655 99 99 UInt m_uiNumAllocatedSlice; 100 100 TComDataCU** m_apcTComDataCU; ///< array of CU data 101 102 Int m_iTileBoundaryIndependenceIdr; 101 103 102 Int m_iNumColumnsMinus1; 104 103 Int m_iNumRowsMinus1; -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r622 r655 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 … … 731 701 // Get depth reference 732 702 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 703 #if H_3D_FCO_VSP_DONBDV_E0163 704 TComPic* pRefPicBaseDepth = 0; 705 Bool bIsCurrDepthCoded = false; 706 pRefPicBaseDepth = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() ); 707 if ( pRefPicBaseDepth->getPicYuvRec() != NULL ) 708 { 709 bIsCurrDepthCoded = true; 710 } 711 else 712 { 713 pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 714 } 715 #else 733 716 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 717 #endif 734 718 assert(pRefPicBaseDepth != NULL); 735 719 TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); … … 752 736 pcCU->clipMv(cDv); 753 737 754 #if NTT_VSP_COMMON_E0207_E0208 738 #if H_3D_FCO_VSP_DONBDV_E0163 739 if ( bIsCurrDepthCoded ) 740 { 741 cDv.setZero(); 742 } 743 #endif 755 744 // fetch virtual depth map 756 #if NTT_VSP_VECTOR_CLIP_E0208757 745 pcBaseViewDepthPicYuv->extendPicBorder(); 758 #endif759 746 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp ); 760 747 // sub-PU based compensation 761 748 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 762 749 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 763 #else764 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();765 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];766 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];767 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );768 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );769 #endif770 771 750 } 772 751 #endif … … 984 963 if ( yFrac == 0 ) 985 964 { 986 #if MTK_CLIPPING_ALIGN_IC_E0168965 #if H_3D_IC 987 966 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi || bICFlag 988 967 #else … … 996 975 else if ( xFrac == 0 ) 997 976 { 998 #if MTK_CLIPPING_ALIGN_IC_E0168977 #if H_3D_IC 999 978 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag 1000 979 #else … … 1019 998 #endif 1020 999 ); 1021 #if MTK_CLIPPING_ALIGN_IC_E01681000 #if H_3D_IC 1022 1001 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi || bICFlag 1023 1002 #else … … 1033 1012 if( bICFlag ) 1034 1013 { 1035 #if SHARP_ILLUCOMP_REFINE_E00461036 1014 Int a, b, i, j; 1037 1015 const Int iShift = IC_CONST_SHIFT; 1038 1016 1039 1017 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 1040 #else1041 Int a, b, iShift, i, j;1042 1043 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA );1044 #endif1045 1018 1046 1019 … … 1049 1022 for ( j = 0; j < width; j++ ) 1050 1023 { 1051 #if !MTK_CLIPPING_ALIGN_IC_E01681052 if( bi )1053 {1054 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;1055 dst[j] = ( ( a*dst[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1 << iIFshift ) - IF_INTERNAL_OFFS;1056 }1057 else1058 #endif1059 1024 dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 1060 1025 } 1061 1026 dst += dstStride; 1062 1027 } 1063 #if MTK_CLIPPING_ALIGN_IC_E0168 1028 1064 1029 if(bi) 1065 1030 { … … 1076 1041 } 1077 1042 } 1078 #endif1079 1043 } 1080 1044 #endif … … 1127 1091 if ( yFrac == 0 ) 1128 1092 { 1129 #if MTK_CLIPPING_ALIGN_IC_E01681093 #if H_3D_IC 1130 1094 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1131 1095 #else … … 1136 1100 #endif 1137 1101 ); 1138 #if MTK_CLIPPING_ALIGN_IC_E01681102 #if H_3D_IC 1139 1103 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag 1140 1104 #else … … 1148 1112 else if ( xFrac == 0 ) 1149 1113 { 1150 #if MTK_CLIPPING_ALIGN_IC_E01681114 #if H_3D_IC 1151 1115 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1152 1116 #else … … 1157 1121 #endif 1158 1122 ); 1159 #if MTK_CLIPPING_ALIGN_IC_E01681123 #if H_3D_IC 1160 1124 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag 1161 1125 #else … … 1174 1138 #endif 1175 1139 ); 1176 #if MTK_CLIPPING_ALIGN_IC_E01681140 #if H_3D_IC 1177 1141 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1178 1142 #else … … 1189 1153 #endif 1190 1154 ); 1191 #if MTK_CLIPPING_ALIGN_IC_E01681155 #if H_3D_IC 1192 1156 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag 1193 1157 #else … … 1203 1167 if( bICFlag ) 1204 1168 { 1205 #if SHARP_ILLUCOMP_REFINE_E00461206 1169 Int a, b, i, j; 1207 1170 const Int iShift = IC_CONST_SHIFT; 1208 1171 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb 1209 #else1210 Int a, b, iShift, i, j;1211 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb1212 #endif1213 1172 for ( i = 0; i < cxHeight; i++ ) 1214 1173 { 1215 1174 for ( j = 0; j < cxWidth; j++ ) 1216 1175 { 1217 #if !MTK_CLIPPING_ALIGN_IC_E01681218 if( bi )1219 {1220 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;1221 dstCb[j] = ( ( a*dstCb[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;1222 }1223 else1224 #endif1225 1176 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b ); 1226 1177 } 1227 1178 dstCb += dstStride; 1228 1179 } 1229 #if SHARP_ILLUCOMP_REFINE_E00461230 1180 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr 1231 #else1232 xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr1233 #endif1234 1181 for ( i = 0; i < cxHeight; i++ ) 1235 1182 { 1236 1183 for ( j = 0; j < cxWidth; j++ ) 1237 1184 { 1238 #if !MTK_CLIPPING_ALIGN_IC_E01681239 if( bi )1240 {1241 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;1242 dstCr[j] = ( ( a*dstCr[j] + a*IF_INTERNAL_OFFS ) >> iShift ) + b*( 1<<iIFshift ) - IF_INTERNAL_OFFS;1243 }1244 else1245 #endif1246 1185 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b ); 1247 1186 } 1248 1187 dstCr += dstStride; 1249 1188 } 1250 #if MTK_CLIPPING_ALIGN_IC_E0168 1189 1251 1190 if(bi) 1252 1191 { … … 1268 1207 } 1269 1208 } 1270 #endif1271 1209 } 1272 1210 #endif … … 1323 1261 Int k, l, bottomLeft, topRight; 1324 1262 Int horPred; 1325 Int leftColumn[MAX_CU_SIZE ], topRow[MAX_CU_SIZE], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];1263 Int leftColumn[MAX_CU_SIZE+1], topRow[MAX_CU_SIZE+1], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE]; 1326 1264 UInt blkSize = width; 1327 1265 UInt offset2D = width; … … 1417 1355 } 1418 1356 1419 #if !SHARP_ILLUCOMP_REFINE_E00461420 /** Function for counting leading number of zeros/ones1421 * \param x input value1422 \ This function counts leading number of zeros for positive numbers and1423 \ leading number of ones for negative numbers. This can be implemented in1424 \ single instructure cycle on many processors.1425 */1426 1427 Short CountLeadingZerosOnes (Short x)1428 {1429 Short clz;1430 Short i;1431 1432 if(x == 0)1433 {1434 clz = 0;1435 }1436 else1437 {1438 if (x == -1)1439 {1440 clz = 15;1441 }1442 else1443 {1444 if(x < 0)1445 {1446 x = ~x;1447 }1448 clz = 15;1449 for(i = 0;i < 15;++i)1450 {1451 if(x)1452 {1453 clz --;1454 }1455 x = x >> 1;1456 }1457 }1458 }1459 return clz;1460 }1461 #endif1462 1357 1463 1358 /** Function for deriving LM illumination compensation. 1464 1359 */ 1465 #if SHARP_ILLUCOMP_REFINE_E00461466 1360 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType ) 1467 #else1468 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType )1469 #endif1470 1361 { 1471 1362 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); … … 1495 1386 1496 1387 Int x = 0, y = 0, xx = 0, xy = 0; 1497 #if SHARP_ILLUCOMP_REFINE_E00461498 1388 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 1499 #endif1500 1389 1501 1390 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 ) … … 1519 1408 } 1520 1409 1521 #if SHARP_ILLUCOMP_REFINE_E00461522 1410 for( j = 0; j < uiWidth; j+=2 ) 1523 #else1524 for( j = 0; j < uiWidth; j++ )1525 #endif1526 1411 { 1527 1412 x += pRef[j]; 1528 1413 y += pRec[j]; 1529 #if SHARP_ILLUCOMP_REFINE_E00461530 1414 xx += (pRef[j] * pRef[j])>>precShift; 1531 1415 xy += (pRef[j] * pRec[j])>>precShift; 1532 #else 1533 xx += pRef[j] * pRef[j]; 1534 xy += pRef[j] * pRec[j]; 1535 #endif 1536 } 1537 #if SHARP_ILLUCOMP_REFINE_E0046 1416 } 1538 1417 iCountShift += g_aucConvertToBit[ uiWidth ] + 1; 1539 #else1540 iCountShift += g_aucConvertToBit[ uiWidth ] + 2;1541 #endif1542 1418 } 1543 1419 … … 1563 1439 } 1564 1440 1565 #if SHARP_ILLUCOMP_REFINE_E00461566 1441 for( i = 0; i < uiHeight; i+=2 ) 1567 #else1568 for( i = 0; i < uiHeight; i++ )1569 #endif1570 1442 { 1571 1443 x += pRef[0]; 1572 1444 y += pRec[0]; 1573 #if SHARP_ILLUCOMP_REFINE_E0046 1445 1574 1446 xx += (pRef[0] * pRef[0])>>precShift; 1575 1447 xy += (pRef[0] * pRec[0])>>precShift; … … 1577 1449 pRef += iRefStride*2; 1578 1450 pRec += iRecStride*2; 1579 #else 1580 xx += pRef[0] * pRef[0]; 1581 xy += pRef[0] * pRec[0]; 1582 1583 pRef += iRefStride; 1584 pRec += iRecStride; 1585 #endif 1586 } 1587 #if SHARP_ILLUCOMP_REFINE_E0046 1451 } 1588 1452 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 ); 1589 #else 1590 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1591 #endif 1592 } 1593 1594 #if SHARP_ILLUCOMP_REFINE_E0046 1453 } 1454 1595 1455 xy += xx >> IC_REG_COST_SHIFT; 1596 1456 xx += xx >> IC_REG_COST_SHIFT; … … 1599 1459 const Int iShift = IC_CONST_SHIFT; 1600 1460 { 1601 #else1602 Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;1603 1604 if( iTempShift > 0 )1605 {1606 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1607 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1608 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1609 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;1610 iCountShift -= iTempShift;1611 }1612 1613 iShift = 13;1614 1615 if( iCountShift == 0 )1616 {1617 a = 1;1618 b = 0;1619 iShift = 0;1620 }1621 else1622 {1623 Int a1 = ( xy << iCountShift ) - y * x;1624 Int a2 = ( xx << iCountShift ) - x * x;1625 #endif1626 1461 { 1627 1462 const Int iShiftA2 = 6; 1628 #if !SHARP_ILLUCOMP_REFINE_E00461629 const Int iShiftA1 = 15;1630 #endif1631 1463 const Int iAccuracyShift = 15; 1632 1464 … … 1636 1468 Int a2s = a2; 1637 1469 1638 #if SHARP_ILLUCOMP_REFINE_E00461639 1470 a1 = Clip3(0, 2*a2, a1); 1640 1471 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1641 1472 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 1642 #else1643 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;1644 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;1645 #endif1646 1473 1647 1474 if( iScaleShiftA1 < 0 ) … … 1662 1489 a1s = a1 >> iScaleShiftA1; 1663 1490 1664 #if SHARP_ILLUCOMP_REFINE_E00461665 1491 a = a1s * m_uiaShift[ a2s ]; 1666 1492 a = a >> iScaleShiftA; 1667 #else1668 if (a2s >= 1)1669 {1670 a = a1s * m_uiaShift[ a2s - 1];1671 }1672 else1673 {1674 a = 0;1675 }1676 1677 if( iScaleShiftA < 0 )1678 {1679 a = a << -iScaleShiftA;1680 }1681 else1682 {1683 a = a >> iScaleShiftA;1684 }1685 1686 a = Clip3( -( 1 << 15 ), ( 1 << 15 ) - 1, a );1687 1688 Int minA = -(1 << (6));1689 Int maxA = (1 << 6) - 1;1690 if( a <= maxA && a >= minA )1691 {1692 // do nothing1693 }1694 else1695 {1696 Short n = CountLeadingZerosOnes( a );1697 a = a >> (9-n);1698 iShift -= (9-n);1699 }1700 #endif1701 1493 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1702 1494 } … … 1706 1498 1707 1499 #if H_3D_VSP 1708 1709 #if NTT_VSP_COMMON_E0207_E02081710 1500 // not fully support iRatioTxtPerDepth* != 1 1711 1501 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) … … 1715 1505 1716 1506 Int refDepStride = picRefDepth->getStride(); 1717 1718 #if NTT_VSP_VECTOR_CLIP_E02081719 1507 1720 1508 Int refDepOffset = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride; … … 1736 1524 refDepth += refDepOffset; 1737 1525 1738 #else // NTT_VSP_VECTOR_CLIP_E02081739 1740 Int widthDepth = picRefDepth->getWidth();1741 Int heightDepth = picRefDepth->getHeight();1742 Int posX, posY;1743 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture1744 posX /= ratioTxtPerDepthX; // texture position -> depth postion1745 posY /= ratioTxtPerDepthY;1746 1747 posX = Clip3(0, widthDepth-width, posX + ((mv->getHor()+2)>>2));1748 posY = Clip3(0, heightDepth-height, posY + ((mv->getVer()+2)>>2));1749 1750 Pel *refDepth = picRefDepth->getLumaAddr() + posX + posY * refDepStride;1751 1752 #endif // NTT_VSP_VECTOR_CLIP_E02081753 1754 1526 Int depStride = yuvDepth->getStride(); 1755 1527 Pel *depth = yuvDepth->getLumaAddr(); 1756 1757 #if NTT_VSP_ADAPTIVE_SPLIT_E02071758 1528 1759 1529 if( width<8 || height<8 ) … … 1894 1664 } 1895 1665 1896 #else // NTT_VSP_ADAPTIVE_SPLIT_E0207 1897 1898 Int rightOffset = nTxtPerDepthX - 1; 1899 Int depStrideBlock = depStride * nTxtPerDepthY; 1900 Int refDepStrideBlock = refDepStride * nTxtPerDepthY; 1901 Pel *refDepthTop = refDepth; 1902 Pel *refDepthBot = refDepthTop + (nTxtPerDepthY-1)*refDepStride; 1903 1904 for( Int y=0; y<height; y+= nTxtPerDepthY ) 1905 { 1906 for( Int x=0; x<width; x+=nTxtPerDepthX ) 1907 { 1908 Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x]; 1909 1910 if( maxDepth < refDepthTop[x+rightOffset] ) 1911 { 1912 maxDepth = refDepthTop[x+rightOffset]; 1913 } 1914 if( maxDepth < refDepthBot[x+rightOffset] ) 1915 { 1916 maxDepth = refDepthBot[x+rightOffset]; 1917 } 1918 1919 depth[x] = maxDepth; 1920 1921 } 1922 refDepthTop += refDepStrideBlock; 1923 refDepthBot += refDepStrideBlock; 1924 depth += depStrideBlock; 1925 } 1926 1927 #endif // NTT_VSP_ADAPTIVE_SPLIT_E0207 1666 1928 1667 } 1929 1668 … … 1943 1682 Pel *dst = yuvDst->getLumaAddr(partAddr); 1944 1683 Pel *depth = yuvDepth->getLumaAddr(); 1945 1946 #if !(NTT_VSP_DC_BUGFIX_E0208)1947 Int widthLuma = picRef->getWidth();1948 Int posX, posY;1949 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture1950 #endif1951 1684 1952 1685 #if H_3D_VSP_BLOCKSIZE == 1 … … 2021 1754 Int xFrac = disparity & 0x3; 2022 1755 2023 #if NTT_VSP_DC_BUGFIX_E02082024 2025 1756 dv.setHor( disparity ); 2026 1757 cu->clipMv( dv ); … … 2038 1769 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2039 1770 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2040 2041 #else // NTT_VSP_DC_BUGFIX_E02082042 2043 for( Int j=0; j < nTxtPerDepthX; j++ )2044 {2045 Int refOffset = xTxt+j + (disparity >> 2);2046 #if H_3D_VSP_CONSTRAINED2047 if(refOffset<minRelativePos || refOffset>maxRelativePos)2048 {2049 xFrac = 0;2050 }2051 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2052 #endif2053 Int absX = posX + refOffset;2054 2055 if (xFrac == 0)2056 {2057 absX = Clip3(0, widthLuma-1, absX);2058 }2059 else2060 {2061 absX = Clip3(4, widthLuma-5, absX);2062 }2063 2064 refOffset = absX - posX;2065 assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 );2066 2067 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2068 }2069 2070 #endif // NTT_VSP_DC_BUGFIX_E02082071 2072 1771 } 2073 1772 ref += refStrideBlock; … … 2101 1800 Pel *depth = yuvDepth->getLumaAddr(); 2102 1801 2103 #if !(NTT_VSP_DC_BUGFIX_E0208)2104 Int widthChroma = picRef->getWidth() >> 1;2105 Int posX, posY;2106 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture2107 posX >>= 1;2108 posY >>= 1;2109 #endif2110 2111 1802 #if H_3D_VSP_BLOCKSIZE == 1 2112 1803 #if H_3D_VSP_CONSTRAINED … … 2173 1864 Int xFrac = disparity & 0x7; 2174 1865 2175 #if NTT_VSP_DC_BUGFIX_E02082176 2177 1866 dv.setHor( disparity ); 2178 1867 cu->clipMv( dv ); … … 2193 1882 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2194 1883 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2195 2196 #else // NTT_VSP_DC_BUGFIX_E02082197 2198 for( Int j=0; j < nTxtPerDepthX; j++ )2199 {2200 Int refOffset = xTxt+j + (disparity >> 3);2201 #if H_3D_VSP_CONSTRAINED2202 if(refOffset<minRelativePos || refOffset>maxRelativePos)2203 {2204 xFrac = 0;2205 }2206 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);2207 #endif2208 Int absX = posX + refOffset;2209 2210 if (xFrac == 0)2211 {2212 absX = Clip3(0, widthChroma-1, absX);2213 }2214 else2215 {2216 absX = Clip3(4, widthChroma-5, absX);2217 }2218 2219 refOffset = absX - posX;2220 assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 );2221 assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 );2222 2223 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2224 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi );2225 }2226 2227 #endif // NTT_VSP_DC_BUGFIX_E02082228 1884 } 2229 1885 refCb += refStrideBlock; … … 2233 1889 depth += depStrideBlock; 2234 1890 } 2235 2236 } 2237 #else // NTT_VSP_COMMON_E0207_E0208 2238 2239 // Input: 2240 // refPic: Ref picture. Full picture, with padding 2241 // posX, posY: PU position, texture 2242 // sizeX, sizeY: PU size 2243 // partAddr: z-order index 2244 // dv: disparity vector. derived from neighboring blocks 2245 // 2246 // Output: dstPic, PU predictor 64x64 2247 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr,Int posX, Int posY 2248 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi ) 2249 { 2250 Int widthLuma; 2251 Int heightLuma; 2252 2253 if (isDepth) 2254 { 2255 widthLuma = pPicBaseDepth->getWidth(); 2256 heightLuma = pPicBaseDepth->getHeight(); 2257 } 2258 else 2259 { 2260 widthLuma = refPic->getWidth(); 2261 heightLuma = refPic->getHeight(); 2262 } 2263 2264 #if H_3D_VSP_BLOCKSIZE != 1 2265 Int widthDepth = pPicBaseDepth->getWidth(); 2266 Int heightDepth = pPicBaseDepth->getHeight(); 2267 #endif 2268 2269 #if H_3D_VSP_CONSTRAINED 2270 Int widthDepth = pPicBaseDepth->getWidth(); 2271 Int heightDepth = pPicBaseDepth->getHeight(); 2272 #endif 2273 2274 Int nTxtPerDepthX = widthLuma / ( pPicBaseDepth->getWidth() ); // texture pixel # per depth pixel 2275 Int nTxtPerDepthY = heightLuma / ( pPicBaseDepth->getHeight() ); 2276 2277 Int refStride = refPic->getStride(); 2278 Int dstStride = dstPic->getStride(); 2279 Int depStride = pPicBaseDepth->getStride(); 2280 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + ((dv->getHor()+2)>>2)); 2281 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + ((dv->getVer()+2)>>2)); 2282 Pel *ref = refPic->getLumaAddr() + posX + posY * refStride; 2283 Pel *dst = dstPic->getLumaAddr(partAddr); 2284 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; 2285 2286 #if H_3D_VSP_BLOCKSIZE != 1 2287 #if H_3D_VSP_BLOCKSIZE == 2 2288 Int dW = sizeX>>1; 2289 Int dH = sizeY>>1; 2290 #endif 2291 #if H_3D_VSP_BLOCKSIZE == 4 2292 Int dW = sizeX>>2; 2293 Int dH = sizeY>>2; 2294 #endif 2295 { 2296 Pel* depthi = depth; 2297 for (Int j = 0; j < dH; j++) 2298 { 2299 for (Int i = 0; i < dW; i++) 2300 { 2301 Pel* depthTmp; 2302 #if H_3D_VSP_BLOCKSIZE == 2 2303 if (depthPosX + (i<<1) < widthDepth) 2304 depthTmp = depthi + (i << 1); 2305 else 2306 depthTmp = depthi + (widthDepth - depthPosX - 1); 2307 #endif 2308 #if H_3D_VSP_BLOCKSIZE == 4 2309 if (depthPosX + (i<<2) < widthDepth) 2310 depthTmp = depthi + (i << 2); 2311 else 2312 depthTmp = depthi + (widthDepth - depthPosX - 1); 2313 #endif 2314 Int maxV = 0; 2315 for (Int blockj = 0; blockj < H_3D_VSP_BLOCKSIZE; blockj+=(H_3D_VSP_BLOCKSIZE-1)) 2316 { 2317 Int iX = 0; 2318 for (Int blocki = 0; blocki < H_3D_VSP_BLOCKSIZE; blocki+=(H_3D_VSP_BLOCKSIZE-1)) 2319 { 2320 if (maxV < depthTmp[iX]) 2321 maxV = depthTmp[iX]; 2322 #if H_3D_VSP_BLOCKSIZE == 2 2323 if (depthPosX + (i<<1) + blocki < widthDepth - 1) 2324 #else // H_3D_VSP_BLOCKSIZE == 4 2325 if (depthPosX + (i<<2) + blocki < widthDepth - 1) 2326 #endif 2327 iX = (H_3D_VSP_BLOCKSIZE-1); 2328 } 2329 #if H_3D_VSP_BLOCKSIZE == 2 2330 if (depthPosY + (j<<1) + blockj < heightDepth - 1) 2331 #else // H_3D_VSP_BLOCKSIZE == 4 2332 if (depthPosY + (j<<2) + blockj < heightDepth - 1) 2333 #endif 2334 depthTmp += depStride * (H_3D_VSP_BLOCKSIZE-1); 2335 } 2336 m_pDepthBlock[i+j*dW] = maxV; 2337 } // end of i < dW 2338 #if H_3D_VSP_BLOCKSIZE == 2 2339 if (depthPosY + ((j+1)<<1) < heightDepth) 2340 depthi += (depStride << 1); 2341 else 2342 depthi = depth + (heightDepth-depthPosY-1)*depStride; 2343 #endif 2344 #if H_3D_VSP_BLOCKSIZE == 4 2345 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 2346 depthi += (depStride << 2); 2347 else 2348 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 2349 #endif 2350 } 2351 } 2352 #endif // H_3D_VSP_BLOCKSIZE != 1 2353 2354 #if H_3D_VSP_BLOCKSIZE == 1 2355 #if H_3D_VSP_CONSTRAINED 2356 //get LUT based horizontal reference range 2357 Int range = xGetConstrainedSize(sizeX, sizeY); 2358 2359 // The minimum depth value 2360 Int minRelativePos = MAX_INT; 2361 Int maxRelativePos = MIN_INT; 2362 2363 Pel* depthTemp, *depthInitial=depth; 2364 for (Int yTxt = 0; yTxt < sizeY; yTxt++) 2365 { 2366 for (Int xTxt = 0; xTxt < sizeX; xTxt++) 2367 { 2368 if (depthPosX+xTxt < widthDepth) 2369 depthTemp = depthInitial + xTxt; 2370 else 2371 depthTemp = depthInitial + (widthDepth - depthPosX - 1); 2372 2373 Int disparity = pShiftLUT[ *depthTemp ]; // << iShiftPrec; 2374 Int disparityInt = disparity >> 2; 2375 2376 if( disparity <= 0) 2377 { 2378 if (minRelativePos > disparityInt+xTxt) 2379 minRelativePos = disparityInt+xTxt; 2380 } 2381 else 2382 { 2383 if (maxRelativePos < disparityInt+xTxt) 2384 maxRelativePos = disparityInt+xTxt; 2385 } 2386 } 2387 if (depthPosY+yTxt < heightDepth) 2388 depthInitial = depthInitial + depStride; 2389 } 2390 2391 Int disparity_tmp = pShiftLUT[ *depth ]; // << iShiftPrec; 2392 if (disparity_tmp <= 0) 2393 maxRelativePos = minRelativePos + range -1 ; 2394 else 2395 minRelativePos = maxRelativePos - range +1 ; 2396 #endif 2397 #endif // H_3D_VSP_BLOCKSIZE == 1 2398 2399 #if H_3D_VSP_BLOCKSIZE != 1 2400 Int yDepth = 0; 2401 #endif 2402 for ( Int yTxt = 0; yTxt < sizeY; yTxt += nTxtPerDepthY ) 2403 { 2404 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth++ ) 2405 { 2406 Pel repDepth = 0; // to store the depth value used for warping 2407 #if H_3D_VSP_BLOCKSIZE == 1 2408 repDepth = depth[xDepth]; 2409 #endif 2410 #if H_3D_VSP_BLOCKSIZE == 2 2411 repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW]; 2412 #endif 2413 #if H_3D_VSP_BLOCKSIZE == 4 2414 repDepth = m_pDepthBlock[(xTxt>>2) + (yTxt>>2)*dW]; 2415 #endif 2416 2417 assert( repDepth >= 0 && repDepth <= 255 ); 2418 Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec ?? 2419 Int refOffset = xTxt + (disparity >> 2); 2420 Int xFrac = disparity & 0x3; 2421 #if H_3D_VSP_CONSTRAINED 2422 if(refOffset<minRelativePos || refOffset>maxRelativePos) 2423 xFrac = 0; 2424 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2425 #endif 2426 Int absX = posX + refOffset; 2427 2428 if (xFrac == 0) 2429 absX = Clip3(0, widthLuma-1, absX); 2430 else 2431 absX = Clip3(4, widthLuma-5, absX); 2432 2433 refOffset = absX - posX; 2434 2435 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2436 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi ); 2437 } 2438 ref += refStride*nTxtPerDepthY; 2439 dst += dstStride*nTxtPerDepthY; 2440 depth += depStride; 2441 #if H_3D_VSP_BLOCKSIZE != 1 2442 yDepth++; 2443 #endif 2444 2445 } 2446 } 2447 2448 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*dv, UInt partAddr, Int posX, Int posY 2449 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi) 2450 { 2451 Int refStride = refPic->getCStride(); 2452 Int dstStride = dstPic->getCStride(); 2453 Int depStride = pPicBaseDepth->getStride(); 2454 2455 Int widthChroma, heightChroma; 2456 if( isDepth) 2457 { 2458 widthChroma = pPicBaseDepth->getWidth()>>1; 2459 heightChroma = pPicBaseDepth->getHeight()>>1; 2460 } 2461 else 2462 { 2463 widthChroma = refPic->getWidth()>>1; 2464 heightChroma = refPic->getHeight()>>1; 2465 } 2466 2467 // Below is only for Texture chroma component 2468 2469 Int widthDepth = pPicBaseDepth->getWidth(); 2470 Int heightDepth = pPicBaseDepth->getHeight(); 2471 2472 Int nTxtPerDepthX, nTxtPerDepthY; // Number of texture samples per one depth sample 2473 Int nDepthPerTxtX, nDepthPerTxtY; // Number of depth samples per one texture sample 2474 2475 Int depthPosX; // Starting position in depth image 2476 Int depthPosY; 2477 2478 if ( widthChroma > widthDepth ) 2479 { 2480 nTxtPerDepthX = widthChroma / widthDepth; 2481 nDepthPerTxtX = 1; 2482 depthPosX = posX / nTxtPerDepthX + ((dv->getHor()+2)>>2); 2483 } 2484 else 2485 { 2486 nTxtPerDepthX = 1; 2487 nDepthPerTxtX = widthDepth / widthChroma; 2488 depthPosX = posX * nDepthPerTxtX + ((dv->getHor()+2)>>2); 2489 } 2490 depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX); 2491 if ( heightChroma > heightDepth ) 2492 { 2493 nTxtPerDepthY = heightChroma / heightDepth; 2494 nDepthPerTxtY = 1; 2495 depthPosY = posY / nTxtPerDepthY + ((dv->getVer()+2)>>2); 2496 } 2497 else 2498 { 2499 nTxtPerDepthY = 1; 2500 nDepthPerTxtY = heightDepth / heightChroma; 2501 depthPosY = posY * nDepthPerTxtY + ((dv->getVer()+2)>>2); 2502 } 2503 depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY); 2504 2505 Pel *refCb = refPic->getCbAddr() + posX + posY * refStride; 2506 Pel *refCr = refPic->getCrAddr() + posX + posY * refStride; 2507 Pel *dstCb = dstPic->getCbAddr(partAddr); 2508 Pel *dstCr = dstPic->getCrAddr(partAddr); 2509 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; // move the pointer to the current depth pixel position 2510 2511 Int refStrideBlock = refStride * nTxtPerDepthY; 2512 Int dstStrideBlock = dstStride * nTxtPerDepthY; 2513 Int depStrideBlock = depStride * nDepthPerTxtY; 2514 2515 if ( widthChroma > widthDepth ) // We assume 2516 { 2517 assert( heightChroma > heightDepth ); 2518 printf("This branch should never been reached.\n"); 2519 exit(0); 2520 } 2521 else 2522 { 2523 #if H_3D_VSP_BLOCKSIZE == 1 2524 Int dW = sizeX; 2525 Int dH = sizeY; 2526 Int sW = 2; // search window size 2527 Int sH = 2; 2528 #endif 2529 #if H_3D_VSP_BLOCKSIZE == 2 2530 Int dW = sizeX; 2531 Int dH = sizeY; 2532 Int sW = 2; // search window size 2533 Int sH = 2; 2534 #endif 2535 #if H_3D_VSP_BLOCKSIZE == 4 2536 Int dW = sizeX>>1; 2537 Int dH = sizeY>>1; 2538 Int sW = 4; // search window size 2539 Int sH = 4; 2540 #endif 2541 2542 { 2543 Pel* depthi = depth; 2544 for (Int j = 0; j < dH; j++) 2545 { 2546 for (Int i = 0; i < dW; i++) 2547 { 2548 Pel* depthTmp; 2549 #if H_3D_VSP_BLOCKSIZE == 1 2550 depthTmp = depthi + (i << 1); 2551 #endif 2552 #if H_3D_VSP_BLOCKSIZE == 2 2553 if (depthPosX + (i<<1) < widthDepth) 2554 depthTmp = depthi + (i << 1); 2555 else 2556 depthTmp = depthi + (widthDepth - depthPosX - 1); 2557 #endif 2558 #if H_3D_VSP_BLOCKSIZE == 4 2559 if (depthPosX + (i<<2) < widthDepth) 2560 depthTmp = depthi + (i << 2); 2561 else 2562 depthTmp = depthi + (widthDepth - depthPosX - 1); 2563 #endif 2564 Int maxV = 0; 2565 for (Int blockj = 0; blockj < sH; blockj+=(sH-1)) 2566 { 2567 Int iX = 0; 2568 for (Int blocki = 0; blocki < sW; blocki+=(sW-1)) 2569 { 2570 if (maxV < depthTmp[iX]) 2571 maxV = depthTmp[iX]; 2572 if (depthPosX + i*sW + blocki < widthDepth - 1) 2573 iX = (sW-1); 2574 } 2575 if (depthPosY + j*sH + blockj < heightDepth - 1) 2576 depthTmp += depStride * (sH-1); 2577 } 2578 m_pDepthBlock[i+j*dW] = maxV; 2579 } // end of i < dW 2580 #if H_3D_VSP_BLOCKSIZE == 1 2581 if (depthPosY + ((j+1)<<1) < heightDepth) 2582 depthi += (depStride << 1); 2583 else 2584 depthi = depth + (heightDepth-1)*depStride; 2585 #endif 2586 #if H_3D_VSP_BLOCKSIZE == 2 2587 if (depthPosY + ((j+1)<<1) < heightDepth) 2588 depthi += (depStride << 1); 2589 else 2590 depthi = depth + (heightDepth-depthPosY-1)*depStride; 2591 #endif 2592 #if H_3D_VSP_BLOCKSIZE == 4 2593 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 2594 depthi += (depStride << 2); 2595 else 2596 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 2597 #endif 2598 } 2599 } 2600 2601 2602 #if H_3D_VSP_BLOCKSIZE == 1 2603 #if H_3D_VSP_CONSTRAINED 2604 //get LUT based horizontal reference range 2605 Int range = xGetConstrainedSize(sizeX, sizeY, false); 2606 2607 // The minimum depth value 2608 Int minRelativePos = MAX_INT; 2609 Int maxRelativePos = MIN_INT; 2610 2611 Int depthTmp; 2612 for (Int yTxt=0; yTxt<sizeY; yTxt++) 2613 { 2614 for (Int xTxt=0; xTxt<sizeX; xTxt++) 2615 { 2616 depthTmp = m_pDepthBlock[xTxt+yTxt*dW]; 2617 Int disparity = pShiftLUT[ depthTmp ]; // << iShiftPrec; 2618 Int disparityInt = disparity >> 3;//in chroma resolution 2619 2620 if (disparityInt < 0) 2621 { 2622 if (minRelativePos > disparityInt+xTxt) 2623 minRelativePos = disparityInt+xTxt; 2624 } 2625 else 2626 { 2627 if (maxRelativePos < disparityInt+xTxt) 2628 maxRelativePos = disparityInt+xTxt; 2629 } 2630 } 2631 } 2632 2633 depthTmp = m_pDepthBlock[0]; 2634 Int disparity_tmp = pShiftLUT[ depthTmp ]; // << iShiftPrec; 2635 if ( disparity_tmp < 0 ) 2636 maxRelativePos = minRelativePos + range - 1; 2637 else 2638 minRelativePos = maxRelativePos - range + 1; 2639 2640 #endif // H_3D_VSP_CONSTRAINED 2641 #endif // H_3D_VSP_BLOCKSIZE == 1 2642 2643 // (sizeX, sizeY) is Chroma block size 2644 for ( Int yTxt = 0, yDepth = 0; yTxt < sizeY; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY ) 2645 { 2646 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX ) 2647 { 2648 Pel repDepth = 0; // to store the depth value used for warping 2649 #if H_3D_VSP_BLOCKSIZE == 1 2650 repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW]; 2651 #endif 2652 #if H_3D_VSP_BLOCKSIZE == 2 2653 repDepth = m_pDepthBlock[(xTxt) + (yTxt)*dW]; 2654 #endif 2655 #if H_3D_VSP_BLOCKSIZE == 4 2656 repDepth = m_pDepthBlock[(xTxt>>1) + (yTxt>>1)*dW]; 2657 #endif 2658 2659 // calculate the offset in the reference picture 2660 Int disparity = pShiftLUT[ repDepth ]; // Remove << iShiftPrec; 2661 Int refOffset = xTxt + (disparity >> 3); // in integer pixel in chroma image 2662 Int xFrac = disparity & 0x7; 2663 #if H_3D_VSP_CONSTRAINED 2664 if(refOffset < minRelativePos || refOffset > maxRelativePos) 2665 xFrac = 0; 2666 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2667 #endif 2668 Int absX = posX + refOffset; 2669 2670 if (xFrac == 0) 2671 absX = Clip3(0, widthChroma-1, absX); 2672 else 2673 absX = Clip3(4, widthChroma-5, absX); 2674 2675 refOffset = absX - posX; 2676 2677 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 2678 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 2679 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2680 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2681 } 2682 refCb += refStrideBlock; 2683 refCr += refStrideBlock; 2684 dstCb += dstStrideBlock; 2685 dstCr += dstStrideBlock; 2686 depth += depStrideBlock; 2687 } 2688 } 2689 2690 } 2691 2692 #endif // NTT_VSP_COMMON_E0207_E0208 1891 } 1892 2693 1893 2694 1894 #if H_3D_VSP_CONSTRAINED … … 2768 1968 2769 1969 #if H_3D_DIM_DMM 2770 #if !SEC_DMM2_E0146_HHIFIX2771 UInt TComPrediction::xPredWedgeFromIntra( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd )2772 {2773 UInt uiThisBlockSize = uiWidth;2774 2775 TComDataCU* pcTempCU;2776 UInt uiTempPartIdx;2777 // 1st: try continue above wedgelet2778 pcTempCU = pcCU->getPUAbove( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );2779 if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )2780 {2781 UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );2782 if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )2783 {2784 // get offset between current and reference block2785 UInt uiOffsetX = 0, uiOffsetY = 0;2786 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );2787 2788 // get reference wedgelet2789 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];2790 TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );2791 2792 // find wedgelet, if direction is suitable for continue wedge2793 if( pcRefWedgelet->checkPredDirAbovePossible( uiThisBlockSize, uiOffsetX ) )2794 {2795 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2796 pcRefWedgelet->getPredDirStartEndAbove( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetX, iDeltaEnd );2797 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2798 }2799 }2800 }2801 2802 // 2nd: try continue left wedglelet2803 pcTempCU = pcCU->getPULeft( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );2804 if( pcTempCU && isDimMode( pcTempCU->getLumaIntraDir( uiTempPartIdx ) ) )2805 {2806 UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );2807 if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )2808 {2809 // get offset between current and reference block2810 UInt uiOffsetX = 0, uiOffsetY = 0;2811 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );2812 2813 // get reference wedgelet2814 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[(pcTempCU->getWidth( uiTempPartIdx )>>((pcTempCU->getPartitionSize( uiTempPartIdx ) == SIZE_NxN) ? 1 : 0))])];2815 TComWedgelet* pcRefWedgelet = &(pacWedgeList->at( pcTempCU->getDmmWedgeTabIdx( dimType, uiTempPartIdx ) ) );2816 2817 // find wedgelet, if direction is suitable for continue wedge2818 if( pcRefWedgelet->checkPredDirLeftPossible( uiThisBlockSize, uiOffsetY ) )2819 {2820 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2821 pcRefWedgelet->getPredDirStartEndLeft( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetY, iDeltaEnd );2822 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2823 }2824 }2825 }2826 2827 // 3rd: (default) make wedglet from intra dir and max slope point2828 Int iSlopeX = 0, iSlopeY = 0;2829 UInt uiStartPosX = 0, uiStartPosY = 0;2830 if( xGetWedgeIntraDirPredData( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY ) )2831 {2832 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;2833 xGetWedgeIntraDirStartEnd( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, iDeltaEnd );2834 return xGetWedgePatternIdx( uiThisBlockSize, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );2835 }2836 2837 return 0;2838 }2839 #endif2840 2841 1970 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx ) 2842 1971 { … … 2847 1976 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255; 2848 1977 2849 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX2850 1978 assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ); 2851 1979 return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx); 2852 #else2853 if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) { return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx); }2854 else { return g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])].at(intraTabIdx).getPatternIdx(); }2855 #endif2856 1980 } 2857 1981 … … 2875 1999 } 2876 2000 2877 #if SCU_HS_DMM4_REMOVE_DIV_E0242 2878 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2; 2879 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2; 2880 #else 2881 iDC /= (uiWidth*uiHeight); 2882 #endif 2001 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2; // 2002 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2; // iDC /= (uiWidth*uiHeight); 2003 2883 2004 piRefBlkY = cTempYuv.getLumaAddr(); 2884 2005 … … 2907 2028 } 2908 2029 } 2909 2910 #if !SEC_DMM2_E0146_HHIFIX 2911 Void TComPrediction::xGetBlockOffset( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ) 2912 { 2913 ruiOffsetX = 0; 2914 ruiOffsetY = 0; 2915 2916 // get offset between current and above/left block 2917 UInt uiThisOriginX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 2918 UInt uiThisOriginY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 2919 2920 UInt uiNumPartInRefCU = pcRefCU->getTotalNumPart(); 2921 UInt uiMaxDepthRefCU = 0; 2922 while( uiNumPartInRefCU > 1 ) 2923 { 2924 uiNumPartInRefCU >>= 2; 2925 uiMaxDepthRefCU++; 2926 } 2927 2928 UInt uiDepthRefPU = (pcRefCU->getDepth(uiRefAbsPartIdx)) + (pcRefCU->getPartitionSize(uiRefAbsPartIdx) == SIZE_2Nx2N ? 0 : 1); 2929 UInt uiShifts = (uiMaxDepthRefCU - uiDepthRefPU)*2; 2930 UInt uiRefBlockOriginPartIdx = (uiRefAbsPartIdx>>uiShifts)<<uiShifts; 2931 2932 UInt uiRefOriginX = pcRefCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 2933 UInt uiRefOriginY = pcRefCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 2934 2935 if( (uiThisOriginX - uiRefOriginX) > 0 ) { ruiOffsetX = (UInt)(uiThisOriginX - uiRefOriginX); } 2936 if( (uiThisOriginY - uiRefOriginY) > 0 ) { ruiOffsetY = (UInt)(uiThisOriginY - uiRefOriginY); } 2937 } 2938 2939 Bool TComPrediction::xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY ) 2940 { 2941 riSlopeX = 0, riSlopeY = 0, ruiStartPosX = 0, ruiStartPosY = 0; 2942 2943 // 1st step: get wedge start point (max. slope) 2944 Int* piSource = pcCU->getPattern()->getAdiOrgBuf( uiBlockSize, uiBlockSize, m_piYuvExt ); 2945 Int iSourceStride = ( uiBlockSize<<1 ) + 1; 2946 2947 UInt uiSlopeMaxAbove = 0, uiPosSlopeMaxAbove = 0; 2948 for( UInt uiPosHor = 0; uiPosHor < (uiBlockSize-1); uiPosHor++ ) 2949 { 2950 if( abs( piSource[uiPosHor+1] - piSource[uiPosHor] ) > uiSlopeMaxAbove ) 2951 { 2952 uiSlopeMaxAbove = abs( piSource[uiPosHor+1] - piSource[uiPosHor] ); 2953 uiPosSlopeMaxAbove = uiPosHor; 2954 } 2955 } 2956 2957 UInt uiSlopeMaxLeft = 0, uiPosSlopeMaxLeft = 0; 2958 for( UInt uiPosVer = 0; uiPosVer < (uiBlockSize-1); uiPosVer++ ) 2959 { 2960 if( abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ) > uiSlopeMaxLeft ) 2961 { 2962 uiSlopeMaxLeft = abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ); 2963 uiPosSlopeMaxLeft = uiPosVer; 2964 } 2965 } 2966 2967 if( uiSlopeMaxAbove == 0 && uiSlopeMaxLeft == 0 ) 2968 { 2969 return false; 2970 } 2971 2972 ruiStartPosX = ( uiSlopeMaxAbove > uiSlopeMaxLeft ) ? uiPosSlopeMaxAbove : 0; 2973 ruiStartPosY = ( uiSlopeMaxLeft >= uiSlopeMaxAbove ) ? uiPosSlopeMaxLeft : 0; 2974 2975 // 2nd step: derive wedge direction 2976 Int uiPreds[3] = {-1, -1, -1}; 2977 Int iMode = -1; 2978 Int iPredNum = pcCU->getIntraDirLumaPredictor( uiAbsPartIdx, uiPreds, &iMode ); 2979 2980 UInt uiDirMode = 0; 2981 if( iMode >= 0 ) { iPredNum = iMode; } 2982 if( iPredNum == 1 ) { uiDirMode = uiPreds[0]; } 2983 if( iPredNum == 2 ) { uiDirMode = uiPreds[1]; } 2984 2985 if( uiDirMode < 2 ) { return false; } // no planar & DC 2986 2987 Bool modeHor = (uiDirMode < 18); 2988 Bool modeVer = !modeHor; 2989 Int intraPredAngle = modeVer ? (Int)uiDirMode - VER_IDX : modeHor ? -((Int)uiDirMode - HOR_IDX) : 0; 2990 Int absAng = abs(intraPredAngle); 2991 Int signAng = intraPredAngle < 0 ? -1 : 1; 2992 Int angTable[9] = {0,2,5,9,13,17,21,26,32}; 2993 absAng = angTable[absAng]; 2994 intraPredAngle = signAng * absAng; 2995 2996 // 3rd step: set slope for direction 2997 if( modeHor ) 2998 { 2999 riSlopeX = ( intraPredAngle > 0 ) ? -32 : 32; 3000 riSlopeY = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle; 3001 } 3002 else if( modeVer ) 3003 { 3004 riSlopeX = ( intraPredAngle > 0 ) ? intraPredAngle : -intraPredAngle; 3005 riSlopeY = ( intraPredAngle > 0 ) ? -32 : 32; 3006 } 3007 3008 return true; 3009 } 3010 3011 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 ) 3012 { 3013 ruhXs = 0; 3014 ruhYs = 0; 3015 ruhXe = 0; 3016 ruhYe = 0; 3017 3018 // scaling of start pos and block size to wedge resolution 3019 UInt uiScaledStartPosX = 0; 3020 UInt uiScaledStartPosY = 0; 3021 UInt uiScaledBlockSize = 0; 3022 WedgeResolution eWedgeRes = g_dmmWedgeResolution[(UInt)g_aucConvertToBit[uiBlockSize]]; 3023 switch( eWedgeRes ) 3024 { 3025 case( DOUBLE_PEL ): { uiScaledStartPosX = (uiPMSPosX>>1); uiScaledStartPosY = (uiPMSPosY>>1); uiScaledBlockSize = (uiBlockSize>>1); break; } 3026 case( FULL_PEL ): { uiScaledStartPosX = uiPMSPosX; uiScaledStartPosY = uiPMSPosY; uiScaledBlockSize = uiBlockSize; break; } 3027 case( HALF_PEL ): { uiScaledStartPosX = (uiPMSPosX<<1); uiScaledStartPosY = (uiPMSPosY<<1); uiScaledBlockSize = (uiBlockSize<<1); break; } 3028 } 3029 Int iMaxPos = (Int)uiScaledBlockSize - 1; 3030 3031 // case above 3032 if( uiScaledStartPosX > 0 && uiScaledStartPosY == 0 ) 3033 { 3034 ruhXs = (UChar)uiScaledStartPosX; 3035 ruhYs = 0; 3036 3037 if( iDeltaY == 0 ) 3038 { 3039 if( iDeltaX < 0 ) 3040 { 3041 ruhXe = 0; 3042 ruhYe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos ); 3043 return; 3044 } 3045 else 3046 { 3047 ruhXe = (UChar)iMaxPos; 3048 ruhYe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos ); 3049 std::swap( ruhXs, ruhXe ); 3050 std::swap( ruhYs, ruhYe ); 3051 return; 3052 } 3053 } 3054 3055 // regular case 3056 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) ); 3057 3058 if( iVirtualEndX < 0 ) 3059 { 3060 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) + iDeltaEnd; 3061 if( iYe < (Int)uiScaledBlockSize ) 3062 { 3063 ruhXe = 0; 3064 ruhYe = (UChar)std::max( iYe, 0 ); 3065 return; 3066 } 3067 else 3068 { 3069 ruhXe = (UChar)std::min( (iYe - iMaxPos), iMaxPos ); 3070 ruhYe = (UChar)iMaxPos; 3071 return; 3072 } 3073 } 3074 else if( iVirtualEndX > iMaxPos ) 3075 { 3076 Int iYe = roftoi( (Double)(iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 3077 if( iYe < (Int)uiScaledBlockSize ) 3078 { 3079 ruhXe = (UChar)iMaxPos; 3080 ruhYe = (UChar)std::max( iYe, 0 ); 3081 std::swap( ruhXs, ruhXe ); 3082 std::swap( ruhYs, ruhYe ); 3083 return; 3084 } 3085 else 3086 { 3087 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3088 ruhYe = (UChar)iMaxPos; 3089 return; 3090 } 3091 } 3092 else 3093 { 3094 Int iXe = iVirtualEndX + iDeltaEnd; 3095 if( iXe < 0 ) 3096 { 3097 ruhXe = 0; 3098 ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 ); 3099 return; 3100 } 3101 else if( iXe > iMaxPos ) 3102 { 3103 ruhXe = (UChar)iMaxPos; 3104 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3105 std::swap( ruhXs, ruhXe ); 3106 std::swap( ruhYs, ruhYe ); 3107 return; 3108 } 3109 else 3110 { 3111 ruhXe = (UChar)iXe; 3112 ruhYe = (UChar)iMaxPos; 3113 return; 3114 } 3115 } 3116 } 3117 3118 // case left 3119 if( uiScaledStartPosY > 0 && uiScaledStartPosX == 0 ) 3120 { 3121 ruhXs = 0; 3122 ruhYs = (UChar)uiScaledStartPosY; 3123 3124 if( iDeltaX == 0 ) 3125 { 3126 if( iDeltaY < 0 ) 3127 { 3128 ruhXe = (UChar)std::min( std::max( -iDeltaEnd, 0 ), iMaxPos ); 3129 ruhYe = 0; 3130 std::swap( ruhXs, ruhXe ); 3131 std::swap( ruhYs, ruhYe ); 3132 return; 3133 } 3134 else 3135 { 3136 ruhXe = (UChar)std::min( std::max( iDeltaEnd, 0 ), iMaxPos ); 3137 ruhYe = (UChar)iMaxPos; 3138 return; 3139 } 3140 } 3141 3142 // regular case 3143 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)iMaxPos * ((Double)iDeltaY / (Double)iDeltaX) ); 3144 3145 if( iVirtualEndY < 0 ) 3146 { 3147 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) - iDeltaEnd; 3148 if( iXe < (Int)uiScaledBlockSize ) 3149 { 3150 ruhXe = (UChar)std::max( iXe, 0 ); 3151 ruhYe = 0; 3152 std::swap( ruhXs, ruhXe ); 3153 std::swap( ruhYs, ruhYe ); 3154 return; 3155 } 3156 else 3157 { 3158 ruhXe = (UChar)iMaxPos; 3159 ruhYe = (UChar)std::min( (iXe - iMaxPos), iMaxPos ); 3160 std::swap( ruhXs, ruhXe ); 3161 std::swap( ruhYs, ruhYe ); 3162 return; 3163 } 3164 } 3165 else if( iVirtualEndY > (uiScaledBlockSize-1) ) 3166 { 3167 Int iXe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) + iDeltaEnd; 3168 if( iXe < (Int)uiScaledBlockSize ) 3169 { 3170 ruhXe = (UChar)std::max( iXe, 0 ); 3171 ruhYe = (UChar)(uiScaledBlockSize-1); 3172 return; 3173 } 3174 else 3175 { 3176 ruhXe = (UChar)iMaxPos; 3177 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3178 std::swap( ruhXs, ruhXe ); 3179 std::swap( ruhYs, ruhYe ); 3180 return; 3181 } 3182 } 3183 else 3184 { 3185 Int iYe = iVirtualEndY - iDeltaEnd; 3186 if( iYe < 0 ) 3187 { 3188 ruhXe = (UChar)std::max( (iMaxPos + iYe), 0 ); 3189 ruhYe = 0; 3190 std::swap( ruhXs, ruhXe ); 3191 std::swap( ruhYs, ruhYe ); 3192 return; 3193 } 3194 else if( iYe > iMaxPos ) 3195 { 3196 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3197 ruhYe = (UChar)iMaxPos; 3198 return; 3199 } 3200 else 3201 { 3202 ruhXe = (UChar)iMaxPos; 3203 ruhYe = (UChar)iYe; 3204 std::swap( ruhXs, ruhXe ); 3205 std::swap( ruhYs, ruhYe ); 3206 return; 3207 } 3208 } 3209 } 3210 3211 // case origin 3212 if( uiScaledStartPosX == 0 && uiScaledStartPosY == 0 ) 3213 { 3214 if( iDeltaX*iDeltaY < 0 ) 3215 { 3216 return; 3217 } 3218 3219 ruhXs = 0; 3220 ruhYs = 0; 3221 3222 if( iDeltaY == 0 ) 3223 { 3224 ruhXe = (UChar)iMaxPos; 3225 ruhYe = 0; 3226 std::swap( ruhXs, ruhXe ); 3227 std::swap( ruhYs, ruhYe ); 3228 return; 3229 } 3230 3231 if( iDeltaX == 0 ) 3232 { 3233 ruhXe = 0; 3234 ruhYe = (UChar)iMaxPos; 3235 return; 3236 } 3237 3238 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)iMaxPos * ((Double)iDeltaX / (Double)iDeltaY) ); 3239 3240 if( iVirtualEndX > iMaxPos ) 3241 { 3242 Int iYe = roftoi( (Double)((Int)iMaxPos - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 3243 if( iYe < (Int)uiScaledBlockSize ) 3244 { 3245 ruhXe = (UChar)(uiScaledBlockSize-1); 3246 ruhYe = (UChar)std::max( iYe, 0 ); 3247 std::swap( ruhXs, ruhXe ); 3248 std::swap( ruhYs, ruhYe ); 3249 return; 3250 } 3251 else 3252 { 3253 ruhXe = (UChar)std::max( (iMaxPos - (iYe - iMaxPos)), 0 ); 3254 ruhYe = (UChar)(uiScaledBlockSize-1); 3255 return; 3256 } 3257 } 3258 else 3259 { 3260 Int iXe = iVirtualEndX + iDeltaEnd; 3261 if( iXe < 0 ) 3262 { 3263 ruhXe = 0; 3264 ruhYe = (UChar)std::max( (iMaxPos + iXe), 0 ); 3265 return; 3266 } 3267 else if( iXe > iMaxPos ) 3268 { 3269 ruhXe = (UChar)(uiScaledBlockSize-1); 3270 ruhYe = (UChar)std::max( (iMaxPos - (iXe - iMaxPos)), 0 ); 3271 std::swap( ruhXs, ruhXe ); 3272 std::swap( ruhYs, ruhYe ); 3273 return; 3274 } 3275 else 3276 { 3277 ruhXe = (UChar)iXe; 3278 ruhYe = (UChar)(uiScaledBlockSize-1); 3279 return; 3280 } 3281 } 3282 } 3283 } 3284 3285 UInt TComPrediction::xGetWedgePatternIdx( UInt uiBlockSize, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ) 3286 { 3287 WedgeRefList* pcWedgeRefList = &g_dmmWedgeRefLists[(g_aucConvertToBit[uiBlockSize])]; 3288 for( UInt uiIdx = 0; uiIdx < pcWedgeRefList->size(); uiIdx++ ) 3289 { 3290 TComWedgeRef* pcTestWedgeRef = &(pcWedgeRefList->at(uiIdx)); 3291 if( pcTestWedgeRef->getStartX() == uhXs && pcTestWedgeRef->getStartY() == uhYs && pcTestWedgeRef->getEndX() == uhXe && pcTestWedgeRef->getEndY() == uhYe ) 3292 { 3293 return pcTestWedgeRef->getRefIdx(); 3294 } 3295 } 3296 return 0; 3297 } 3298 #endif 3299 #endif 2030 #endif 2031 3300 2032 #if H_3D_DIM_RBC 3301 2033 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC ) … … 3327 2059 #if H_3D_DIM_SDC 3328 2060 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride 3329 #if KWU_SDC_SIMPLE_DC_E01173330 2061 ,UInt uiIntraMode 3331 2062 ,Bool orgDC 3332 #endif3333 2063 ) 3334 2064 { … … 3338 2068 memset(iSumPix, 0, sizeof(Int)*2); 3339 2069 3340 #if KWU_SDC_SIMPLE_DC_E01173341 2070 if (orgDC == false) 3342 2071 { … … 3364 2093 return; 3365 2094 } 3366 #endif3367 2095 3368 2096 Int subSamplePix; -
trunk/source/Lib/TLibCommon/TComPrediction.h
r622 r655 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 -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r622 r655 484 484 } 485 485 486 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX486 #if H_3D_FAST_DEPTH_INTRA 487 487 488 488 UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth) … … 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 #else 610 return dist; 611 #endif 612 613 } 614 #endif 615 616 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 609 } 610 #endif 611 612 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 617 613 UInt TComRdCost::getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ) 618 614 { … … 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 { -
trunk/source/Lib/TLibCommon/TComRdCost.h
r622 r655 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 … … 148 148 private: 149 149 // for distortion 150 Int m_iBlkWidth;151 Int m_iBlkHeight;152 150 153 151 #if AMP_SAD … … 235 233 UInt calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ); 236 234 237 #if SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX235 #if H_3D_FAST_DEPTH_INTRA 238 236 UInt calcVAR(Pel* pi0, Int stride, Int width, Int height, Int cuDepth); 239 237 #endif … … 283 281 static UInt xGetSSE64 ( DistParam* pcDtParam ); 284 282 static UInt xGetSSE16N ( DistParam* pcDtParam ); 285 #if H_3D_IC || LGE_INTER_SDC_E0156283 #if H_3D_IC || H_3D_INTER_SDC 286 284 static UInt xGetSADic ( DistParam* pcDtParam ); 287 285 static UInt xGetSAD4ic ( DistParam* pcDtParam ); … … 311 309 312 310 #if AMP_SAD 313 #if H_3D_IC || LGE_INTER_SDC_E0156311 #if H_3D_IC || H_3D_INTER_SDC 314 312 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 315 313 static UInt xGetSAD24ic ( DistParam* pcDtParam ); … … 322 320 #endif 323 321 324 #if H_3D_IC || LGE_INTER_SDC_E0156322 #if H_3D_IC || H_3D_INTER_SDC 325 323 static UInt xGetHADsic ( DistParam* pcDtParam ); 326 324 #endif … … 343 341 #endif 344 342 345 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT343 #if (RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT) || KWU_RC_MADPRED_E0227 346 344 UInt getSADPart ( Int bitDepth, Pel* pelCur, Int curStride, Pel* pelOrg, Int orgStride, UInt width, UInt height ); 347 345 #endif -
trunk/source/Lib/TLibCommon/TComRom.cpp
r622 r655 55 55 ::memset( g_aucConvertToBit, -1, sizeof( g_aucConvertToBit ) ); 56 56 c=0; 57 for ( i=4; i< MAX_CU_SIZE; i*=2 )57 for ( i=4; i<=MAX_CU_SIZE; i*=2 ) 58 58 { 59 59 g_aucConvertToBit[ i ] = c; 60 60 c++; 61 61 } 62 g_aucConvertToBit[ i ] = c;63 62 64 63 c=2; … … 292 291 293 292 #if FAST_UDI_USE_MPM 294 const UChar g_aucIntraModeNumFast[ 7] =293 const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] = 295 294 { 296 295 3, // 2x2 … … 299 298 3, // 16x16 300 299 3, // 32x32 301 3, // 64x64 302 3 // 128x128 300 3 // 64x64 303 301 }; 304 302 #else // FAST_UDI_USE_MPM 305 const UChar g_aucIntraModeNumFast[ 7] =303 const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] = 306 304 { 307 305 3, // 2x2 … … 310 308 4, // 16x16 33 311 309 4, // 32x32 33 312 5, // 64x64 33 313 4 // 128x128 33 310 5 // 64x64 33 314 311 }; 315 312 #endif // FAST_UDI_USE_MPM … … 347 344 { //2x2 4x4 8x8 16x16 32x32 64x64 348 345 0, 7, 10, 11, 11, 13 }; 349 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 346 350 347 const UChar g_dmm3IntraTabIdxBits[6] = 351 348 { //2x2 4x4 8x8 16x16 32x32 64x64 352 349 0, 4, 7, 8, 8, 0 }; 353 #else354 const UChar g_dmm3IntraTabIdxBits[6] =355 { //2x2 4x4 8x8 16x16 32x32 64x64356 0, 6, 9, 9, 9, 0 };357 #endif358 350 359 351 extern std::vector< std::vector<TComWedgelet> > g_dmmWedgeLists; … … 614 606 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3; 615 607 616 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX617 608 Void initWedgeLists( Bool initNodeList ) 618 #else619 Void initWedgeLists( Bool initRefinements )620 #endif621 609 { 622 610 if( !g_dmmWedgeLists.empty() ) return; … … 631 619 g_dmmWedgeRefLists.push_back( acWedgeRefList ); 632 620 633 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX634 621 if( initNodeList ) 635 622 { 636 #endif 637 // create WedgeNodeList 638 std::vector<TComWedgeNode> acWedgeNodeList; 639 for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ ) 640 { 641 if( acWedgeList[uiPos].getIsCoarse() ) 642 { 643 TComWedgeNode cWedgeNode; 644 cWedgeNode.setPatternIdx( uiPos ); 645 646 #if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 647 if( initRefinements ) 623 // create WedgeNodeList 624 std::vector<TComWedgeNode> acWedgeNodeList; 625 for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ ) 626 { 627 if( acWedgeList[uiPos].getIsCoarse() ) 648 628 { 649 #endif 629 TComWedgeNode cWedgeNode; 630 cWedgeNode.setPatternIdx( uiPos ); 631 650 632 UInt uiRefPos = 0; 651 633 for( Int iOffS = -1; iOffS <= 1; iOffS++ ) … … 674 656 { 675 657 if( iSx == (Int)acWedgeRefList[k].getStartX() && 676 677 678 658 iSy == (Int)acWedgeRefList[k].getStartY() && 659 iEx == (Int)acWedgeRefList[k].getEndX() && 660 iEy == (Int)acWedgeRefList[k].getEndY() ) 679 661 { 680 662 if( acWedgeRefList[k].getRefIdx() != cWedgeNode.getPatternIdx() ) … … 694 676 } 695 677 } 696 #if !LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 678 acWedgeNodeList.push_back( cWedgeNode ); 697 679 } 698 #endif 699 acWedgeNodeList.push_back( cWedgeNode ); 700 } 701 } 702 g_dmmWedgeNodeLists.push_back( acWedgeNodeList ); 703 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 704 } 705 #endif 706 } 707 return; 680 } 681 g_dmmWedgeNodeLists.push_back( acWedgeNodeList ); 682 } 683 } 708 684 } 709 685 -
trunk/source/Lib/TLibCommon/TComRom.h
r622 r655 56 56 // ==================================================================================================================== 57 57 58 #define MAX_CU_DEPTH 7// log2(LCUSize)58 #define MAX_CU_DEPTH 6 // log2(LCUSize) 59 59 #define MAX_CU_SIZE (1<<(MAX_CU_DEPTH)) // maximum allowable size of CU 60 60 #define MIN_PU_SIZE 4 … … 136 136 // ==================================================================================================================== 137 137 138 extern const UChar g_aucIntraModeNumFast[ 7];138 extern const UChar g_aucIntraModeNumFast[ MAX_CU_DEPTH ]; 139 139 140 140 // ==================================================================================================================== … … 174 174 extern std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3; 175 175 176 #if LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX177 176 Void initWedgeLists( Bool initNodeList = false ); 178 #else179 Void initWedgeLists( Bool initRefinements = false );180 #endif181 177 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes ); 182 178 Void addWedgeletToList( TComWedgelet cWedgelet, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList ); -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r622 r655 101 101 , m_enableTMVPFlag ( true ) 102 102 #if H_MV 103 #if H_MV5104 103 , m_refPicSetInterLayer0 ( NULL ) 105 104 , m_refPicSetInterLayer1 ( NULL ) 106 #else107 , m_refPicSetInterLayer ( NULL )108 #endif109 105 , m_layerId (0) 110 106 , m_viewId (0) 111 #if H_MV5112 107 , m_viewIndex (0) 113 #endif114 108 #if H_3D 115 #if !H_MV5116 , m_viewIndex (0)117 #endif118 109 , m_isDepth (false) 119 110 #endif 120 #if H_MV5121 111 , m_pocResetFlag (false) 122 #endif123 112 , m_discardableFlag (false) 124 113 , m_interLayerPredEnabledFlag (false) 125 114 , m_numInterLayerRefPicsMinus1 (0) 126 #if !H_MV5127 , m_interLayerSamplePredOnlyFlag (false)128 , m_altCollocatedIndicationFlag (0)129 , m_collocatedRefLayerIdx (0)130 #endif131 115 #if H_3D_IC 132 116 , m_bApplyIC ( false ) … … 164 148 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 165 149 { 166 #if H_MV5167 150 m_interLayerPredLayerIdc[ i ] = i; 168 #else169 m_interLayerPredLayerIdc[ i ] = 0;170 #endif171 151 } 172 152 #endif … … 322 302 if (!pocHasMsb) 323 303 { 324 poc = poc % pocCycle;304 poc = poc & (pocCycle - 1); 325 305 } 326 306 … … 333 313 if (!pocHasMsb) 334 314 { 335 picPoc = picPoc % pocCycle;315 picPoc = picPoc & (pocCycle - 1); 336 316 } 337 317 … … 387 367 } 388 368 } 389 #if H_MV5390 369 #if !H_MV 391 370 #if FIX1071 … … 472 451 { 473 452 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 474 // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.475 // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.453 // ?If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 454 // ?Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 476 455 if (getRapPicFlag()) 477 456 { … … 730 709 } 731 710 #endif 732 #else 711 Int TComSlice::getNumRpsCurrTempList() 712 { 713 Int numRpsCurrTempList = 0; 714 715 if (m_eSliceType == I_SLICE) 716 { 717 return 0; 718 } 719 for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++) 720 { 721 if(m_pcRPS->getUsed(i)) 722 { 723 numRpsCurrTempList++; 724 } 725 } 733 726 #if H_MV 734 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)735 #else736 #if FIX1071737 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )738 #else739 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )740 #endif741 #endif742 {743 #if FIX1071744 if (!checkNumPocTotalCurr)745 #endif746 {747 if (m_eSliceType == I_SLICE)748 {749 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));750 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx ));751 752 return;753 }754 755 #if !H_MV756 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);757 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);758 #endif759 }760 761 TComPic* pcRefPic= NULL;762 TComPic* RefPicSetStCurr0[16];763 TComPic* RefPicSetStCurr1[16];764 TComPic* RefPicSetLtCurr[16];765 UInt NumPocStCurr0 = 0;766 UInt NumPocStCurr1 = 0;767 UInt NumPocLtCurr = 0;768 Int i;769 770 for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)771 {772 if(m_pcRPS->getUsed(i))773 {774 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));775 pcRefPic->setIsLongTerm(0);776 pcRefPic->getPicYuvRec()->extendPicBorder();777 RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;778 NumPocStCurr0++;779 pcRefPic->setCheckLTMSBPresent(false);780 }781 }782 783 for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)784 {785 if(m_pcRPS->getUsed(i))786 {787 pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));788 pcRefPic->setIsLongTerm(0);789 pcRefPic->getPicYuvRec()->extendPicBorder();790 RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;791 NumPocStCurr1++;792 pcRefPic->setCheckLTMSBPresent(false);793 }794 }795 796 for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)797 {798 if(m_pcRPS->getUsed(i))799 {800 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));801 pcRefPic->setIsLongTerm(1);802 pcRefPic->getPicYuvRec()->extendPicBorder();803 RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;804 NumPocLtCurr++;805 }806 if(pcRefPic==NULL)807 {808 pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));809 }810 pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));811 }812 813 // ref_pic_list_init814 TComPic* rpsCurrList0[MAX_NUM_REF+1];815 TComPic* rpsCurrList1[MAX_NUM_REF+1];816 #if H_MV817 Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;818 assert( numPocInterCurr == 0 || getInterRefEnabledInRPLFlag() );819 Int numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( );820 assert( numPocTotalCurr == getNumRpsCurrTempList() );821 #else822 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;823 #endif824 #if FIX1071825 if (checkNumPocTotalCurr)826 {827 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:828 #if H_MV829 // â If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.830 // â Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.831 if ( getRapPicFlag() && m_layerId == 0 )832 #else833 // â If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.834 // â Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.835 if (getRapPicFlag())836 #endif837 {838 assert(numPocTotalCurr == 0);839 }840 841 if (m_eSliceType == I_SLICE)842 {843 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));844 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx ));845 846 return;847 }848 849 assert(numPocTotalCurr > 0);850 851 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);852 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);853 }854 #endif855 856 Int cIdx = 0;857 #if H_MV858 if ( getInterRefEnabledInRPLFlag() )859 {860 #endif861 for ( i=0; i<NumPocStCurr0; i++, cIdx++)862 {863 rpsCurrList0[cIdx] = RefPicSetStCurr0[i];864 }865 for ( i=0; i<NumPocStCurr1; i++, cIdx++)866 {867 rpsCurrList0[cIdx] = RefPicSetStCurr1[i];868 }869 for ( i=0; i<NumPocLtCurr; i++, cIdx++)870 {871 rpsCurrList0[cIdx] = RefPicSetLtCurr[i];872 }873 #if H_MV874 }875 for ( i=0; i < getNumActiveRefLayerPics( ); i++, cIdx++)876 {877 assert( cIdx < MAX_NUM_REF );878 rpsCurrList0[cIdx] = refPicSetInterLayer[i];879 }880 #endif881 assert(cIdx == numPocTotalCurr);882 883 if (m_eSliceType==B_SLICE)884 {885 cIdx = 0;886 #if H_MV887 if ( getInterRefEnabledInRPLFlag() )888 {889 #endif890 for ( i=0; i<NumPocStCurr1; i++, cIdx++)891 {892 rpsCurrList1[cIdx] = RefPicSetStCurr1[i];893 }894 for ( i=0; i<NumPocStCurr0; i++, cIdx++)895 {896 rpsCurrList1[cIdx] = RefPicSetStCurr0[i];897 }898 for ( i=0; i<NumPocLtCurr; i++, cIdx++)899 {900 rpsCurrList1[cIdx] = RefPicSetLtCurr[i];901 }902 #if H_MV903 }904 for ( i=0; i < getNumActiveRefLayerPics( ); i++, cIdx++)905 {906 assert( cIdx < MAX_NUM_REF );907 rpsCurrList1[cIdx] = refPicSetInterLayer[i];908 }909 #endif910 assert(cIdx == numPocTotalCurr);911 }912 913 ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));914 915 #if H_MV916 Int numPocSt = NumPocStCurr0 + NumPocStCurr1;917 assert( getInterRefEnabledInRPLFlag( ) || numPocSt == 0 );918 919 for (Int li = 0; li < 2; li++)920 {921 if ( m_eSliceType == P_SLICE && li == 1 )922 {923 m_aiNumRefIdx[1] = 0;924 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));925 }926 else927 {928 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++)929 {930 Bool listModified = m_RefPicListModification.getRefPicListModificationFlagL( li );931 Int orgIdx = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr);932 933 m_apcRefPicList [li][rIdx] = ( li == 0 ) ? rpsCurrList0[ orgIdx ] : rpsCurrList1[ orgIdx ];934 m_bIsUsedAsLongTerm[li][rIdx] = ( orgIdx >= numPocSt ) ;935 }936 }937 }938 #else939 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)940 {941 cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;942 assert(cIdx >= 0 && cIdx < numPocTotalCurr);943 m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];944 m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );945 }946 if ( m_eSliceType != B_SLICE )947 {948 m_aiNumRefIdx[1] = 0;949 ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));950 }951 else952 {953 for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)954 {955 cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;956 assert(cIdx >= 0 && cIdx < numPocTotalCurr);957 m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];958 m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );959 }960 }961 #endif962 }963 964 #endif965 Int TComSlice::getNumRpsCurrTempList()966 {967 Int numRpsCurrTempList = 0;968 969 if (m_eSliceType == I_SLICE)970 {971 return 0;972 }973 for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)974 {975 if(m_pcRPS->getUsed(i))976 {977 numRpsCurrTempList++;978 }979 }980 #if H_MV981 #if !H_MV5982 assert( ( numRpsCurrTempList == 0 ) || getInterRefEnabledInRPLFlag() );983 #endif984 727 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics(); 985 728 #endif … … 1063 806 } 1064 807 1065 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)808 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic) 1066 809 { 1067 810 for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++) … … 1089 832 { 1090 833 pocCRA = getPOC(); 1091 prevRAPisBLA = false;834 associatedIRAPType = getNalUnitType(); 1092 835 } 1093 836 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found 1094 837 { 1095 838 pocCRA = getPOC(); 1096 prevRAPisBLA = false;839 associatedIRAPType = getNalUnitType(); 1097 840 } 1098 841 else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP … … 1101 844 { 1102 845 pocCRA = getPOC(); 1103 prevRAPisBLA = true;846 associatedIRAPType = getNalUnitType(); 1104 847 } 1105 848 } … … 1126 869 { 1127 870 TComPic* rpcPic; 871 setAssociatedIRAPPOC(pocCRA); 1128 872 Int pocCurr = getPOC(); 1129 873 … … 1295 1039 #if H_MV 1296 1040 // Additional slice header syntax elements 1297 #if H_MV51298 1041 m_pocResetFlag = pSrc->m_pocResetFlag; 1299 #endif1300 1042 m_discardableFlag = pSrc->m_discardableFlag; 1301 1043 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; … … 1306 1048 m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 1307 1049 } 1308 #if !H_MV51309 m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag;1310 m_altCollocatedIndicationFlag = pSrc->m_altCollocatedIndicationFlag ;1311 m_collocatedRefLayerIdx = pSrc->m_collocatedRefLayerIdx ;1312 m_numActiveMotionPredRefLayers = pSrc->m_numActiveMotionPredRefLayers;1313 1314 for (Int layer = 0; layer < MAX_NUM_LAYER_IDS; layer++)1315 {1316 m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer];1317 }1318 #endif1319 1050 #endif 1320 1051 #if H_3D_IC … … 1324 1055 } 1325 1056 1326 Int TComSlice::m_prev POC = 0;1057 Int TComSlice::m_prevTid0POC = 0; 1327 1058 1328 1059 /** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag. … … 1379 1110 } 1380 1111 1112 1113 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic) 1114 { 1115 TComPic* rpcPic; 1116 1117 Int nalUnitType = this->getNalUnitType(); 1118 1119 // When a picture is a leading picture, it shall be a RADL or RASL picture. 1120 if(this->getAssociatedIRAPPOC() > this->getPOC()) 1121 { 1122 // Do not check IRAP pictures since they may get a POC lower than their associated IRAP 1123 if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP || 1124 nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23) 1125 { 1126 assert(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1127 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || 1128 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1129 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); 1130 } 1131 } 1132 1133 // When a picture is a trailing picture, it shall not be a RADL or RASL picture. 1134 if(this->getAssociatedIRAPPOC() < this->getPOC()) 1135 { 1136 assert(nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N && 1137 nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R && 1138 nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N && 1139 nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R); 1140 } 1141 1142 // No RASL pictures shall be present in the bitstream that are associated 1143 // with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP. 1144 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1145 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1146 { 1147 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_W_RADL && 1148 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP); 1149 } 1150 1151 // No RASL pictures shall be present in the bitstream that are associated with 1152 // an IDR picture. 1153 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1154 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1155 { 1156 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP && 1157 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL); 1158 } 1159 1160 // No RADL pictures shall be present in the bitstream that are associated with 1161 // a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated 1162 // with an IDR picture having nal_unit_type equal to IDR_N_LP. 1163 if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1164 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R) 1165 { 1166 assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP && 1167 this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP); 1168 } 1169 1170 // loop through all pictures in the reference picture buffer 1171 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1172 while ( iterPic != rcListPic.end()) 1173 { 1174 rpcPic = *(iterPic++); 1175 if (rpcPic->getPOC() == this->getPOC()) 1176 { 1177 continue; 1178 } 1179 1180 // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture 1181 // in decoding order shall precede the IRAP picture in output order. 1182 // (Note that any picture following in output order would be present in the DPB) 1183 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1184 { 1185 if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1186 nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1187 nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1188 nalUnitType == NAL_UNIT_CODED_SLICE_CRA || 1189 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP || 1190 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1191 { 1192 assert(rpcPic->getPOC() < this->getPOC()); 1193 } 1194 } 1195 1196 // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture 1197 // in decoding order shall precede any RADL picture associated with the IRAP 1198 // picture in output order. 1199 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1200 { 1201 if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1202 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)) 1203 { 1204 // rpcPic precedes the IRAP in decoding order 1205 if(this->getAssociatedIRAPPOC() > rpcPic->getSlice(0)->getAssociatedIRAPPOC()) 1206 { 1207 // rpcPic must not be the IRAP picture 1208 if(this->getAssociatedIRAPPOC() != rpcPic->getPOC()) 1209 { 1210 assert(rpcPic->getPOC() < this->getPOC()); 1211 } 1212 } 1213 } 1214 } 1215 1216 // When a picture is a leading picture, it shall precede, in decoding order, 1217 // all trailing pictures that are associated with the same IRAP picture. 1218 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1219 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || 1220 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1221 nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R) 1222 { 1223 if(rpcPic->getSlice(0)->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC()) 1224 { 1225 // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB 1226 // rpcPic would violate the constraint if it was a trailing picture 1227 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1228 } 1229 } 1230 1231 // Any RASL picture associated with a CRA or BLA picture shall precede any 1232 // RADL picture associated with the CRA or BLA picture in output order 1233 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1234 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1235 { 1236 if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1237 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1238 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1239 this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) && 1240 this->getAssociatedIRAPPOC() == rpcPic->getSlice(0)->getAssociatedIRAPPOC()) 1241 { 1242 if(rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 1243 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R) 1244 { 1245 assert(rpcPic->getPOC() > this->getPOC()); 1246 } 1247 } 1248 } 1249 1250 // Any RASL picture associated with a CRA picture shall follow, in output 1251 // order, any IRAP picture that precedes the CRA picture in decoding order. 1252 if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || 1253 nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R) 1254 { 1255 if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) 1256 { 1257 if(rpcPic->getSlice(0)->getPOC() < this->getAssociatedIRAPPOC() && 1258 (rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP || 1259 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP || 1260 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL || 1261 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || 1262 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || 1263 rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1264 { 1265 assert(this->getPOC() > rpcPic->getSlice(0)->getPOC()); 1266 } 1267 } 1268 } 1269 } 1270 } 1271 1272 1273 1381 1274 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1382 1275 */ … … 1385 1278 TComPic* rpcPic; 1386 1279 Int i, isReference; 1280 1281 checkLeadingPictureRestrictions(rcListPic); 1387 1282 1388 1283 // loop through all pictures in the reference picture buffer … … 1421 1316 else 1422 1317 { 1423 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) 1318 Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1319 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1); 1320 Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1); 1321 if(rpcPic->getIsLongTerm() && curPoc == refPoc) 1424 1322 { 1425 1323 isReference = 1; … … 1481 1379 else 1482 1380 { 1483 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced()) 1381 Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC(); 1382 Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1); 1383 Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1); 1384 if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced()) 1484 1385 { 1485 1386 isAvailable = 1; … … 1500 1401 if (!pReferencePictureSet->getCheckLTMSBPresent(i)) 1501 1402 { 1502 curPoc = curPoc % pocCycle;1503 refPoc = refPoc % pocCycle;1403 curPoc = curPoc & (pocCycle - 1); 1404 refPoc = refPoc & (pocCycle - 1); 1504 1405 } 1505 1406 … … 1781 1682 : m_VPSId ( 0) 1782 1683 , m_uiMaxTLayers ( 1) 1783 #if H_MV51784 1684 #if H_MV 1785 1685 , m_uiMaxLayersMinus1 ( 0) 1786 #else1787 , m_uiMaxLayers ( 1)1788 #endif1789 1686 #else 1790 1687 , m_uiMaxLayers ( 1) … … 1800 1697 , m_hrdOpSetIdx (NULL) 1801 1698 , m_cprmsPresentFlag (NULL) 1802 #if H_MV51803 1699 #if H_MV 1804 1700 , m_vpsVUI ( NULL ) 1805 #endif1806 1701 #endif 1807 1702 { … … 1848 1743 1849 1744 m_avcBaseLayerFlag = false; 1850 #if H_MV51851 1745 m_vpsVuiOffset = 0; 1852 #endif1853 1746 m_splittingFlag = false; 1854 1747 1855 1748 for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ ) 1856 1749 { 1857 #if H_MV51858 1750 m_scalabilityMaskFlag[i] = false; 1859 #else1860 m_scalabilityMask[i] = false;1861 #endif1862 1751 m_dimensionIdLen [i] = -1; 1863 1752 } … … 1885 1774 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1886 1775 m_numDirectRefLayers[i] = 0; 1887 #if H_MV51888 1776 m_maxTidIlRefPicPlus1[i] = 7; 1889 1777 m_vpsRepFormatIdx [i] = 0; 1890 1778 m_repFormat [i] = NULL; 1891 1779 m_viewIdVal [i] = 0; 1892 #else1893 m_maxTidIlRefPicPlus1[i] = -1;1894 #endif1895 1780 1896 1781 #if H_3D … … 1935 1820 #endif 1936 1821 } 1937 #if H_MV51938 1822 m_vpsVUI = new TComVPSVUI; 1939 #endif1940 1823 #if H_3D 1941 1824 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1950 1833 m_depthRefinementFlag [ i ] = false; 1951 1834 #endif 1952 #if LGE_INTER_SDC_E01561835 #if H_3D_INTER_SDC 1953 1836 m_bInterSDCFlag [ i ] = false; 1954 1837 #endif … … 1963 1846 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1964 1847 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; 1965 #if H_MV51966 1848 #if H_MV 1967 1849 if ( m_vpsVUI != NULL ) delete m_vpsVUI; … … 1983 1865 #endif 1984 1866 } 1985 #endif1986 #else1987 #if H_3D_DIM_DLT1988 for( Int i = 0; i < MAX_NUM_LAYERS; i++ )1989 {1990 if ( m_iDepthValue2Idx[i] != 0 )1991 {1992 xFree( m_iDepthValue2Idx[i] );1993 m_iDepthValue2Idx[i] = 0;1994 }1995 1996 if ( m_iIdx2DepthValue[i] != 0 )1997 {1998 xFree( m_iIdx2DepthValue[i] );1999 m_iIdx2DepthValue[i] = 0;2000 2001 }2002 }2003 #endif2004 1867 #endif 2005 1868 } … … 2072 1935 Bool TComVPS::checkVPSExtensionSyntax() 2073 1936 { 2074 #if H_MV52075 1937 for( Int layer = 1; layer <= getMaxLayersMinus1(); layer++ ) 2076 #else2077 for( Int layer = 1; layer < getMaxLayers(); layer++ )2078 #endif2079 1938 { 2080 1939 // check layer_id_in_nuh constraint … … 2092 1951 { 2093 1952 assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES ); 2094 #if H_MV52095 1953 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMaskFlag( scalType ) ); 2096 #else2097 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );2098 #endif2099 1954 Int scalIdx = 0; 2100 1955 for( Int curScalType = 0; curScalType < scalType; curScalType++ ) 2101 1956 { 2102 #if H_MV52103 1957 scalIdx += ( getScalabilityMaskFlag( curScalType ) ? 1 : 0 ); 2104 #else2105 scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );2106 #endif2107 1958 2108 1959 } … … 2110 1961 return scalIdx; 2111 1962 } 2112 #if H_MV52113 1963 Void TComVPS::setScalabilityMaskFlag( UInt val ) 2114 1964 { … … 2118 1968 } 2119 1969 } 2120 #else 2121 Void TComVPS::setScalabilityMask( UInt val ) 2122 { 2123 for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ ) 2124 setScalabilityMask( scalType, ( val & (1 << scalType ) ) != 0 ); 2125 } 2126 2127 #endif 2128 2129 #if H_MV5 1970 2130 1971 Void TComVPS::setRefLayers() 2131 1972 { … … 2176 2017 } 2177 2018 #endif // H_3D 2178 #else2179 Void TComVPS::setRefLayers()2180 {2181 for( Int i = 0; i < MAX_NUM_LAYERS; i++ )2182 {2183 m_numSamplePredRefLayers[ i ] = 0;2184 m_numMotionPredRefLayers[ i ] = 0;2185 m_numDirectRefLayers[ i ] = 0;2186 for( Int j = 0; j < MAX_NUM_LAYERS; j++ ) {2187 m_samplePredEnabledFlag[ i ][ j ] = 0;2188 m_motionPredEnabledFlag[ i ][ j ] = 0;2189 m_refLayerId[ i ][ j ] = 0;2190 m_samplePredRefLayerId[ i ][ j ] = 0;2191 m_motionPredRefLayerId[ i ][ j ] = 0;2192 }2193 }2194 2195 for( Int i = 1; i <= getMaxLayers()- 1; i++ )2196 {2197 for( Int j = 0; j < i; j++ )2198 {2199 if( getDirectDependencyFlag(i,j) )2200 {2201 m_refLayerId[ i ][m_numDirectRefLayers[ i ]++ ] = getLayerIdInNuh( j );2202 2203 m_samplePredEnabledFlag [ i ][ j ] = ( ( getDirectDependencyType( i , j ) + 1 ) & 1 ) == 1;2204 m_numSamplePredRefLayers[ i ] += m_samplePredEnabledFlag [ i ][ j ] ? 1 : 0;2205 m_motionPredEnabledFlag [ i ][ j ] = ( ( ( getDirectDependencyType( i , j ) + 1 ) & 2 ) >> 1 ) == 1;2206 m_numMotionPredRefLayers[ i ] += m_motionPredEnabledFlag [ i][ j ] ? 1 : 0;2207 }2208 }2209 }2210 2211 for( Int i = 1, mIdx = 0, sIdx = 0; i <= getMaxLayers()- 1; i++ )2212 {2213 for( Int j = 0 ; j < i; j++ )2214 {2215 if( m_motionPredEnabledFlag[ i ][ j ] )2216 {2217 m_motionPredRefLayerId[ i ][ mIdx++ ] = getLayerIdInNuh( j );2218 }2219 2220 if( m_samplePredEnabledFlag[ i ][ j ] )2221 {2222 m_samplePredRefLayerId[ i ][ sIdx++ ] = getLayerIdInNuh( j );2223 }2224 }2225 }2226 }2227 2228 Int TComVPS::getRefLayerId( Int layerIdInVps, Int idx )2229 {2230 assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInVps] );2231 Int layerIdInNuh = m_refLayerId[ layerIdInVps ][ idx ];2232 assert ( layerIdInNuh >= 0 );2233 return layerIdInNuh;2234 }2235 2236 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )2237 {2238 return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;2239 }2240 2241 #if H_3D2242 Void TComVPS::initViewIndex()2243 {2244 Int viewIdList [ MAX_NUM_LAYERS ]; // ed. should be changed to MAX_VIEW_ID2245 Int viewIndexList[ MAX_NUM_LAYERS ];2246 Int numViewIds = 0;2247 2248 for ( Int i = 0 ; i < m_uiMaxLayers; i++ )2249 {2250 Int currViewId = getViewId( i );2251 2252 Bool viewIdInListFlag = false;2253 for ( Int j = 0; j < numViewIds; j ++ )2254 {2255 viewIdInListFlag = viewIdInListFlag || ( currViewId == viewIdList[ j ] );2256 }2257 2258 if ( !viewIdInListFlag )2259 {2260 viewIdList [ numViewIds ] = currViewId;2261 viewIndexList[ currViewId ] = numViewIds;2262 2263 numViewIds++;2264 }2265 2266 m_viewIndex[ i ] = viewIndexList[ currViewId ];2267 }2268 }2269 2270 Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag )2271 {2272 Int foundlayerId = -1;2273 2274 for (Int layer = 0 ; layer < m_uiMaxLayers; layer++ )2275 {2276 if( ( getViewIndex( layer ) == viewIndex ) && ( getDepthId( layer ) == ( depthFlag ? 1 : 0 ) ) )2277 {2278 foundlayerId = layer;2279 break;2280 }2281 }2282 assert( foundlayerId != -1 );2283 2284 return getLayerIdInNuh( foundlayerId );2285 }2286 2287 #endif // H_3D2288 2289 Int TComVPS::xCeilLog2( Int val )2290 {2291 assert( val > 0 );2292 Int ceilLog2 = 0;2293 while( val > ( 1 << ceilLog2 ) ) ceilLog2++;2294 return ceilLog2;2295 }2296 2297 #endif // H_MV52298 2019 2299 2020 … … 2336 2057 return numLayersInIdList; 2337 2058 } 2338 #if H_MV52339 2059 Int TComVPS::getNumViews() 2340 2060 { … … 2366 2086 return dependentFlag; 2367 2087 } 2368 #endif2369 2088 #endif // H_MV 2370 2089 … … 2417 2136 , m_vuiParameters () 2418 2137 #if H_MV 2419 #if H_MV52420 2138 , m_pcVPS ( NULL ) 2421 2139 , m_spsInferScalingListFlag ( false ) … … 2423 2141 , m_updateRepFormatFlag ( true ) 2424 2142 , m_interViewMvVertConstraintFlag (false) 2425 #else2426 , m_interViewMvVertConstraintFlag (false)2427 , m_numIlpRestrictedRefLayers ( 0 )2428 #endif2429 2143 #endif 2430 2144 #if H_3D … … 2441 2155 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2442 2156 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2443 #if !H_MV52444 #if H_MV2445 for (Int i = 0; i < MAX_NUM_LAYERS; i++ )2446 {2447 m_minSpatialSegmentOffsetPlus1[ i ] = 0;2448 m_ctuBasedOffsetEnabledFlag [ i ] = false;2449 m_minHorizontalCtuOffsetPlus1 [ i ] = 0;2450 }2451 #endif2452 #endif2453 2157 } 2454 2158 … … 2603 2307 , m_listsModificationPresentFlag( 0) 2604 2308 , m_numExtraSliceHeaderBits(0) 2605 #if H_MV52606 2309 #if H_MV 2607 2310 , m_ppsInferScalingListFlag(false) 2608 2311 , m_ppsScalingListRefLayerId(0) 2609 2312 #endif 2610 #endif2611 2313 { 2612 2314 m_scalingList = new TComScalingList; … … 2628 2330 } 2629 2331 2630 #if H_MV52631 2332 #if H_MV 2632 2333 Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr ) … … 2679 2380 } 2680 2381 } 2681 #endif2682 2382 #endif 2683 2383 #if H_3D … … 2908 2608 TComScalingList::TComScalingList() 2909 2609 { 2910 m_useTransformSkip = false;2911 2610 init(); 2912 2611 } … … 2950 2649 2951 2650 #if H_MV 2952 #if H_MV52953 2651 Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ) 2954 2652 { … … 2982 2680 } 2983 2681 } 2984 #else 2985 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ) 2986 { 2987 refPicSetInterLayer.clear(); 2988 2989 for( Int i = 0; i < getNumActiveRefLayerPics(); i++ ) 2990 { 2991 Int layerIdRef = getRefPicLayerId( i ); 2992 TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ; 2993 assert ( picRef != 0 ); 2994 2995 picRef->getPicYuvRec()->extendPicBorder(); 2996 picRef->setIsLongTerm( true ); 2997 picRef->getSlice(0)->setReferenced( true ); 2998 2999 // Consider to check here: 3000 // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. " 3001 refPicSetInterLayer.push_back( picRef ); 3002 } 3003 } 3004 #endif 3005 3006 #if H_MV5 2682 3007 2683 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ) 3008 2684 { … … 3019 2695 3020 2696 } 3021 #else3022 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer )3023 {3024 // Mark as shortterm3025 for ( Int i = 0; i < refPicSetInterLayer.size(); i++ )3026 {3027 refPicSetInterLayer[i]->setIsLongTerm( false );3028 }3029 }3030 3031 #endif3032 2697 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 3033 2698 { … … 3035 2700 if (targetDecLayerIdSet.size() == 0 ) 3036 2701 { 3037 #if H_MV53038 2702 for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ ) 3039 #else3040 for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ )3041 #endif3042 2703 { 3043 2704 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); … … 3068 2729 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 3069 2730 { 3070 #if H_MV53071 2731 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 3072 2732 { 3073 2733 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 3074 #else3075 Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] );3076 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ )3077 {3078 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS, k ) )3079 #endif3080 2734 { 3081 2735 remainingInterLayerReferencesFlag = true; … … 3093 2747 } 3094 2748 3095 #if H_MV53096 2749 Void TComSlice::printRefPicList() 3097 #else3098 Void TComSlice::xPrintRefPicList()3099 #endif3100 2750 { 3101 2751 for ( Int li = 0; li < 2; li++) … … 3110 2760 } 3111 2761 } 3112 #if !H_MV53113 Int TComSlice::xCeilLog2( Int val )3114 {3115 assert( val > 0 );3116 Int ceilLog2 = 0;3117 while( val > ( 1 << ceilLog2 ) ) ceilLog2++;3118 return ceilLog2;3119 }3120 #endif3121 2762 3122 2763 Void TComSlice::markCurrPic( TComPic* currPic ) … … 3133 2774 } 3134 2775 3135 #if H_MV53136 2776 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1 ) 3137 2777 { … … 3158 2798 return pcPic; 3159 2799 } 3160 #else3161 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer )3162 {3163 m_refPicSetInterLayer = refPicSetInterLayer;3164 }3165 3166 TComPic* TComSlice::getPicFromRefPicSetInterLayer( Int layerId )3167 {3168 assert( m_refPicSetInterLayer != 0 );3169 assert( (*m_refPicSetInterLayer).size() == getNumActiveRefLayerPics() );3170 TComPic* pcPic = NULL;3171 for ( Int i = 0; i < getNumActiveRefLayerPics(); i++ )3172 {3173 if ((*m_refPicSetInterLayer)[ i ]->getLayerId() == layerId)3174 {3175 pcPic = (*m_refPicSetInterLayer)[ i ];3176 }3177 }3178 assert(pcPic != NULL);3179 return pcPic;3180 }3181 #endif3182 2800 Int TComSlice::getNumActiveRefLayerPics() 3183 2801 { 3184 2802 Int numActiveRefLayerPics; 3185 2803 3186 #if H_MV53187 2804 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) == 0 ) 3188 2805 { … … 3198 2815 } 3199 2816 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 3200 #else3201 if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 || !getInterLayerPredEnabledFlag() )3202 {3203 numActiveRefLayerPics = 0;3204 }3205 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )3206 #endif3207 2817 { 3208 2818 numActiveRefLayerPics = 1; … … 3217 2827 Int TComSlice::getRefPicLayerId( Int i ) 3218 2828 { 3219 #if H_MV53220 2829 return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) ); 3221 #else 3222 return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) ); 3223 #endif 3224 } 3225 3226 #if !H_MV5 3227 Void TComSlice::setActiveMotionPredRefLayers() 3228 { 3229 Int j = 0; 3230 for( Int i = 0; i < getNumActiveRefLayerPics(); i++) 3231 { 3232 if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i )) ) 3233 { 3234 m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i ); 3235 } 3236 } 3237 m_numActiveMotionPredRefLayers = j; 3238 3239 // Consider incorporating bitstream conformance tests on derived variables here. 3240 } 3241 3242 Bool TComSlice::getInterRefEnabledInRPLFlag() 3243 { 3244 Bool interRefEnabledInRPLFlag; 3245 if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 ) 3246 { 3247 interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag(); 3248 } 3249 else 3250 { 3251 interRefEnabledInRPLFlag = 1; 3252 } 3253 return interRefEnabledInRPLFlag; 3254 } 3255 #endif 2830 } 2831 3256 2832 #if H_3D_ARP 3257 2833 Void TComSlice::setARPStepNum() … … 3531 3107 } 3532 3108 3533 #if H_MV53534 3109 #if H_MV 3535 3110 Void TComScalingList::inferFrom( TComScalingList* srcScLi ) … … 3545 3120 } 3546 3121 } 3547 #endif3548 3122 #endif 3549 3123 /** initialization process of quantization matrix array … … 3636 3210 , m_ppsMap(MAX_NUM_PPS) 3637 3211 , m_activeVPSId(-1) 3638 #if H_MV53639 3212 #if !H_MV 3640 3213 , m_activeSPSId(-1) … … 3649 3222 } 3650 3223 #endif 3651 #else3652 , m_activeSPSId(-1)3653 , m_activePPSId(-1)3654 {3655 #endif3656 3224 } 3657 3225 … … 3663 3231 //! activate a SPS from a active parameter sets SEI message 3664 3232 //! \returns true, if activation is successful 3665 #if H_MV53666 3233 #if H_MV 3667 3234 Bool ParameterSetManager::activateSPSWithSEI(Int spsId, Int layerId ) … … 3669 3236 Bool ParameterSetManager::activateSPSWithSEI(Int spsId) 3670 3237 #endif 3671 #else3672 Bool ParameterSetManager::activateSPSWithSEI(Int spsId)3673 #endif3674 3238 { 3675 3239 TComSPS *sps = m_spsMap.getPS(spsId); … … 3680 3244 { 3681 3245 m_activeVPSId = vpsId; 3682 #if !H_MV53683 m_activeSPSId = spsId;3684 #else3685 3246 #if H_MV 3686 3247 m_activeSPSId[ layerId ] = spsId; … … 3688 3249 m_activeSPSId = spsId; 3689 3250 #endif 3690 #endif3691 3251 return true; 3692 3252 } … … 3705 3265 //! activate a PPS and depending on isIDR parameter also SPS and VPS 3706 3266 //! \returns true, if activation is successful 3707 #if H_MV53708 3267 #if H_MV 3709 3268 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP, Int layerId ) … … 3742 3301 m_activeSPSId[ layerId ] = spsId; 3743 3302 #else 3744 m_activePPSId = ppsId;3745 m_activeVPSId = vpsId;3746 m_activeSPSId = spsId;3747 #endif3748 #else3749 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)3750 {3751 TComPPS *pps = m_ppsMap.getPS(ppsId);3752 if (pps)3753 {3754 Int spsId = pps->getSPSId();3755 #if H_MV3756 // active parameter sets per layer should be used here3757 #else3758 if (!isIRAP && (spsId != m_activeSPSId))3759 {3760 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");3761 return false;3762 }3763 #endif3764 TComSPS *sps = m_spsMap.getPS(spsId);3765 if (sps)3766 {3767 Int vpsId = sps->getVPSId();3768 if (!isIRAP && (vpsId != m_activeVPSId))3769 {3770 printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");3771 return false;3772 }3773 if (m_vpsMap.getPS(vpsId))3774 {3775 3303 m_activePPSId = ppsId; 3776 3304 m_activeVPSId = vpsId; … … 3828 3356 //! \} 3829 3357 3830 #if H_MV53831 3358 #if H_MV 3832 3359 TComVPSVUI::TComVPSVUI() … … 3861 3388 } 3862 3389 #endif 3863 #endif -
trunk/source/Lib/TLibCommon/TComSlice.h
r622 r655 155 155 Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } 156 156 Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } 157 Bool getUseTransformSkip () { return m_useTransformSkip; }158 Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; }159 157 Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 160 158 Bool checkPredMode (UInt sizeId, UInt listId); … … 169 167 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 170 168 Bool xParseScalingList (Char* pchFile); 171 #if H_MV5172 169 #if H_MV 173 170 Void inferFrom ( TComScalingList* srcScLi ); 174 #endif175 171 #endif 176 172 … … 184 180 UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 185 181 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix 186 Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4187 182 }; 188 183 … … 407 402 }; 408 403 409 #if H_MV5410 404 #if H_MV 411 405 class TComVPSVUI … … 502 496 }; 503 497 #endif 504 #endif505 498 506 499 class TComVPS … … 510 503 UInt m_uiMaxTLayers; 511 504 512 #if H_MV5513 505 #if H_MV 514 506 UInt m_uiMaxLayersMinus1; 515 #else516 UInt m_uiMaxLayers;517 #endif518 507 #else 519 508 UInt m_uiMaxLayers; … … 551 540 /// VPS EXTENSION SYNTAX ELEMENTS 552 541 Bool m_avcBaseLayerFlag; 553 #if H_MV5554 542 Int m_vpsVuiOffset; 555 #endif556 543 Bool m_splittingFlag; 557 #if H_MV5558 544 Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; 559 #else560 Bool m_scalabilityMask [MAX_NUM_SCALABILITY_TYPES];561 #endif562 545 Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; 563 546 Bool m_vpsNuhLayerIdPresentFlag; 564 547 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 565 548 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 566 #if H_MV5567 549 Int m_viewIdLenMinus1; 568 550 Int m_viewIdVal [MAX_NUM_LAYERS]; 569 #endif570 551 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 571 #if H_MV5572 552 Bool m_maxTidRefPresentFlag; 573 #endif574 553 Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; 575 #if H_MV5576 554 Bool m_allRefLayersActiveFlag; 577 #endif578 555 Int m_vpsNumberLayerSetsMinus1; 579 556 Int m_vpsNumProfileTierLevelMinus1; … … 586 563 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 587 564 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 588 #if H_MV5589 565 Bool m_repFormatIdxPresentFlag; 590 566 Int m_vpsNumRepFormatsMinus1; 591 567 Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; 592 568 TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; 593 #endif594 569 Bool m_maxOneActiveRefLayerFlag; 595 #if H_MV5596 570 Bool m_crossLayerIrapAlignedFlag; 597 #endif598 571 Int m_directDepTypeLenMinus2; 599 #if H_MV5600 572 Bool m_vpsVuiPresentFlag; 601 573 TComVPSVUI* m_vpsVUI; 602 #endif603 574 Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; 604 575 … … 616 587 Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 617 588 Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 618 #if H_MV5619 589 Int m_viewIndex [MAX_NUM_LAYERS ]; 620 #else621 #if H_3D622 Int m_viewIndex [MAX_NUM_LAYERS ];623 #endif624 625 Int xCeilLog2 ( Int val );626 #endif627 590 Int xGetDimBitOffset( Int j ); 628 591 … … 653 616 Bool m_ivMvScalingFlag; 654 617 #endif 655 #if LGE_INTER_SDC_E0156618 #if H_3D_INTER_SDC 656 619 Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; 657 620 #endif … … 681 644 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 682 645 683 #if H_MV5684 646 #if H_MV 685 647 UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; … … 689 651 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 690 652 #endif 691 #else692 UInt getMaxLayers () { return m_uiMaxLayers; }693 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; }694 #endif695 653 696 654 Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } … … 735 693 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } 736 694 737 #if H_MV5738 695 Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; } 739 696 Int getVpsVuiOffset( ) { return m_vpsVuiOffset; } 740 #endif741 697 742 698 Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } 743 699 Bool getSplittingFlag() { return m_splittingFlag; } 744 700 745 #if H_MV5746 701 Void setScalabilityMaskFlag( UInt val ); 747 702 Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } 748 703 Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } 749 #else750 Void setScalabilityMask( UInt val );751 752 Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; }753 Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; }754 #endif755 704 Int getNumScalabilityTypes( ); 756 705 … … 769 718 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } 770 719 771 #if H_MV5772 720 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 773 721 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } … … 775 723 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 776 724 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 777 #endif778 725 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 779 726 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 780 727 781 #if H_MV5782 728 Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } 783 729 Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } 784 #endif785 730 Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } 786 731 Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 787 #if H_MV5788 732 Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } 789 733 Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } 790 #endif791 734 Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } 792 735 Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } … … 819 762 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 820 763 821 #if H_MV5822 764 Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } 823 765 Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } … … 831 773 Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } 832 774 TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } 833 #endif834 775 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 835 776 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } 836 #if H_MV5837 777 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 838 778 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 839 #endif840 779 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 841 780 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } … … 843 782 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 844 783 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } 845 #if H_MV5846 784 Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } 847 785 Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } 848 786 849 787 TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } 850 #endif851 788 // VPS EXTENSION SEMANTICS VARIABLES 852 789 Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } … … 854 791 855 792 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); 856 #if H_MV5857 793 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } 858 #else859 Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); }860 861 #endif862 794 Void setRefLayers(); 863 795 864 #if H_MV5865 796 Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 866 797 Int getNumViews(); … … 868 799 Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; 869 800 Int getRefLayerId ( Int layerIdInNuh, Int idx );; 870 #else871 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; };872 Int getRefLayerId ( Int layerIdInVps, Int idx );;873 874 Int getNumSamplePredRefLayers( Int layerIdInVps ) { return m_numSamplePredRefLayers[layerIdInVps]; }875 Bool getSamplePredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_samplePredEnabledFlag [layerIdInVps][idx]; }876 Int getSamplePredRefLayerId ( Int layerIdInVps, Int idx ) { return m_samplePredRefLayerId [layerIdInVps][idx]; }877 878 Int getNumMotionPredRefLayers( Int layerIdInVps ) { return m_numMotionPredRefLayers[layerIdInVps]; }879 Bool getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; }880 Int getMotionPredRefLayerId ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId [layerIdInVps][idx]; }881 #endif882 801 Bool checkVPSExtensionSyntax(); 883 802 Int scalTypeToScalIdx ( ScalabilityType scalType ); 884 803 885 #if H_MV5886 804 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 887 #else888 Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };889 #endif890 805 891 806 Int getNumLayersInIdList ( Int lsIdx );; … … 895 810 Int inferLastDimsionIdLenMinus1(); 896 811 897 #if H_MV5898 812 // helpers 899 813 Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); 900 #endif901 814 /// VPS EXTENSION 2 SYNTAX ELEMENTS 902 815 #if H_3D 903 #if H_MV5904 816 Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } 905 #else906 Void initViewIndex();907 Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; }908 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); }909 #endif910 817 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 911 818 … … 943 850 Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } 944 851 Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } 945 #if LGE_INTER_SDC_E0156852 #if H_3D_INTER_SDC 946 853 Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } 947 854 Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } … … 960 867 Int m_winTopOffset; 961 868 Int m_winBottomOffset; 962 #if H_MV5963 869 #if H_MV 964 870 Bool m_scaledFlag; 965 #endif966 871 #endif 967 872 public: … … 972 877 , m_winTopOffset (0) 973 878 , m_winBottomOffset (0) 974 #if H_MV5975 879 #if H_MV 976 880 , m_scaledFlag(true) 977 #endif978 881 #endif 979 882 { } … … 990 893 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 991 894 992 #if H_MV5993 895 #if H_MV 994 896 Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } … … 1005 907 } 1006 908 } 1007 #endif1008 909 #endif 1009 910 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) … … 1054 955 TComHRD m_hrdParameters; 1055 956 TimingInfo m_timingInfo; 1056 #if !H_MV51057 #if H_MV1058 Bool m_tileBoundariesAlignedFlag;1059 #endif1060 #endif1061 957 1062 958 public: … … 1091 987 ,m_log2MaxMvLengthHorizontal(15) 1092 988 ,m_log2MaxMvLengthVertical(15) 1093 #if !H_MV51094 #if H_MV1095 ,m_tileBoundariesAlignedFlag(true)1096 #endif1097 #endif1098 989 {} 1099 990 … … 1191 1082 TComHRD* getHrdParameters () { return &m_hrdParameters; } 1192 1083 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1193 #if !H_MV51194 #if H_MV1195 Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; }1196 Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; }1197 #endif1198 #endif1199 1084 1200 1085 }; … … 1281 1166 TComPTL m_pcPTL; 1282 1167 #if H_MV 1283 #if H_MV51284 1168 TComVPS* m_pcVPS; 1285 1169 // SPS … … 1287 1171 Int m_spsScalingListRefLayerId; 1288 1172 Bool m_updateRepFormatFlag; 1289 #endif1290 1173 // SPS Extension 1291 1174 Bool m_interViewMvVertConstraintFlag; 1292 #if !H_MV51293 Int m_numIlpRestrictedRefLayers ;1294 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS];1295 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS];1296 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS];1297 #endif1298 1175 #endif 1299 1176 #if H_3D … … 1432 1309 TComPTL* getPTL() { return &m_pcPTL; } 1433 1310 #if H_MV 1434 #if H_MV51435 1311 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 1436 1312 TComVPS* getVPS () { return m_pcVPS; } … … 1444 1320 Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } 1445 1321 Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } 1446 #endif1447 1322 // SPS Extension 1448 1323 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1449 1324 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1450 #if H_MV51451 1325 // Inference 1452 1326 Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); 1453 1327 1454 1328 Void inferScalingList( TComSPS* spsSrc ); 1455 #else1456 Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;}1457 Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;}1458 1459 Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;}1460 Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];}1461 1462 Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;}1463 Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];}1464 1465 Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;}1466 Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];}1467 1468 #endif1469 1329 #endif 1470 1330 #if H_3D_QTLPC … … 1582 1442 Int m_numExtraSliceHeaderBits; 1583 1443 1584 #if H_MV51585 1444 #if H_MV 1586 1445 Int m_layerId; 1587 1446 Bool m_ppsInferScalingListFlag; 1588 1447 Int m_ppsScalingListRefLayerId; 1589 #endif1590 1448 #endif 1591 1449 public: … … 1710 1568 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1711 1569 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1712 #if H_MV51713 1570 #if H_MV 1714 1571 Void setLayerId( Int val ) { m_layerId = val; } … … 1720 1577 Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } 1721 1578 Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } 1722 #endif1723 1579 #endif 1724 1580 }; … … 1754 1610 Bool m_PicOutputFlag; ///< pic_output_flag 1755 1611 Int m_iPOC; 1756 #if H_MV51757 1612 #if H_MV 1758 1613 Int m_iPOCBeforeReset; 1759 1614 #endif 1760 #endif1761 1615 Int m_iLastIDR; 1762 static Int m_prevPOC; 1616 Int m_iAssociatedIRAP; 1617 NalUnitType m_iAssociatedIRAPType; 1618 static Int m_prevTid0POC; 1763 1619 TComReferencePictureSet *m_pcRPS; 1764 1620 TComReferencePictureSet m_LocalRPS; … … 1853 1709 Bool m_enableTMVPFlag; 1854 1710 #if H_MV 1855 #if H_MV51856 1711 std::vector<TComPic*>* m_refPicSetInterLayer0; 1857 1712 std::vector<TComPic*>* m_refPicSetInterLayer1; … … 1862 1717 Bool m_isDepth; 1863 1718 #endif 1864 #else1865 std::vector<TComPic*>* m_refPicSetInterLayer;1866 Int m_layerId;1867 Int m_viewId;1868 #if H_3D1869 Int m_viewIndex;1870 Bool m_isDepth;1871 #endif1872 #endif1873 1719 1874 1720 // Additional slice header syntax elements 1875 #if H_MV51876 1721 Bool m_pocResetFlag; 1877 #endif1878 1722 Bool m_discardableFlag; 1879 1723 Bool m_interLayerPredEnabledFlag; 1880 1724 Int m_numInterLayerRefPicsMinus1; 1881 1725 Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; 1882 #if !H_MV51883 Bool m_interLayerSamplePredOnlyFlag;1884 Bool m_altCollocatedIndicationFlag;1885 Int m_collocatedRefLayerIdx;1886 // Additional slice header semantics variables1887 Int m_numActiveMotionPredRefLayers;1888 Int m_activeMotionPredRefLayerId [ MAX_NUM_LAYER_IDS ];1889 1890 #endif1891 1726 Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; 1892 1727 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; … … 1940 1775 Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } 1941 1776 Int getRPSidx () { return m_iBDidx; } 1942 Int getPrev POC () { return m_prevPOC; }1777 Int getPrevTid0POC () { return m_prevTid0POC; } 1943 1778 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 1944 1779 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } 1945 1780 Int getLastIDR() { return m_iLastIDR; } 1781 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 1782 Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } 1783 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 1784 NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } 1946 1785 SliceType getSliceType () { return m_eSliceType; } 1947 1786 Int getPOC () { return m_iPOC; } … … 1988 1827 Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); 1989 1828 Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } 1829 Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } 1990 1830 Bool getCheckLDC () { return m_bCheckLDC; } 1991 1831 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } … … 1994 1834 Void setReferenced(Bool b) { m_bRefenced = b; } 1995 1835 Bool isReferenced() { return m_bRefenced; } 1996 Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } 1836 Bool isReferenceNalu() { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } 1837 Void setPOC ( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } 1997 1838 Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } 1998 1839 NalUnitType getNalUnitType () const { return m_eNalUnitType; } … … 2000 1841 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2001 1842 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 2002 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);1843 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2003 1844 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); 2004 1845 Void setSliceType ( SliceType e ) { m_eSliceType = e; } … … 2022 1863 2023 1864 #if H_MV 2024 #if H_MV52025 1865 Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } 2026 1866 Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } 2027 #endif2028 1867 Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } 2029 1868 Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } 2030 #if H_MV52031 1869 Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, 2032 1870 std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 2033 1871 2034 1872 Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 2035 #else2036 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false );2037 #endif2038 1873 #else 2039 1874 #if FIX1071 … … 2082 1917 Void setTLayerInfo( UInt uiTLayer ); 2083 1918 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 1919 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); 2084 1920 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 2085 1921 #if H_MV 2086 #if !H_MV52087 Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );2088 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer );2089 #else2090 1922 Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); 2091 1923 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); 2092 #endif2093 1924 static Void markCurrPic ( TComPic* currPic );; 2094 1925 static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); 2095 #if H_MV52096 1926 Void printRefPicList(); 2097 #else2098 Void xPrintRefPicList();2099 #endif2100 1927 #endif 2101 1928 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); … … 2184 2011 Void setViewId ( Int viewId ) { m_viewId = viewId; } 2185 2012 Int getViewId () { return m_viewId; } 2186 #if H_MV52187 2013 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 2188 2014 Int getViewIndex () { return m_viewIndex; } 2189 #endif2190 2015 #if H_3D 2191 2016 #if H_3D_TMVP … … 2193 2018 Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } 2194 2019 Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } 2195 #endif2196 #if !H_MV52197 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; }2198 Int getViewIndex () { return m_viewIndex; }2199 2020 #endif 2200 2021 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } … … 2219 2040 // Additional slice header syntax elements 2220 2041 2221 #if H_MV52222 2042 Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 2223 2043 Bool getPocResetFlag( ) { return m_pocResetFlag; } 2224 #endif2225 2044 2226 2045 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } … … 2236 2055 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 2237 2056 2238 #if H_MV52239 2057 // Additional variables derived in slice header semantics 2240 2058 Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } … … 2250 2068 Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); 2251 2069 TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); 2252 #else2253 Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; }2254 Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; }2255 2256 Void setAltCollocatedIndicationFlag( Bool flag ) { m_altCollocatedIndicationFlag = flag; }2257 Bool getAltCollocatedIndicationFlag( ) { return m_altCollocatedIndicationFlag; }2258 2259 Void setCollocatedRefLayerIdx( Int val ) { m_collocatedRefLayerIdx = val; }2260 Int getCollocatedRefLayerIdx( ) { return m_collocatedRefLayerIdx; }2261 2262 // Additional variables derived in slice header semantics2263 Int getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }2264 Int getInterLayerPredLayerIdcLen ( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }2265 2266 Int getNumActiveRefLayerPics( );2267 Int getRefPicLayerId ( Int i );2268 2269 Void setActiveMotionPredRefLayers ( );2270 2271 Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; }2272 Int getActiveMotionPredRefLayerId ( Int i ) { return m_activeMotionPredRefLayerId[i]; }2273 2274 Bool getInterRefEnabledInRPLFlag( );2275 2276 Void setRefPicSetInterLayer ( std::vector<TComPic*>* m_refPicSetInterLayer );2277 TComPic* getPicFromRefPicSetInterLayer( Int layerId );2278 2279 #endif2280 2070 #endif 2281 2071 protected: … … 2284 2074 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 2285 2075 #if H_MV 2286 #if !H_MV52287 Int xCeilLog2( Int val );2288 #endif2289 2076 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); 2290 2077 #endif … … 2368 2155 //! activate a SPS from a active parameter sets SEI message 2369 2156 //! \returns true, if activation is successful 2370 #if !H_MV52371 Bool activateSPSWithSEI(Int SPSId);2372 2373 //! activate a PPS and depending on isIDR parameter also SPS and VPS2374 //! \returns true, if activation is successful2375 Bool activatePPS(Int ppsId, Bool isIRAP);2376 2377 TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };2378 TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); };2379 TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); };2380 2381 protected:2382 2383 ParameterSetMap<TComVPS> m_vpsMap;2384 ParameterSetMap<TComSPS> m_spsMap;2385 ParameterSetMap<TComPPS> m_ppsMap;2386 2387 Int m_activeVPSId;2388 Int m_activeSPSId;2389 Int m_activePPSId;2390 #else2391 2157 #if H_MV 2392 2158 Bool activateSPSWithSEI(Int SPSId, Int layerId ); … … 2426 2192 #endif 2427 2193 2428 #endif2429 2194 }; 2430 2195 -
trunk/source/Lib/TLibCommon/TComWedgelet.cpp
r622 r655 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 { -
trunk/source/Lib/TLibCommon/TComWedgelet.h
r622 r655 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 -
trunk/source/Lib/TLibCommon/TComWeightPrediction.h
r608 r655 53 53 class TComWeightPrediction 54 54 { 55 wpScalingParam m_wp0[3], m_wp1[3];56 57 55 public: 58 56 TComWeightPrediction(); -
trunk/source/Lib/TLibCommon/TypeDef.h
r622 r655 92 92 // QC_CU_NBDV_D0181 93 93 // SEC_DEFAULT_DV_D0112 94 // MTK_DVMCP_FIX_E0172 1 // fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172 94 // MTK_DVMCP_FIX_E0172 fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172 95 // SEC_SIMPLIFIED_NBDV_E0142 Simplified NBDV, JCT3V-E0142 and JCT3V-E0190 96 // MTK_NBDV_TN_FIX_E0172 fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172 97 // MTK_TEXTURE_MRGCAND_BUGFIX_E0182 Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 95 98 #define H_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177 96 99 #define H_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 97 100 // Unifying rounding offset, for IC part, JCT3V-D0135 98 101 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 102 // SHARP_ILLUCOMP_REFINE_E0046 103 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 99 104 100 105 #if H_3D_NBDV … … 103 108 // MERL_D0166: Reference view selection in NBDV & Bi-VSP 104 109 // MERL_C0152: Basic VSP 110 // NBDV_DEFAULT_VIEWIDX_BUGFIX Bug fix for invalid default view index for NBDV 111 // NTT_DoNBDV_VECTOR_CLIP_E0141 disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209 112 105 113 #endif 106 114 … … 112 120 // LG_D0092: Multiple VSP candidate allowed 113 121 // MTK_VSP_FIX_ALIGN_WD_E0172 122 // NTT_VSP_ADAPTIVE_SPLIT_E0207 adaptive sub-PU partitioning in VSP, JCT3V-E0207 123 // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208 124 // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208 114 125 #define H_3D_IV_MERGE 1 // Inter-view motion merge candidate 115 126 // HHI_INTER_VIEW_MOTION_PRED … … 139 150 // FIX_SDC_ENC_RD_WVSO_D0163 140 151 // MTK_SAMPLE_BASED_SDC_D0110 141 142 143 144 ///////////////////////////////////////////////////////////////////////////////////////// 145 /////////////////////////////////// HTM-8.0 INTEGRATIONS ////////////////////////////// 146 ///////////////////////////////////////////////////////////////////////////////////////// 147 148 #define SHARP_ILLUCOMP_REFINE_E0046 1 149 #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 156 157 #if H_3D_NBDV 158 #define NBDV_DEFAULT_VIEWIDX_BUGFIX 1 // Bug fix for invalid default view index for NBDV 159 #define MTK_RVS_BUGFIX_E0172 1 // Bug fix for issues caused by reference view selection, JCT3V-E0172 160 #define MTK_TEXTURE_MRGCAND_BUGFIX_E0182 1 // Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 161 162 #if MTK_RVS_BUGFIX_E0172 163 #define MTK_DIVMC_FIX_E0172 1 // fix the issue of derivation of disparity inter-view merge candidate, issue 5 in JCT3V-E0172 164 #define MTK_NBDV_TN_FIX_E0172 1 // fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172 165 #endif // MTK_RVS_BUGFIX_E0172 166 167 #if H_3D_NBDV_REF 168 #define NTT_DoNBDV_VECTOR_CLIP_E0141 1 // disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209 169 #define SEC_SIMPLIFIED_NBDV_E0142 1 // Simplified NBDV, JCT3V-E0142 and JCT3V-E0190 170 #endif 171 #endif // H_3D_NBDV 172 152 // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs 153 // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode 154 // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC 155 // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal 156 // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC 157 // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 Removal of overlap between DMM3 and DMM1 158 159 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding 160 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 161 #define H_3D_FCO 0 // Flexible coding order for 3D 162 163 164 165 // OTHERS 166 // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170 167 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation 168 #define H_3D_FAST_TEXTURE_ENCODING 1 // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173 169 // MTK_FAST_TEXTURE_ENCODING_E0173 173 170 #if H_3D_DIM 174 #define SEC_DMM2_E0146_HHIFIX 1 // Removal of DMM2 from DMMs 175 #define ZJU_DEPTH_INTRA_MODE_E0204 1 // Simplified Binarization for depth_intra_mode 176 #define KWU_SDC_SIMPLE_DC_E0117 1 // Simplified DC calculation for SDC 177 #define SCU_HS_DMM4_REMOVE_DIV_E0242 1 // DMM4 Division Removal 178 #define SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX 1 // Fast DMM and RBC Mode Selection 179 #endif 180 181 #if H_3D_VSP 182 #define NTT_VSP_COMMON_E0207_E0208 1 // common part of JCT3V-E0207 and JCT3V-E0208 183 #if NTT_VSP_COMMON_E0207_E0208 184 #define NTT_VSP_DC_BUGFIX_E0208 1 // bugfix for sub-PU based DC in VSP, JCT3V-E0208 185 #define NTT_VSP_VECTOR_CLIP_E0208 1 // disparity vector clipping on fetching depth map in VSP, JCT3V-E0208 186 #define NTT_VSP_ADAPTIVE_SPLIT_E0207 1 // adaptive sub-PU partitioning in VSP, JCT3V-E0207 187 #endif 188 #endif 189 190 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation 191 192 /// FIXES 193 #define H_3D_FIX_BVSP 1 // DV from NBDV instead of DoNBDV should be used 194 #define H_3D_FIX_TICKET_036 1 // fix for ticket #36 195 #define H_3D_FIX_REN 1 // fix of erroneous inpainting for renderer 196 #define H_3D_FIX_REN_WARNING 1 // fix of warning related to camera parameter precision 197 198 #define H_3D_FIX_UINT_WARNING 1 // explicit in VSD 171 #define H_3D_FAST_DEPTH_INTRA 1 // Fast DMM and RBC Mode Selection 172 // SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX 173 #endif 174 175 176 // Rate Control 177 #define KWU_FIX_URQ 1 178 #define KWU_RC_VIEWRC_E0227 0 ///< JCT3V-E0227, view-wise target bitrate allocation 179 #define KWU_RC_MADPRED_E0227 0 ///< JCT3V-E0227, inter-view MAD prediction 180 199 181 #endif // H_3D 200 182 201 183 202 ///////////////////////////////////////////////////////////////////////////////////////// 203 /////////////////////////////////// HTM-8.1 INTEGRATIONS ////////////////////////////// 204 ///////////////////////////////////////////////////////////////////////////////////////// 205 206 // Please put HTM-8.1 Integration defines here, when possible 207 208 209 /// FIXES 210 #if H_MV 211 #define H_MV_FIX_LID_PIC_HASH_SEI_T40 1 // Fix wrong layer_id in decoded picture hash SEI 212 #define H_MV5 1 // Update to MV-HEVC 5 HLS 213 #endif 184 214 185 ///////////////////////////////////////////////////////////////////////////////////////// 215 186 /////////////////////////////////// DERIVED DEFINES /////////////////////////////////// … … 223 194 #define H_3D_VSO_RM_ASSERTIONS 0 // Output VSO assertions 224 195 #define H_3D_VSO_SYNTH_DIST_OUT 0 // Output of synthesized view distortion instead of depth distortion in encoder output 225 226 196 #define H_3D_VSO_FIX 0 // This fix should be enabled after verification 227 228 #endif 229 //// ****** Neighbouring block-based Disparity Vector *********197 #endif 198 199 //// ****** neighbouring block-based disparity vector ********* 230 200 #if H_3D_NBDV 231 #if SEC_SIMPLIFIED_NBDV_E0142232 201 #define DVFROM_LEFT 0 233 202 #define DVFROM_ABOVE 1 234 203 #define IDV_CANDS 2 235 #else236 #define DVFROM_LEFTBELOW 0237 #define DVFROM_LEFT 1238 #define DVFROM_ABOVERIGHT 2239 #define DVFROM_ABOVE 3240 #define DVFROM_ABOVELEFT 4241 #define IDV_CANDS 5242 #endif243 204 #endif 244 205 … … 247 208 #define H_3D_ARP_WFNR 3 248 209 #endif 210 249 211 ///// ***** DEPTH INTRA MODES ********* 250 212 #if H_3D_DIM … … 256 218 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 257 219 // LG_ZEROINTRADEPTHRESI_A0087 258 #if H_3D_DIM_SDC 259 #define LGE_SDC_REMOVE_DC_E0158 1 // Removal of DC mode from SDC 260 #endif 261 #if H_3D_DIM_DMM 262 #define LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 // Removal of overlap between DMM3 and DMM1 263 #endif 264 #endif 265 220 #endif 266 221 ///// ***** VIEW SYNTHESIS PREDICTION ********* 267 222 #if H_3D_VSP … … 273 228 #endif 274 229 230 #endif 231 232 ///// ***** ILLUMATION COMPENSATION ********* 233 #if H_3D_IC 234 #define IC_REG_COST_SHIFT 7 235 #define IC_CONST_SHIFT 5 236 #define IC_SHIFT_DIFF 12 237 #endif 238 239 ///// ***** FCO ********* 240 #if H_3D_FCO 241 #define H_3D_FCO_VSP_DONBDV_E0163 1 // Adaptive depth reference for flexible coding order 242 #else 243 #define H_3D_FCO_VSP_DONBDV_E0163 0 // Adaptive depth reference for flexible coding order 275 244 #endif 276 245 … … 300 269 #define TICKET_1090_FIX 1 301 270 271 #if KWU_FIX_URQ 272 #if RATE_CONTROL_LAMBDA_DOMAIN 302 273 #define RC_FIX 1 /// suggested fix for M0036 303 274 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 275 #endif 276 #else 277 #define RC_FIX 1 /// suggested fix for M0036 278 #define RATE_CONTROL_INTRA 1 ///< JCTVC-M0257, rate control for intra 279 #endif 280 304 281 305 282 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) … … 484 461 485 462 #if H_3D_VSO_DIST_INT 486 #if H_3D_FIX_TICKET_036487 463 typedef Int64 Dist; ///< RDO distortion 488 #else489 typedef Int Dist; ///< RDO distortion490 #endif491 464 typedef Int64 Dist64; 492 465 #define RDO_DIST_MIN MIN_INT … … 793 766 enum ScalabilityType 794 767 { 795 #if H_MV5796 768 #if H_3D 797 769 DEPTH_ID = 0, 798 770 #endif 799 771 VIEW_ORDER_INDEX = 1, 800 #else801 VIEW_ID = 0,802 #if H_3D803 DEPTH_ID = 1,804 #endif805 #endif806 772 }; 807 773 #endif
Note: See TracChangeset for help on using the changeset viewer.