Changeset 412 in 3DVCSoftware for branches/HTM-6.2-dev2-MERL
- Timestamp:
- 16 May 2013, 16:05:31 (12 years ago)
- Location:
- branches/HTM-6.2-dev2-MERL/source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-6.2-dev2-MERL/source/App/TAppDecoder/TAppDecTop.cpp
r296 r412 735 735 736 736 #if MERL_VSP_C0152 737 Void TAppDecTop::setBWVSPLUT(TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc) 737 Void TAppDecTop::setBWVSPLUT( 738 #if MERL_VSP_NBDV_RefVId_Fix_D0166 739 Int iNeighborViewId, 740 #endif 741 TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc) 742 738 743 { 739 744 //first view does not have VSP … … 742 747 AOT( iCodedViewIdx <= 0); 743 748 //AOT( iCodedViewIdx >= m_iNumberOfViews ); 749 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 744 750 Int iNeighborViewId = 0; 751 #endif 745 752 // Int* piShiftLUT = bRenderFromLeft ? m_cCamParsCollector.getBaseViewShiftLUTI()[iCodedViewIdx][iNeighborViewId][0] : m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx][0]; 746 753 Int* piShiftLUT = m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx][0]; 754 #if MERL_VSP_NBDV_RefVId_Fix_D0166 755 pcSlice->setBWVSPLUTParam(piShiftLUT, 2-LOG2_DISP_PREC_LUT, iNeighborViewId ); 756 #else 747 757 pcSlice->setBWVSPLUTParam(piShiftLUT, 2-LOG2_DISP_PREC_LUT ); 758 #endif 748 759 } 749 760 #endif -
branches/HTM-6.2-dev2-MERL/source/App/TAppDecoder/TAppDecTop.h
r296 r412 113 113 114 114 #if MERL_VSP_C0152 115 #if MERL_VSP_NBDV_RefVId_Fix_D0166 116 Void setBWVSPLUT( Int iNeighborViewId, TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc ); 117 #else 115 118 Void setBWVSPLUT( TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc ); 119 #endif 116 120 #endif 117 121 -
branches/HTM-6.2-dev2-MERL/source/App/TAppEncoder/TAppEncTop.cpp
r402 r412 1097 1097 pEncSlice->setRefPicBaseTxt(pcBaseTxtPic); 1098 1098 pEncSlice->setRefPicBaseDepth(pcBaseDepthPic); 1099 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1100 for (Int refViewId=0; refViewId < iViewIdx; refViewId++ ) 1101 { 1102 pEncSlice->setListDepthPic(m_acTEncDepthTopList[refViewId]->getListPic(), refViewId ); // The list will store only the depth pictures 1103 setBWVSPLUT(refViewId, iViewIdx, gopId, false); 1104 } 1105 #endif 1099 1106 } 1107 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 1100 1108 setBWVSPLUT( iViewIdx, gopId, false); 1109 #endif 1110 #endif 1111 1101 1112 #if MERL_VSP_C0152_BugFix_ForNoDepthCase 1102 1113 } … … 1113 1124 #endif 1114 1125 1115 #endif1116 1126 // call encoding function for one frame 1117 1127 m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId ); … … 1128 1138 TEncSlice* pcSlice = (TEncSlice*) m_acTEncDepthTopList[iViewIdx]->getSliceEncoder(); 1129 1139 pcSlice->setRefPicBaseDepth(pcBaseDepthPic); 1140 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1141 for (Int refViewId=0; refViewId < iViewIdx; refViewId++ ) 1142 { 1143 pcSlice->setListDepthPic(m_acTEncDepthTopList[refViewId]->getListPic(), refViewId ); // The list will store only the depth pictures 1144 setBWVSPLUT( refViewId, iViewIdx, gopId, true); 1145 } 1146 #endif 1130 1147 } 1148 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 1131 1149 setBWVSPLUT( iViewIdx, gopId, true); 1150 #endif 1132 1151 #endif 1133 1152 … … 1646 1665 1647 1666 #if MERL_VSP_C0152 1648 Void TAppEncTop::setBWVSPLUT(Int iCodedViewIdx, Int gopId, Bool isDepth) 1667 1668 Void TAppEncTop::setBWVSPLUT( 1669 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1670 Int iNeighborViewId, 1671 #endif 1672 Int iCodedViewIdx, Int gopId, Bool isDepth) 1649 1673 { 1650 1674 //first view does not have VSP … … 1653 1677 AOT( iCodedViewIdx <= 0); 1654 1678 AOT( iCodedViewIdx >= m_iNumberOfViews ); 1655 1679 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 1656 1680 Int iNeighborViewId = 0; 1681 #endif 1657 1682 //setting look-up table 1658 1683 Int* piShiftLUT = m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx][0]; … … 1661 1686 { 1662 1687 TEncSlice* pcEncSlice = (TEncSlice*) m_acTEncDepthTopList[iCodedViewIdx]->getSliceEncoder(); 1688 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1689 pcEncSlice->setBWVSPLUTParam( piShiftLUT, LOG2_DISP_PREC_LUT, iNeighborViewId ); 1690 #else 1663 1691 pcEncSlice->setBWVSPLUTParam( piShiftLUT, LOG2_DISP_PREC_LUT ); 1692 #endif 1664 1693 } 1665 1694 else 1666 1695 { 1667 1696 TEncSlice* pcEncSlice = (TEncSlice*) m_acTEncTopList[iCodedViewIdx]->getSliceEncoder(); 1697 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1698 pcEncSlice->setBWVSPLUTParam( piShiftLUT, LOG2_DISP_PREC_LUT, iNeighborViewId ); 1699 #else 1668 1700 pcEncSlice->setBWVSPLUTParam( piShiftLUT, LOG2_DISP_PREC_LUT ); 1701 #endif 1669 1702 } 1670 1703 -
branches/HTM-6.2-dev2-MERL/source/App/TAppEncoder/TAppEncTop.h
r296 r412 167 167 168 168 #if MERL_VSP_C0152 169 #if MERL_VSP_NBDV_RefVId_Fix_D0166 170 Void setBWVSPLUT( Int refViewIdx, Int iCodedViewIdx, Int gopId, Bool isDepth); 171 #else 169 172 Void setBWVSPLUT( Int iCodedViewIdx, Int gopId, Bool isDepth); 173 #endif 170 174 #endif 171 175 };// END CLASS DEFINITION TAppEncTop -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComDataCU.cpp
r399 r412 55 55 #define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && !( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] ) 56 56 57 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) 57 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo 58 #if MERL_VSP_NBDV_RefVId_Fix_D0166 59 , Int* iVSPDirTrue 60 #endif 61 ) 58 62 { 59 63 Int vspIdx = (Int) pcCURef->getVSPIndex(uiIdx); … … 69 73 if (vspIdx < 4) 70 74 { 75 #if MERL_VSP_NBDV_RefVId_Fix_D0166 76 if(pDInfo->iN > 0 ) 77 { // using derived disparity and store corresponding used reference list and ref idx 78 iVSPDirTrue[idx] = pDInfo->m_aListIdx[0]; 79 assert(pDInfo->m_aRefIdx[0] < 0); 80 #if MTK_VSP_USING_NBDV_D0105 81 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 82 #else 83 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 84 #endif 85 if ( pcCURef->getSlice()->isInterB() ) 86 { 87 #if MTK_VSP_USING_NBDV_D0105 88 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 89 #else 90 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 91 #endif 92 } 93 } 94 else 95 { // using the original neighboring block vsp reference list 96 TComMv cMvPred = pcCURef->getCUMvField(REF_PIC_LIST_0)->getMv(uiIdx); 97 Int refId = pcCURef->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiIdx); 98 99 assert(refId < 0); 100 iVSPDirTrue[idx] = pcCURef->getVSPDir(uiIdx); 101 pcMvFieldNeighbours[iCount<<1].setMvField( cMvPred, refId ); 102 if ( pcCURef->getSlice()->isInterB() ) 103 { 104 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cMvPred, refId ); 105 } 106 } 107 108 #else // !MERL_VSP_NBDV_RefVId_Fix_D0166 109 71 110 #if MTK_VSP_USING_NBDV_D0105 72 111 pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); … … 82 121 #endif 83 122 } 123 #endif 84 124 } 85 125 } … … 87 127 88 128 inline Bool TComDataCU::xAddVspMergeCand( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 89 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo ) 129 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo 130 #if MERL_VSP_NBDV_RefVId_Fix_D0166 131 , Int* iVspDirTrue 132 #endif 133 ) 90 134 { 91 135 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 … … 99 143 TComPic* pRefPicBaseDepth = NULL; 100 144 pRefPicBaseDepth = getSlice()->getRefPicBaseDepth(); 101 if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) // VSP can be used only when depth is used as input145 if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) // VSP can be used only when depth is used as input 102 146 #else 103 147 if( ucVspMergePos == VSP_MERGE_POS ) … … 120 164 if (vspIdx < 4) // spatial 121 165 { 166 #if MERL_VSP_NBDV_RefVId_Fix_D0166 167 assert(pDInfo->m_aRefIdx[0] < 0); 168 iVspDirTrue[idx] = pDInfo->m_aListIdx[0]; 169 170 #if MTK_VSP_USING_NBDV_D0105 171 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 172 #else 173 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 174 #endif 175 if ( getSlice()->isInterB() ) 176 { 177 #if MTK_VSP_USING_NBDV_D0105 178 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 179 #else 180 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 181 #endif 182 } 183 184 #else 185 122 186 #if MTK_VSP_USING_NBDV_D0105 123 187 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], NOT_VALID ); … … 133 197 #endif 134 198 } 199 #endif 135 200 } 136 201 iVSPIndexTrue[idx] = iCount; … … 178 243 #if MERL_VSP_C0152 179 244 m_piVSPIndex = NULL; 245 #if MERL_VSP_NBDV_RefVId_Fix_D0166 246 m_piVSPDir = NULL; 247 #endif 180 248 #endif 181 249 m_puhLumaIntraDir = NULL; … … 323 391 #if MERL_VSP_C0152 324 392 m_piVSPIndex = (Char* )xMalloc(Char, uiNumPartition); 393 #if MERL_VSP_NBDV_RefVId_Fix_D0166 394 m_piVSPDir = (Char* )xMalloc(Char, uiNumPartition); 395 #endif 325 396 #endif 326 397 #if H3D_IVRP … … 483 554 #if MERL_VSP_C0152 484 555 if ( m_piVSPIndex ) { xFree(m_piVSPIndex); m_piVSPIndex = NULL; } 556 #if MERL_VSP_NBDV_RefVId_Fix_D0166 557 if ( m_piVSPDir ) { xFree(m_piVSPDir ); m_piVSPDir = NULL; } 558 #endif 485 559 #endif 486 560 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } … … 688 762 #if MERL_VSP_C0152 689 763 m_piVSPIndex[ui] = pcFrom->m_piVSPIndex[ui]; 764 #if MERL_VSP_NBDV_RefVId_Fix_D0166 765 m_piVSPDir [ui] = pcFrom->m_piVSPDir [ui]; 766 #endif 690 767 #endif 691 768 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 731 808 #if MERL_VSP_C0152 732 809 memset( m_piVSPIndex + firstElement, 0, numElements * sizeof( *m_piVSPIndex ) ); 810 #if MERL_VSP_NBDV_RefVId_Fix_D0166 811 memset( m_piVSPDir + firstElement, 0, numElements * sizeof( *m_piVSPDir ) ); 812 #endif 733 813 #endif 734 814 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 908 988 #if MERL_VSP_C0152 909 989 m_piVSPIndex[ui] = 0; 990 #if MERL_VSP_NBDV_RefVId_Fix_D0166 991 m_piVSPDir [ui] = 0; 992 #endif 910 993 #endif 911 994 #if H3D_IVRP … … 1022 1105 #if MERL_VSP_C0152 1023 1106 memset( m_piVSPIndex, 0, iSizeInChar ); 1107 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1108 memset( m_piVSPDir , 0, iSizeInChar ); 1109 #endif 1024 1110 #endif 1025 1111 #if H3D_IVRP … … 1113 1199 #if MERL_VSP_C0152 1114 1200 m_piVSPIndex[ui]=pcCU->m_piVSPIndex[uiPartOffset+ui]; 1201 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1202 m_piVSPDir [ui]=pcCU->m_piVSPDir [uiPartOffset+ui]; 1203 #endif 1115 1204 #endif 1116 1205 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 1266 1355 #if MERL_VSP_C0152 1267 1356 m_piVSPIndex = pcCU->getVSPIndex() + uiPart; 1357 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1358 m_piVSPDir = pcCU->getVSPDir () + uiPart; 1359 #endif 1268 1360 #endif 1269 1361 #if H3D_IVRP … … 1437 1529 #if MERL_VSP_C0152 1438 1530 m_piVSPIndex = pcCU->getVSPIndex() + uiAbsPartIdx; 1531 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1532 m_piVSPDir = pcCU->getVSPDir () + uiAbsPartIdx; 1533 #endif 1439 1534 #endif 1440 1535 #if H3D_IVRP … … 1499 1594 #if MERL_VSP_C0152 1500 1595 memcpy( m_piVSPIndex + uiOffset, pcCU->getVSPIndex(), iSizeInChar ); 1596 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1597 memcpy( m_piVSPDir + uiOffset, pcCU->getVSPDir (), iSizeInChar ); 1598 #endif 1501 1599 #endif 1502 1600 #if H3D_IVRP … … 1648 1746 #if MERL_VSP_C0152 1649 1747 memcpy( rpcCU->getVSPIndex() + m_uiAbsIdxInLCU, m_piVSPIndex, iSizeInChar ); 1748 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1749 memcpy( rpcCU->getVSPDir () + m_uiAbsIdxInLCU, m_piVSPDir , iSizeInChar ); 1750 #endif 1650 1751 #endif 1651 1752 #if H3D_IVRP … … 1781 1882 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1782 1883 #if MERL_VSP_C0152 1783 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 1884 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 1885 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1886 memcpy( rpcCU->getVSPDir () + uiPartOffset, m_piVSPDir , iSizeInChar ); 1887 #endif 1784 1888 #endif 1785 1889 #if H3D_IVRP … … 3079 3183 setSubPart<Char>( iVSPIdx, m_piVSPIndex, uiAbsPartIdx, uiDepth, uiPartIdx ); 3080 3184 } 3081 #endif 3185 3186 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3187 Void TComDataCU::setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3188 { 3189 setSubPart<Char>( iVSPDir, m_piVSPDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 3190 } 3191 #endif 3192 3193 #endif // MERL_VSP_C0152 3082 3194 3083 3195 #if H3D_IVRP … … 3661 3773 */ 3662 3774 #if MERL_VSP_C0152 3663 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx ) 3775 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue 3776 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3777 , Int* iVSPDirTrue 3778 #endif 3779 , Int mrgCandIdx ) 3664 3780 #else 3665 3781 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) … … 3724 3840 #if H3D_NBDV 3725 3841 DisInfo cDisInfo; 3842 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3843 cDisInfo.bDV = false; // default setting 3844 cDisInfo.iN = 0; 3845 #endif 3846 3726 3847 #if !QC_CU_NBDV_D0181 3727 3848 cDisInfo.iN = 0; … … 3741 3862 cDisInfo.m_acMvCandNoRef[0] = getDvInfo(uiAbsPartIdx).m_acMvCandNoRef[0]; 3742 3863 #endif 3864 #if MERL_VSP_C0152 3865 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3866 cDisInfo.m_aListIdx[0] = getDvInfo(uiAbsPartIdx).m_aListIdx[0]; 3867 cDisInfo.m_aRefIdx[0] = getDvInfo(uiAbsPartIdx).m_aRefIdx[0]; 3868 #endif 3869 #endif 3743 3870 } 3744 3871 #else … … 3750 3877 #endif 3751 3878 } 3879 3752 3880 #if FCO_DVP_REFINE_C0132_C0170 3753 3881 if(getPic()->getDepthCoded() ) … … 3782 3910 #endif 3783 3911 } 3912 3913 #if MERL_VSP_NBDV_RefVId_Fix_D0166 && !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 3914 if (bNoPdmMerge && cDisInfo.bDV == false) 3915 { // purely for default setting 3916 cDisInfo.iN = 1; 3917 cDisInfo.m_acMvCand[0].setHor(0); 3918 cDisInfo.m_acMvCand[0].setVer(0); 3919 cDisInfo.m_acMvCandNoRef[0].setHor(0); 3920 cDisInfo.m_acMvCandNoRef[0].setVer(0); 3921 cDisInfo.m_aVIdxCan[0] = 0; 3922 3923 RefPicList eRefPicList = REF_PIC_LIST_0 ; 3924 Int refFrmIdx = 0; 3925 getRefListAndRefFrmIdx(0, eRefPicList, refFrmIdx); 3926 cDisInfo.m_aListIdx[0] = eRefPicList; 3927 cDisInfo.m_aRefIdx [0] = -1-refFrmIdx; 3928 } 3929 #endif 3784 3930 3785 3931 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 … … 3850 3996 #if MERL_VSP_C0152 3851 3997 #if !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 3852 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 3998 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 3999 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4000 , iVSPDirTrue 4001 #endif 4002 ) ; 3853 4003 #endif 3854 4004 #endif … … 3923 4073 } 3924 4074 3925 #endif // H3D_IVMP 4075 #endif // H3D_IVMP 3926 4076 3927 4077 #if MERL_VSP_COMPENSATION_C0152 3928 4078 //===== vsp 0 ===== 3929 4079 if( iCount < 4 + extraMergeCand ) 3930 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4080 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4081 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4082 , iVSPDirTrue 4083 #endif 4084 ) 4085 ) 3931 4086 return; 3932 4087 #endif … … 3996 4151 #endif 3997 4152 #if MERL_VSP_C0152 3998 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4153 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4154 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4155 , iVSPDirTrue 4156 #endif 4157 ); 3999 4158 #endif 4000 4159 if ( mrgCandIdx == iCount ) … … 4069 4228 #endif 4070 4229 #if MERL_VSP_C0152 4071 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4230 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4231 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4232 , iVSPDirTrue 4233 #endif 4234 ) ; 4072 4235 #endif 4073 4236 if ( mrgCandIdx == iCount ) … … 4118 4281 #endif 4119 4282 #if MERL_VSP_C0152 4120 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4283 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4284 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4285 , iVSPDirTrue 4286 #endif 4287 ) ; 4121 4288 #endif 4122 4289 if ( mrgCandIdx == iCount ) … … 4176 4343 #endif // H3D_IVMP 4177 4344 4178 4179 4345 //left bottom 4180 4346 UInt uiLeftBottomPartIdx = 0; … … 4214 4380 #endif 4215 4381 #if MERL_VSP_C0152 4216 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4382 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4383 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4384 , iVSPDirTrue 4385 #endif 4386 ) ; 4217 4387 #endif 4218 4388 if ( mrgCandIdx == iCount ) … … 4222 4392 iCount ++; 4223 4393 } 4224 4225 4394 4226 4395 // above left 4227 4396 #if H3D_IVMP … … 4269 4438 #endif 4270 4439 #if MERL_VSP_C0152 4271 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4440 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4441 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4442 , iVSPDirTrue 4443 #endif 4444 ) ; 4272 4445 #endif 4273 4446 if ( mrgCandIdx == iCount ) … … 4282 4455 //===== vsp 5 ===== 4283 4456 if( iCount < 4 + extraMergeCand ) 4284 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4457 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4458 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4459 , iVSPDirTrue 4460 #endif 4461 ) ) 4285 4462 return; 4286 4463 #endif … … 5150 5327 return iDisp; 5151 5328 } 5152 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 5329 5330 Void TComDataCU::estimateDVFromDM( 5331 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5332 Int refViewIdx, 5333 #endif 5334 UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 5153 5335 { 5154 5336 if (picDepth) … … 5164 5346 Int iShiftPrec; 5165 5347 5166 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec); 5348 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec 5349 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5350 , refViewIdx 5351 #endif 5352 ); 5167 5353 5168 5354 Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine ); … … 5193 5379 clipMv(cMvPred); 5194 5380 5195 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5381 TComPic* picDepth = NULL; 5382 #if MERL_VSP_C0152 5383 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5384 Int refPOC = getSlice()->getRefPic(eRefPicList, refId)->getPOC(); 5385 picDepth = getSlice()->getDepthRefPic(refViewIdx, refPOC); 5386 assert(refPOC == getSlice()->getPOC()); 5387 assert(picDepth != NULL); 5388 #else 5389 picDepth = getSlice()->getRefPicBaseDepth(); 5390 #endif 5391 #endif 5392 5196 5393 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5197 5394 pNbDvInfo->m_acMvCandNoRef[pNbDvInfo->iN] = cMvPred; 5198 5395 #endif 5199 5396 if (picDepth && bDepthRefine) 5200 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5201 5397 estimateDVFromDM( 5398 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5399 refViewIdx, 5400 #endif 5401 uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5402 5403 5404 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5405 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = eRefPicList; 5406 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refId; 5407 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0); 5408 #endif 5202 5409 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 5203 5410 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++ ] = refViewIdx; … … 5217 5424 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5218 5425 { 5219 TComPic* picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5426 TComPic* picDepth = NULL; 5427 5428 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5429 RefPicList privateRefPicList = (RefPicList) pcTmpCU->getVSPDir( uiIdx ); 5430 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 5431 Int refIdx = -1-pcTmpCU->getCUMvField( privateRefPicList )->getRefIdx( uiIdx ); // a trick when storing refIdx for temporal BVSP 5432 assert(refIdx >= 0); 5433 Int refViewIdx = getSlice()->getRefViewId(privateRefPicList, refIdx); 5434 Int refPOC = getSlice()->getRefPOC(privateRefPicList, refIdx); 5435 5436 picDepth = getSlice()->getDepthRefPic(refViewIdx, refPOC); 5437 assert(refPOC == getSlice()->getPOC()); 5438 assert(picDepth != NULL); 5439 #else 5440 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5441 #endif 5442 5220 5443 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5221 5444 pNbDvInfo->m_acMvCandNoRef[pNbDvInfo->iN] = cMvPred; 5222 5445 #endif 5223 5446 if (picDepth && bDepthRefine) 5224 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5447 estimateDVFromDM( 5448 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5449 refViewIdx, 5450 #endif 5451 uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5225 5452 5226 5453 cMvPred.setVer(0); 5227 5454 5455 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5456 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refIdx; 5457 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = privateRefPicList; 5458 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 5459 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN ] = refViewIdx; 5460 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0); 5461 pNbDvInfo->iN++; 5462 #else 5228 5463 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN] = cMvPred; 5229 5464 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++] = 0; // refViewIdx; 5465 #endif 5230 5466 return true; 5231 5467 } … … 5281 5517 } 5282 5518 } 5519 5520 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5521 Bool TComDataCU::getRefListAndRefFrmIdx(Int targetRefViewIdx, RefPicList& eRefPicList, Int& refFrmIdx) 5522 { 5523 Bool isFound = false; 5524 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 5525 5526 refFrmIdx = 0; 5527 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1) && isFound == false; iList++) 5528 { 5529 privateRefPicList = RefPicList(iList); 5530 for (Int refIdx = 0; refIdx < getSlice()->getNumRefIdx(privateRefPicList); refIdx++) 5531 { 5532 Int refViewIdx = getSlice()->getRefViewId( privateRefPicList, refIdx); 5533 if ( refViewIdx == targetRefViewIdx) 5534 { 5535 refFrmIdx = refIdx; 5536 eRefPicList = privateRefPicList; 5537 isFound = true; 5538 break; 5539 } 5540 } 5541 } 5542 5543 return isFound; 5544 } 5545 #endif 5283 5546 5284 5547 #if QC_CU_NBDV_D0181 … … 5381 5644 { 5382 5645 clipMv(cColMv); 5383 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5646 TComPic* picDepth = NULL; 5647 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5648 Int currPoc = getSlice()->getPOC(); 5649 picDepth = getSlice()->getDepthRefPic(iTargetViewIdx, currPoc); 5650 assert(picDepth!=NULL); 5651 #else 5652 picDepth = getSlice()->getRefPicBaseDepth(); 5653 #endif 5384 5654 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5385 5655 pDInfo->m_acMvCandNoRef[pDInfo->iN] = cColMv; 5386 5656 #endif 5387 5657 if (picDepth && bDepthRefine) 5658 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5659 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5660 #else 5388 5661 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5389 5390 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5662 #endif 5663 5664 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5665 Int refFrmIdx = 0; 5666 RefPicList privateRefPicList = REF_PIC_LIST_0; 5667 getRefListAndRefFrmIdx(iTargetViewIdx, privateRefPicList, refFrmIdx); 5668 5669 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 5670 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 5671 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 5672 #endif 5673 pDInfo->m_acMvCand[ pDInfo->iN ] = cColMv; 5391 5674 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5392 5675 #if QC_CU_NBDV_D0181 … … 5536 5819 clipMv( cDispVec ); 5537 5820 5538 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5821 TComPic* picDepth = NULL; 5822 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5823 Int refPOC = getSlice()->getPOC(); 5824 picDepth = getSlice()->getDepthRefPic(0, refPOC); 5825 assert(picDepth!=NULL); 5826 #else 5827 picDepth = getSlice()->getRefPicBaseDepth(); 5828 #endif 5829 5539 5830 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5540 5831 pDInfo->m_acMvCandNoRef[pDInfo->iN] = cDispVec; 5541 5832 #endif 5542 5833 if (picDepth && bDepthRefine) 5834 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5835 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); // from base view 5836 #else 5543 5837 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); 5544 5545 pDInfo->m_acMvCand[ pDInfo->iN] = cDispVec; 5838 #endif 5839 5840 #if MERL_VSP_NBDV_RefVId_Fix_D0166 //if DVMCP is used, do a local reference frame list and idx search 5841 Int refFrmIdx = 0; 5842 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 5843 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 5844 5845 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 5846 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 5847 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 5848 #endif 5849 5850 pDInfo->m_acMvCand[ pDInfo->iN ] = cDispVec; 5546 5851 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 5547 5852 #if !QC_CU_NBDV_D0181 … … 5560 5865 TComMv defaultDV(0, 0); 5561 5866 5867 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5868 Int refPOC = getSlice()->getPOC(); 5869 picDepth = getSlice()->getDepthRefPic(0, refPOC); 5870 assert(picDepth!=NULL); 5871 #else 5562 5872 picDepth = getSlice()->getRefPicBaseDepth(); 5873 #endif 5874 5875 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 // TODO: CHECK if the macro is right 5876 pDInfo->m_acMvCandNoRef[pDInfo->iN] = defaultDV; 5877 #endif 5563 5878 5564 5879 if (picDepth && bDepthRefine) 5565 5880 { 5881 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5882 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV, true); // from base view 5883 #else 5566 5884 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &defaultDV, true); 5567 } 5568 5885 #endif 5886 } 5887 5888 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5889 Int refFrmIdx = 0; 5890 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 5891 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 5892 5893 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 5894 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 5895 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 5896 5897 #endif 5569 5898 pDInfo->m_acMvCand[pDInfo->iN] = defaultDV; 5570 5899 pDInfo->m_aVIdxCan[pDInfo->iN] = 0; 5900 #if MERL_VSP_NBDV_RefVId_Fix_D0166 // Bug fix for Samsung code. 5901 pDInfo->iN++; 5902 #endif 5571 5903 } 5572 5904 #endif … … 7354 7686 #if MERL_VSP_C0152 && MTK_UNCONSTRAINED_MVI_B0083 7355 7687 memcpy( m_piVSPIndex + uiAbsPartIdxDst, pcCU->getVSPIndex() + uiAbsPartIdxSrc, sizeof( m_piVSPIndex[0] ) * uiNumPartition ); 7688 #endif 7689 #if MERL_VSP_NBDV_RefVId_Fix_D0166 7690 memcpy( m_piVSPDir + uiAbsPartIdxDst, pcCU->getVSPDir () + uiAbsPartIdxSrc, sizeof( m_piVSPDir [0] ) * uiNumPartition ); 7356 7691 #endif 7357 7692 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComDataCU.h
r373 r412 195 195 ///< value 0: non-VSP, value 1: VSP 196 196 #endif 197 #if MERL_VSP_NBDV_RefVId_Fix_D0166 198 Char* m_piVSPDir; ///< 0: LIST0; 1: LIST1 199 #endif 197 200 #if AMP_MRG 198 201 Bool m_bIsMergeAMP; … … 280 283 #if MERL_VSP_C0152 281 284 inline Bool xAddVspMergeCand ( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 282 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo ); 283 inline Void xInheritVspMode ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) ; 285 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo 286 #if MERL_VSP_NBDV_RefVId_Fix_D0166 287 , Int* iVspDirTrue = NULL 288 #endif 289 ); 290 inline Void xInheritVspMode ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo 291 #if MERL_VSP_NBDV_RefVId_Fix_D0166 292 ,Int *iVSPDirTrue 293 #endif 294 ) ; 284 295 #endif 285 296 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); … … 477 488 Void setVSPIndex ( UInt uiIdx, Int n ) { m_piVSPIndex[uiIdx] = n; } 478 489 Void setVSPIndexSubParts( Char bVSPIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 490 #endif 491 #if MERL_VSP_NBDV_RefVId_Fix_D0166 492 Char* getVSPDir () { return m_piVSPDir; } 493 Char getVSPDir ( UInt uiIdx ) { return m_piVSPDir[uiIdx]; } 494 Void setVSPDir ( UInt uiIdx, Int n ) { m_piVSPDir[uiIdx] = n; } 495 Void setVSPDirSubParts ( Char bVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 496 Bool getRefListAndRefFrmIdx(Int targetRefViewIdx, RefPicList& eRefPicList, Int& refFrmIdx); 479 497 #endif 480 498 … … 576 594 #if MERL_VSP_C0152 577 595 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine = false); 578 Void estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false); 596 Void estimateDVFromDM( 597 #if MERL_VSP_NBDV_RefVId_Fix_D0166 598 Int refViewIdx, 599 #endif 600 UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false); 579 601 #endif 580 602 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); … … 682 704 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 683 705 #if MERL_VSP_C0152 684 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, Int mrgCandIdx = -1 ); 706 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, 707 #if MERL_VSP_NBDV_RefVId_Fix_D0166 708 Int* iVSPDir, 709 #endif 710 Int mrgCandIdx = -1 ); 685 711 #else 686 712 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComMotionInfo.h
r351 r412 71 71 #endif 72 72 Int iN; ///< number of motion vector predictor candidates 73 #if MERL_VSP_NBDV_RefVId_Fix_D0166 74 Int m_aListIdx[ DIS_CANS ]; ///< array of reference list of derived NBDV 75 Int m_aRefIdx [ DIS_CANS ]; ///< array of reference frame index corresponding to either RefList0/1 76 #endif 73 77 } DisInfo; 74 78 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.cpp
r402 r412 789 789 790 790 #if MERL_VSP_C0152 791 // Function to perform VSP block compensation 792 Void TComPrediction::xPredInterVSPBlk(TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComMv cMv, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 793 { 794 TComPic* pRefPicBaseTxt = NULL; 795 TComPicYuv* pcBaseViewTxtPicYuv = NULL; 796 TComPicYuv* pcBaseViewDepthPicYuv = NULL; 797 Int iBlkX = 0; 798 Int iBlkY = 0; 799 Int* pShiftLUT; 800 Int iShiftPrec; 801 802 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 803 pRefPicBaseTxt = pcCU->getSlice()->getRefPicBaseTxt(); 804 pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 805 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); 806 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 807 808 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 809 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 810 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec); 811 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred ); 812 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred ); 813 814 #else // MERL_VSP_NBDV_RefVId_Fix_D0166 815 816 //recover VSP reference frame according to negative refIdx number 817 RefPicList privateRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 818 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 819 820 // Step 1: get depth reference 821 Int refIdx = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); // texture ref index, a trick when storing refIdx 822 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, refIdx); // texture view id 823 Int refPoc = pcCU->getSlice()->getRefPOC(privateRefPicList, refIdx); // texture POC 824 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getDepthRefPic(viewId, refPoc); 825 826 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 827 assert(refPoc == pcCU->getSlice()->getPOC()); 828 assert(pRefPicBaseDepth != NULL); 829 assert(pcBaseViewDepthPicYuv != NULL); 830 831 iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 832 iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 833 #if MERL_Bi_VSP_D0166 834 // Step 2: get texture reference 835 pRefPicBaseTxt = xGetVspRefTxt( pcCU, uiPartAddr, eRefPicList); 836 pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 837 assert(pcBaseViewTxtPicYuv != NULL); 838 839 //initialize the LUT according to the reference view idx 840 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec, pRefPicBaseTxt->getViewId()); 841 842 // Step 3: Do compensation 843 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred, bi ); 844 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred, bi ); 845 #else 846 // Step 2: get texture reference 847 pRefPicBaseTxt = pcCU->getSlice()->getRefPic(privateRefPicList, refIdx); 848 pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 849 assert(pcBaseViewTxtPicYuv != NULL); 850 851 //initialize the LUT according to the reference view idx 852 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec, pRefPicBaseTxt->getViewId()); 853 854 // Step 3: Do compensation 855 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred ); 856 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred ); 857 #endif 858 859 #endif 860 } 861 862 863 864 #if MERL_Bi_VSP_D0166 865 TComPic* TComPrediction::xGetVspRefTxt(TComDataCU* pcCU, UInt uiPartAddr, RefPicList eRefPicList) 866 { 867 RefPicList privateRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 868 Int refIdx = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); // texture ref index, a trick when storing refIdx 869 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, refIdx); // texture view id 870 TComPic* refPic = NULL; 871 872 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 873 874 if (privateRefPicList == eRefPicList) 875 { 876 Int refIdxt = -1-pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 877 assert(refIdxt>= 0); 878 refPic = pcCU->getSlice()->getRefPic(eRefPicList, refIdxt); 879 } 880 else 881 { 882 // Find the other interview reference in order to do VSP 883 RefPicList otherRefPicList = privateRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 884 Bool IsFound = false; 885 for (Int irefIdx = 0; irefIdx <pcCU->getSlice()->getNumRefIdx(otherRefPicList); irefIdx ++ ) 886 { 887 Int refViewIdx = pcCU->getSlice()->getRefViewId( otherRefPicList, irefIdx); 888 if ( (refViewIdx != pcCU->getSlice()->getViewId()) && (refViewIdx != viewId ) ) 889 { 890 refPic = pcCU->getSlice()->getRefPic(otherRefPicList, irefIdx); 891 IsFound = true; 892 break; 893 } 894 } 895 896 if (IsFound == false) 897 { 898 Int refIdxtxt = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 899 assert(refIdxtxt >= 0); 900 refPic = pcCU->getSlice()->getRefPic(privateRefPicList, refIdxtxt); 901 } 902 assert(IsFound); 903 } 904 assert(refPic != NULL); 905 return refPic; 906 } 907 #endif 908 #endif 909 910 #if MERL_VSP_C0152 791 911 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi ) 792 912 #else … … 829 949 #endif 830 950 #if QC_ARP_D0177 831 if( pcCU->getSlice()->getSPS()->isDepth() == false 951 if( 952 #if MERL_VSP_C0152 953 vspIdx == 0 && // TODO: Maybe logically redundant, but easier to read 954 #endif 955 pcCU->getSlice()->getSPS()->isDepth() == false 832 956 && pcCU->getSlice()->getSPS()->getViewId() > 0 833 957 && pcCU->getSlice()->getSPS()->getUseAdvRP() > 0 … … 847 971 #if MERL_VSP_C0152 848 972 if (vspIdx != 0) 849 { // depth, vsp 850 // get depth estimator here 851 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); 852 TComPicYuv* pcBaseViewDepthPicYuv = NULL; 853 if (vspIdx < 4) // spatial 854 { 855 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 856 } 857 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 858 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 859 Int* pShiftLUT; 860 Int iShiftPrec; 861 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec); 862 //using disparity to find the depth block of the base view as the depth block estimator of the current block 863 //using depth block estimator and base view texture to get Backward warping 864 xPredInterLumaBlkFromDM ( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 865 xPredInterChromaBlkFromDM( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 973 { // depth, vsp compensation 974 xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi ); 866 975 } 867 976 else … … 886 995 #endif// MERL_VSP_C0152 //else 887 996 } 888 else 997 else // texture 889 998 { 890 999 #endif 891 1000 #if MERL_VSP_C0152 892 1001 if ( vspIdx != 0 ) 893 { // texture, vsp 894 TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPicBaseTxt(); 895 TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 896 TComPicYuv* pcBaseViewDepthPicYuv = NULL; 897 if (vspIdx < 4) // spatial 898 { 899 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); 900 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 901 } 902 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseTxt->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 903 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseTxt->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 904 Int* pShiftLUT; 905 Int iShiftPrec; 906 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec); 907 908 //using disparity to find the depth block of the base view as the depth block estimator of the current block 909 //using depth block estimator and base view texture to get Backward warping 910 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 911 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1002 { // texture, vsp compensation 1003 xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi ); 912 1004 } 913 1005 else//texture not VSP … … 1072 1164 Int iRefIdx[2] = {-1, -1}; 1073 1165 1166 #if MERL_Bi_VSP_D0166 1167 Bool biDecision = 0; 1168 Int predDirVSP = 0; 1169 if (pcCU->getVSPIndex(uiPartAddr) != 0) // is VSP 1170 { 1171 Int Bi_VSP_Avail = 0; 1172 //test whether VSP is Bi or Uni 1173 //Step1. Get derived DV view id 1174 RefPicList privateRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 1175 RefPicList otherRefPicList = privateRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1176 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 1177 Int refIdx = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 1178 assert(refIdx >= 0); 1179 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, refIdx); 1180 Int refPoc = pcCU->getSlice()->getRefPOC(privateRefPicList, refIdx); 1181 1182 assert(refPoc == pcCU->getSlice()->getPOC()); 1183 // if(refPoc != pcCU->getSlice()->getPOC() ) 1184 // { 1185 // printf("refPOC= %d, and current POC=%d\n", refPoc, pcCU->getSlice()->getPOC() ); 1186 // } 1187 //Step 2. Get initial prediction direction value according to reference picture list availability 1188 Int iInterDir = ((pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 : 1189 (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2)); 1190 //Step 3. Check the availability of Bi VSP by checking the interview reference availability in the other reference list 1191 if(iInterDir==3) 1192 { 1193 for (Int irefIdx = 0; irefIdx <pcCU->getSlice()->getNumRefIdx(otherRefPicList); irefIdx ++ ) 1194 { 1195 Int refViewIdx = pcCU->getSlice()->getRefViewId( otherRefPicList, irefIdx); 1196 if ( (refViewIdx != pcCU->getSlice()->getViewId()) && (refViewIdx != viewId ) ) 1197 { 1198 Bi_VSP_Avail = 1; 1199 break; 1200 } 1201 } 1202 } 1203 //Step 4. Update the Bi VSP prediction direction 1204 if ( iInterDir == 3 && Bi_VSP_Avail == 1) 1205 { 1206 biDecision = 1; 1207 predDirVSP = 3; 1208 } 1209 else 1210 { 1211 biDecision = 0; 1212 if ( privateRefPicList == REF_PIC_LIST_0 ) 1213 predDirVSP = 1; 1214 else 1215 predDirVSP = 2; 1216 } 1217 } 1218 else 1219 {//not VSP 1220 if( ( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) ) 1221 biDecision = 1; 1222 else 1223 biDecision = 0; 1224 } 1225 #endif 1226 1074 1227 for ( Int iRefList = 0; iRefList < 2; iRefList++ ) 1075 1228 { … … 1087 1240 else 1088 1241 { 1242 1243 #if !MERL_Bi_VSP_D0166 //both lists should go 1089 1244 if ( iRefList== REF_PIC_LIST_1 && iRefIdx[iRefList] < 0 ) // iRefIdx[iRefList] ==NOT_VALID 1090 1245 { 1091 1246 continue; 1092 1247 } 1248 #else 1249 //Reference list loop termination 1250 RefPicList privateVSPRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 1251 if( (pcCU->getVSPIndex(uiPartAddr)!=0) && iRefList != privateVSPRefPicList && !biDecision ) 1252 {//when VSP mode, if it is uni prediction, the other reference list should skip 1253 continue; 1254 } 1255 #endif 1256 1093 1257 } 1094 1258 #else … … 1102 1266 1103 1267 pcMbYuv = &m_acYuvPred[iRefList]; 1268 1269 #if MERL_Bi_VSP_D0166 1270 if(biDecision==1) 1271 #else 1104 1272 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 1273 #endif 1105 1274 { 1106 1275 #if MERL_VSP_C0152 … … 1142 1311 { 1143 1312 #if MERL_VSP_C0152 1313 #if !MERL_Bi_VSP_D0166 1144 1314 if(pcCU->getVSPIndex(uiPartAddr)) 1145 1315 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1146 1316 else 1147 1317 #endif 1318 #endif 1148 1319 xWeightedPredictionBi( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1149 1320 } … … 1153 1324 { 1154 1325 #if MERL_VSP_C0152 1326 #if !MERL_Bi_VSP_D0166 1155 1327 if(pcCU->getVSPIndex(uiPartAddr)) 1156 1328 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1157 1329 else 1158 1330 #endif 1331 #endif 1159 1332 xWeightedPredictionUni( pcCU, &m_acYuvPred[0], uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, rpcYuvPred, iPartIdx ); 1160 1333 } … … 1169 1342 { 1170 1343 #if MERL_VSP_C0152 1344 #if !MERL_Bi_VSP_D0166 1171 1345 if(pcCU->getVSPIndex(uiPartAddr)) 1172 1346 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1173 1347 else 1174 #endif 1348 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1349 #else 1350 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, predDirVSP ); 1351 #endif 1352 #else 1175 1353 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1354 #endif 1176 1355 } 1177 1356 } … … 1507 1686 // 1508 1687 // Output: dstPic, PU predictor 64x64 1509 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 1510 , TComYuv *&dstPic ) 1688 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, TComYuv *&dstPic 1689 #if MERL_Bi_VSP_D0166 1690 , Bool bi 1691 #endif 1692 ) 1511 1693 { 1512 1694 Int widthLuma; … … 1730 1912 1731 1913 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 1914 #if MERL_Bi_VSP_D0166 1915 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi ); 1916 #else 1732 1917 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true ); 1918 #endif 1919 1733 1920 } 1734 1921 ref += refStride*nTxtPerDepthY; … … 1738 1925 yDepth++; 1739 1926 #endif 1740 } 1741 } 1742 1743 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 1744 , TComYuv *&dstPic ) 1927 1928 } 1929 } 1930 1931 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, TComYuv *&dstPic 1932 #if MERL_Bi_VSP_D0166 1933 , Bool bi 1934 #endif 1935 ) 1745 1936 { 1746 1937 Int refStride = refPic->getCStride(); … … 1808 1999 Int depStrideBlock = depStride * nDepthPerTxtY; 1809 2000 1810 if (isDepth)1811 {1812 // DT: Since the call for this function is redundant, ..1813 for (Int y = 0; y < size_y; y++)1814 {1815 for (Int x = 0; x < size_x; x++)1816 {1817 dstCb[x] = 128;1818 dstCr[x] = 128;1819 }1820 dstCb += dstStride;1821 dstCr += dstStride;1822 }1823 return;1824 }1825 1826 2001 if ( widthChroma > widthDepth ) // We assume 1827 2002 { … … 2014 2189 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 2015 2190 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 2191 #if MERL_Bi_VSP_D0166 2192 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2193 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2194 #else 2016 2195 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true); 2017 2196 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true); 2197 #endif 2198 2018 2199 } 2019 2200 refCb += refStrideBlock; … … 2024 2205 } 2025 2206 } 2207 2026 2208 } 2027 2209 … … 2031 2213 Void TComPrediction::xWeightedAveragePdm( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ) 2032 2214 { 2215 2033 2216 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 2034 2217 { … … 2050 2233 #endif 2051 2234 2052 Void TComPrediction::xWeightedAverage( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ) 2053 { 2235 Void TComPrediction::xWeightedAverage( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst 2236 #if MERL_Bi_VSP_D0166 2237 , Int predDirVSP 2238 #endif 2239 ) 2240 { 2241 #if MERL_Bi_VSP_D0166 2242 Bool isVSP = 0; 2243 if (pcCU->getVSPIndex(uiPartIdx)!=0)//is VSP 2244 { 2245 isVSP = 1; 2246 } 2247 2248 if(( !isVSP && iRefIdx0 >= 0 && iRefIdx1 >= 0 ) || ( isVSP && predDirVSP == 3 )) 2249 #else 2054 2250 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 2251 #endif 2055 2252 { 2056 2253 rpcYuvDst->addAvg( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight ); 2057 2254 } 2255 #if MERL_Bi_VSP_D0166 2256 else if ( ( !isVSP && iRefIdx0 >= 0 && iRefIdx1 < 0 ) || ( isVSP && predDirVSP == 1)) 2257 #else 2058 2258 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 2259 #endif 2059 2260 { 2060 2261 pcYuvSrc0->copyPartToPartYuv( rpcYuvDst, uiPartIdx, iWidth, iHeight ); 2061 2262 } 2263 #if MERL_Bi_VSP_D0166 2264 else if (( !isVSP && iRefIdx0 < 0 && iRefIdx1 >= 0 ) || ( isVSP && predDirVSP == 2)) 2265 #else 2062 2266 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 2267 #endif 2063 2268 { 2064 2269 pcYuvSrc1->copyPartToPartYuv( rpcYuvDst, uiPartIdx, iWidth, iHeight ); 2065 2270 } 2271 #if MERL_Bi_VSP_D0166 2272 else 2273 {//for debug test only 2274 assert(0); 2275 } 2276 #endif 2066 2277 } 2067 2278 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComPrediction.h
r402 r412 115 115 ); 116 116 117 #if MERL_VSP_C0152118 Void xPredInterUniBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi=false );119 Void xPredInterBiBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );120 #endif121 122 117 #if DEPTH_MAP_GENERATION 123 118 Void xWeightedAveragePdm ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); … … 151 146 ); 152 147 #endif 148 149 #if MERL_Bi_VSP_D0166 150 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, Int predDir); 151 #else 153 152 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 154 155 #if MERL_VSP_C0152 156 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 157 , TComYuv *&dstPic ); 158 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 159 , TComYuv *&dstPic ); 153 #endif 154 #if MERL_VSP_C0152 155 Void xPredInterVSPBlk(TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComMv cMv, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ); 156 #if MERL_Bi_VSP_D0166 157 TComPic* xGetVspRefTxt(TComDataCU* pcCU, UInt uiPartAddr, RefPicList eRefPicList); 158 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, 159 TComYuv *&dstPic, Bool bi); 160 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, 161 TComYuv *&dstPic, Bool bi); 162 #else 163 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, 164 TComYuv *&dstPic ); 165 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, 166 TComYuv *&dstPic ); 167 #endif 160 168 #endif 161 169 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComSlice.cpp
r373 r412 119 119 #endif 120 120 { 121 #if MERL_VSP_NBDV_RefVId_Fix_D0166 122 for(Int iNumCount = 0; iNumCount < MAX_VIEW_NUM; iNumCount++) 123 m_pcListDepthPic[iNumCount] =NULL; 124 #endif 121 125 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 122 126 … … 1386 1390 } 1387 1391 #endif 1392 1393 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1394 TComPic* TComSlice::getDepthRefPic(Int viewId, Int poc) 1395 { 1396 TComPic* pPic = NULL; 1397 1398 if (m_pcListDepthPic[viewId] == NULL) 1399 return NULL; 1400 1401 for( TComList<TComPic*>::iterator it = m_pcListDepthPic[viewId]->begin(); it != m_pcListDepthPic[viewId]->end(); it++ ) 1402 { 1403 TComPic* currPic = *it; 1404 TComSlice* currSlice = currPic->getCurrSlice(); 1405 Bool isDepth = currSlice->getIsDepth(); 1406 //assert(isDepth); 1407 if( isDepth && currPic->getPOC() == poc && currPic->getViewId() == viewId ) // (*it)->getSPS()->isDepth() 1408 { 1409 pPic = *it; 1410 break; 1411 } 1412 } 1413 1414 return pPic; 1415 } 1416 #endif 1417 1418 1388 1419 #if QC_ARP_D0177 1389 1420 Void TComSlice::setARPStepNum() -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TComSlice.h
r373 r412 1119 1119 Bool m_bApplyIC; 1120 1120 #endif 1121 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1122 TComList<TComPic*>* m_pcListDepthPic[MAX_VIEW_NUM]; // For encoder, the list may also include texture pictures. Three views with ViewIdx = 0, 1, 2 1123 #endif 1121 1124 #if QC_ARP_D0177 1122 1125 TComList<TComPic*> * m_pBaseViewRefPicList[MAX_VIEW_NUM]; … … 1131 1134 TComPic* m_apcRefPicBaseTxt; 1132 1135 TComPic* m_apcRefPicBaseDepth; 1136 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1137 Int* m_aiShiftLUT[2]; // For reference views 1138 #else 1133 1139 Int* m_aiShiftLUT; 1140 #endif 1134 1141 Int m_iShiftPrec; 1135 1142 #endif … … 1439 1446 TComPic* getRefPicBaseDepth () { return m_apcRefPicBaseDepth; } 1440 1447 Void setRefPicBaseDepth ( TComPic* RefPic) { m_apcRefPicBaseDepth = RefPic; } 1441 1448 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1449 Void setBWVSPLUTParam( Int *pShiftLUT, Int iLoG2LUTPrec, Int iNeighborViewId) { m_aiShiftLUT[iNeighborViewId] = pShiftLUT; m_iShiftPrec = iLoG2LUTPrec; } 1450 Void getBWVSPLUTParam( Int*&pShiftLUT, Int&iLoG2LUTPrec, Int iNeighborViewId) { pShiftLUT = m_aiShiftLUT[iNeighborViewId]; iLoG2LUTPrec = m_iShiftPrec; } 1451 #else 1442 1452 Void setBWVSPLUTParam( Int *pShiftLUT, Int iLoG2LUTPrec) { m_aiShiftLUT = pShiftLUT; m_iShiftPrec = iLoG2LUTPrec; } 1443 1453 Void getBWVSPLUTParam( Int*&pShiftLUT, Int&iLoG2LUTPrec) { pShiftLUT = m_aiShiftLUT; iLoG2LUTPrec = m_iShiftPrec; } 1454 #endif 1455 #endif 1456 1457 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1458 Void setListDepthPic( TComList<TComPic*>* pListDepthPic, Int viewId) { m_pcListDepthPic[viewId] = pListDepthPic; } 1459 TComList<TComPic*>* getListDepthPic(Int viewId) { return m_pcListDepthPic[viewId]; } 1460 TComPic* getDepthRefPic(Int viewId, Int poc); 1461 TComPic* getDepthRefPic(Int refIdx); 1444 1462 #endif 1445 1463 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibCommon/TypeDef.h
r402 r412 182 182 183 183 ///// ***** VSP ********* 184 #define MERL_VSP_C0152 1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools185 // LGE_SIMP_DVP_REFINE_C0112186 // MERL_MTK_VSP_DVP_REFINE_C0152_C0131184 #define MERL_VSP_C0152 1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools 185 // LGE_SIMP_DVP_REFINE_C0112 186 // MERL_MTK_VSP_DVP_REFINE_C0152_C0131 187 187 #if MERL_VSP_C0152 188 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 1// MERL bugfix for test condition of no depth 189 /* 190 * Two macros are used to configure combinations of JCT3V-C0152 and JCT3V-C0131 191 * 192 * a) (full) A full JCT3V-C0152 implementation, including JCT3V-C0131 193 * #define MERL_VSP_COMPENSATION_C0152 1 194 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 1 195 * 196 * b) (mvp2off) For partial JCT3V-C0152 excluding overlaps from JCT3V-C0131 197 * #define MERL_VSP_COMPENSATION_C0152 1 198 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 0 199 * 200 * c) (nocand) For JCT3V-C0131 only 201 * #define MERL_VSP_COMPENSATION_C0152 0 202 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 1 203 */ 204 205 #define MERL_VSP_COMPENSATION_C0152 1 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add (nocand). 206 207 208 #define MERL_VSP_BLOCKSIZE_C0152 1 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 188 189 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 1 // MERL bugfix for test condition of no depth 190 #define MERL_VSP_COMPENSATION_C0152 1 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add (nocand). 191 192 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 209 193 #if MERL_VSP_BLOCKSIZE_C0152 == 1 210 #define MERL_CVSP_D0165 1 // JCT3V-D0165: 1:enable CVSP; 0: disable CVSP. 194 #define MERL_CVSP_D0165 1 // JCT3V-D0165: 1: enable CVSP; 0: disable CVSP. 195 #else 196 #define MERL_CVSP_D0165 0 // JCT3V-D0165: 1: enable CVSP; 0: disable CVSP. 211 197 #endif 212 198 213 199 #define VSP_MERGE_POS 5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5. 214 // MTK_DVPREFINE_BVSP_BUG_FIX 1200 // MTK_DVPREFINE_BVSP_BUG_FIX 1 215 201 #define MTK_DEPTH_TO_DISP_D0138 1 // JCT3V-D0138: Use max among four corners for DoNBDV and BVSP 202 203 #define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 1 // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map 204 #define MTK_VSP_USING_NBDV_D0105 1 // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP 205 206 #define MERL_VSP_NBDV_RefVId_Fix_D0166 1 // JCT3V-D0166: 1: fix the NBDV with ref view selectioin; 0: always use base view with refViewIdx=0 207 #if MERL_VSP_NBDV_RefVId_Fix_D0166 208 #define MERL_Bi_VSP_D0166 0 // JCT3V-D0166: 1: add supporting for Bi-VSP, the code under the macro can also handle uni-direction VSP 209 #endif 216 210 217 211 #else // !MERL_VSP_C0152 218 212 #define MERL_VSP_COMPENSATION_C0152 0 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add 219 213 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 220 #endif 221 222 #define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 1 // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map 223 #define MTK_VSP_USING_NBDV_D0105 1 // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP 214 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 0 // MERL bugfix for test condition of no depth 215 define MERL_CVSP_D0165 0 // JCT3V-D0165: 1: enable CVSP; 0: disable CVSP. 216 #define MERL_VSP_NBDV_RefVId_Fix_D0166 0 // JCT3V-D0166: 1: fix the NBDV with ref view selectioin; 0: always use base view with refViewIdx=0 217 #define MERL_Bi_VSP_D0166 0 // JCT3V-D0166: 1: add supporting for Bi-VSP, the code under the macro can also handle uni-direction VSP 218 #define MTK_VSP_USING_NBDV_D0105 0 219 #endif 224 220 225 221 ///// ***** DERIVED PARAMETERS ********* -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibDecoder/TDecCu.cpp
r402 r412 393 393 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 394 394 #if MERL_VSP_C0152 395 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 396 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 395 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui ); 396 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx ); 397 #endif 398 #if MERL_VSP_NBDV_RefVId_Fix_D0166 399 Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui ); 400 pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir ); 397 401 #endif 398 402 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP ); … … 412 416 #if MERL_VSP_C0152 413 417 Int iVSPIndexTrue[3] = {-1, -1, -1}; 418 #if MERL_VSP_NBDV_RefVId_Fix_D0166 419 Int iVSPDirTrue[3] = {-1, -1, -1}; 420 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex ); 421 #else 414 422 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 423 #endif 415 424 { 416 425 Int iVSPIdx = 0; … … 425 434 } 426 435 } 427 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 436 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth ); // Initialize 437 #if MERL_VSP_NBDV_RefVId_Fix_D0166 438 pcCU->setVSPDirSubParts( iVSPDirTrue[iVSPIdx-1], uiAbsPartIdx, 0, uiDepth ); 439 #endif 428 440 } 429 441 #else … … 530 542 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 531 543 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 544 #endif 545 #if MERL_VSP_NBDV_RefVId_Fix_D0166 546 if (pcCU->getSlice()->getIsDepth()) { 547 pcCU->setVSPDir( uiAbsPartIdx + ui, 0); 548 } 549 else { 550 Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui); 551 pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir); 552 } 532 553 #endif 533 554 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER ); -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibDecoder/TDecEntropy.cpp
r373 r412 321 321 #if MERL_VSP_C0152 322 322 Int iVSPIndexTrue[3] = {-1, -1, -1}; 323 #if MERL_VSP_NBDV_RefVId_Fix_D0166 324 Int iVSPDirTrue[3] = {-1, -1, -1}; 325 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex ); 326 #else 323 327 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 324 328 #endif 325 329 #if HHI_MPI 326 330 if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used … … 330 334 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 331 335 { 332 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui );336 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui ); 333 337 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 338 #if MERL_VSP_NBDV_RefVId_Fix_D0166 339 Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui ); 340 pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir); 341 #endif 334 342 } 335 343 } … … 348 356 } 349 357 } 350 pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 358 pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth ); // Initialize 359 #if MERL_VSP_NBDV_RefVId_Fix_D0166 360 pcCU->setVSPDirSubParts( iVSPDirTrue[iVSPIdx-1], uiSubPartIdx, uiPartIdx, uiDepth ); // Initialize 361 #endif 351 362 } 352 363 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibDecoder/TDecTop.cpp
r373 r412 1222 1222 pcSlice->setRefPicBaseDepth(pcBaseDepthPic); 1223 1223 } 1224 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 1224 1225 getTAppDecTop()->setBWVSPLUT( pcSlice, pcSlice->getViewId(), pcSlice->getPOC() ); // get the LUT for backward warping 1226 #else 1227 if (pcSlice->getViewId() != 0) 1228 { 1229 Bool isDepth = true; 1230 for(Int refviewId = 0; refviewId < (pcSlice->getViewId()); refviewId++) 1231 { 1232 if (m_tAppDecTop->getTDecTop( refviewId, isDepth )) 1233 { 1234 pcSlice->setListDepthPic(m_tAppDecTop->getTDecTop( refviewId, isDepth )->getListPic(), refviewId); // The list will store only the depth pictures 1235 } 1236 getTAppDecTop()->setBWVSPLUT( refviewId, pcSlice, pcSlice->getViewId(), pcSlice->getPOC() ); // get the LUT for backward warping 1237 } 1238 } 1239 #endif 1225 1240 #endif 1226 1241 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibEncoder/TEncCu.cpp
r399 r412 623 623 rpcTempCU->setPartSizeSubParts( ePartTemp, 0, uiDepth ); 624 624 } 625 625 626 if(DvInfo.bDV==false) 626 627 { … … 1714 1715 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1715 1716 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 1716 1717 1717 1718 if( getCheckBurstIPCMFlag() ) 1718 1719 { … … 1826 1827 { 1827 1828 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); 1829 1828 1830 #if LGE_ILLUCOMP_B0045 1829 1831 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx … … 1844 1846 #endif 1845 1847 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1846 1848 1847 1849 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1848 1850 1849 1851 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1850 1852 { … … 1861 1863 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1862 1864 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1865 1863 1866 #if LGE_ILLUCOMP_B0045 1864 1867 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx … … 1934 1937 #if MERL_VSP_C0152 1935 1938 Int iVSPIndexTrue[3] = {-1, -1, -1}; 1939 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1940 Int iVSPDirTrue[3] = {-1, -1, -1}; 1941 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue ); 1942 #else 1936 1943 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 1944 #endif 1937 1945 #else 1938 1946 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); … … 2003 2011 } 2004 2012 rpcTempCU->setVSPIndexSubParts( iVSPIdx, 0, 0, uhDepth ); 2013 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2014 rpcTempCU->setVSPDirSubParts( iVSPDirTrue[iVSPIdx-1], 0, 0, uhDepth ); // interprets depth relative to LCU level 2015 #endif 2005 2016 } 2006 2017 #endif … … 2938 2949 assert( rpcTempCU->getPredictionMode( ui ) != MODE_NONE ); 2939 2950 #if MERL_VSP_C0152 2940 Int vspIdx = pcTextureCU->getVSPIndex( rpcTempCU->getZorderIdxInCU() + ui );2951 Int vspIdx = pcTextureCU->getVSPIndex( rpcTempCU->getZorderIdxInCU() + ui ); 2941 2952 rpcTempCU->setVSPIndex( ui , vspIdx); 2953 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2954 Int vspDir = pcTextureCU->getVSPDir ( rpcTempCU->getZorderIdxInCU() + ui ); 2955 rpcTempCU->setVSPDir( ui, vspDir); 2956 #endif 2942 2957 #endif 2943 2958 } -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibEncoder/TEncSearch.cpp
r373 r412 2921 2921 , Int* iVSPIndexTrue 2922 2922 #endif 2923 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2924 , Int* iVSPDirTrue 2925 #endif 2923 2926 ) 2924 2927 { … … 2962 2965 } 2963 2966 #else 2967 2964 2968 #if MERL_VSP_C0152 2965 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 2969 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue 2970 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2971 , iVSPDirTrue 2972 #endif 2973 ); 2974 2966 2975 #else 2967 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 2968 #endif 2969 #endif 2970 2976 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand 2977 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2978 , iVSPDirTrue 2979 #endif 2980 ); 2981 #endif 2982 2983 #endif 2971 2984 2972 2985 #if H3D_IVMP … … 2998 3011 } 2999 3012 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3013 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3014 pcCU->setVSPDirSubParts( iVSPDirTrue[iVSPIdx-1], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3015 #endif 3000 3016 } 3001 3017 #endif … … 3138 3154 //reset the VSP flag to be 0 3139 3155 pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3156 #endif 3157 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3158 pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3140 3159 #endif 3141 3160 #if AMP_MRG … … 3377 3396 iNumIter = 1; 3378 3397 } 3379 3398 3380 3399 for ( Int iIter = 0; iIter < iNumIter; iIter++ ) 3381 3400 { … … 3658 3677 #if MERL_VSP_C0152 3659 3678 Int iVSPIndexTrue[3] = {-1, -1, -1}; 3679 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3680 Int iVSPDirTrue[3] = {-1, -1, -1}; 3681 #endif 3660 3682 #endif 3661 3683 UInt uiMEInterDir = 0; … … 3688 3710 3689 3711 3690 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost3712 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost 3691 3713 #if CU_BASED_MRG_CAND_LIST 3692 3714 , cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, … … 3694 3716 #if MERL_VSP_C0152 3695 3717 , iVSPIndexTrue 3718 #endif 3719 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3720 , iVSPDirTrue 3696 3721 #endif 3697 3722 ); … … 3716 3741 } 3717 3742 pcCU->setVSPIndexSubParts( iVSPIdx, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3743 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3744 pcCU->setVSPDirSubParts( iVSPDirTrue[iVSPIdx-1], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3745 #endif 3718 3746 } 3719 3747 #endif … … 3738 3766 pcCU->setInterDirSubParts ( uiMEInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3739 3767 #if MERL_VSP_C0152 3740 pcCU->setVSPIndexSubParts ( 0 , uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3768 pcCU->setVSPIndexSubParts ( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3769 #endif 3770 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3771 pcCU->setVSPDirSubParts ( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3741 3772 #endif 3742 3773 { -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibEncoder/TEncSearch.h
r332 r412 511 511 , Int* iVSPIndexTrue 512 512 #endif 513 #if MERL_VSP_NBDV_RefVId_Fix_D0166 514 , Int* iVSPDirTrue 515 #endif 513 516 ); 514 517 // ------------------------------------------------------------------------------------------------------------------- -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibEncoder/TEncSlice.cpp
r332 r412 60 60 m_pcBufferLowLatSbacCoders = NULL; 61 61 m_pcBufferLowLatBinCoderCABACs = NULL; 62 #if MERL_VSP_NBDV_RefVId_Fix_D0166 63 for(Int iNumCount = 0; iNumCount < MAX_VIEW_NUM; iNumCount++) 64 m_pcListDepthPic[iNumCount] =NULL; 65 #endif 62 66 #if FCO_DVP_REFINE_C0132_C0170 63 67 m_pPicBaseTxt = NULL; … … 148 152 m_pdRdPicQp = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 149 153 m_piRdPicQp = (Int* )xMalloc( Int, m_pcCfg->getDeltaQpRD() * 2 + 1 ); 154 155 #if MERL_VSP_NBDV_RefVId_Fix_D0166 156 for(Int iNumCount = 0; iNumCount < MAX_VIEW_NUM; iNumCount++) 157 m_pcListDepthPic[iNumCount] =NULL; 158 #endif 150 159 } 151 160 … … 819 828 #if MERL_VSP_C0152 820 829 // Send Depth/Texture pointers to slice level 830 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 821 831 pcSlice->setBWVSPLUTParam(m_aiShiftLUT, m_iShiftPrec); 832 #endif 822 833 pcSlice->setRefPicBaseTxt(m_pPicBaseTxt); 823 834 pcSlice->setRefPicBaseDepth(m_pPicBaseDepth); 835 #if MERL_VSP_NBDV_RefVId_Fix_D0166 836 for (Int refviewId=0; refviewId < pcSlice->getViewId(); refviewId++) 837 { 838 assert( m_pcListDepthPic[refviewId] ); 839 pcSlice->setListDepthPic(m_pcListDepthPic[refviewId], refviewId); 840 pcSlice->setBWVSPLUTParam(m_aiShiftLUT[refviewId], m_iShiftPrec, refviewId); 841 } 842 #endif 824 843 #endif 825 844 -
branches/HTM-6.2-dev2-MERL/source/Lib/TLibEncoder/TEncSlice.h
r296 r412 106 106 TComPic* m_pPicBaseTxt; 107 107 TComPic* m_pPicBaseDepth; 108 #if MERL_VSP_NBDV_RefVId_Fix_D0166 109 Int* m_aiShiftLUT[2]; ///< For reference views from LIST0 and LIST1 110 #else 108 111 Int* m_aiShiftLUT; 112 #endif 109 113 Int m_iShiftPrec; 110 114 #endif 111 115 #if MERL_VSP_NBDV_RefVId_Fix_D0166 116 TComList<TComPic*>* m_pcListDepthPic[MAX_VIEW_NUM]; ///< For three views in total, indexed as viewId = 0, 1, 2 117 #endif 112 118 public: 113 119 TEncSlice(); … … 143 149 144 150 #if MERL_VSP_C0152 145 Void setBWVSPLUTParam ( Int *pShiftLUT, Int iLoG2LUTPrec ) { m_aiShiftLUT = pShiftLUT; m_iShiftPrec = 2-iLoG2LUTPrec; } 151 #if MERL_VSP_NBDV_RefVId_Fix_D0166 152 Void setBWVSPLUTParam ( Int *pShiftLUT, Int iLoG2LUTPrec, Int iNeighborViewId ) { m_aiShiftLUT[iNeighborViewId] = pShiftLUT; m_iShiftPrec = 2-iLoG2LUTPrec; } 153 #else 154 Void setBWVSPLUTParam ( Int *pShiftLUT, Int iLoG2LUTPrec ) { m_aiShiftLUT = pShiftLUT; m_iShiftPrec = 2-iLoG2LUTPrec; } 155 #endif 146 156 Void setRefPicBaseTxt ( TComPic*pPicTxt ) { m_pPicBaseTxt = pPicTxt; } 147 157 Void setRefPicBaseDepth ( TComPic*pPicDepth ) { m_pPicBaseDepth = pPicDepth;} 158 #if MERL_VSP_NBDV_RefVId_Fix_D0166 159 Void getBWVSPLUTParam ( Int*& pShiftLUT, Int& iShiftPrec, Int iNeighborViewId ) { pShiftLUT = m_aiShiftLUT[iNeighborViewId]; iShiftPrec = m_iShiftPrec; } 160 #else 148 161 Void getBWVSPLUTParam ( Int*& pShiftLUT, Int& iShiftPrec ) { pShiftLUT = m_aiShiftLUT; iShiftPrec = m_iShiftPrec; } 162 #endif 149 163 TComPic* getRefPicBaseTxt () { return m_pPicBaseTxt; } 150 164 TComPic* getRefPicBaseDepth () { return m_pPicBaseDepth; } 165 #if MERL_VSP_NBDV_RefVId_Fix_D0166 166 Void setListDepthPic ( TComList<TComPic*>* pListDepthPic, Int viewId ) { m_pcListDepthPic[viewId] = pListDepthPic; } 167 TComList<TComPic*>* getListDepthPic(Int viewId) { return m_pcListDepthPic[viewId]; } 168 #endif 151 169 #endif 152 170 };
Note: See TracChangeset for help on using the changeset viewer.