Changeset 566 in 3DVCSoftware for branches/HTM-DEV-2.0-dev1-Mediatek/source


Ignore:
Timestamp:
12 Aug 2013, 11:11:06 (11 years ago)
Author:
mediatek-htm
Message:

Integration of JCT3V-E0172. The MACRO is "MTK_RVS_BUGFIX_E0172".

By Na Zhang (na.zhang@…)

Location:
branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp

    r542 r566  
    144144#if H_3D_VSP
    145145  m_piVSPFlag            = NULL;
     146#if MTK_VSP_FIX_E0172
     147  m_piVSPDir             = NULL;
     148#endif
    146149#endif
    147150#if H_3D_ARP
     
    187190#if H_3D_VSP
    188191    m_piVSPFlag          = (Char*  )xMalloc(Char,   uiNumPartition);
     192#if MTK_VSP_FIX_E0172
     193    m_piVSPDir           = (Char*  )xMalloc(Char,   uiNumPartition);
     194#endif
    189195#endif
    190196    m_puhLumaIntraDir    = (UChar* )xMalloc(UChar,  uiNumPartition);
     
    336342#if H_3D_VSP
    337343    if ( m_piVSPFlag          ) { xFree(m_piVSPFlag);           m_piVSPFlag         = NULL; }
     344#if MTK_VSP_FIX_E0172
     345    if ( m_piVSPDir           ) { xFree(m_piVSPDir  );          m_piVSPDir          = NULL; }
     346#endif
    338347#endif
    339348    if ( m_puhLumaIntraDir    ) { xFree(m_puhLumaIntraDir);     m_puhLumaIntraDir   = NULL; }
     
    532541#if H_3D_VSP
    533542    m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui];
     543#if MTK_VSP_FIX_E0172
     544    m_piVSPDir  [ui] = pcFrom->m_piVSPDir[ui];
     545#endif
    534546#endif
    535547    m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui];
     
    571583#if H_3D_VSP
    572584    memset( m_piVSPFlag         + firstElement, 0,                        numElements * sizeof( *m_piVSPFlag ) );
     585#if MTK_VSP_FIX_E0172
     586    memset( m_piVSPDir          + firstElement, 0,                        numElements * sizeof( *m_piVSPDir   ) );
     587#endif
    573588#endif
    574589    memset( m_puhLumaIntraDir   + firstElement, DC_IDX,                   numElements * sizeof( *m_puhLumaIntraDir ) );
     
    743758#if H_3D_VSP
    744759      m_piVSPFlag[ui] = 0;
     760#if MTK_VSP_FIX_E0172
     761      m_piVSPDir  [ui] = 0;
     762#endif
    745763#endif
    746764      m_puhLumaIntraDir[ui] = DC_IDX;
     
    835853#if H_3D_VSP
    836854  memset( m_piVSPFlag,          0, sizeof( Char  ) * m_uiNumPartition );
     855#if MTK_VSP_FIX_E0172
     856  memset( m_piVSPDir  ,         0, sizeInChar );
     857#endif
    837858#endif
    838859  memset( m_puhLumaIntraDir,    DC_IDX, iSizeInUchar );
     
    922943#if H_3D_VSP
    923944      m_piVSPFlag[ui]=pcCU->m_piVSPFlag[uiPartOffset+ui];
     945#if MTK_VSP_FIX_E0172
     946      m_piVSPDir[ui]=pcCU->m_piVSPDir[uiPartOffset+ui];
     947#endif
    924948#endif
    925949      m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui];
     
    10641088#if H_3D_VSP
    10651089  m_piVSPFlag           = pcCU->getVSPFlag()          + uiPart;
     1090#if MTK_VSP_FIX_E0172
     1091  m_piVSPDir            = pcCU->getVSPDir  ()         + uiPart;
     1092#endif
    10661093#endif
    10671094
     
    12111238#if H_3D_VSP
    12121239  m_piVSPFlag          = pcCU->getVSPFlag()               + uiAbsPartIdx;
     1240#if MTK_VSP_FIX_E0172
     1241  m_piVSPDir           = pcCU->getVSPDir  ()              + uiAbsPartIdx;
     1242#endif
    12131243#endif
    12141244
     
    12581288#if H_3D_VSP
    12591289  memcpy( m_piVSPFlag           + uiOffset, pcCU->getVSPFlag(),           sizeof( Char ) * uiNumPartition );
     1290#if MTK_VSP_FIX_E0172
     1291  memcpy( m_piVSPDir            + uiOffset, pcCU->getVSPDir  (),          sizeInChar );
     1292#endif
    12601293#endif
    12611294  memcpy( m_puhLumaIntraDir     + uiOffset, pcCU->getLumaIntraDir(),      iSizeInUchar );
     
    13781411#if H_3D_VSP
    13791412  memcpy( rpcCU->getVSPFlag()           + m_uiAbsIdxInLCU, m_piVSPFlag,           sizeof( Char ) * m_uiNumPartition );
     1413#if MTK_VSP_FIX_E0172
     1414  memcpy( rpcCU->getVSPDir  ()          + m_uiAbsIdxInLCU, m_piVSPDir  ,          sizeInChar );
     1415#endif
    13801416#endif
    13811417  memcpy( rpcCU->getLumaIntraDir()      + m_uiAbsIdxInLCU, m_puhLumaIntraDir,     iSizeInUchar );
     
    14861522#if H_3D_VSP
    14871523  memcpy( rpcCU->getVSPFlag()           + uiPartOffset, m_piVSPFlag,           sizeof(Char) * uiQNumPart );
     1524#if MTK_VSP_FIX_E0172
     1525  memcpy( rpcCU->getVSPDir  ()          + uiPartOffset, m_piVSPDir  ,          sizeInChar );
     1526#endif
    14881527#endif
    14891528  memcpy( rpcCU->getLumaIntraDir()      + uiPartOffset, m_puhLumaIntraDir,     iSizeInUchar );
     
    24892528  setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    24902529}
     2530#if MTK_VSP_FIX_E0172
     2531Void TComDataCU::setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     2532{
     2533  setSubPart<Char>( iVSPDir, m_piVSPDir, uiAbsPartIdx, uiDepth, uiPartIdx );
     2534}
     2535#endif
    24912536#endif
    24922537Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth )
     
    29412986 *   false: otherwise
    29422987 */
     2988#if MTK_VSP_FIX_E0172
     2989inline Bool TComDataCU::xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
     2990                                    Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int* vspDir )
     2991#else
    29432992inline Bool TComDataCU::xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    29442993                                     Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag )
     2994#endif
    29452995{
    29462996  if ( ucVspMergePos != H_3D_VSP_POSITION || 0 == m_pcSlice->getViewIndex() || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )
     
    29573007  Int  iRefListIdY = 0;
    29583008  Int  i;
    2959 
     3009#if MTK_VSP_FIX_E0172
     3010  Int currViewId = m_pcSlice->getViewId();
     3011  Int derivedViewId = -1;
     3012  Int otherViewId = -1;
     3013#endif
    29603014  for( iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
    29613015  {
     
    29683022        refViewAvailFlag = true;
    29693023        predFlag[iRefListIdX] = 1;
     3024#if MTK_VSP_FIX_E0172
     3025        vspDir[iCount] = iRefListIdX;
     3026        derivedViewId = m_pcSlice->getRefPic(eRefPicList, i)->getViewId();
     3027#endif
    29703028        iRefListIdY = 1 - iRefListIdX;
    29713029        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acDoNBDV, i );
     
    29883046        refViewAvailFlag = true;
    29893047        predFlag[iRefListIdY] = 1;
     3048#if MTK_VSP_FIX_E0172
     3049        TComMv  cMv = pDInfo->m_acDoNBDV;
     3050        otherViewId = m_pcSlice->getRefPic( eRefPicList, i)->getViewId();
     3051        Int iScale = xGetDistScaleFactor( currViewId, otherViewId, currViewId, derivedViewId );
     3052        if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() )
     3053        {
     3054          cMv = cMv.scaleMv( iScale );
     3055        }
     3056        else
     3057        {
     3058
     3059          cMv = cMv;
     3060        }
     3061        clipMv( cMv );
     3062        pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( cMv, i );
     3063#else
    29903064        pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( pDInfo->m_acDoNBDV, i );
     3065#endif
    29913066#if H_3D_NBDV
    29923067        pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].getMv().setIDVFlag (false);
     
    30213096#if H_3D_VSP
    30223097      , Int* vspFlag
     3098#if MTK_VSP_FIX_E0172
     3099      , Int* vspDir
     3100#endif
    30233101#endif
    30243102      , Int& numValidMergeCand, Int mrgCandIdx
     
    32103288#if H_3D_VSP
    32113289      if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1)
     3290#if MTK_VSP_FIX_E0172
     3291      {
     3292#endif
    32123293        vspFlag[iCount] = 1;
     3294#if MTK_VSP_FIX_E0172
     3295        vspDir[iCount] = pcCULeft->getVSPDir( uiLeftPartIdx );
     3296      }
     3297#endif
    32133298#endif
    32143299      if ( mrgCandIdx == iCount )
     
    32783363#if H_3D_VSP
    32793364      if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
     3365#if MTK_VSP_FIX_E0172
     3366      {
     3367#endif
    32803368        vspFlag[iCount] = 1;
     3369#if MTK_VSP_FIX_E0172
     3370        vspDir[iCount] = pcCUAbove->getVSPDir( uiAbovePartIdx );
     3371      }
     3372#endif
    32813373#endif
    32823374      if ( mrgCandIdx == iCount )
     
    33243416#if H_3D_VSP
    33253417    if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
     3418#if MTK_VSP_FIX_E0172
     3419    {
     3420#endif
    33263421      vspFlag[iCount] = 1;
     3422#if MTK_VSP_FIX_E0172
     3423      vspDir[iCount] = pcCUAboveRight->getVSPDir( uiAboveRightPartIdx);
     3424    }
     3425#endif
    33273426#endif
    33283427    if ( mrgCandIdx == iCount )
     
    33903489
    33913490#if H_3D_VSP
     3491#if MTK_VSP_FIX_E0172
     3492  if ( xAddVspCand( H_3D_VSP_POSITION, mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, vspDir ) )
     3493#else
    33923494  if ( xAddVspCand( H_3D_VSP_POSITION, mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )
     3495#endif
    33933496    return;
    33943497  // early termination
     
    34213524#if H_3D_VSP
    34223525    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1)
     3526#if MTK_VSP_FIX_E0172
     3527    {
     3528#endif
    34233529      vspFlag[iCount] = 1;
     3530#if MTK_VSP_FIX_E0172
     3531      vspDir[iCount] = pcCULeftBottom->getVSPDir( uiLeftBottomPartIdx);
     3532    }
     3533#endif
    34243534#endif
    34253535    if ( mrgCandIdx == iCount )
     
    34613571#if H_3D_VSP
    34623572      if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
     3573#if MTK_VSP_FIX_E0172
     3574      {
     3575#endif
    34633576        vspFlag[iCount] = 1;
     3577#if MTK_VSP_FIX_E0172
     3578        vspDir[iCount] = pcCUAboveLeft->getVSPDir( uiAboveLeftPartIdx);
     3579      }
     3580#endif
    34643581#endif
    34653582      if ( mrgCandIdx == iCount )
     
    49145031        Bool bCheck = false;
    49155032        if ( curPosition == 0 && iLCUIdxRBNb >= 0 )
     5033#if MTK_NBDV_TN_FIX_E0172
     5034          bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb,  cColMv, iTargetViewIdx, iTStartViewIdx);
     5035#else
    49165036          bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb,  cColMv, iTargetViewIdx, iTStartViewIdx);
     5037#endif
    49175038
    49185039        if (curPosition == 1 )
     5040#if MTK_NBDV_TN_FIX_E0172
     5041          bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx,   uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx );
     5042#else
    49195043          bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx,   uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx );
     5044#endif
    49205045
    49215046        if( bCheck )
     
    50215146          pDInfo->m_acNBDV = cDispVec;
    50225147          pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ];
     5148#if !MTK_DVMCP_FIX_E0172
    50235149          assert(pDInfo->m_aVIdxCan == 0); //Notes from QC: only works for CTC
     5150#endif
    50245151#if H_3D_NBDV_REF
    50255152          TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan );
     
    51455272          paIDVInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.getIDVHor(), cMvPred.getIDVVer() );
    51465273          //Notes from QC: DvMCP is implemented in a way that doesn�t carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design.
     5274#if MTK_DVMCP_FIX_E0172
     5275          paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = cMvPred.getIDVVId();
     5276#else 
    51475277          paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = 0;
     5278#endif
    51485279          paIDVInfo->m_bAvailab[iList][ uiMvpDvPos ] = true;
    51495280          paIDVInfo->m_bFound                        = true;
     
    52105341  }
    52115342}
    5212 
     5343#if MTK_NBDV_TN_FIX_E0172
     5344Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
     5345#else
    52135346Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
     5347#endif
    52145348{
    52155349
     
    52455379    else
    52465380    {
     5381#if MTK_NBDV_TN_FIX_E0172
     5382      if(getPic()->isTempIVRefValid(currCandPic, ilist,  iColRefIdx))
     5383      {
     5384#endif
    52475385      rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx);
    52485386      rcMv.setIDVFlag(0);
     
    52505388      iStartViewIdx   = iColViewIdx   ;
    52515389      return true;   
     5390#if MTK_NBDV_TN_FIX_E0172
     5391      }
     5392#endif
    52525393    }
    52535394  }
     
    53285469                cMv.setIDVHor    (cDv.getHor());                 
    53295470                cMv.setIDVVer    (cDv.getVer()); 
     5471#if MTK_DVMCP_FIX_E0172
     5472                cMv.setIDVVId    (iViewIndex);
     5473#endif
    53305474#endif
    53315475                clipMv( cMv );
     
    53485492    for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    53495493    {
     5494#if MTK_DIVMC_FIX_E0172
     5495      if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
     5496#else
    53505497      if( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC())
     5498#endif
    53515499      {
    53525500        abPdmAvailable[ iRefListId+2 ] = true;
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComDataCU.h

    r531 r566  
    197197  Char*         m_piVSPFlag;          ///< array of VSP flags to indicate whehter a block uses VSP or not
    198198                                      ///< 0: non-VSP; 1: VSP
     199#if MTK_VSP_FIX_E0172
     200  Char*         m_piVSPDir;           ///< 0: LIST0; 1: LIST1
     201#endif
    199202#endif
    200203#if H_3D_ARP
     
    246249  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    247250#if H_3D_VSP
     251#if MTK_VSP_FIX_E0172
     252  Bool          xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
     253                             Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int* vspDir );
     254#else
    248255  Bool          xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    249256                             Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag );
     257#endif
    250258#endif
    251259
     
    473481#endif
    474482  );
     483#if MTK_NBDV_TN_FIX_E0172
     484  Bool          xGetColDisMV      ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
     485#else
    475486  Bool          xGetColDisMV      ( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
     487#endif
    476488  Bool          getDisMvpCandNBDV ( DisInfo* pDInfo
    477489#if H_3D_NBDV_REF
     
    632644#if H_3D_VSP
    633645                                            , Int* vspFlag
     646#if MTK_VSP_FIX_E0172
     647                                            , Int* vspDir
     648#endif
    634649#endif
    635650                                            , Int& numValidMergeCand, Int mrgCandIdx = -1 );
     
    639654  Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;      }
    640655  Void          setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     656#if MTK_VSP_FIX_E0172
     657  Char*         getVSPDir          ()                        { return m_piVSPDir;                           }
     658  Char          getVSPDir          ( UInt uiIdx )            { return m_piVSPDir[uiIdx];                  }
     659  Void          setVSPDir          ( UInt uiIdx, Int n )     { m_piVSPDir[uiIdx] = n;  }
     660  Void          setVSPDirSubParts  ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     661#endif
    641662#endif
    642663  Void          deriveLeftRightTopIdxGeneral  ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComMv.h

    r499 r566  
    5858  Short m_iIDVHor;   
    5959  Short m_iIDVVer;   
     60#if MTK_DVMCP_FIX_E0172
     61  Short m_iIDVVId;  //view index of the IDV
     62#endif
    6063#endif
    6164public:
     
    7275  , m_iIDVHor(0)
    7376  , m_iIDVVer(0)
     77#if MTK_DVMCP_FIX_E0172
     78  , m_iIDVVId(0)
     79#endif
    7480#endif
    7581  {
     
    8389  , m_iIDVHor(0)
    8490  , m_iIDVVer(0)
     91#if MTK_DVMCP_FIX_E0172
     92  , m_iIDVVId(0)
     93#endif
    8594#endif
    8695  {
     
    97106 #if H_3D_NBDV
    98107   m_bIDV = false; m_iIDVHor = m_iIDVVer = 0;
     108#if MTK_DVMCP_FIX_E0172
     109   m_iIDVVId = 0;
     110#endif
    99111#endif
    100112  }
     
    103115  Void   setIDVVer  (Short i)                    {m_iIDVVer = i;}
    104116  Void   setIDVFlag (Bool b )                    {m_bIDV    = b;}
     117#if MTK_DVMCP_FIX_E0172
     118  Void   setIDVVId  (Short i)                    {m_iIDVVId = i;}
     119#endif
    105120#endif
    106121  // ------------------------------------------------------------------------------------------------------------------
     
    116131  Short getIDVVer () const { return m_iIDVVer;       }
    117132  Bool  getIDVFlag() const { return m_bIDV;          }
     133#if MTK_DVMCP_FIX_E0172
     134  Short getIDVVId () const { return m_iIDVVId;       }
     135#endif
    118136#endif
    119137  // ------------------------------------------------------------------------------------------------------------------
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComPic.cpp

    r539 r566  
    655655}
    656656#endif
     657#if MTK_NBDV_TN_FIX_E0172
     658Void TComPic::checkTemporalIVRef()
     659{
     660  TComSlice* currSlice = getSlice(getCurrSliceIdx());
     661  const Int numCandPics = this->getNumDdvCandPics();
     662  for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++)
     663  {
     664    RefPicList eCurRefPicList   = REF_PIC_LIST_0 ;
     665    Int        curCandPicRefIdx = 0;
     666    if( curCandPic == 0 )
     667    {
     668      eCurRefPicList   = RefPicList(currSlice->isInterB() ? 1-currSlice->getColFromL0Flag() : 0);
     669      curCandPicRefIdx = currSlice->getColRefIdx();
     670    }
     671    else                 
     672    {
     673      eCurRefPicList   = this->getRapRefList();
     674      curCandPicRefIdx = this->getRapRefIdx();
     675    }
     676    TComPic* pcCandColPic = currSlice->getRefPic( eCurRefPicList, curCandPicRefIdx);
     677    TComSlice* pcCandColSlice = pcCandColPic->getSlice(0);// currently only support single slice
     678
     679    if(!pcCandColSlice->isIntra())
     680    {
     681      for( Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2: 1); iColRefDir ++ )
     682      {
     683        for( Int iColRefIdx =0; iColRefIdx < pcCandColSlice->getNumRefIdx(( RefPicList )iColRefDir ); iColRefIdx++)
     684        {
     685          m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false;
     686          Int iColViewIdx    = pcCandColSlice->getViewIndex();
     687          Int iColRefViewIdx = pcCandColSlice->getRefPic( ( RefPicList )iColRefDir, iColRefIdx)->getViewIndex();
     688          if(iColViewIdx == iColRefViewIdx)
     689            continue;
     690
     691          for(Int iCurrRefDir = 0;(iCurrRefDir < (currSlice->isInterB() ? 2: 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false ); iCurrRefDir++)
     692          {
     693            for( Int iCurrRefIdx =0; iCurrRefIdx < currSlice->getNumRefIdx(( RefPicList )iCurrRefDir ); iCurrRefIdx++)
     694            {
     695              if( currSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx )->getViewIndex() == iColRefViewIdx )
     696              { 
     697                m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true;
     698                break;
     699              }
     700            }
     701          }
     702        }
     703      }
     704    }
     705  }
     706}
     707Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx)
     708{
     709  return m_abTIVRINCurrRL[currCandPic][iColRefDir][iColRefIdx];
     710}
     711#endif
    657712//! \}
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComPic.h

    r541 r566  
    104104  Int         m_iNumDdvCandPics;
    105105#endif
     106#if MTK_NBDV_TN_FIX_E0172
     107  Bool        m_abTIVRINCurrRL  [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists
     108#endif
    106109public:
    107110  TComPic();
     
    215218  RefPicList    getRapRefList()                        {return m_eRapRefList;       }
    216219#endif
     220#if MTK_NBDV_TN_FIX_E0172
     221  Void      checkTemporalIVRef();
     222  Bool      isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx);
     223#endif
    217224  /** transfer ownership of seis to this picture */
    218225  void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComPrediction.cpp

    r537 r566  
    697697{
    698698  // Get depth reference
     699#if MTK_VSP_FIX_E0172
     700  Int vspDir = pcCU->getVSPDir( uiPartAddr );
     701  RefPicList privateRefPicList = (vspDir == 0) ? REF_PIC_LIST_0 : REF_PIC_LIST_1;
     702  Int privateRefIdx = pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr );
     703  Int depthRefViewIdx = pcCU->getSlice()->getRefPic(privateRefPicList, privateRefIdx)->getViewIndex();
     704#else
    699705  Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan;
     706#endif
    700707  TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
    701708  assert(pRefPicBaseDepth != NULL);
     
    716723
    717724  // Do compensation
     725#if MTK_VSP_FIX_E0172
     726  TComMv cDv  = pcCU->getCUMvField( privateRefPicList )->getMv( uiPartAddr );
     727#else
    718728  TComMv cDv  = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); // cDv is the disparity vector derived from the neighbors
     729#endif
    719730  pcCU->clipMv(cDv);
    720731  UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TypeDef.h

    r543 r566  
    101101                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
    102102                                              // MERL_C0152: Basic VSP
     103#define MTK_RVS_BUGFIX_E0172              1  // Bug fix for issues caused by reference view selection, JCT3V-E0172
     104#if MTK_RVS_BUGFIX_E0172
     105#define MTK_DVMCP_FIX_E0172                  1 // fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172
     106#define MTK_VSP_FIX_E0172                    1 // fix the issues related to VSP merge candidate, issue 3, 4 in JCT3V-E0172
     107#define MTK_DIVMC_FIX_E0172                  1 // fix the issue of derivation of disparity inter-view merge candidate, issue 5 in JCT3V-E0172
     108#define MTK_NBDV_TN_FIX_E0172                1 // fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172
     109#endif
    103110#endif
    104111#define H_3D_VSP                          1   // View synthesis prediction
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibDecoder/TDecCu.cpp

    r531 r566  
    366366    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    367367    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    368 
     368#if MTK_VSP_FIX_E0172
     369    Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     370    memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     371    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand, uiMergeIndex );
     372    pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
     373#else
    369374    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex );
     375#endif
    370376    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    371377#else
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibDecoder/TDecEntropy.cpp

    r531 r566  
    243243          Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    244244          memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     245#if MTK_VSP_FIX_E0172
     246          Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     247          memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     248          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir, numValidMergeCand );
     249          pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     250#else
    245251          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand );
     252#endif
    246253          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    247254#else
     
    258265        Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    259266        memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     267#if MTK_VSP_FIX_E0172
     268        Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     269        memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     270        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir,numValidMergeCand, uiMergeIndex );
     271        pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     272#else
    260273        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex );
     274#endif
    261275        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    262276#else
     
    291305      }
    292306    }
     307#if MTK_VSP_FIX_E0172
     308    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
     309#else
    293310    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
     311#endif
    294312    {
    295313      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibDecoder/TDecGop.cpp

    r542 r566  
    159159  }
    160160#endif
     161#if MTK_NBDV_TN_FIX_E0172
     162  if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
     163  {
     164    rpcPic->checkTemporalIVRef();
     165  }
     166#endif
    161167#if H_3D
    162168  pcSlice->setDepthToDisparityLUTs();
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncCu.cpp

    r541 r566  
    16151615  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    16161616  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     1617#if MTK_VSP_FIX_E0172
     1618  Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     1619  memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     1620  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand );
     1621#else
    16171622  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
     1623#endif
    16181624#else
    16191625  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     
    16831689#if H_3D_VSP
    16841690          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
     1691#if MTK_VSP_FIX_E0172
     1692          rpcTempCU->setVSPDirSubParts( vspDir[uiMergeCand], 0, 0, uhDepth );
     1693#endif
    16851694#endif
    16861695          rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncGOP.cpp

    r542 r566  
    10781078#endif
    10791079#endif
     1080#if MTK_NBDV_TN_FIX_E0172
     1081      if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
     1082      {
     1083        pcPic->checkTemporalIVRef();
     1084      }
     1085#endif
    10801086    while(nextCUAddr<uiRealEndAddress) // determine slice boundaries
    10811087    {
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.cpp

    r537 r566  
    35503550#if H_3D_VSP
    35513551                                 , Int* vspFlag
     3552#if MTK_VSP_FIX_E0172
     3553                                 , Int* vspDir
     3554#endif
    35523555#endif
    35533556                                 , Int& numValidMergeCand
     
    35693572#if H_3D_VSP
    35703573                                   , vspFlag
     3574#if MTK_VSP_FIX_E0172
     3575                                   , vspDir
     3576#endif
    35713577#endif
    35723578                                   , numValidMergeCand
     
    35803586#if H_3D_VSP
    35813587                                 , vspFlag
     3588#if MTK_VSP_FIX_E0172
     3589                                 , vspDir
     3590#endif
    35823591#endif
    35833592                                 , numValidMergeCand
    35843593                                 );
    35853594  }
     3595#if MTK_VSP_FIX_E0172
     3596  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand );
     3597#else
    35863598  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
     3599#endif
    35873600
    35883601  ruiCost = MAX_UINT;
     
    36003613#if H_3D_VSP
    36013614      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3615#if MTK_VSP_FIX_E0172
     3616      pcCU->setVSPDirSubParts( vspDir[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3617#endif
    36023618#endif
    36033619
     
    36293645 * \returns Void
    36303646 */
     3647#if MTK_VSP_FIX_E0172
     3648Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand )
     3649#else
    36313650Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int numValidMergeCand )
     3651#endif
    36323652{
    36333653  if ( pcCU->isBipredRestriction(puIdx) )
     
    36353655    for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand )
    36363656    {
     3657#if MTK_VSP_FIX_E0172
     3658      if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) )
     3659#else
    36373660      if ( interDirNeighbours[mergeCand] == 3 )
     3661#endif
    36383662      {
    36393663        interDirNeighbours[mergeCand] = 1;
     
    37583782#if H_3D_VSP
    37593783    pcCU->setVSPFlagSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
     3784#if MTK_VSP_FIX_E0172
     3785    pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) );
     3786#endif
    37603787#endif
    37613788   
     
    42504277      Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    42514278      memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     4279#if MTK_VSP_FIX_E0172
     4280      Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     4281      memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     4282#endif
    42524283#endif
    42534284
     
    42554286#if H_3D_VSP
    42564287                      , vspFlag
     4288#if MTK_VSP_FIX_E0172
     4289                      , vspDir
     4290#endif
    42574291#endif
    42584292                      , numValidMergeCand
     
    42654299#if H_3D_VSP
    42664300        pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4301#if MTK_VSP_FIX_E0172
     4302        pcCU->setVSPDirSubParts( vspDir[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4303#endif
    42674304#endif
    42684305        pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     
    42874324#if H_3D_VSP
    42884325        pcCU->setVSPFlagSubParts ( 0,             uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4326#if MTK_VSP_FIX_E0172
     4327        pcCU->setVSPDirSubParts ( 0,             uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4328#endif
    42894329#endif
    42904330        {
  • branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibEncoder/TEncSearch.h

    r531 r566  
    415415#if H_3D_VSP
    416416                                  , Int* vspFlag
     417#if MTK_VSP_FIX_E0172
     418                                  , Int* vspDir
     419#endif
    417420#endif
    418421                                  , Int& numValidMergeCand
     
    423426                                    TComMvField*    mvFieldNeighbours,
    424427                                    UChar*          interDirNeighbours,
     428#if MTK_VSP_FIX_E0172
     429                                    Int* vspFlag,
     430#endif
    425431                                    Int             numValidMergeCand );
    426432
Note: See TracChangeset for help on using the changeset viewer.