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@…)

File:
1 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;
Note: See TracChangeset for help on using the changeset viewer.