Changeset 499 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib
- Timestamp:
- 27 Jun 2013, 00:45:09 (12 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/Lib
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp
r487 r499 2463 2463 Int iPosLeftAbove[2] = {-1, -1}; 2464 2464 2465 //Notes from QC: DvMCP related variables.2466 //acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false;2467 2465 2468 2466 DisInfo cDisInfo; … … 2497 2495 //clipMv(cMvPred); 2498 2496 //pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx()); 2497 #if H_3D_CLEANUPS //Notes from QC: for BVSP coded blocks, the reference index shall not be equal to -1 due to the adoption of JCT3V-D0191 2498 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx()); 2499 #else 2499 2500 if (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0) 2500 2501 { … … 2508 2509 } 2509 2510 } 2510 2511 #endif 2511 2512 } 2512 2513 … … 2524 2525 //clipMv(cMvPred); 2525 2526 //pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()); 2527 #if H_3D_CLEANUPS 2528 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()); 2529 #else 2526 2530 if (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0) 2527 2531 { … … 2535 2539 } 2536 2540 } 2537 2541 #endif 2538 2542 } 2539 2543 } 2540 2544 #if !H_3D_CLEANUPS 2541 2545 if (!((pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && !getSlice()->isInterB()) 2542 2546 || (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0 && getSlice()->isInterB()))) 2543 2547 { 2548 #endif 2549 #if H_3D_IDV 2550 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2551 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2552 #endif 2544 2553 if ( mrgCandIdx == iCount ) 2545 2554 { … … 2547 2556 } 2548 2557 iCount ++; 2558 #if !H_3D_CLEANUPS 2549 2559 } 2550 2560 else … … 2552 2562 assert(0); 2553 2563 } 2564 #endif 2554 2565 } 2555 2566 } … … 2563 2574 2564 2575 Int iPdmInterDir; 2576 #if H_3D_CLEANUPS 2577 if( iPdmDir[0] ) 2578 #else 2565 2579 if( iPdmDir[0] && ivMvPredFlag ) 2580 #endif 2566 2581 { 2567 2582 abCandIsInter [ iCount ] = true; … … 2573 2588 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 2574 2589 } 2575 2576 2590 if( ( iPdmInterDir & 2 ) == 2 ) 2577 2591 { … … 2584 2598 } 2585 2599 iCount ++; 2586 } 2600 } 2601 #if H_3D_CLEANUPS 2602 // early termination 2603 if (iCount == getSlice()->getMaxNumMergeCand()) 2604 { 2605 return; 2606 } 2607 #endif 2587 2608 #endif 2588 2609 … … 2646 2667 bLeftAvai = true; 2647 2668 iPosLeftAbove[0] = iCount; 2648 2669 #if H_3D_IDV 2670 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2671 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2672 #endif 2649 2673 if ( mrgCandIdx == iCount ) 2650 2674 { … … 2707 2731 { 2708 2732 iPosLeftAbove[1] = iCount; 2709 2733 #if H_3D_IDV 2734 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2735 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2736 #endif 2710 2737 if ( mrgCandIdx == iCount ) 2711 2738 { … … 2746 2773 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 2747 2774 } 2775 #if H_3D_IDV 2776 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2777 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2778 #endif 2748 2779 if ( mrgCandIdx == iCount ) 2749 2780 { … … 2759 2790 2760 2791 #if H_3D_IV_MERGE 2792 #if H_3D_CLEANUPS 2793 if( iPdmDir[1] ) 2794 #else 2761 2795 if(ivMvPredFlag && iPdmDir[1] ) 2796 #endif 2762 2797 { 2763 2798 assert(iCount < getSlice()->getMaxNumMergeCand()); … … 2792 2827 if(!bRemoveSpa) 2793 2828 { 2829 #if H_3D_IDV 2830 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2831 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2832 #endif 2794 2833 if ( mrgCandIdx == iCount ) 2795 2834 return; … … 2823 2862 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 2824 2863 } 2864 #if H_3D_IDV 2865 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2866 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2867 #endif 2825 2868 if ( mrgCandIdx == iCount ) 2826 2869 { … … 2855 2898 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 2856 2899 } 2900 #if H_3D_IDV 2901 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 2902 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 2903 #endif 2857 2904 if ( mrgCandIdx == iCount ) 2858 2905 { … … 2932 2979 pcMvFieldNeighbours[ 2 * uiArrayAddr ].setMvField( cColMv, iRefIdx ); 2933 2980 } 2934 2981 2935 2982 if ( getSlice()->isInterB() ) 2936 2983 { 2984 #if H_3D_TMVP 2985 iRefIdx = 0; 2986 #endif 2937 2987 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 2938 2988 if( bExistMV == false ) … … 2951 3001 puhInterDirNeighbours[uiArrayAddr] = dir; 2952 3002 abCandIsInter[uiArrayAddr] = true; 2953 3003 #if H_3D_IDV 3004 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 3005 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 3006 #endif 2954 3007 if ( mrgCandIdx == iCount ) 2955 3008 { … … 3258 3311 } 3259 3312 } 3260 if ( uiLCUIdx >= 0 && xGetColMVP( eRefPicList, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx_Col ) ) 3313 if ( uiLCUIdx >= 0 && xGetColMVP( eRefPicList, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx_Col 3314 #if H_3D_TMVP 3315 , 0 3316 #endif 3317 ) ) 3261 3318 { 3262 3319 pInfo->m_acMvCand[pInfo->iN++] = cColMv; … … 3267 3324 UInt uiCurLCUIdx = getAddr(); 3268 3325 xDeriveCenterIdx( uiPartIdx, uiPartIdxCenter ); 3269 if (xGetColMVP( eRefPicList, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx_Col )) 3326 if (xGetColMVP( eRefPicList, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx_Col 3327 #if H_3D_TMVP 3328 , 0 3329 #endif 3330 )) 3270 3331 { 3271 3332 pInfo->m_acMvCand[pInfo->iN++] = cColMv; … … 3582 3643 * \returns Bool 3583 3644 */ 3584 Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ) 3645 Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 3646 #if H_3D_TMVP 3647 , Bool bMRG 3648 #endif 3649 ) 3585 3650 { 3586 3651 UInt uiAbsPartAddr = uiPartUnitIdx; … … 3630 3695 if ( bIsCurrRefLongTerm != bIsColRefLongTerm ) 3631 3696 { 3632 return false; 3697 #if H_3D_TMVP 3698 Int iAlterRefIdx = m_pcSlice->getAlterRefIdx(eRefPicList); 3699 if(bMRG && iAlterRefIdx > 0) 3700 { 3701 riRefIdx = iAlterRefIdx; 3702 bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm(); 3703 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 3704 assert(bIsCurrRefLongTerm == bIsColRefLongTerm); 3705 } 3706 else 3707 { 3708 #endif 3709 return false; 3710 #if H_3D_TMVP 3711 } 3712 #endif 3633 3713 } 3634 3714 3635 3715 if ( bIsCurrRefLongTerm || bIsColRefLongTerm ) 3636 3716 { 3637 rcMv = cColMv; 3717 #if H_3D_TMVP 3718 Int iCurrViewId = m_pcSlice->getViewIndex (); 3719 Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewIndex (); 3720 Int iColViewId = pColCU->getSlice()->getViewIndex(); 3721 Int iColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewIndex(); 3722 iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId ); 3723 if ( iScale != 4096 ) 3724 { 3725 rcMv = cColMv.scaleMv( iScale ); 3726 } 3727 else 3728 { 3729 #endif 3730 rcMv = cColMv; 3731 #if H_3D_TMVP 3732 } 3733 #endif 3638 3734 } 3639 3735 else … … 4354 4450 clipMv( cDispVec ); 4355 4451 pDInfo->m_acNBDV = cDispVec; 4452 #if H_3D_CLEANUPS 4453 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 4454 assert(pDInfo->m_aVIdxCan == 0); //Notes from QC: only works for CTC 4455 #else 4356 4456 pDInfo->m_aVIdxCan = 0; 4457 #endif 4357 4458 #if H_3D_NBDV_REF 4459 #if H_3D_CLEANUPS 4460 TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); 4461 #else 4358 4462 TComPic* picDepth = getSlice()->getIvPic( true, 0 ); 4463 #endif 4359 4464 assert(picDepth!=NULL); 4360 4465 4361 4466 if (picDepth && bDepthRefine) 4467 #if H_3D_CLEANUPS 4468 estimateDVFromDM (pDInfo->m_aVIdxCan, uiPartIdx, picDepth, uiPartAddr, &cDispVec); 4469 #else 4362 4470 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &cDispVec ); // from base view 4363 4471 #endif 4364 4472 pDInfo->m_acDoNBDV = cDispVec; 4365 4473 … … 4484 4592 4485 4593 UInt uiPartIdx = 0; //Notes from MTK: Please confirm that using 0 as partition index and partition address is correct for CU-level DoNBDV 4486 UInt uiPartAddr = 0; 4594 UInt uiPartAddr = 0; //QC: confirmed 4487 4595 4488 4596 if (picDepth && bDepthRefine) … … 4615 4723 { 4616 4724 TComSlice* pcSlice = getSlice (); 4617 4725 #if H_3D_CLEANUPS //Notes from QC: to be aligned with the spec. 4726 Int iViewIndex = pDInfo->m_aVIdxCan; 4727 #else 4618 4728 Bool valid = false; 4729 4619 4730 Int iViewIndex = 0; 4620 4731 … … 4642 4753 if (!valid) 4643 4754 return false; 4644 4755 #endif 4645 4756 //--- get base CU/PU and check prediction mode --- 4646 4757 TComPic* pcBasePic = pcSlice->getIvPic( false, iViewIndex ); … … 4675 4786 4676 4787 Bool abPdmAvailable[4] = {false, false, false, false}; 4788 #if H_3D_IDV 4789 for( Int i = 0; i < 4; i++) 4790 { 4791 pacPdmMv[i].setIDVFlag (false); 4792 } 4793 #endif 4677 4794 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 4678 4795 { … … 4699 4816 abPdmAvailable[ uiCurrRefListId ] = true; 4700 4817 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 4701 4702 // cMv.m_bDvMcp = true; 4703 // cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 4704 4818 #if H_3D_IDV 4819 cMv.setIDVFlag (true); 4820 cMv.setIDVHor (cDv.getHor()); 4821 cMv.setIDVVer (cDv.getVer()); 4822 #endif 4705 4823 clipMv( cMv ); 4706 4824 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; … … 4716 4834 } 4717 4835 availableMcDc[0] = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 4718 4719 4836 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 4720 4837 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.h
r486 r499 213 213 214 214 Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); 215 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); 215 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 216 #if H_3D_TMVP 217 , 218 Bool bMRG = true 219 #endif 220 ); 216 221 217 222 /// compute required bits to encode MVD (used in AMVP) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComMv.h
r455 r499 94 94 Void setHor ( Short i ) { m_iHor = i; } 95 95 Void setVer ( Short i ) { m_iVer = i; } 96 Void setZero () { m_iHor = m_iVer = 0; } 96 Void setZero () { m_iHor = m_iVer = 0; 97 #if H_3D_NBDV 98 m_bIDV = false; m_iIDVHor = m_iIDVVer = 0; 99 #endif 100 } 97 101 #if H_3D_NBDV 98 102 Void setIDVHor (Short i) {m_iIDVHor = i;} -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.cpp
r486 r499 221 221 m_numEntryPointOffsets = 0; 222 222 m_enableTMVPFlag = true; 223 #if H_3D_TMVP 224 m_aiAlterRefIdx[0] = -1; 225 m_aiAlterRefIdx[1] = -1; 226 #endif 223 227 } 224 228 … … 699 703 } 700 704 #if H_3D 705 #if H_3D_TMVP 706 Void TComSlice::generateAlterRefforTMVP() 707 { 708 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 709 { 710 if ( this->getNumRefIdx( RefPicList( uiRefListIdx ) ) == 0) 711 continue; 712 713 Bool bZeroIdxLtFlag = this->getRefPic(RefPicList(uiRefListIdx), 0)->getIsLongTerm(); 714 for(Int i = 1; i < this->getNumRefIdx(RefPicList(uiRefListIdx)); i++ ) 715 { 716 if ( ( bZeroIdxLtFlag && !this->getRefPic(RefPicList(uiRefListIdx), i)->getIsLongTerm() ) || 717 (!bZeroIdxLtFlag && this->getRefPic(RefPicList(uiRefListIdx), i)->getIsLongTerm() ) ) 718 { 719 this->setAlterRefIdx(RefPicList(uiRefListIdx),i); 720 break; 721 } 722 } 723 } 724 } 725 #endif 701 726 Void TComSlice::setCamparaSlice( Int** aaiScale, Int** aaiOffset ) 702 727 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.h
r486 r499 1506 1506 Bool m_isDepth; 1507 1507 Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; 1508 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; 1508 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; 1509 #if H_3D_TMVP 1510 Int m_aiAlterRefIdx [2]; 1511 #endif 1509 1512 #if H_3D_GEN 1510 1513 TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; … … 1779 1782 Int getViewId () { return m_viewId; } 1780 1783 #if H_3D 1784 #if H_3D_TMVP 1785 Void generateAlterRefforTMVP (); 1786 Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } 1787 Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } 1788 #endif 1781 1789 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 1782 1790 Int getViewIndex () { return m_viewIndex; } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h
r486 r499 78 78 // LGE_WVSO_A0119 79 79 #define H_3D_NBDV 1 // Neighboring block disparity derivation 80 // JCT3V-A009780 // QC_JCT3V-A0097 81 81 // LGE_DVMCP_A0126 82 82 // LGE_DVMCP_MEM_REDUCTION_B0135 … … 88 88 // QC_CU_NBDV_D0181 89 89 // SEC_DEFAULT_DV_D0112 90 #if H_3D_NBDV 91 #define H_3D_IDV 1 // LGE_DVMCP_A0126 QC note: this macro will be removed after merging to dev2a 90 92 #define H_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation 91 93 // MTK_D0156 92 94 // MERL_VSP_NBDV_RefVId_Fix_D0166 95 #endif 93 96 #define H_3D_VSP 0 // Depth oriented neighboring block disparity derivation 94 97 … … 101 104 // QC_AMVP_MRG_UNIFY_IVCAN_C0051 102 105 // TEXTURE MERGING CANDIDATE , JCT3V-C0137 106 #define H_3D_TMVP 1 // QC_TMVP_C0047 107 // Sony_M23639 103 108 #define H_3D_GEN 1 // Some general changes can be removed after merge 109 #define H_3D_CLEANUPS 1 104 110 #endif 105 111 … … 121 127 //// ****** Neighbouring block-based Disparity Vector ********* 122 128 #if H_3D_NBDV 129 #if H_3D_CLEANUPS 130 #define DVFROM_LEFTBELOW 0 131 #define DVFROM_LEFT 1 132 #define DVFROM_ABOVERIGHT 2 133 #define DVFROM_ABOVE 3 134 #define DVFROM_ABOVELEFT 4 135 #define IDV_CANDS 5 136 #else 123 137 #define IDV_CANDS 6 124 138 #define DVFROM_LEFTBELOW 1 … … 127 141 #define DVFROM_ABOVE 4 128 142 #define DVFROM_ABOVELEFT 5 143 #endif 129 144 #endif 130 145 ///////////////////////////////////////////////////////////////////////////////////////// -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecTop.cpp
r479 r499 959 959 } 960 960 #endif 961 #if H_3D_TMVP 962 if(pcSlice->getLayerId()) 963 pcSlice->generateAlterRefforTMVP(); 964 #endif 961 965 } 962 966 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
r486 r499 778 778 pcSlice->generateCombinedList(); 779 779 #endif 780 780 #if H_3D_TMVP 781 if(pcSlice->getLayerId()) 782 pcSlice->generateAlterRefforTMVP(); 783 #endif 781 784 if (m_pcEncTop->getTMVPModeId() == 2) 782 785 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibExtractor/TExtrTop.cpp
r446 r499 115 115 } 116 116 #endif 117 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibRenderer/TRenImagePlane.cpp
r446 r499 529 529 template class TRenImagePlanePart<Int>; 530 530 #endif // H_3D 531 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibRenderer/TRenInterpFilter.cpp
r446 r499 51 51 52 52 #endif // H_3D 53 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibRenderer/TRenTop.cpp
r446 r499 2227 2227 } 2228 2228 #endif // H_3D 2229
Note: See TracChangeset for help on using the changeset viewer.