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/TLibEncoder/TEncCu.cpp

    r1256 r1274  
    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
     
    7979  m_ppcRecoYuvTemp = new TComYuv*[m_uhTotalDepth-1];
    8080  m_ppcOrigYuv     = new TComYuv*[m_uhTotalDepth-1];
    81 #if H_3D_DBBP
     81#if NH_3D_DBBP
    8282  m_ppcOrigYuvDBBP = new TComYuv*[m_uhTotalDepth-1];
    8383#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
     
    105105
    106106    m_ppcOrigYuv    [i] = new TComYuv; m_ppcOrigYuv    [i]->create(uiWidth, uiHeight, chromaFormat);
    107 #if H_3D_DBBP
    108     m_ppcOrigYuvDBBP[i] = new TComYuv; m_ppcOrigYuvDBBP[i]->create(uiWidth, uiHeight);
     107#if NH_3D_DBBP
     108    m_ppcOrigYuvDBBP[i] = new TComYuv; m_ppcOrigYuvDBBP[i]->create(uiWidth, uiHeight, chromaFormat);
    109109#endif
    110110
     
    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    {
     
    180180      m_ppcOrigYuv[i]->destroy();     delete m_ppcOrigYuv[i];     m_ppcOrigYuv[i] = NULL;
    181181    }
    182 #if H_3D_DBBP
     182#if NH_3D_DBBP
    183183    if(m_ppcOrigYuvDBBP[i])
    184184    {
     
    198198  }
    199199
    200 #if H_3D_ARP
     200#if NH_3D_ARP
    201201  if(m_ppcWeightedTempCU)
    202202  {
     
    240240    m_ppcOrigYuv = NULL;
    241241  }
    242 #if H_3D_DBBP
     242#if NH_3D_DBBP
    243243  if(m_ppcOrigYuvDBBP)
    244244  {
     
    280280  m_ppcTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
    281281
     282#if NH_3D_ARP
     283  m_ppcWeightedTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
     284#endif
     285
    282286#if KWU_RC_MADPRED_E0227
    283287  m_LCUPredictionSAD = 0;
     
    441445  Bool    earlyDetectionSkipMode = false;
    442446
    443 #if H_3D_VSP
     447#if NH_3D_NBDV
    444448  DisInfo DvInfo;
    445449  DvInfo.m_acNBDV.setZero();
    446450  DvInfo.m_aVIdxCan = 0;
    447 #if H_3D_NBDV_REF
     451#if NH_3D_NBDV_REF
    448452  DvInfo.m_acDoNBDV.setZero();
    449453#endif
     
    584588#endif
    585589
    586 #if H_3D_NBDV
     590#if NH_3D_NBDV
    587591      if( rpcTempCU->getSlice()->getSliceType() != I_SLICE )
    588592      {
    589 #if H_3D_ARP && H_3D_IV_MERGE
    590         if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getIvMvPredFlag() )
     593#if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP
     594        if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getIvMvPredFlag() || rpcTempCU->getSlice()->getViewSynthesisPredFlag() )
    591595#else
    592 #if H_3D_ARP
    593         if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) )
     596#if NH_3D_IV_MERGE && NH_3D_VSP
     597        if( rpcTempCU->getSlice()->getIvMvPredFlag() || rpcTempCU->getSlice()->getViewSynthesisPredFlag() )
     598#else
     599#if NH_3D_ARP && NH_3D_VSP
     600        if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getViewSynthesisPredFlag() )
     601#else
     602#if NH_3D_VSP
     603        if( rpcTempCU->getSlice()->getViewSynthesisPredFlag() )
     604#else
     605#if NH_3D_ARP
     606        if( rpcTempCU->getSlice()->getIvResPredFlag() )
    594607#else
    595608#if H_3D_IV_MERGE
    596609        if( rpcTempCU->getSlice()->getVPS()->getIvMvPredFlag(rpcTempCU->getSlice()->getLayerId()) )
    597610#else
     611#if NH_3D_DBBP
     612        if( rpcTempCU->getSlice()->getDepthBasedBlkPartFlag() )
     613#else
    598614        if (0)
     615#endif
     616#endif
     617#endif
     618#endif
    599619#endif
    600620#endif
     
    602622        {
    603623          PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
    604           rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );     
    605 #if H_3D_IV_MERGE
     624          rpcTempCU->setPartSizeSubParts(SIZE_2Nx2N, 0, uiDepth);
     625#if NH_3D_IV_MERGE
    606626          if (rpcTempCU->getSlice()->getIsDepth() )
    607627          {
     
    611631          {
    612632#endif
    613 #if H_3D_NBDV_REF
     633#if NH_3D_NBDV_REF
    614634            if( rpcTempCU->getSlice()->getDepthRefinementFlag() )
    615635            {
     
    621641              rpcTempCU->getDisMvpCandNBDV(&DvInfo);
    622642            }
    623 #if H_3D_IV_MERGE
     643#if NH_3D_IV_MERGE
    624644          }
    625645#endif
     
    659679          rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N
    660680#endif
    661 #if H_3D_VSP
    662             rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     681#if NH_3D_VSP  || NH_3D_DBBP
     682          rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    663683#endif
    664684        }
     
    673693
    674694        rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    675 #if H_3D_VSP
    676           rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     695#if NH_3D_VSP  || NH_3D_DBBP
     696        rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    677697#endif
    678698
     
    690710          rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    691711#endif
    692 #if H_3D_VSP
    693             rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    694 #endif
    695 #if H_3D_DBBP
     712#if NH_3D_VSP  || NH_3D_DBBP
     713          rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     714#endif
     715#if NH_3D_DBBP
    696716            if( rpcTempCU->getSlice()->getDepthBasedBlkPartFlag() && rpcTempCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
    697717            {
    698718              xCheckRDCostInterDBBP( rpcBestCU, rpcTempCU, false );
    699719              rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode  );
    700 #if H_3D_VSP
     720#if NH_3D_VSP  || NH_3D_DBBP
    701721              rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    702722#endif
     
    780800#endif
    781801              rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    782 #if H_3D_VSP
    783                 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     802#if NH_3D_VSP || NH_3D_DBBP
     803              rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    784804#endif
    785805
     
    799819#endif
    800820            rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    801 #if H_3D_VSP
     821#if NH_3D_VSP || NH_3D_DBBP
    802822            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    803823#endif
     
    822842
    823843            rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    824 #if H_3D_VSP
     844#if NH_3D_VSP || NH_3D_DBBP
    825845            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    826846#endif
     
    861881#endif
    862882                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    863 #if H_3D_VSP
     883#if NH_3D_VSP || NH_3D_DBBP
    864884                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    865885#endif
     
    882902
    883903                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    884 #if H_3D_VSP
     904#if NH_3D_VSP || NH_3D_DBBP
    885905                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    886906#endif
     
    909929
    910930                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    911 #if H_3D_VSP
     931#if NH_3D_VSP || NH_3D_DBBP
    912932                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    913933#endif
     
    929949#endif
    930950                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    931 #if H_3D_VSP
     951#if NH_3D_VSP || NH_3D_DBBP
    932952                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    933953#endif
     
    957977
    958978                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    959 #if H_3D_VSP
     979#if NH_3D_VSP || NH_3D_DBBP
    960980                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    961981#endif
     
    977997#endif
    978998                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    979 #if H_3D_VSP
     999#if NH_3D_VSP || NH_3D_DBBP
    9801000                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    9811001#endif
     
    9971017#endif
    9981018                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    999 #if H_3D_VSP
     1019#if NH_3D_VSP || NH_3D_DBBP
    10001020                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    10011021#endif
     
    10181038#endif
    10191039                rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    1020 #if H_3D_VSP
     1040#if NH_3D_VSP || NH_3D_DBBP
    10211041                rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    10221042#endif
     
    10341054            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
    10351055            rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    1036 #if H_3D_VSP
    1037               rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     1056#if NH_3D_VSP || NH_3D_DBBP
     1057            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    10381058#endif
    10391059            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
    10401060            rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    1041 #if H_3D_VSP
    1042               rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     1061#if NH_3D_VSP || NH_3D_DBBP
     1062            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    10431063#endif
    10441064#if NH_3D_QTLPC
     
    10491069            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
    10501070            rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    1051 #if H_3D_VSP
    1052               rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     1071#if NH_3D_VSP || NH_3D_DBBP
     1072            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    10531073#endif
    10541074            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
    10551075            rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    1056 #if H_3D_VSP
    1057               rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     1076#if NH_3D_VSP || NH_3D_DBBP
     1077            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
    10581078#endif
    10591079#if NH_3D_QTLPC
     
    12701290      DEBUG_STRING_NEW(sTempDebug)
    12711291
     1292#if NH_3D_ARP
     1293      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice());
     1294      m_ppcWeightedTempCU[uhNextDepth]->setPic  ( m_ppcWeightedTempCU[ uiDepth] );
     1295#endif
    12721296      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
    12731297      {
     
    15751599
    15761600    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
    1577 #if H_3D_ARP
     1601#if NH_3D_ARP
    15781602    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    15791603#endif
     
    16121636  // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
    16131637  m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
    1614 #if H_3D
     1638#if NH_3D_DBBP
    16151639  m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx );
    16161640#endif
     
    16181642  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
    16191643#endif 
    1620 #if H_3D_ARP
     1644#if NH_3D_ARP
    16211645  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    16221646#endif
     
    17631787{
    17641788  assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE );
    1765 #if H_3D_IV_MERGE
     1789#if NH_3D_MLC
    17661790  TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    17671791  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     
    17921816#endif
    17931817
    1794 #if H_3D_ARP
     1818#if NH_3D_ARP
    17951819  DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
    17961820#else
     
    17981822
    17991823  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to CTU level
    1800 #if H_3D_VSP
    1801 #if !H_3D_ARP
     1824
     1825#if NH_3D_SPIVMP
     1826  Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
     1827  memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     1828  TComMvField*  pcMvFieldSP;
     1829  UChar* puhInterDirSP;
     1830  pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2];
     1831  puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartitionsInCtu()];
     1832#endif
     1833
     1834#if NH_3D_VSP
     1835#if !NH_3D_ARP
    18021836  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18031837  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    1804   InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    1805   rpcTempCU->m_bAvailableFlagA1 = 0;
    1806   rpcTempCU->m_bAvailableFlagB1 = 0;
    1807   rpcTempCU->m_bAvailableFlagB0 = 0;
    1808   rpcTempCU->m_bAvailableFlagA0 = 0;
    1809   rpcTempCU->m_bAvailableFlagB2 = 0;
     1838#if NH_3D_MLC
     1839  rpcTempCU->initAvailableFlags();
     1840#endif
    18101841  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    1811   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand );
    1812 #endif
    1813 #else
    1814 #if H_3D
    1815   rpcTempCU->m_bAvailableFlagA1 = 0;
    1816   rpcTempCU->m_bAvailableFlagB1 = 0;
    1817   rpcTempCU->m_bAvailableFlagB0 = 0;
    1818   rpcTempCU->m_bAvailableFlagA0 = 0;
    1819   rpcTempCU->m_bAvailableFlagB2 = 0;
    1820   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    1821   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    1822 #else
     1842#if NH_3D_MLC
     1843  rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1844#if NH_3D_SPIVMP
     1845    , pcMvFieldSP, puhInterDirSP
     1846#endif
     1847    , numValidMergeCand
     1848    );
     1849
     1850  rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
     1851#if NH_3D_SPIVMP
     1852    , bSPIVMPFlag
     1853#endif
     1854    , numValidMergeCand
     1855    );
     1856#endif
     1857#endif
     1858#else
     1859#if NH_3D_MLC
     1860  rpcTempCU->initAvailableFlags();
     1861#endif
    18231862  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    1824 #endif
    1825 #endif
    1826 #if H_3D_IV_MERGE
     1863#if NH_3D_MLC
     1864  rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1865#if H_3D_SPIVMP
     1866    , pcMvFieldSP, puhInterDirSP
     1867#endif
     1868    , numValidMergeCand
     1869    );
     1870#if NH_3D_MLC
     1871  rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
     1872#if H_3D_SPIVMP
     1873    , bSPIVMPFlag
     1874#endif
     1875    , numValidMergeCand
     1876    );
     1877#endif
     1878#endif
     1879#endif
     1880
     1881#if NH_3D_MLC
    18271882  Int mergeCandBuffer[MRG_MAX_NUM_CANDS_MEM];
    18281883#else
    18291884  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    18301885#endif
    1831 #if H_3D_ARP
    1832 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
     1886#if NH_3D_MLC
     1887  for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    18331888#else
    18341889  for( UInt ui = 0; ui < numValidMergeCand; ++ui )
    18351890#endif
    1836 
    18371891  {
    18381892    mergeCandBuffer[ui] = 0;
     
    18521906  DEBUG_STRING_NEW(bestStr)
    18531907
    1854 #if H_3D_ARP
     1908#if NH_3D_ARP
    18551909  Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
     1910#if H_3D_IC
    18561911  if( nARPWMax < 0 || bICFlag )
     1912#else
     1913  if( nARPWMax < 0 )
     1914#endif
    18571915  {
    18581916    nARPWMax = 0;
     
    18601918  for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- )
    18611919  {
     1920#if NH_3D_IV_MERGE
    18621921    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
     1922#else
     1923    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS * sizeof(Int) );
     1924#endif
    18631925    rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    18641926    rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     
    18671929#endif
    18681930    rpcTempCU->getDvInfo(0) = cOrigDisInfo;
    1869     rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, 0, uhDepth );
     1931    rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, uhDepth );
     1932#if NH_3D_VSP
    18701933    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18711934    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    1872 #if H_3D_SPIVMP
    1873     Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    1874     memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    1875     TComMvField*  pcMvFieldSP;
    1876     UChar* puhInterDirSP;
    1877     pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartition()*2];
    1878     puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()];
    1879 #endif
    1880 #if H_3D
     1935#endif
     1936#if NH_3D
     1937#if NH_3D_MLC
    18811938    rpcTempCU->initAvailableFlags();
     1939#endif
    18821940    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18831941    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    1884 #if H_3D_SPIVMP
     1942#if NH_3D_SPIVMP
    18851943      , pcMvFieldSP, puhInterDirSP
    18861944#endif
     
    18881946      );
    18891947
    1890     rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
    1891 #if H_3D_SPIVMP
     1948    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
     1949#if NH_3D_VSP
     1950      , vspFlag
     1951#endif
     1952#if NH_3D_SPIVMP
    18921953      , bSPIVMPFlag
    18931954#endif
     
    18961957
    18971958#else
    1898     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
     1959    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    18991960#endif
    19001961
     
    19261987          rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    19271988#endif
    1928 #if H_3D_ARP
    1929           rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    1930 #endif
    19311989          rpcTempCU->setCUTransquantBypassSubParts( bTransquantBypassFlag, 0, uhDepth );
    19321990          rpcTempCU->setChromaQpAdjSubParts( bTransquantBypassFlag ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
     
    19341992          rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to CTU level
    19351993          rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to CTU level
    1936 #if H_3D_VSP
     1994#if NH_3D_ARP
     1995          rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     1996#endif
     1997
     1998#if NH_3D_VSP
    19371999          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
    19382000#endif
    1939 #if H_3D_SPIVMP
     2001#if NH_3D_SPIVMP
    19402002          rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth);
    19412003          if (bSPIVMPFlag[uiMergeCand])
     
    19562018          else
    19572019#endif
    1958 #if H_3D_VSP
    19592020          {
     2021#if NH_3D_VSP
    19602022            if ( vspFlag[uiMergeCand] )
    19612023            {
     
    19872049            {
    19882050#endif
    1989           rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to CTU level
    1990           rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1991           rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1992 #if H_3D_VSP
     2051            rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to CTU level
     2052            rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
     2053            rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
     2054#if NH_3D_VSP
    19932055            }
     2056#endif
    19942057          }
    1995 #endif
    19962058          // do MC
    19972059          m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     
    20272089          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
    20282090#endif
    2029 #if H_3D_VSP // possible bug fix
     2091#if NH_3D_VSP
    20302092          if( rpcTempCU->getSkipFlag(0) )
    20312093          {
     
    21602222  }
    21612223  DEBUG_STRING_APPEND(sDebug, bestStr)
    2162 #if H_3D_SPIVMP
     2224#if NH_3D_ARP
     2225 }
     2226#endif
     2227#if NH_3D_SPIVMP
    21632228 delete[] pcMvFieldSP;
    21642229 delete[] puhInterDirSP;
    21652230#endif
    2166 #if H_3D_ARP
    2167  }
    2168 #endif
    2169 
    21702231}
    21712232
     
    21842245
    21852246  // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    2186 #if H_3D
     2247#if H_3D || NH_3D_ARP
    21872248  const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
    21882249#endif
     
    21922253#endif
    21932254  UChar uhDepth = rpcTempCU->getDepth( 0 );
    2194 #if H_3D_ARP
     2255#if NH_3D_ARP
    21952256    Bool bFirstTime = true;
    21962257    Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
     2258#if H_3D_IC
    21972259    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
     2260#else
     2261    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N )
     2262#endif
    21982263    {
    21992264      nARPWMax = 0;
     
    22232288  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    22242289  rpcTempCU->setChromaQpAdjSubParts( rpcTempCU->getCUTransquantBypass(0) ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
    2225 #if H_3D_ARP
     2290#if NH_3D_ARP
    22262291      rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    22272292#endif
    2228 #if H_3D_ARP
     2293#if NH_3D_ARP
    22292294      if( bFirstTime == false && nARPWMax )
    22302295      {
     
    22492314  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
    22502315#endif
    2251 #if H_3D_ARP
     2316#if NH_3D_ARP
    22522317        if( nARPWMax )
    22532318        {
     
    22602325  if ( !rpcTempCU->getMergeAMP() )
    22612326  {
    2262 #if H_3D_ARP
     2327#if NH_3D_ARP
    22632328        if( nARPWMax )
    22642329        {
     
    22812346
    22822347  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false DEBUG_STRING_PASS_INTO(sTest) );
    2283 #if H_3D_VSP // possible bug fix
    2284       if( rpcTempCU->getQtRootCbf(0)==0 )
    2285       {
    2286         rpcTempCU->setTrIdxSubParts(0, 0, uhDepth);
    2287       }
     2348#if NH_3D_VSP
     2349  if( rpcTempCU->getQtRootCbf(0)==0 )
     2350  {
     2351    rpcTempCU->setTrIdxSubParts(0, 0, uhDepth);
     2352  }
    22882353#endif
    22892354#if NH_3D_VSO // M4
     
    23772442      }
    23782443#endif
    2379 #if H_3D_ARP
     2444#if NH_3D_ARP
    23802445    }
    23812446#endif
     
    23852450}
    23862451
    2387 #if H_3D_DBBP
     2452#if NH_3D_DBBP
    23882453Void TEncCu::xInvalidateOriginalSegments( TComYuv* pOrigYuv, TComYuv* pOrigYuvTemp, Bool* pMask, UInt uiValidSegment )
    23892454{
    2390   UInt  uiWidth     = pOrigYuv->getWidth ( );
    2391   UInt  uiHeight    = pOrigYuv->getHeight( );
    2392   Pel*  piSrc       = pOrigYuv->getLumaAddr( );
    2393   UInt  uiSrcStride = pOrigYuv->getStride();
    2394   Pel*  piDst       = pOrigYuvTemp->getLumaAddr( );
    2395   UInt  uiDstStride = pOrigYuvTemp->getStride();
     2455  UInt  uiWidth     = pOrigYuv->getWidth (COMPONENT_Y);
     2456  UInt  uiHeight    = pOrigYuv->getHeight(COMPONENT_Y);
     2457  Pel*  piSrc       = pOrigYuv->getAddr(COMPONENT_Y);
     2458  UInt  uiSrcStride = pOrigYuv->getStride(COMPONENT_Y);
     2459  Pel*  piDst       = pOrigYuvTemp->getAddr(COMPONENT_Y);
     2460  UInt  uiDstStride = pOrigYuvTemp->getStride(COMPONENT_Y);
    23962461 
    23972462  UInt  uiMaskStride= MAX_CU_SIZE;
     
    24182483 
    24192484  // now invalidate chroma
    2420   Pel*  piSrcU       = pOrigYuv->getCbAddr();
    2421   Pel*  piSrcV       = pOrigYuv->getCrAddr();
    2422   UInt  uiSrcStrideC = pOrigYuv->getCStride();
    2423   Pel*  piDstU       = pOrigYuvTemp->getCbAddr( );
    2424   Pel*  piDstV       = pOrigYuvTemp->getCrAddr( );
    2425   UInt  uiDstStrideC = pOrigYuvTemp->getCStride();
     2485  Pel*  piSrcU       = pOrigYuv->getAddr(COMPONENT_Cb);
     2486  Pel*  piSrcV       = pOrigYuv->getAddr(COMPONENT_Cr);
     2487  UInt  uiSrcStrideC = pOrigYuv->getStride(COMPONENT_Cb);
     2488  Pel*  piDstU       = pOrigYuvTemp->getAddr(COMPONENT_Cb);
     2489  Pel*  piDstV       = pOrigYuvTemp->getAddr(COMPONENT_Cr);
     2490  UInt  uiDstStrideC = pOrigYuvTemp->getStride(COMPONENT_Cb);
    24262491  pMask = pMaskStart;
    24272492 
     
    24442509  }
    24452510}
    2446 
     2511#endif
     2512
     2513#if H_3D_DIS
    24472514Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
    24482515{
     
    25182585  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
    25192586}
    2520 
     2587#endif
     2588
     2589#if NH_3D_DBBP
    25212590Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
    25222591{
     
    25402609  AOF( uiWidth == uiHeight );
    25412610 
    2542 #if H_3D_DBBP
    2543   // Is this correct here, was under the macro SEC_DBBP_DISALLOW_8x8_I0078, however the function is related to Single Depth Mode
     2611#if NH_3D_DBBP
    25442612  if(uiWidth <= 8)
    25452613  {
     
    25922660    rpcTempCU->getDBBPTmpData()->eVirtualPartSize = eVirtualPartSize;
    25932661    rpcTempCU->getDBBPTmpData()->uiVirtualPartIndex = uiSegment;
    2594     m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, false, bUseMRG );
     2662    m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, bUseMRG );
    25952663    m_pcRdCost->setUseMask(false);
    25962664   
     
    26012669    pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0);
    26022670   
     2671#if NH_3D_VSP
    26032672    AOF( rpcTempCU->getSPIVMPFlag(0) == false );
    26042673    AOF( rpcTempCU->getVSPFlag(0) == 0 );
     2674#endif
    26052675   
    26062676    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    26212691  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    26222692 
    2623   UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMaxCUDepth() - uhDepth ) << 1 ) ) >> 4;
     2693  UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uhDepth ) << 1 ) ) >> 4;
    26242694  for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ )
    26252695  {
     
    26472717 
    26482718  // reconstruct final prediction signal by combining both segments
    2649   m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize);
     2719  Int bitDepthY = rpcTempCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     2720  m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize, bitDepthY);
    26502721  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
    26512722 
Note: See TracChangeset for help on using the changeset viewer.