Changeset 163 in 3DVCSoftware for branches/HTM-4.1-dev1-LG/source


Ignore:
Timestamp:
1 Nov 2012, 13:49:52 (12 years ago)
Author:
lg
Message:

Implemented the support of parallel merge in disparity vector derivation with macro: LGE_IVMP_PARALLEL_MERGE_B0136

Implemented the fix for the 'single merge candidate list for all PUs inside a 8x8 CU' with macro: FIX_CU_BASED_MRG_CAND_LIST_B0136. Without this fix, mismatch occurs when parallel merge is activated (LOG2_PARALLEL_MERGE_LEVEL_MINUS2>0).

Location:
branches/HTM-4.1-dev1-LG/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.1-dev1-LG/source/Lib/TLibCommon/TComDataCU.cpp

    r162 r163  
    35133513  {
    35143514#if LGE_DVMCP
     3515#if LGE_IVMP_PARALLEL_MERGE_B0136
     3516    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true, REF_PIC_LIST_X, -1, true );
     3517#else
    35153518    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true );
     3519#endif
    35163520#else
    35173521    getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo );
     
    35383542      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    35393543    }
     3544#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3545    else
     3546    {
     3547      pcMvFieldNeighbours[ iCount<<1    ].setMvField( TComMv(0,0), NOT_VALID );
     3548    }
     3549#endif
    35403550    if( ( iPdmInterDir & 2 ) == 2 )
    35413551    {
    35423552      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    35433553    }
     3554#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3555    else
     3556    {
     3557      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3558    }
     3559#endif
    35443560#if SIMP_MRG_PRUN
    35453561    if ( mrgCandIdx == iCount )
     
    35833599      pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    35843600    }
     3601#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3602    else
     3603    {
     3604      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3605    }
     3606#endif
    35853607#if LGE_DVMCP
    35863608    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     
    36063628      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    36073629    }
     3630#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3631    else
     3632    {
     3633      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     3634    }
     3635#endif
    36083636    if( ( iPdmInterDir & 2 ) == 2 )
    36093637    {
    36103638      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    36113639    }
     3640#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3641    else
     3642    {
     3643      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3644    }
     3645#endif
    36123646#if SIMP_MRG_PRUN
    36133647    if ( mrgCandIdx == iCount )
     
    36593693      pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    36603694    }
     3695#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3696    else
     3697    {
     3698      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3699    }
     3700#endif
    36613701#if LGE_DVMCP
    36623702    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     
    36843724      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    36853725    }
     3726#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3727    else
     3728    {
     3729      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     3730    }
     3731#endif
    36863732    if( ( iPdmInterDir & 2 ) == 2 )
    36873733    {
    36883734      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    36893735    }
     3736#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3737    else
     3738    {
     3739      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3740    }
     3741#endif
    36903742#if SIMP_MRG_PRUN
    36913743    if ( mrgCandIdx == iCount )
     
    37303782      pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    37313783    }
     3784#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3785    else
     3786    {
     3787      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3788    }
     3789#endif
    37323790#if LGE_DVMCP
    37333791    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     
    37523810      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    37533811    }
     3812#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3813    else
     3814    {
     3815      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     3816    }
     3817#endif
    37543818    if( ( iPdmInterDir & 2 ) == 2 )
    37553819    {
    37563820      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    37573821    }
     3822#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3823    else
     3824    {
     3825      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3826    }
     3827#endif
    37583828#if SIMP_MRG_PRUN
    37593829    if ( mrgCandIdx == iCount )
     
    37983868      pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    37993869    }
     3870#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3871    else
     3872    {
     3873      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3874    }
     3875#endif
    38003876#if LGE_DVMCP
    38013877    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     
    38203896      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    38213897    }
     3898#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3899    else
     3900    {
     3901      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     3902    }
     3903#endif
    38223904    if( ( iPdmInterDir & 2 ) == 2 )
    38233905    {
    38243906      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    38253907    }
     3908#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3909    else
     3910    {
     3911      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3912    }
     3913#endif
    38263914#if SIMP_MRG_PRUN
    38273915    if ( mrgCandIdx == iCount )
     
    38753963        pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    38763964      }
     3965#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3966      else
     3967      {
     3968        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3969      }
     3970#endif
    38773971#if LGE_DVMCP
    38783972      pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     
    39894083        {
    39904084          puhInterDirNeighbours[uiArrayAddr] = 1;
     4085#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4086          pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID );
     4087#endif
    39914088        }
    39924089      }
     
    39944091      {
    39954092        puhInterDirNeighbours[uiArrayAddr] = 1;
     4093#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4094        pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID );
     4095#endif
    39964096      }
    39974097#if LGE_DVMCP
     
    42314331      pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r);
    42324332    }
     4333#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4334    else
     4335    {
     4336      pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID );
     4337    }
     4338#endif
    42334339    uiArrayAddr++;
    42344340  }
     
    47954901
    47964902#if LGE_DVMCP
    4797 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 )
     4903Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0
     4904#if LGE_IVMP_PARALLEL_MERGE_B0136
     4905                                , Bool bParMerge
     4906#endif
     4907                                )
    47984908{
    47994909  PartSize eCUMode = getPartitionSize( uiPartAddr );
     
    48174927#endif
    48184928
     4929#if LGE_IVMP_PARALLEL_MERGE_B0136
     4930  Int xP, yP, nPSW, nPSH;
     4931  if( bParMerge)
     4932    this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
     4933#endif
     4934
    48194935  deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT );
    48204936  deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB );
     
    48324948  }
    48334949#endif
     4950#if LGE_IVMP_PARALLEL_MERGE_B0136
     4951  if (pcTmpCU && bParMerge)
     4952  {
     4953    if (!pcTmpCU->isDiffMER(xP -1, yP+nPSH-1, xP, yP))
     4954    {
     4955      pcTmpCU = NULL;
     4956    }
     4957  }
     4958#endif
     4959
    48344960
    48354961  pcCULeft = pcTmpCU;
     
    48785004  }
    48795005#endif
     5006#if LGE_IVMP_PARALLEL_MERGE_B0136
     5007  if (pcTmpCU && bParMerge)
     5008  {
     5009    if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP))
     5010    {
     5011      pcTmpCU = NULL;
     5012    }
     5013  }
     5014#endif
    48805015
    48815016  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     
    49235058  pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true);
    49245059#endif
     5060#if LGE_IVMP_PARALLEL_MERGE_B0136
     5061  if (pcTmpCU && bParMerge)
     5062  {
     5063    if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP))
     5064    {
     5065      pcTmpCU = NULL;
     5066    }
     5067  }
     5068#endif
     5069
    49255070  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    49265071  {
     
    49665111#else
    49675112  pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB);
     5113#endif
     5114#if LGE_IVMP_PARALLEL_MERGE_B0136
     5115  if (pcTmpCU && bParMerge)
     5116  {
     5117    if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP))
     5118    {
     5119      pcTmpCU = NULL;
     5120    }
     5121  }
    49685122#endif
    49695123  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     
    50065160  pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true);
    50075161#endif
     5162#if LGE_IVMP_PARALLEL_MERGE_B0136
     5163  if (pcTmpCU && bParMerge)
     5164  {
     5165    if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP))
     5166    {
     5167      pcTmpCU = NULL;
     5168    }
     5169  }
     5170#endif
     5171
    50085172  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    50095173  {
  • branches/HTM-4.1-dev1-LG/source/Lib/TLibCommon/TComDataCU.h

    r154 r163  
    538538  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
    539539#if LGE_DVMCP
    540   Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 );
     540  Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1
     541#if LGE_IVMP_PARALLEL_MERGE_B0136
     542    , Bool bParMerg = false
     543#endif
     544    );
    541545#endif
    542546
  • branches/HTM-4.1-dev1-LG/source/Lib/TLibCommon/TypeDef.h

    r162 r163  
    155155
    156156#define PARALLEL_MERGE  1                   //< H0082 parallel merge/skip
     157#define LGE_IVMP_PARALLEL_MERGE_B0136     1 //< B0136 support of parallel merge/skip in disparity vector derivation
    157158#define LOG2_PARALLEL_MERGE_LEVEL_MINUS2  0 //< H0082 parallel merge level 0-> 4x4, 1-> 8x8, 2->16x16, 3->32x32, 4->64x64
    158159#if PARALLEL_MERGE && LOG2_PARALLEL_MERGE_LEVEL_MINUS2
    159160#define CU_BASED_MRG_CAND_LIST            1  //< H0240: single merge candidate list for all PUs inside a 8x8 CU conditioned on LOG2_PARALLEL_MERGE_LEVEL_MINUS2 > 0
     161#define FIX_CU_BASED_MRG_CAND_LIST_B0136  1  //< B0136 bug fix for CU_BASED_MRG_CAND_LIST
    160162#endif
    161163#define MVP_AT_ENTROPYSLICE_BOUNDARY      1  //< H0362 enable motion prediction accross entropy slice boundary
  • branches/HTM-4.1-dev1-LG/source/Lib/TLibEncoder/TEncSearch.cpp

    r125 r163  
    26422642 */
    26432643#if CU_BASED_MRG_CAND_LIST
     2644#if LG_RESTRICTEDRESPRED_M24766
     2645Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
     2646#else
    26442647Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
     2648#endif
    26452649#else
    26462650#if LG_RESTRICTEDRESPRED_M24766
     
    35393543      UInt uiMRGCost = MAX_UINT;
    35403544#if CU_BASED_MRG_CAND_LIST
     3545#if LG_RESTRICTEDRESPRED_M24766
     3546      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
     3547#else
    35413548      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
     3549#endif
    35423550#else
    35433551#if LG_RESTRICTEDRESPRED_M24766
Note: See TracChangeset for help on using the changeset viewer.