Ignore:
Timestamp:
15 Nov 2013, 13:43:17 (11 years ago)
Author:
nokia
Message:

Fix inter-layer constrained tile sets for merge and skip modes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r442 r474  
    250250#endif
    251251
     252#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     253  m_disableILP = xCheckTileSetConstraint(rpcCU);
     254  m_pcPredSearch->setDisableILP(m_disableILP);
     255#endif
     256
    252257  // analysis of CU
    253258  xCompressCU( m_ppcBestCU[0], m_ppcTempCU[0], 0 );
     
    261266    }
    262267  }
     268#endif
     269
     270#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     271  xVerifyTileSetConstraint(rpcCU);
    263272#endif
    264273}
     
    731740        }
    732741#if (ENCODER_FAST_MODE)
     742#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     743      if(pcPic->getLayerId() > 0 && !m_disableILP)
     744#else
    733745      if(pcPic->getLayerId() > 0)
     746#endif
    734747      {
    735748        for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++)
     
    13811394      Bool bZeroMVILR = rpcTempCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]);
    13821395      if(bZeroMVILR)
     1396      {
     1397#endif
     1398#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     1399      if (!(rpcTempCU->isInterLayerReference(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]) && m_disableILP))
    13831400      {
    13841401#endif
     
    14261443          }
    14271444        }
     1445      }
     1446#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     1447      }
     1448#endif
    14281449#if REF_IDX_ME_ZEROMV
    1429         }
    1430 #endif
    1431       }
     1450      }
     1451#endif
    14321452  }
    14331453
     
    18081828}
    18091829
     1830#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     1831Bool TEncCu::xCheckTileSetConstraint( TComDataCU*& rpcCU )
     1832{
     1833  Bool disableILP = false;
     1834
     1835  if (rpcCU->getLayerId() == (m_pcEncCfg->getNumLayer() - 1)  && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(rpcCU->getAddr()) >= 0)
     1836  {
     1837    if (rpcCU->getPic()->getPicSym()->getTileSetType(rpcCU->getAddr()) == 2)
     1838    {
     1839      disableILP = true;
     1840    }
     1841    if (rpcCU->getPic()->getPicSym()->getTileSetType(rpcCU->getAddr()) == 1)
     1842    {
     1843      Int currCUaddr = rpcCU->getAddr();
     1844      Int frameWitdhInCU  = rpcCU->getPic()->getPicSym()->getFrameWidthInCU();
     1845      Int frameHeightInCU = rpcCU->getPic()->getPicSym()->getFrameHeightInCU();
     1846      Bool leftCUExists   = (currCUaddr % frameWitdhInCU) > 0;
     1847      Bool aboveCUExists  = (currCUaddr / frameWitdhInCU) > 0;
     1848      Bool rightCUExists  = (currCUaddr % frameWitdhInCU) < (frameWitdhInCU - 1);
     1849      Bool belowCUExists  = (currCUaddr / frameWitdhInCU) < (frameHeightInCU - 1);
     1850      Int currTileSetIdx  = rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr);
     1851      // Check if CU is at tile set boundary
     1852      if ( (leftCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-1) != currTileSetIdx) ||
     1853           (leftCUExists && aboveCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU-1) != currTileSetIdx) ||
     1854           (aboveCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU) != currTileSetIdx) ||
     1855           (aboveCUExists && rightCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr-frameWitdhInCU+1) != currTileSetIdx) ||
     1856           (rightCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+1) != currTileSetIdx) ||
     1857           (rightCUExists && belowCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU+1) != currTileSetIdx) ||
     1858           (belowCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU) != currTileSetIdx) ||
     1859           (belowCUExists && leftCUExists && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(currCUaddr+frameWitdhInCU-1) != currTileSetIdx) )
     1860      {
     1861        disableILP = true;  // Disable ILP in tile set boundary CU
     1862      }
     1863    }
     1864  }
     1865
     1866  return disableILP;
     1867}
     1868
     1869Void TEncCu::xVerifyTileSetConstraint( TComDataCU*& rpcCU )
     1870{
     1871  if (rpcCU->getLayerId() == (m_pcEncCfg->getNumLayer() - 1)  && m_pcEncCfg->getInterLayerConstrainedTileSetsSEIEnabled() && rpcCU->getPic()->getPicSym()->getTileSetIdxMap(rpcCU->getAddr()) >= 0 &&
     1872      m_disableILP)
     1873  {
     1874    UInt numPartitions = rpcCU->getPic()->getNumPartInCU();
     1875    for (UInt i = 0; i < numPartitions; i++)
     1876    {
     1877      if (!rpcCU->isIntra(i))
     1878      {
     1879        for (UInt refList = 0; refList < 2; refList++)
     1880        {
     1881          if (rpcCU->getInterDir(i) & (1<<refList))
     1882          {
     1883            TComCUMvField *mvField = rpcCU->getCUMvField(RefPicList(refList));
     1884            if (mvField->getRefIdx(i) >= 0)
     1885            {
     1886              assert(!(rpcCU->getSlice()->getRefPic(RefPicList(refList), mvField->getRefIdx(i))->isILR(rpcCU->getLayerId())));
     1887            }
     1888          }
     1889        }
     1890      }
     1891    }
     1892  }
     1893}
     1894#endif
     1895
    18101896/** Collect ARL statistics from one LCU
    18111897 * \param pcCU
Note: See TracChangeset for help on using the changeset viewer.