Ignore:
Timestamp:
29 Jun 2015, 19:43:32 (10 years ago)
Author:
qualcomm
Message:
  1. enable ARP by NH_3D_ARP with simulation results included; 2. address Gerhard's comments on setBaseViewRefPicList; 3. align the software with the specification of checking the correct reference picture list proposed in JCT3V-F105
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncCu.cpp

    r1246 r1262  
    6868  m_ppcTempCU      = new TComDataCU*[m_uhTotalDepth-1];
    6969
    70 #if H_3D_ARP
     70#if NH_3D_ARP
    7171  m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1];
    7272#endif
     
    9292    m_ppcBestCU[i] = new TComDataCU; m_ppcBestCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    9393    m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    94 #if H_3D_ARP
    95     m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
     94#if NH_3D_ARP
     95    m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    9696#endif 
    9797
     
    146146      m_ppcTempCU[i]->destroy();      delete m_ppcTempCU[i];      m_ppcTempCU[i] = NULL;
    147147    }
    148 #if H_3D_ARP
     148#if NH_3D_ARP
    149149    if(m_ppcWeightedTempCU[i])
    150150    {
     
    198198  }
    199199
    200 #if H_3D_ARP
     200#if NH_3D_ARP
    201201  if(m_ppcWeightedTempCU)
    202202  {
     
    279279  m_ppcBestCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
    280280  m_ppcTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
     281
     282#if NH_3D_ARP
     283  m_ppcWeightedTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
     284#endif
    281285
    282286#if KWU_RC_MADPRED_E0227
     
    587591      if( rpcTempCU->getSlice()->getSliceType() != I_SLICE )
    588592      {
    589 #if H_3D_ARP && H_3D_IV_MERGE
     593#if NH_3D_ARP && H_3D_IV_MERGE
    590594        if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getIvMvPredFlag() )
    591595#else
    592 #if H_3D_ARP
    593         if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) )
     596#if NH_3D_ARP
     597        if( rpcTempCU->getSlice()->getIvResPredFlag() )
    594598#else
    595599#if H_3D_IV_MERGE
     
    12721276      TComDataCU* pcSubTempPartCU     = m_ppcTempCU[uhNextDepth];
    12731277      DEBUG_STRING_NEW(sTempDebug)
    1274 
     1278#if NH_3D_ARP
     1279      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice());
     1280      m_ppcWeightedTempCU[uhNextDepth]->setPic  ( m_ppcWeightedTempCU[ uiDepth] );
     1281#endif
    12751282      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
    12761283      {
     
    15781585
    15791586    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
    1580 #if H_3D_ARP
     1587#if NH_3D_ARP
    15811588    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    15821589#endif
     
    16211628  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
    16221629#endif 
    1623 #if H_3D_ARP
     1630#if NH_3D_ARP
    16241631  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    16251632#endif
     
    17951802#endif
    17961803
    1797 #if H_3D_ARP
     1804#if NH_3D_ARP
    17981805  DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
    17991806#else
     
    18021809  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to CTU level
    18031810#if H_3D_VSP
    1804 #if !H_3D_ARP
     1811#if !NH_3D_ARP
    18051812  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18061813  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     
    18321839  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    18331840#endif
    1834 #if H_3D_ARP
    1835 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    1836 #else
     1841
    18371842  for( UInt ui = 0; ui < numValidMergeCand; ++ui )
    1838 #endif
    1839 
    18401843  {
    18411844    mergeCandBuffer[ui] = 0;
     
    18551858  DEBUG_STRING_NEW(bestStr)
    18561859
    1857 #if H_3D_ARP
     1860#if NH_3D_ARP
    18581861  Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
     1862#if H_3D_IC
    18591863  if( nARPWMax < 0 || bICFlag )
     1864#else
     1865  if( nARPWMax < 0 )
     1866#endif
    18601867  {
    18611868    nARPWMax = 0;
    18621869  }
    1863   for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- )
    1864   {
    1865     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
    1866     rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    1867     rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     1870  for( Int nARPW = nARPWMax; nARPW >= 0 ; nARPW-- )
     1871  {
     1872#if NH_3D_IV_MERGE
     1873    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM * sizeof(Int) );   
     1874#else
     1875    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS * sizeof(Int) );
     1876#endif
     1877    rpcTempCU->setPartSizeSubParts(   SIZE_2Nx2N , 0 , uhDepth ); // interprets depth relative to LCU level
     1878    rpcTempCU->setARPWSubParts    ( (UChar)nARPW , 0 , uhDepth );
    18681879#if H_3D_IC
    18691880    rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    18701881#endif
    18711882    rpcTempCU->getDvInfo(0) = cOrigDisInfo;
    1872     rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, 0, uhDepth );
     1883    rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, uhDepth );
    18731884    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18741885    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     
    18971908      , numValidMergeCand
    18981909      );
    1899 
    1900 #else
    1901     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
     1910#else
     1911    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    19021912#endif
    19031913
     
    19291939          rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    19301940#endif
    1931 #if H_3D_ARP
    1932           rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    1933 #endif
    19341941          rpcTempCU->setCUTransquantBypassSubParts( bTransquantBypassFlag, 0, uhDepth );
    19351942          rpcTempCU->setChromaQpAdjSubParts( bTransquantBypassFlag ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
     
    19371944          rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to CTU level
    19381945          rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to CTU level
     1946#if NH_3D_ARP
     1947          rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     1948#endif
    19391949#if H_3D_VSP
    19401950          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
     
    21122122
    21132123          rpcTempCU->initEstData( uhDepth, orgQP, bTransquantBypassFlag );
    2114 
    21152124          if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip )
    21162125          {
     
    21672176 delete[] puhInterDirSP;
    21682177#endif
    2169 #if H_3D_ARP
     2178#if NH_3D_ARP
    21702179 }
    21712180#endif
     
    21872196
    21882197  // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    2189 #if H_3D
     2198#if H_3D || NH_3D_ARP
    21902199  const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
    21912200#endif
     
    21952204#endif
    21962205  UChar uhDepth = rpcTempCU->getDepth( 0 );
    2197 #if H_3D_ARP
     2206#if NH_3D_ARP
    21982207    Bool bFirstTime = true;
    21992208    Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
     2209#if H_3D_IC
    22002210    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
     2211#else
     2212    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N )
     2213#endif
    22012214    {
    22022215      nARPWMax = 0;
     
    22262239  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    22272240  rpcTempCU->setChromaQpAdjSubParts( rpcTempCU->getCUTransquantBypass(0) ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
    2228 #if H_3D_ARP
    2229       rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    2230 #endif
    2231 #if H_3D_ARP
    2232       if( bFirstTime == false && nARPWMax )
    2233       {
    2234         rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth );
    2235         rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    2236 
    2237         m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
    2238       }
    2239       else
    2240       {
    2241         bFirstTime = false;
     2241#if NH_3D_ARP
     2242  rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     2243#endif
     2244#if NH_3D_ARP
     2245  if( bFirstTime == false && nARPWMax )
     2246  {
     2247    rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth );
     2248    rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     2249
     2250    m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
     2251  }
     2252  else
     2253  {
     2254    bFirstTime = false;
    22422255#endif
    22432256#if AMP_MRG
     
    22522265  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
    22532266#endif
    2254 #if H_3D_ARP
    2255         if( nARPWMax )
    2256         {
    2257           m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
    2258         }
    2259       }
     2267#if NH_3D_ARP
     2268  if( nARPWMax )
     2269  {
     2270    m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
     2271  }
     2272  }
    22602273#endif
    22612274
     
    22632276  if ( !rpcTempCU->getMergeAMP() )
    22642277  {
    2265 #if H_3D_ARP
    2266         if( nARPWMax )
    2267         {
    2268           continue;
    2269         }
    2270         else
     2278#if NH_3D_ARP
     2279    if( nARPWMax )
     2280    {
     2281      continue;
     2282    }
     2283    else
    22712284#endif
    22722285    return;
     
    23802393      }
    23812394#endif
    2382 #if H_3D_ARP
     2395#if NH_3D_ARP
    23832396    }
    23842397#endif
Note: See TracChangeset for help on using the changeset viewer.