Ignore:
Timestamp:
14 May 2015, 03:55:10 (10 years ago)
Author:
samsung-htm
Message:

Alignment and reactivation of NBDV

  • new macro NH_3D_NBDV for NBDV
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev3-Samsung-Qualcomm/source/Lib/TLibCommon/TComPic.cpp

    r1200 r1210  
    7878  m_bReduceBitsQTL    = 0;
    7979#endif
    80 #if H_3D_NBDV
     80#if NH_3D_NBDV
    8181  m_iNumDdvCandPics   = 0;
    8282  m_eRapRefList       = REF_PIC_LIST_0;
     
    303303#endif // NH_MV
    304304
    305 #if H_3D_NBDV
    306 Int TComPic::getDisCandRefPictures( Int iColPOC )
     305#if NH_3D_NBDV
     306Int TComPic::getDisCandRefPictures(Int iColPOC)
    307307{
    308308  UInt       uiTempLayerCurr = 7;
     
    310310  UInt       numDdvCandPics  = 0;
    311311
    312   if ( !currSlice->getEnableTMVPFlag() )
     312  if(!currSlice->getEnableTMVPFlag())
     313  {
    313314    return numDdvCandPics;
     315  }
    314316
    315317  numDdvCandPics += 1;
     
    318320  UInt pocDiff = 255;
    319321
    320   for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
    321   {
    322     UInt x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();
    323 
    324     for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
     322  for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr++)
     323  {
     324    Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();
     325
     326    for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
    325327    {
    326328      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex()
    327         && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) && numDdvCandPics!=2)
     329         && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) && numDdvCandPics != 2)
    328330      {
    329331        TComSlice* refSlice    = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx());
    330         Bool       bRAP        = (refSlice->getViewIndex() && refSlice->isIRAP())? 1: 0;
     332        Bool       bRAP        = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1 : 0;
    331333        UInt       uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer();
    332334       
    333         if( bRAP )
     335        if(bRAP)
    334336        {
    335337          this->setRapRefIdx(i);
     
    350352  UInt idx = 0;
    351353 
    352   for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
    353   {
    354     UInt x = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();
     354  for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++)
     355  {
     356    Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();
    355357   
    356     for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
     358    for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
    357359    {
    358360      Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC();
    359       Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr): (pocCurr - iTempPoc);
     361      Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc);
    360362     
    361       if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() &&  (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC)
    362         && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff)
     363      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC)
     364         && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff)
    363365      {
    364366        pocDiff = iTempDiff;
     
    369371  }
    370372
    371   if( pocDiff < 255 )
     373  if(pocDiff < 255)
    372374  {
    373375    this->setRapRefIdx(idx);
    374     this->setRapRefList((RefPicList) z );
     376    this->setRapRefList((RefPicList) z);
    375377    numDdvCandPics = 2;
    376378  }
     
    383385  TComSlice* currSlice = getSlice(getCurrSliceIdx());
    384386  const Int numCandPics = this->getNumDdvCandPics();
     387
    385388  for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++)
    386389  {
    387390    RefPicList eCurRefPicList   = REF_PIC_LIST_0 ;
    388391    Int        curCandPicRefIdx = 0;
    389     if( curCandPic == 0 )
     392    if(curCandPic == 0)
    390393    {
    391       eCurRefPicList   = RefPicList(currSlice->isInterB() ? 1-currSlice->getColFromL0Flag() : 0);
     394      eCurRefPicList   = RefPicList(currSlice->isInterB() ? 1 - currSlice->getColFromL0Flag() : 0);
    392395      curCandPicRefIdx = currSlice->getColRefIdx();
    393396    }
     
    397400      curCandPicRefIdx = this->getRapRefIdx();
    398401    }
    399     TComPic* pcCandColPic = currSlice->getRefPic( eCurRefPicList, curCandPicRefIdx);
    400     TComSlice* pcCandColSlice = pcCandColPic->getSlice(0);// currently only support single slice
     402
     403    TComPic* pcCandColPic = currSlice->getRefPic(eCurRefPicList, curCandPicRefIdx);
     404    TComSlice* pcCandColSlice = pcCandColPic->getSlice(0); // currently only support single slice
    401405
    402406    if(!pcCandColSlice->isIntra())
    403407    {
    404       for( Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2: 1); iColRefDir ++ )
    405       {
    406         for( Int iColRefIdx =0; iColRefIdx < pcCandColSlice->getNumRefIdx(( RefPicList )iColRefDir ); iColRefIdx++)
     408      for(Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2 : 1); iColRefDir++)
     409      {
     410        for(Int iColRefIdx = 0; iColRefIdx < pcCandColSlice->getNumRefIdx((RefPicList)iColRefDir); iColRefIdx++)
    407411        {
    408412          m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false;
    409413          Int iColViewIdx    = pcCandColSlice->getViewIndex();
    410           Int iColRefViewIdx = pcCandColSlice->getRefPic( ( RefPicList )iColRefDir, iColRefIdx)->getViewIndex();
     414          Int iColRefViewIdx = pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx)->getViewIndex();
    411415          if(iColViewIdx == iColRefViewIdx)
     416          {
    412417            continue;
    413 
    414           for(Int iCurrRefDir = 0;(iCurrRefDir < (currSlice->isInterB() ? 2: 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false ); iCurrRefDir++)
     418          }
     419
     420          for(Int iCurrRefDir = 0; (iCurrRefDir < (currSlice->isInterB() ? 2 : 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false); iCurrRefDir++)
    415421          {
    416             for( Int iCurrRefIdx =0; iCurrRefIdx < currSlice->getNumRefIdx(( RefPicList )iCurrRefDir ); iCurrRefIdx++)
     422            for(Int iCurrRefIdx = 0; iCurrRefIdx < currSlice->getNumRefIdx((RefPicList)iCurrRefDir); iCurrRefIdx++)
    417423            {
    418               if( currSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx )->getViewIndex() == iColRefViewIdx )
     424              if(currSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iColRefViewIdx)
    419425              { 
    420426                m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true;
     
    428434  }
    429435}
     436
    430437Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx)
    431438{
     
    433440}
    434441
    435 Void TComPic::checkTextureRef(  )
     442Void TComPic::checkTextureRef()
    436443{
    437444  TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx());
    438   TComPic* pcTextPic = pcCurrSlice->getTexturePic();
     445  TComPic* pcTextPic = pcCurrSlice->getIvPic(0, getViewIndex());
    439446#if H_3D_FCO
    440447  if ( pcTextPic )
    441448  {
    442449#endif
    443 
    444450    TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice
    445451
    446     for( Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB()? 2:1) ) && !pcTextSlice->isIntra(); iTextRefDir ++ )
    447     {
    448       for( Int iTextRefIdx =0; iTextRefIdx<pcTextSlice->getNumRefIdx(( RefPicList )iTextRefDir ); iTextRefIdx++)
    449       {
    450         Int iTextRefPOC    = pcTextSlice->getRefPOC( ( RefPicList )iTextRefDir, iTextRefIdx);
    451         Int iTextRefViewId = pcTextSlice->getRefPic( ( RefPicList )iTextRefDir, iTextRefIdx)->getViewIndex();
     452    for(Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB() ? 2 :1) ) && !pcTextSlice->isIntra(); iTextRefDir++)
     453    {
     454      for(Int iTextRefIdx =0; iTextRefIdx < pcTextSlice->getNumRefIdx((RefPicList)iTextRefDir); iTextRefIdx++)
     455      {
     456        Int iTextRefPOC    = pcTextSlice->getRefPOC((RefPicList)iTextRefDir, iTextRefIdx);
     457        Int iTextRefViewId = pcTextSlice->getRefPic((RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex();
    452458        m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1;
    453459        Int iCurrRefDir = iTextRefDir;
    454         for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++)
     460
     461        for(Int iCurrRefIdx = 0; (iCurrRefIdx<pcCurrSlice->getNumRefIdx((RefPicList)iCurrRefDir)) && (m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0); iCurrRefIdx++)
    455462        {
    456           if( pcCurrSlice->getRefPOC( ( RefPicList )iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&
    457             pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId )
     463          if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&
     464             pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId)
    458465          { 
    459466            m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx;
     
    461468        }
    462469      }
    463 
    464470    }
    465471#if H_3D_FCO
Note: See TracChangeset for help on using the changeset viewer.