Changeset 514 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source
- Timestamp:
- 3 Jul 2013, 16:13:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp
r513 r514 2644 2644 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag ) 2645 2645 { 2646 if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) ) // Not to add the candidate if VSP is turned off 2646 if ( pDInfo->bDV == false || ucVspMergePos != H_3D_VSP_POSITION || 0 == m_pcSlice->getViewIndex() || 2647 !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || // Not to add the candidate if VSP is turned off 2648 m_pcSlice->getIsDepth() // VSP is disabled for depth layers 2647 2649 return false; 2648 if( m_pcSlice->getIsDepth() ) // VSP is turned off for depth layers 2650 2651 Int refViewIdx = pDInfo->m_aVIdxCan; 2652 TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx ); 2653 if( picDepth == NULL ) // No depth reference avail 2649 2654 return false; 2650 2651 Int refViewIdx = pDInfo->m_aVIdxCan; 2652 TComPic* picDepth = NULL; 2653 //assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); 2654 picDepth = getSlice()->getIvPic( true, refViewIdx ); 2655 2655 2656 2656 ////////// 2657 2657 // Code if simply re-writing … … 2681 2681 ///////////// 2682 2682 2683 if(ucVspMergePos == H_3D_VSP_POSITION && picDepth != NULL && 0 != m_pcSlice->getViewIndex() ) // VSP can be used only when depth is used as input 2684 { 2685 Bool refViewAvailFlag = false; 2686 UChar predFlag[2] = {0, 0}; 2687 Int iRefListIdX = 0; 2688 Int iRefListIdY = 0; 2689 2690 for( iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) 2691 { 2692 RefPicList eRefPicList = RefPicList( iRefListIdX ); 2693 for (Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicList) && !refViewAvailFlag; i++) 2694 { 2695 Int viewIdxRefInList = m_pcSlice->getRefPic(eRefPicList, i)->getViewIndex(); 2696 if (refViewIdx == viewIdxRefInList) 2697 { 2698 Int iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC() == getSlice()->getPOC() ? 0 : 2699 (getSlice()->getAlterRefIdx(REF_PIC_LIST_0) == -1 ? NOT_VALID : getSlice()->getAlterRefIdx(REF_PIC_LIST_0)); 2700 2701 refViewAvailFlag = true; 2702 predFlag[0] = 1; // iRefListIdX 2703 iRefListIdY = 1 - iRefListIdX; 2704 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList0 ); 2705 // pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acDoNBDV, i ); // Buggy code 2706 } 2707 } 2708 } 2709 2710 if (m_pcSlice->isInterB() && refViewAvailFlag) 2711 { 2712 RefPicList eRefPicList = RefPicList( iRefListIdY ); 2713 refViewAvailFlag = false; 2714 for (Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicList) && !refViewAvailFlag; i++) 2715 { 2716 Int viewIdxRefInList = m_pcSlice->getRefPic(eRefPicList, i)->getViewIndex(); 2717 if (refViewIdx != viewIdxRefInList) 2718 { 2719 Int iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC() == getSlice()->getPOC() ? 0 : 2720 (getSlice()->getAlterRefIdx(REF_PIC_LIST_1) == -1 ? NOT_VALID : getSlice()->getAlterRefIdx(REF_PIC_LIST_1)); 2721 2722 refViewAvailFlag = true; 2723 predFlag[1] = 1; // iRefListIdY 2724 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList1 ); 2725 //pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( pDInfo->m_acDoNBDV, i ); // Buggy code 2726 } 2727 } 2728 } 2729 2730 abCandIsInter[iCount] = true; 2731 puhInterDirNeighbours[iCount] = (predFlag[0] | (predFlag[1] << 1)); 2732 vspFlag[iCount] = 1; 2733 2734 if ( mrgCandIdx == iCount ) 2735 return true; 2736 2737 iCount++; 2738 } 2683 2684 Bool refViewAvailFlag = false; 2685 UChar predFlag[2] = {0, 0}; 2686 Int iRefListIdX = 0; 2687 Int iRefListIdY = 0; 2688 2689 for( iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) 2690 { 2691 RefPicList eRefPicList = RefPicList( iRefListIdX ); 2692 for (Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicList) && !refViewAvailFlag; i++) 2693 { 2694 Int viewIdxRefInList = m_pcSlice->getRefPic(eRefPicList, i)->getViewIndex(); 2695 if (refViewIdx == viewIdxRefInList) 2696 { 2697 Int iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC() == getSlice()->getPOC() ? 2698 0 : getSlice()->getAlterRefIdx(REF_PIC_LIST_0); 2699 2700 refViewAvailFlag = true; 2701 predFlag[0] = 1; // iRefListIdX 2702 iRefListIdY = 1 - iRefListIdX; 2703 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList0 ); 2704 // pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acDoNBDV, i ); // Buggy code 2705 } 2706 } 2707 } 2708 2709 if (m_pcSlice->isInterB() && refViewAvailFlag) 2710 { 2711 RefPicList eRefPicList = RefPicList( iRefListIdY ); 2712 refViewAvailFlag = false; 2713 for (Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicList) && !refViewAvailFlag; i++) 2714 { 2715 Int viewIdxRefInList = m_pcSlice->getRefPic(eRefPicList, i)->getViewIndex(); 2716 if (refViewIdx != viewIdxRefInList) 2717 { 2718 Int iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC() == getSlice()->getPOC() ? 2719 0 : getSlice()->getAlterRefIdx(REF_PIC_LIST_1); 2720 2721 refViewAvailFlag = true; 2722 predFlag[1] = 1; // iRefListIdY 2723 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acDoNBDV, iRefIdxList1 ); 2724 //pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( pDInfo->m_acDoNBDV, i ); // Buggy code 2725 } 2726 } 2727 } 2728 2729 // Set values to be returned 2730 abCandIsInter[iCount] = true; 2731 puhInterDirNeighbours[iCount] = (predFlag[0] | (predFlag[1] << 1)); 2732 vspFlag[iCount] = 1; 2733 2734 if ( mrgCandIdx == iCount ) 2735 return true; 2736 2737 iCount++; 2739 2738 2740 2739 return false;
Note: See TracChangeset for help on using the changeset viewer.