Changeset 986 in 3DVCSoftware


Ignore:
Timestamp:
14 Jul 2014, 04:08:54 (10 years ago)
Author:
qualcomm
Message:

Integration of JCT3V-I0051

Location:
branches/HTM-11.2-dev2-Qualcomm
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp

    r985 r986  
    13601360  }
    13611361}
     1362
     1363#if QC_I0051_ARP_SIMP
     1364Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc )
     1365{
     1366  Int         iRefIdx       = pcCU->getCUMvField( eBaseRefPicList )->getRefIdx( uiPartAddr );
     1367  TComMv      cDMv          = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr );
     1368  TComPic* pcPicYuvBaseCol  = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 
     1369  TComPicYuv* pcYuvBaseCol  = pcPicYuvBaseCol->getPicYuvRec();
     1370  Int uiLCUAddr,uiAbsPartAddr;
     1371  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
     1372  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     1373
     1374  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
     1375  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 
     1376  pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
     1377  TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
     1378
     1379  TComPic* pcPicYuvBaseTRef = NULL;
     1380  pcPicYuvCurrTRef = NULL;
     1381
     1382  //If there is available motion in base reference list, use it
     1383  if(!pColCU->isIntra(uiAbsPartAddr))
     1384  {
     1385    for(Int iList = 0; iList < (pColCU->getSlice()->isInterB() ? 2: 1); iList ++)
     1386    {
     1387      RefPicList eRefPicListCurr = RefPicList(iList);
     1388      Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr);
     1389      if( iRef != -1)
     1390      {
     1391        pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 
     1392        Int  iCurrPOC    = pColCU->getSlice()->getPOC();
     1393        Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
     1394        Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
     1395        if( iCurrRef >= 0)
     1396        {
     1397          pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef); 
     1398          Int iTargetPOC = pcPicYuvCurrTRef->getPOC();
     1399          pcPicYuvBaseTRef =  pcCU->getSlice()->getBaseViewRefPic(iTargetPOC,  pcPicYuvBaseCol->getViewIndex() ); 
     1400          if(pcPicYuvBaseTRef)
     1401          {
     1402            cBaseTMV = pColCU->getCUMvField(eRefPicListCurr)->getMv(uiAbsPartAddr);
     1403            Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC);
     1404            if ( iScale != 4096 )
     1405            {
     1406              cBaseTMV = cBaseTMV.scaleMv( iScale );
     1407            }
     1408            iCurrTRefPoc = iTargetPOC;
     1409            return true;
     1410          }
     1411        }
     1412      }
     1413    }
     1414  }
     1415
     1416  //If there is no available motion in base reference list, use ( 0, 0 )
     1417  if( pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) >= 0 )
     1418  {
     1419    cBaseTMV.set( 0, 0 );
     1420    pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eBaseRefPicList,  pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) );
     1421    iCurrTRefPoc = pcPicYuvCurrTRef->getPOC();
     1422    return true;
     1423  }
     1424
     1425  return false;
     1426}
     1427#endif
     1428
    13621429Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
    13631430{
     
    13931460  pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
    13941461  TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
    1395 
     1462#if QC_I0051_ARP_SIMP
     1463  if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
     1464  {
     1465    RefPicList eOtherRefList = ( eRefPicList == REF_PIC_LIST_0 ) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     1466    Int iOtherRefIdx = pcCU->getCUMvField( eOtherRefList )->getRefIdx( uiPartAddr );
     1467    //The other prediction direction is temporal ARP
     1468    if( iOtherRefIdx >= 0 && pcCU->getSlice()->getViewIndex() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() )
     1469    {
     1470      bTMVAvai = true;
     1471      pcPicYuvBaseTRef = pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx );
     1472      Int  iCurrPOC    = pcCU->getSlice()->getPOC();
     1473      Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
     1474      Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx( eOtherRefList );
     1475     
     1476      if( iCurrRef >= 0 )
     1477      {
     1478        pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic( eOtherRefList,iCurrRef ); 
     1479        Int iTargetPOC = pcPicYuvCurrTRef->getPOC();
     1480        pcPicYuvBaseTRef =  pcCU->getSlice()->getBaseViewRefPic( iTargetPOC,  pcPicYuvBaseCol->getViewIndex() );
     1481        if( pcPicYuvBaseTRef )
     1482        {
     1483          cBaseTMV = pcCU->getCUMvField( eOtherRefList )->getMv( uiPartAddr );
     1484          Int iScale = pcCU-> xGetDistScaleFactor( iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC );
     1485          if ( iScale != 4096 )
     1486          {
     1487            cBaseTMV = cBaseTMV.scaleMv( iScale );
     1488          }
     1489        }
     1490        else
     1491        {
     1492          dW = 0;
     1493        }
     1494      }
     1495      else
     1496      {
     1497        dW = 0;
     1498      }
     1499    }
     1500
     1501    //Both prediction directions are inter-view ARP
     1502    if ( iOtherRefIdx >= 0 && !bTMVAvai )
     1503    {
     1504      RefPicList eBaseList = REF_PIC_LIST_0;
     1505      Int iCurrTRefPoc;
     1506      bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() );
     1507     
     1508      if ( bTMVAvai )
     1509      {
     1510        if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) )
     1511        {
     1512          pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc,  pcPicYuvBaseCol->getViewIndex() );
     1513          if ( pcPicYuvBaseTRef == NULL )
     1514          {
     1515            dW = 0;
     1516          }
     1517        }
     1518        else
     1519        {
     1520          dW = 0;
     1521        }
     1522      }
     1523    }
     1524  }
     1525
     1526  if( !pColCU->isIntra( uiAbsPartAddr ) && !bTMVAvai )
     1527#else
    13961528  if(!pColCU->isIntra(uiAbsPartAddr))
     1529#endif
    13971530  {
    13981531    TComMvField puMVField;
  • branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPrediction.h

    r884 r986  
    9090#if H_3D_ARP
    9191  Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL );
     92#if QC_I0051_ARP_SIMP
     93  Bool xCheckBiInterviewARP     ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc );
     94#endif
    9295  Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );
    9396#endif
  • branches/HTM-11.2-dev2-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r985 r986  
    284284#define H_3D_ARP_WFNR                     3
    285285#define QC_I0129_ARP_FIX                  1
     286#define QC_I0051_ARP_SIMP                 1
    286287#endif
    287288
Note: See TracChangeset for help on using the changeset viewer.