Ignore:
Timestamp:
15 Jul 2015, 14:57:32 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev2@1277.

Location:
branches/HTM-14.1-update-dev1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1

  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp

    r1258 r1279  
    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;
     
    413417
    414418
    415 #if H_3D_QTLPC
     419#if NH_3D_QTLPC
    416420  Bool  bLimQtPredFalg    = pcPic->getSlice(0)->getQtPredFlag();
    417421  TComPic *pcTexture      = rpcBestCU->getSlice()->getTexturePic();
     
    429433  m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getCtuRsAddr(), rpcBestCU->getZorderIdxInCtu() );
    430434
    431 #if H_3D_QTLPC 
     435#if NH_3D_QTLPC 
    432436  Bool    bTrySplit     = true;
    433437  Bool    bTrySplitDQP  = true;
     
    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
     
    505509  }
    506510
    507 #if H_3D_IC
     511#if NH_3D_IC
    508512  Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth();
    509513  bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC();
     
    529533      }
    530534
    531 #if H_3D_QTLPC
     535#if NH_3D_QTLPC
    532536      bTrySplit    = true;
    533537#endif
     
    547551
    548552      rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    549 #if H_3D_QTLPC
     553#if NH_3D_QTLPC
    550554      //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
    551555#if H_3D_FCO
     
    555559#endif
    556560      {
    557         TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU
    558         UInt uiCUIdx            = rpcBestCU->getZorderIdxInCU();
     561        TComDataCU* pcTextureCU = pcTexture->getCtu( rpcBestCU->getCtuRsAddr() ); //Corresponding texture LCU
     562        UInt uiCUIdx            = rpcBestCU->getZorderIdxInCtu();
    559563        assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partitioned than the texture.
    560564        if (pcTextureCU->getDepth(uiCUIdx) > uiDepth || pcTextureCU->getPartitionSize(uiCUIdx) == SIZE_NxN) //Texture was split.
     
    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
     
    642662      if( rpcBestCU->getSlice()->getSliceType() != I_SLICE )
    643663      {
    644 #if H_3D_IC
     664#if NH_3D_IC
    645665        for( UInt uiICId = 0; uiICId < ( bICEnabled ? 2 : 1 ); uiICId++ )
    646666        {
     
    650670        if(m_pcEncCfg->getUseEarlySkipDetection())
    651671        {
    652 #if H_3D_IC
     672#if NH_3D_IC
    653673            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    654674#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        }
    665685        // SKIP
    666 #if H_3D_IC
     686#if NH_3D_IC
    667687          rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    668688#endif
     
    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
     
    680700        {
    681701          // 2Nx2N, NxN
    682 #if H_3D_IC
     702#if NH_3D_IC
    683703            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    684704#endif
     
    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
     
    709729          }
    710730        }
    711 #if H_3D_IC
     731#if NH_3D_IC
    712732        }
    713733#endif
    714734      }
    715 #if H_3D_QTLPC     
     735#if NH_3D_QTLPC     
    716736      if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
    717737      {
     
    768788          {
    769789            if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() && doNotBlockPu
    770 #if H_3D_QTLPC
     790#if NH_3D_QTLPC
    771791                && bTrySplit
    772792#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
     
    788808
    789809          if(doNotBlockPu
    790 #if H_3D_QTLPC
     810#if NH_3D_QTLPC
    791811            && bTryNx2N
    792812#endif
     
    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
     
    809829          }
    810830          if(doNotBlockPu
    811 #if H_3D_QTLPC
     831#if NH_3D_QTLPC
    812832            && bTry2NxN
    813833#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
     
    850870            {
    851871              if(doNotBlockPu
    852 #if H_3D_QTLPC
     872#if NH_3D_QTLPC
    853873                && bTry2NxN
    854874#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
     
    870890              }
    871891              if(doNotBlockPu
    872 #if H_3D_QTLPC
     892#if NH_3D_QTLPC
    873893                && bTry2NxN
    874894#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
     
    896916            {
    897917              if(doNotBlockPu
    898 #if H_3D_QTLPC
     918#if NH_3D_QTLPC
    899919                && bTry2NxN
    900920#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
     
    918938              }
    919939              if(doNotBlockPu
    920 #if H_3D_QTLPC
     940#if NH_3D_QTLPC
    921941                && bTry2NxN
    922942#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
     
    945965            {
    946966              if(doNotBlockPu
    947 #if H_3D_QTLPC
     967#if NH_3D_QTLPC
    948968                && bTryNx2N
    949969#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
     
    966986              }
    967987              if(doNotBlockPu
    968 #if H_3D_QTLPC
     988#if NH_3D_QTLPC
    969989                && bTryNx2N
    970990#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
     
    9861006            {
    9871007              if(doNotBlockPu
    988 #if H_3D_QTLPC
     1008#if NH_3D_QTLPC
    9891009                && bTryNx2N
    9901010#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
     
    10061026              }
    10071027              if(doNotBlockPu
    1008 #if H_3D_QTLPC
     1028#if NH_3D_QTLPC
    10091029                && bTryNx2N
    10101030#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
     
    10271047
    10281048#else
    1029 #if H_3D_QTLPC
     1049#if NH_3D_QTLPC
    10301050            if (bTry2NxN)
    10311051            {
     
    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);
    1043 #endif
    1044 #if H_3D_QTLPC
     1061#if NH_3D_VSP || NH_3D_DBBP
     1062            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     1063#endif
     1064#if NH_3D_QTLPC
    10451065            }
    10461066            if (bTryNx2N)
     
    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);
    1058 #endif
    1059 #if H_3D_QTLPC
     1076#if NH_3D_VSP || NH_3D_DBBP
     1077            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     1078#endif
     1079#if NH_3D_QTLPC
    10601080            }
    10611081#endif
     
    11131133          if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() )
    11141134          {
    1115 #if H_3D_QTLPC //Try IntraNxN
     1135#if NH_3D_QTLPC //Try IntraNxN
    11161136              if(bTrySplit)
    11171137              {
     
    11291149              rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    11301150            }
    1131 #if H_3D_QTLPC
     1151#if NH_3D_QTLPC
    11321152              }
    11331153#endif
     
    12451265
    12461266    // further split
    1247 #if H_3D_QTLPC
    1248     if( bSubBranch && bTrySplitDQP && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )
     1267#if NH_3D_QTLPC
     1268
     1269    if( bSubBranch && bTrySplitDQP && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() )
    12491270#else
    12501271    if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() )
     
    12671288      DEBUG_STRING_NEW(sTempDebug)
    12681289
     1290#if NH_3D_ARP
     1291      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice());
     1292      m_ppcWeightedTempCU[uhNextDepth]->setPic  ( m_ppcWeightedTempCU[ uiDepth] );
     1293#endif
    12691294      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
    12701295      {
     
    15721597
    15731598    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
    1574 #if H_3D_ARP
     1599#if NH_3D_ARP
    15751600    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    15761601#endif
    1577 #if H_3D_IC
     1602#if NH_3D_IC
    15781603    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
    15791604#endif
     
    16091634  // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
    16101635  m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
    1611 #if H_3D
     1636#if NH_3D_DBBP
    16121637  m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx );
    16131638#endif
     
    16151640  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx );
    16161641#endif 
    1617 #if H_3D_ARP
     1642#if NH_3D_ARP
    16181643  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    16191644#endif
    1620 #if H_3D_IC
     1645#if NH_3D_IC
    16211646  m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
    16221647#endif
     
    17601785{
    17611786  assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE );
    1762 #if H_3D_IV_MERGE
     1787#if NH_3D_MLC
    17631788  TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    17641789  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     
    17751800  }
    17761801  UChar uhDepth = rpcTempCU->getDepth( 0 );
    1777 #if H_3D_IC
     1802#if NH_3D_IC
    17781803  Bool bICFlag = rpcTempCU->getICFlag( 0 );
    17791804#endif
     
    17891814#endif
    17901815
    1791 #if H_3D_ARP
     1816#if NH_3D_ARP
    17921817  DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
    17931818#else
     
    17951820
    17961821  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to CTU level
    1797 #if H_3D_VSP
    1798 #if !H_3D_ARP
     1822
     1823#if NH_3D_SPIVMP
     1824  Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
     1825  memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     1826  TComMvField*  pcMvFieldSP;
     1827  UChar* puhInterDirSP;
     1828  pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2];
     1829  puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartitionsInCtu()];
     1830#endif
     1831
     1832#if NH_3D_VSP
     1833#if !NH_3D_ARP
    17991834  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18001835  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    1801   InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
    1802   rpcTempCU->m_bAvailableFlagA1 = 0;
    1803   rpcTempCU->m_bAvailableFlagB1 = 0;
    1804   rpcTempCU->m_bAvailableFlagB0 = 0;
    1805   rpcTempCU->m_bAvailableFlagA0 = 0;
    1806   rpcTempCU->m_bAvailableFlagB2 = 0;
     1836#if NH_3D_MLC
     1837  rpcTempCU->initAvailableFlags();
     1838#endif
    18071839  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    1808   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand );
    1809 #endif
    1810 #else
    1811 #if H_3D
    1812   rpcTempCU->m_bAvailableFlagA1 = 0;
    1813   rpcTempCU->m_bAvailableFlagB1 = 0;
    1814   rpcTempCU->m_bAvailableFlagB0 = 0;
    1815   rpcTempCU->m_bAvailableFlagA0 = 0;
    1816   rpcTempCU->m_bAvailableFlagB2 = 0;
    1817   rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    1818   rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    1819 #else
     1840#if NH_3D_MLC
     1841  rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1842#if NH_3D_SPIVMP
     1843    , pcMvFieldSP, puhInterDirSP
     1844#endif
     1845    , numValidMergeCand
     1846    );
     1847
     1848  rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
     1849#if NH_3D_SPIVMP
     1850    , bSPIVMPFlag
     1851#endif
     1852    , numValidMergeCand
     1853    );
     1854#endif
     1855#endif
     1856#else
     1857#if NH_3D_MLC
     1858  rpcTempCU->initAvailableFlags();
     1859#endif
    18201860  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    1821 #endif
    1822 #endif
    1823 #if H_3D_IV_MERGE
     1861#if NH_3D_MLC
     1862  rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1863#if H_3D_SPIVMP
     1864    , pcMvFieldSP, puhInterDirSP
     1865#endif
     1866    , numValidMergeCand
     1867    );
     1868#if NH_3D_MLC
     1869  rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
     1870#if H_3D_SPIVMP
     1871    , bSPIVMPFlag
     1872#endif
     1873    , numValidMergeCand
     1874    );
     1875#endif
     1876#endif
     1877#endif
     1878
     1879#if NH_3D_MLC
    18241880  Int mergeCandBuffer[MRG_MAX_NUM_CANDS_MEM];
    18251881#else
    18261882  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    18271883#endif
    1828 #if H_3D_ARP
    1829 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
     1884#if NH_3D_MLC
     1885  for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    18301886#else
    18311887  for( UInt ui = 0; ui < numValidMergeCand; ++ui )
    18321888#endif
    1833 
    18341889  {
    18351890    mergeCandBuffer[ui] = 0;
     
    18491904  DEBUG_STRING_NEW(bestStr)
    18501905
    1851 #if H_3D_ARP
     1906#if NH_3D_ARP
    18521907  Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
     1908#if NH_3D_IC
    18531909  if( nARPWMax < 0 || bICFlag )
     1910#else
     1911  if( nARPWMax < 0 )
     1912#endif
    18541913  {
    18551914    nARPWMax = 0;
     
    18571916  for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- )
    18581917  {
     1918#if NH_3D_IV_MERGE
    18591919    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
     1920#else
     1921    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS * sizeof(Int) );
     1922#endif
    18601923    rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    18611924    rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    1862 #if H_3D_IC
     1925#if NH_3D_IC
    18631926    rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    18641927#endif
    18651928    rpcTempCU->getDvInfo(0) = cOrigDisInfo;
    1866     rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, 0, uhDepth );
     1929    rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, uhDepth );
     1930#if NH_3D_VSP
    18671931    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18681932    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    1869 #if H_3D_SPIVMP
    1870     Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    1871     memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    1872     TComMvField*  pcMvFieldSP;
    1873     UChar* puhInterDirSP;
    1874     pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartition()*2];
    1875     puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()];
    1876 #endif
    1877 #if H_3D
     1933#endif
     1934#if NH_3D
     1935#if NH_3D_MLC
    18781936    rpcTempCU->initAvailableFlags();
     1937#endif
    18791938    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18801939    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    1881 #if H_3D_SPIVMP
     1940#if NH_3D_SPIVMP
    18821941      , pcMvFieldSP, puhInterDirSP
    18831942#endif
     
    18851944      );
    18861945
    1887     rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
    1888 #if H_3D_SPIVMP
     1946    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
     1947#if NH_3D_VSP
     1948      , vspFlag
     1949#endif
     1950#if NH_3D_SPIVMP
    18891951      , bSPIVMPFlag
    18901952#endif
     
    18931955
    18941956#else
    1895     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
     1957    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    18961958#endif
    18971959
     
    19031965    for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    19041966    {
    1905 #if H_3D_IC
     1967#if NH_3D_IC
    19061968      if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() )
    19071969      {
     
    19201982          // set MC parameters
    19211983          rpcTempCU->setPredModeSubParts( MODE_INTER, 0, uhDepth ); // interprets depth relative to CTU level
    1922 #if H_3D_IC
     1984#if NH_3D_IC
    19231985          rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    1924 #endif
    1925 #if H_3D_ARP
    1926           rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    19271986#endif
    19281987          rpcTempCU->setCUTransquantBypassSubParts( bTransquantBypassFlag, 0, uhDepth );
     
    19311990          rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to CTU level
    19321991          rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to CTU level
    1933 #if H_3D_VSP
     1992#if NH_3D_ARP
     1993          rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     1994#endif
     1995
     1996#if NH_3D_VSP
    19341997          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
    19351998#endif
    1936 #if H_3D_SPIVMP
     1999#if NH_3D_SPIVMP
    19372000          rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth);
    19382001          if (bSPIVMPFlag[uiMergeCand])
     
    19532016          else
    19542017#endif
    1955 #if H_3D_VSP
    19562018          {
     2019#if NH_3D_VSP
    19572020            if ( vspFlag[uiMergeCand] )
    19582021            {
     
    19842047            {
    19852048#endif
    1986           rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to CTU level
    1987           rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1988           rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
    1989 #if H_3D_VSP
     2049            rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to CTU level
     2050            rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
     2051            rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
     2052#if NH_3D_VSP
    19902053            }
     2054#endif
    19912055          }
    1992 #endif
    19932056          // do MC
    19942057          m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     
    20242087          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
    20252088#endif
    2026 #if H_3D_VSP // possible bug fix
     2089#if NH_3D_VSP
    20272090          if( rpcTempCU->getSkipFlag(0) )
    20282091          {
     
    21572220  }
    21582221  DEBUG_STRING_APPEND(sDebug, bestStr)
    2159 #if H_3D_SPIVMP
     2222#if NH_3D_ARP
     2223 }
     2224#endif
     2225#if NH_3D_SPIVMP
    21602226 delete[] pcMvFieldSP;
    21612227 delete[] puhInterDirSP;
    21622228#endif
    2163 #if H_3D_ARP
    2164  }
    2165 #endif
    2166 
    21672229}
    21682230
     
    21812243
    21822244  // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    2183 #if H_3D
     2245#if H_3D || NH_3D_ARP
    21842246  const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
    21852247#endif
     
    21892251#endif
    21902252  UChar uhDepth = rpcTempCU->getDepth( 0 );
    2191 #if H_3D_ARP
     2253#if NH_3D_ARP
    21922254    Bool bFirstTime = true;
    21932255    Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
     2256#if NH_3D_IC
    21942257    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
     2258#else
     2259    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N )
     2260#endif
    21952261    {
    21962262      nARPWMax = 0;
     
    22202286  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    22212287  rpcTempCU->setChromaQpAdjSubParts( rpcTempCU->getCUTransquantBypass(0) ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
    2222 #if H_3D_ARP
     2288#if NH_3D_ARP
    22232289      rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    22242290#endif
    2225 #if H_3D_ARP
     2291#if NH_3D_ARP
    22262292      if( bFirstTime == false && nARPWMax )
    22272293      {
     
    22462312  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
    22472313#endif
    2248 #if H_3D_ARP
     2314#if NH_3D_ARP
    22492315        if( nARPWMax )
    22502316        {
     
    22572323  if ( !rpcTempCU->getMergeAMP() )
    22582324  {
    2259 #if H_3D_ARP
     2325#if NH_3D_ARP
    22602326        if( nARPWMax )
    22612327        {
     
    22782344
    22792345  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) );
    2280 #if H_3D_VSP // possible bug fix
    2281       if( rpcTempCU->getQtRootCbf(0)==0 )
    2282       {
    2283         rpcTempCU->setTrIdxSubParts(0, 0, uhDepth);
    2284       }
     2346#if NH_3D_VSP
     2347  if( rpcTempCU->getQtRootCbf(0)==0 )
     2348  {
     2349    rpcTempCU->setTrIdxSubParts(0, 0, uhDepth);
     2350  }
    22852351#endif
    22862352#if NH_3D_VSO // M4
     
    23742440      }
    23752441#endif
    2376 #if H_3D_ARP
     2442#if NH_3D_ARP
    23772443    }
    23782444#endif
     
    23822448}
    23832449
    2384 #if H_3D_DBBP
     2450#if NH_3D_DBBP
    23852451Void TEncCu::xInvalidateOriginalSegments( TComYuv* pOrigYuv, TComYuv* pOrigYuvTemp, Bool* pMask, UInt uiValidSegment )
    23862452{
    2387   UInt  uiWidth     = pOrigYuv->getWidth ( );
    2388   UInt  uiHeight    = pOrigYuv->getHeight( );
    2389   Pel*  piSrc       = pOrigYuv->getLumaAddr( );
    2390   UInt  uiSrcStride = pOrigYuv->getStride();
    2391   Pel*  piDst       = pOrigYuvTemp->getLumaAddr( );
    2392   UInt  uiDstStride = pOrigYuvTemp->getStride();
     2453  UInt  uiWidth     = pOrigYuv->getWidth (COMPONENT_Y);
     2454  UInt  uiHeight    = pOrigYuv->getHeight(COMPONENT_Y);
     2455  Pel*  piSrc       = pOrigYuv->getAddr(COMPONENT_Y);
     2456  UInt  uiSrcStride = pOrigYuv->getStride(COMPONENT_Y);
     2457  Pel*  piDst       = pOrigYuvTemp->getAddr(COMPONENT_Y);
     2458  UInt  uiDstStride = pOrigYuvTemp->getStride(COMPONENT_Y);
    23932459 
    23942460  UInt  uiMaskStride= MAX_CU_SIZE;
     
    24152481 
    24162482  // now invalidate chroma
    2417   Pel*  piSrcU       = pOrigYuv->getCbAddr();
    2418   Pel*  piSrcV       = pOrigYuv->getCrAddr();
    2419   UInt  uiSrcStrideC = pOrigYuv->getCStride();
    2420   Pel*  piDstU       = pOrigYuvTemp->getCbAddr( );
    2421   Pel*  piDstV       = pOrigYuvTemp->getCrAddr( );
    2422   UInt  uiDstStrideC = pOrigYuvTemp->getCStride();
     2483  Pel*  piSrcU       = pOrigYuv->getAddr(COMPONENT_Cb);
     2484  Pel*  piSrcV       = pOrigYuv->getAddr(COMPONENT_Cr);
     2485  UInt  uiSrcStrideC = pOrigYuv->getStride(COMPONENT_Cb);
     2486  Pel*  piDstU       = pOrigYuvTemp->getAddr(COMPONENT_Cb);
     2487  Pel*  piDstV       = pOrigYuvTemp->getAddr(COMPONENT_Cr);
     2488  UInt  uiDstStrideC = pOrigYuvTemp->getStride(COMPONENT_Cb);
    24232489  pMask = pMaskStart;
    24242490 
     
    24412507  }
    24422508}
    2443 
     2509#endif
     2510
     2511#if NH_3D_DBBP
    24442512Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
    24452513{
     
    24632531  AOF( uiWidth == uiHeight );
    24642532 
    2465 #if H_3D_DBBP
    2466   // Is this correct here, was under the macro SEC_DBBP_DISALLOW_8x8_I0078, however the function is related to Single Depth Mode
     2533#if NH_3D_DBBP
    24672534  if(uiWidth <= 8)
    24682535  {
     
    25152582    rpcTempCU->getDBBPTmpData()->eVirtualPartSize = eVirtualPartSize;
    25162583    rpcTempCU->getDBBPTmpData()->uiVirtualPartIndex = uiSegment;
    2517     m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, false, bUseMRG );
     2584    m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, bUseMRG );
    25182585    m_pcRdCost->setUseMask(false);
    25192586   
     
    25242591    pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0);
    25252592   
     2593#if NH_3D_VSP
    25262594    AOF( rpcTempCU->getSPIVMPFlag(0) == false );
    25272595    AOF( rpcTempCU->getVSPFlag(0) == 0 );
     2596#endif
    25282597   
    25292598    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    25442613  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    25452614 
    2546   UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMaxCUDepth() - uhDepth ) << 1 ) ) >> 4;
     2615  UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uhDepth ) << 1 ) ) >> 4;
    25472616  for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ )
    25482617  {
     
    25702639 
    25712640  // reconstruct final prediction signal by combining both segments
    2572   m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize);
     2641  Int bitDepthY = rpcTempCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     2642  m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize, bitDepthY);
    25732643  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
    25742644 
Note: See TracChangeset for help on using the changeset viewer.