Ignore:
Timestamp:
14 Jul 2015, 12:31:09 (9 years ago)
Author:
tech
Message:

Merged HTM-14.1-update-dev3@1273.

File:
1 edited

Legend:

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

    r1256 r1274  
    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;
     
    143143}
    144144#if NH_3D
     145#if NH_3D_ARP
     146Void TComPic::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx )
     147{
     148  Int iMaxCUWidth   = (Int) ( getPicSym()->getSPS().getMaxCUWidth()  );
     149  Int iMaxCuHeight  = (Int) ( getPicSym()->getSPS().getMaxCUHeight() );
     150
     151  UInt uiMaxTotalCUDepth = getPicSym()->getSPS().getMaxTotalCUDepth();
     152  Int iBaseUnitWidth  = iMaxCUWidth >> uiMaxTotalCUDepth;
     153  Int iBaseUnitHeight = iMaxCUWidth >> uiMaxTotalCUDepth;
     154
     155  Int iNumCuInWidth   = getPicYuvRec()->getWidth(COMPONENT_Y) / iMaxCUWidth;
     156  iNumCuInWidth      += ( getPicYuvRec()->getWidth(COMPONENT_Y) % iMaxCUWidth ) ? 1 : 0;
     157
     158
     159  Int iCuX            = iX / iMaxCUWidth;
     160  Int iCuY            = iY / iMaxCuHeight;
     161  Int iBaseX          = ( iX - iCuX * iMaxCUWidth  ) / iBaseUnitWidth;
     162  Int iBaseY          = ( iY - iCuY * iMaxCuHeight ) / iBaseUnitHeight;
     163  Int iCuSizeInBases  = iMaxCuHeight                 / iBaseUnitWidth;
     164
     165  riCuAddr            = iCuY   * iNumCuInWidth + iCuX;
     166  Int iRastPartIdx    = iBaseY * iCuSizeInBases  + iBaseX;
     167  riAbsZorderIdx      = g_auiRasterToZscan[ iRastPartIdx ];
     168}
     169#endif
    145170Void TComPic::compressMotion(Int scale)
    146171#else
     
    283308  return getPicYuv( layerIdInNuh, poc, recon );
    284309}
    285 #if H_3D_ARP
     310#if NH_3D_ARP
    286311TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh )
    287312{
     
    303328#endif // NH_MV
    304329
    305 #if H_3D_NBDV
    306 Int TComPic::getDisCandRefPictures( Int iColPOC )
     330#if NH_3D_NBDV
     331Int TComPic::getDisCandRefPictures(Int iColPOC)
    307332{
    308333  UInt       uiTempLayerCurr = 7;
     
    310335  UInt       numDdvCandPics  = 0;
    311336
    312   if ( !currSlice->getEnableTMVPFlag() )
     337  if(!currSlice->getEnableTMVPFlag())
     338  {
    313339    return numDdvCandPics;
     340  }
    314341
    315342  numDdvCandPics += 1;
     
    318345  UInt pocDiff = 255;
    319346
    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++)
     347  for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr++)
     348  {
     349    Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();
     350
     351    for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
    325352    {
    326353      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex()
    327         && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) && numDdvCandPics!=2)
     354         && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) && numDdvCandPics != 2)
    328355      {
    329356        TComSlice* refSlice    = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx());
    330         Bool       bRAP        = (refSlice->getViewIndex() && refSlice->isIRAP())? 1: 0;
     357        Bool       bRAP        = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1 : 0;
    331358        UInt       uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer();
    332359       
    333         if( bRAP )
     360        if(bRAP)
    334361        {
    335362          this->setRapRefIdx(i);
     
    350377  UInt idx = 0;
    351378 
    352   for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
    353   {
    354     UInt x = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();
     379  for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++)
     380  {
     381    Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();
    355382   
    356     for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
     383    for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
    357384    {
    358385      Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC();
    359       Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr): (pocCurr - iTempPoc);
     386      Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc);
    360387     
    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)
     388      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC)
     389         && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff)
    363390      {
    364391        pocDiff = iTempDiff;
     
    369396  }
    370397
    371   if( pocDiff < 255 )
     398  if(pocDiff < 255)
    372399  {
    373400    this->setRapRefIdx(idx);
    374     this->setRapRefList((RefPicList) z );
     401    this->setRapRefList((RefPicList) z);
    375402    numDdvCandPics = 2;
    376403  }
     
    383410  TComSlice* currSlice = getSlice(getCurrSliceIdx());
    384411  const Int numCandPics = this->getNumDdvCandPics();
     412
    385413  for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++)
    386414  {
    387415    RefPicList eCurRefPicList   = REF_PIC_LIST_0 ;
    388416    Int        curCandPicRefIdx = 0;
    389     if( curCandPic == 0 )
     417    if(curCandPic == 0)
    390418    {
    391       eCurRefPicList   = RefPicList(currSlice->isInterB() ? 1-currSlice->getColFromL0Flag() : 0);
     419      eCurRefPicList   = RefPicList(currSlice->isInterB() ? 1 - currSlice->getColFromL0Flag() : 0);
    392420      curCandPicRefIdx = currSlice->getColRefIdx();
    393421    }
     
    397425      curCandPicRefIdx = this->getRapRefIdx();
    398426    }
    399     TComPic* pcCandColPic = currSlice->getRefPic( eCurRefPicList, curCandPicRefIdx);
    400     TComSlice* pcCandColSlice = pcCandColPic->getSlice(0);// currently only support single slice
     427
     428    TComPic* pcCandColPic = currSlice->getRefPic(eCurRefPicList, curCandPicRefIdx);
     429    TComSlice* pcCandColSlice = pcCandColPic->getSlice(0); // currently only support single slice
    401430
    402431    if(!pcCandColSlice->isIntra())
    403432    {
    404       for( Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2: 1); iColRefDir ++ )
    405       {
    406         for( Int iColRefIdx =0; iColRefIdx < pcCandColSlice->getNumRefIdx(( RefPicList )iColRefDir ); iColRefIdx++)
     433      for(Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2 : 1); iColRefDir++)
     434      {
     435        for(Int iColRefIdx = 0; iColRefIdx < pcCandColSlice->getNumRefIdx((RefPicList)iColRefDir); iColRefIdx++)
    407436        {
    408437          m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false;
    409438          Int iColViewIdx    = pcCandColSlice->getViewIndex();
    410           Int iColRefViewIdx = pcCandColSlice->getRefPic( ( RefPicList )iColRefDir, iColRefIdx)->getViewIndex();
     439          Int iColRefViewIdx = pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx)->getViewIndex();
    411440          if(iColViewIdx == iColRefViewIdx)
     441          {
    412442            continue;
    413 
    414           for(Int iCurrRefDir = 0;(iCurrRefDir < (currSlice->isInterB() ? 2: 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false ); iCurrRefDir++)
     443          }
     444
     445          for(Int iCurrRefDir = 0; (iCurrRefDir < (currSlice->isInterB() ? 2 : 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false); iCurrRefDir++)
    415446          {
    416             for( Int iCurrRefIdx =0; iCurrRefIdx < currSlice->getNumRefIdx(( RefPicList )iCurrRefDir ); iCurrRefIdx++)
     447            for(Int iCurrRefIdx = 0; iCurrRefIdx < currSlice->getNumRefIdx((RefPicList)iCurrRefDir); iCurrRefIdx++)
    417448            {
    418               if( currSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx )->getViewIndex() == iColRefViewIdx )
     449              if(currSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iColRefViewIdx)
    419450              { 
    420451                m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true;
     
    428459  }
    429460}
     461
    430462Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx)
    431463{
     
    433465}
    434466
    435 Void TComPic::checkTextureRef(  )
     467Void TComPic::checkTextureRef()
    436468{
    437469  TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx());
    438   TComPic* pcTextPic = pcCurrSlice->getTexturePic();
     470  TComPic* pcTextPic = pcCurrSlice->getIvPic(0, getViewIndex());
    439471#if H_3D_FCO
    440472  if ( pcTextPic )
    441473  {
    442474#endif
    443 
    444475    TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice
    445476
    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();
     477    for(Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB() ? 2 :1) ) && !pcTextSlice->isIntra(); iTextRefDir++)
     478    {
     479      for(Int iTextRefIdx =0; iTextRefIdx < pcTextSlice->getNumRefIdx((RefPicList)iTextRefDir); iTextRefIdx++)
     480      {
     481        Int iTextRefPOC    = pcTextSlice->getRefPOC((RefPicList)iTextRefDir, iTextRefIdx);
     482        Int iTextRefViewId = pcTextSlice->getRefPic((RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex();
    452483        m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1;
    453484        Int iCurrRefDir = iTextRefDir;
    454         for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++)
     485
     486        for(Int iCurrRefIdx = 0; (iCurrRefIdx<pcCurrSlice->getNumRefIdx((RefPicList)iCurrRefDir)) && (m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0); iCurrRefIdx++)
    455487        {
    456           if( pcCurrSlice->getRefPOC( ( RefPicList )iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&
    457             pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId )
     488          if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&
     489             pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId)
    458490          { 
    459491            m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx;
     
    461493        }
    462494      }
    463 
    464495    }
    465496#if H_3D_FCO
Note: See TracChangeset for help on using the changeset viewer.