Changeset 519 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source
- Timestamp:
- 4 Jul 2013, 02:34:03 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp
r518 r519 2189 2189 setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2190 2190 } 2191 2191 2192 #endif 2192 2193 … … 2632 2633 * \param uiCount: The next position to add merge candidate. Will be updated if VSP is successfully added 2633 2634 * \param abCandIsInter: abCandIsInter[iCount] tells that VSP candidate is an Inter candidate, if VSP is successfully added 2634 * \param pcMvFieldNeighbours: Return the "disparity vector". Type 1 MV. To be used to fetch a depth block. A "global" variable 2635 * \param puhInterDirNeighbours: Tells the VSP prediction direction. TODO: The value does NOT matter for VSP, as the direction will be determined based on availability later 2636 * Having it as output is mainly for coding beauty 2635 * \param pcMvFieldNeighbours: Return combined motion information, then stored to a global buffer 2636 * 1) the "disparity vector". Type 1 MV. To be used to fetch a depth block. 2637 * 2) the ref index /list. Type 2 reference picture pointer, typically for texture 2638 * \param puhInterDirNeighbours: Indicate the VSP prediction direction. 2637 2639 * \param vspFlag: vspFlag[iCount] will be set (equal to 1), if VSP is successfully added. To be used to indicate the actual position of the VSP candidate 2638 2640 * … … 2654 2656 return false; 2655 2657 2656 //////////2657 // Code if simply re-writing2658 // if(ucVspMergePos == H_3D_VSPPOSITION && picDepth != NULL && 0 != m_pcSlice->getViewIndex() ) // VSP can be used only when depth is used as input2659 // {2660 // abCandIsInter[iCount] = true;2661 // puhInterDirNeighbours[iCount] = 1;2662 // vspFlag[iCount] = 1;2663 // vspDirTrue[iCount] = 0; // TODO: Check if this is really useful!!!!2664 //2665 // Int iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC() == getSlice()->getPOC() ? 0 :2666 // (getSlice()->getAlterRefIdx(REF_PIC_LIST_0) == -1 ? NOT_VALID : getSlice()->getAlterRefIdx(REF_PIC_LIST_0));2667 // pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList0 );2668 // if (getSlice()->isInterB())2669 // {2670 // puhInterDirNeighbours[iCount] = xGetVspDirection(uiPUIdx);2671 // Int iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC() == getSlice()->getPOC() ? 0 :2672 // (getSlice()->getAlterRefIdx(REF_PIC_LIST_1) == -1 ? NOT_VALID : getSlice()->getAlterRefIdx(REF_PIC_LIST_1));2673 // pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList1 );2674 // }2675 //2676 // if ( mrgCandIdx == iCount )2677 // return true;2678 //2679 // iCount++;2680 // }2681 /////////////2682 2683 2684 2658 Bool refViewAvailFlag = false; 2685 2659 UChar predFlag[2] = {0, 0}; … … 2711 2685 { 2712 2686 TComPic* refPic = m_pcSlice->getRefPic(eRefPicList, i); 2713 if ( refPic->getPOC() == m_pcSlice->getPOC() ) // i s inter-view reference2687 if ( refPic->getPOC() == m_pcSlice->getPOC() ) // inter-view reference 2714 2688 { 2715 2689 Int viewIdxRefInList = refPic->getViewIndex(); … … 2736 2710 return false; 2737 2711 } 2712 2738 2713 #endif 2739 2714 … … 4726 4701 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv ); 4727 4702 4728 #if 0 // H_3D_VSP4729 Int refFrmIdx = 0;4730 RefPicList privateRefPicList = REF_PIC_LIST_0;4731 //getRefListAndRefFrmIdx(iTargetViewIdx, privateRefPicList, refFrmIdx);4732 4733 //pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList;4734 //pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx;4735 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0);4736 #endif //H_3D_VSP4737 4703 pDInfo->m_acDoNBDV = cColMv; 4738 4704 #endif //H_3D_NBDV_REF … … 4844 4810 #endif 4845 4811 pDInfo->m_acDoNBDV = cDispVec; 4846 4847 #if 0 // H_3D_VSP4848 Int refFrmIdx = 0;4849 RefPicList privateRefPicList = REF_PIC_LIST_0 ;4850 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view4851 4852 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList;4853 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx;4854 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0);4855 #endif //H_3D_VSP4856 4857 4812 #endif 4858 4813 return true; … … 4875 4830 } 4876 4831 pDInfo->m_acDoNBDV = defaultDV; 4877 4878 #if 0 // H_3D_VSP 4879 Int refFrmIdx = 0; 4880 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 4881 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 4882 4883 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 4884 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 4885 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 4886 #endif 4887 #endif 4832 #endif 4833 4888 4834 return false; 4889 4835 } … … 4968 4914 if (picDepth && bDepthRefine) 4969 4915 estimateDVFromDM(refViewIdx, uiPartIdx, picDepth, uiPartAddr, &cMvPred ); 4970 4971 #if 0 // H_3D_VSP4972 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = eRefPicList;4973 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refId;4974 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0);4975 #endif4976 4916 4977 4917 pNbDvInfo->m_acDoNBDV = cMvPred; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.h
r510 r519 564 564 , Int mrgCandIdx = -1 ); 565 565 #if H_3D_VSP 566 Char* getVSPFlag () { return m_piVSPFlag; }567 Char getVSPFlag ( UInt uiIdx ) { return m_piVSPFlag[uiIdx]; }568 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; }566 Char* getVSPFlag () { return m_piVSPFlag; } 567 Char getVSPFlag ( UInt uiIdx ) { return m_piVSPFlag[uiIdx]; } 568 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } 569 569 Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 570 570 #endif -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.cpp
r512 r519 437 437 Int iHeight; 438 438 UInt uiPartAddr; 439 #if H_3D_VSP440 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();441 #endif442 439 443 440 if ( iPartIdx >= 0 ) … … 479 476 { 480 477 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 481 xPredInterUniVSP( pcCU, uiPartAddr, uiAbsPartIdx,iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );478 xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 482 479 else 483 xPredInterBiVSP ( pcCU, uiPartAddr, uiAbsPartIdx,iWidth, iHeight, pcYuvPred );480 xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 484 481 } 485 482 #endif … … 526 523 { 527 524 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 528 xPredInterUniVSP( pcCU, uiPartAddr, uiAbsPartIdx,iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );525 xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 529 526 else 530 xPredInterBiVSP ( pcCU, uiPartAddr, uiAbsPartIdx,iWidth, iHeight, pcYuvPred );527 xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 531 528 } 532 529 #endif … … 573 570 574 571 #if H_3D_VSP 575 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 576 { 572 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 573 { 574 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU(); 575 577 576 // Step 1: get depth reference 578 577 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; … … 592 591 Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex(); 593 592 Int* pShiftLUT = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx ); 593 assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() ); 594 594 595 595 // Step 4: Do compensation 596 TComMv c Mv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); // cMv is the disparity vector derived from the neighbors597 pcCU->clipMv(c Mv);596 TComMv cDv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); // cDv is the disparity vector derived from the neighbors 597 pcCU->clipMv(cDv); 598 598 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 599 599 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 600 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &c Mv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );601 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &c Mv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );600 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 601 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 602 602 } 603 603 #endif … … 748 748 #if H_3D_VSP 749 749 750 Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx,Int iWidth, Int iHeight, TComYuv*& rpcYuvPred )750 Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ) 751 751 { 752 752 TComYuv* pcMbYuv; … … 765 765 pcMbYuv = &m_acYuvPred[iRefList]; 766 766 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 767 xPredInterUniVSP ( pcCU, uiPartAddr, uiAbsPartIdx,iWidth, iHeight, eRefPicList, pcMbYuv, true );767 xPredInterUniVSP ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true ); 768 768 else 769 xPredInterUniVSP ( pcCU, uiPartAddr, uiAbsPartIdx,iWidth, iHeight, eRefPicList, pcMbYuv );769 xPredInterUniVSP ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv ); 770 770 } 771 771 … … 1390 1390 // sizeX, sizeY: PU size 1391 1391 // partAddr: z-order index 1392 // mv: disparity vector. derived from neighboring blocks1392 // dv: disparity vector. derived from neighboring blocks 1393 1393 // 1394 1394 // Output: dstPic, PU predictor 64x64 1395 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* mv, UInt partAddr,Int posX, Int posY1395 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr,Int posX, Int posY 1396 1396 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi ) 1397 1397 { … … 1426 1426 Int dstStride = dstPic->getStride(); 1427 1427 Int depStride = pPicBaseDepth->getStride(); 1428 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + (( mv->getHor()+2)>>2));1429 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + (( mv->getVer()+2)>>2));1428 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + ((dv->getHor()+2)>>2)); 1429 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + ((dv->getVer()+2)>>2)); 1430 1430 Pel *ref = refPic->getLumaAddr() + posX + posY * refStride; 1431 1431 Pel *dst = dstPic->getLumaAddr(partAddr); … … 1595 1595 } 1596 1596 1597 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* mv, UInt partAddr, Int posX, Int posY1597 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv*dv, UInt partAddr, Int posX, Int posY 1598 1598 , Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi) 1599 1599 { … … 1629 1629 nTxtPerDepthX = widthChroma / widthDepth; 1630 1630 nDepthPerTxtX = 1; 1631 depthPosX = posX / nTxtPerDepthX + (( mv->getHor()+2)>>2);1631 depthPosX = posX / nTxtPerDepthX + ((dv->getHor()+2)>>2); 1632 1632 } 1633 1633 else … … 1635 1635 nTxtPerDepthX = 1; 1636 1636 nDepthPerTxtX = widthDepth / widthChroma; 1637 depthPosX = posX * nDepthPerTxtX + (( mv->getHor()+2)>>2);1637 depthPosX = posX * nDepthPerTxtX + ((dv->getHor()+2)>>2); 1638 1638 } 1639 1639 depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX); … … 1642 1642 nTxtPerDepthY = heightChroma / heightDepth; 1643 1643 nDepthPerTxtY = 1; 1644 depthPosY = posY / nTxtPerDepthY + (( mv->getVer()+2)>>2);1644 depthPosY = posY / nTxtPerDepthY + ((dv->getVer()+2)>>2); 1645 1645 } 1646 1646 else … … 1648 1648 nTxtPerDepthY = 1; 1649 1649 nDepthPerTxtY = heightDepth / heightChroma; 1650 depthPosY = posY * nDepthPerTxtY + (( mv->getVer()+2)>>2);1650 depthPosY = posY * nDepthPerTxtY + ((dv->getVer()+2)>>2); 1651 1651 } 1652 1652 depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.h
r510 r519 96 96 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ); 97 97 #if H_3D_VSP 98 Void xPredInterUniVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx,Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false );99 Void xPredInterBiVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx,Int iWidth, Int iHeight, TComYuv*& rpcYuvPred );98 Void xPredInterUniVSP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false ); 99 Void xPredInterBiVSP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ); 100 100 #endif 101 101 … … 119 119 120 120 #if H_3D_VSP 121 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth121 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth 122 122 , TComYuv *&dstPic 123 123 , Bool bi ); 124 Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* mv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth124 Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth 125 125 , TComYuv *&dstPic 126 126 , Bool bi );
Note: See TracChangeset for help on using the changeset viewer.