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/TLibDecoder/TDecCu.cpp

    r1225 r1274  
    5252  m_ppcYuvReco = NULL;
    5353  m_ppcCU      = NULL;
    54 #if H_3D_DBBP
     54#if NH_3D_DBBP
    5555  m_ppcYuvRecoDBBP = NULL;
    5656#endif
     
    8181  m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
    8282  m_ppcCU      = new TComDataCU*[m_uiMaxDepth-1];
    83 #if H_3D_DBBP
     83#if NH_3D_DBBP
    8484  m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1];
    8585#endif
     
    9595    m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC );
    9696    m_ppcCU     [ui] = new TComDataCU; m_ppcCU     [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) );
    97 #if H_3D_DBBP
    98     m_ppcYuvRecoDBBP[ui] = new TComYuv;    m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight );
     97#if NH_3D_DBBP
     98    m_ppcYuvRecoDBBP[ui] = new TComYuv;    m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight, chromaFormatIDC );
    9999#endif
    100100}
     
    119119    m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
    120120    m_ppcCU     [ui]->destroy(); delete m_ppcCU     [ui]; m_ppcCU     [ui] = NULL;
    121 #if H_3D_DBBP
     121#if NH_3D_DBBP
    122122    m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL;
    123123#endif
     
    127127  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
    128128  delete [] m_ppcCU     ; m_ppcCU      = NULL;
    129 #if H_3D_DBBP
     129#if NH_3D_DBBP
    130130  delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL;
    131131#endif
     
    152152    setIsChromaQpAdjCoded(true);
    153153  }
    154 
     154 
    155155  // start from the top level CU
    156156  xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment);
     
    163163Void TDecCu::decompressCtu( TComDataCU* pCtu )
    164164{
    165 #if !H_3D_IV_MERGE
     165#if !NH_3D_IV_MERGE
    166166  xDecompressCU( pCtu, 0,  0 );
    167167#endif
     
    283283    pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP
    284284  }
    285 #if H_3D_NBDV
     285#if NH_3D_NBDV
    286286  DisInfo DvInfo;
    287287  DvInfo.m_acNBDV.setZero();
    288288  DvInfo.m_aVIdxCan = 0;
    289 #if H_3D_NBDV_REF 
     289#if NH_3D_NBDV_REF 
    290290  DvInfo.m_acDoNBDV.setZero();
    291291#endif
     
    293293if(!pcCU->getSlice()->isIntra())
    294294  {
    295 #if H_3D_ARP && H_3D_IV_MERGE
    296     if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() )
     295#if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP
     296    if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
    297297#else
     298#if NH_3D_IV_MERGE && NH_3D_VSP
     299    if( pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
     300#else
     301#if NH_3D_ARP && NH_3D_VSP
     302    if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )
     303#else
     304#if NH_3D_VSP
     305    if( pcCU->getSlice()->getViewSynthesisPredFlag() )
     306#else
    298307#if H_3D_ARP
    299     if( pcCU->getSlice()->getVPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) )
     308    if( pcCU->getSlice()->getIvResPredFlag( ) )
    300309#else
    301310#if H_3D_IV_MERGE
    302311    if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) )
    303312#else
     313#if NH_3D_DBBP
     314    if( pcCU->getSlice()->getDepthBasedBlkPartFlag() )
     315#else
    304316    if (0)
    305317#endif
    306318#endif
    307319#endif
    308     {
    309       m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true );
    310       m_ppcCU[uiDepth]->copyDVInfoFrom( pcCU, uiAbsPartIdx);
     320#endif
     321#endif
     322#endif
     323#endif
     324    {
     325      m_ppcCU[uiDepth]->copyInterPredInfoFrom(pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true);
     326      m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx);
    311327      PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0);
    312328      UChar cWidTemp     = m_ppcCU[uiDepth]->getWidth(0);
    313329      UChar cHeightTemp  = m_ppcCU[uiDepth]->getHeight(0);
    314       m_ppcCU[uiDepth]->setWidth  ( 0, pcCU->getSlice()->getSPS()->getMaxCUWidth ()/(1<<uiDepth)  );
    315       m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth)  );
    316       m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );     
    317 #if H_3D_IV_MERGE
     330      m_ppcCU[uiDepth]->setWidth (0, pcCU->getSlice()->getSPS()->getMaxCUWidth () / (1 << uiDepth));
     331      m_ppcCU[uiDepth]->setHeight(0, pcCU->getSlice()->getSPS()->getMaxCUHeight() / (1 << uiDepth));
     332      m_ppcCU[uiDepth]->setPartSizeSubParts(SIZE_2Nx2N, 0, uiDepth);     
     333#if NH_3D_IV_MERGE
    318334      if( pcCU->getSlice()->getIsDepth())
    319335      {
     
    323339      {
    324340#endif
    325 #if H_3D_NBDV_REF
     341#if NH_3D_NBDV_REF
    326342      if( pcCU->getSlice()->getDepthBasedBlkPartFlag() )  //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done.
    327343      {
     
    333349        m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo);
    334350      }
    335 #if H_3D_IV_MERGE
     351#if NH_3D_IV_MERGE
    336352      }
    337353#endif
     
    346362      }
    347363#endif
    348 
    349364      pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth);
    350       m_ppcCU[uiDepth]->setPartSizeSubParts( ePartTemp, 0, uiDepth );
    351       m_ppcCU[uiDepth]->setWidth  ( 0, cWidTemp );
    352       m_ppcCU[uiDepth]->setHeight ( 0, cHeightTemp );
     365      m_ppcCU[uiDepth]->setPartSizeSubParts(ePartTemp, 0, uiDepth);
     366      m_ppcCU[uiDepth]->setWidth(0, cWidTemp);
     367      m_ppcCU[uiDepth]->setHeight(0, cHeightTemp);
    353368     }
    354369  }
     
    381396    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    382397    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
    383 #if H_3D_IV_MERGE
     398#if NH_3D_IV_MERGE
    384399    m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx);
     400    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
     401    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     402#else
     403#if NH_3D_MLC
    385404    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    386405    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     
    389408    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    390409#endif
     410#endif
    391411    Int numValidMergeCand = 0;
    392412    for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui )
     
    396416    m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
    397417    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    398 #if H_3D_ARP
     418#if NH_3D_ARP
    399419    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
    400420#endif
     
    403423#endif
    404424
    405 #if H_3D_VSP
     425
     426#if NH_3D_VSP
    406427    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    407428    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
    408 #if H_3D_SPIVMP
     429#endif
     430#if NH_3D_SPIVMP
    409431    Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
    410432    memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
    411433    TComMvField*  pcMvFieldSP;
    412434    UChar* puhInterDirSP;
    413     pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2];
    414     puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()];
    415 #endif
     435    pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2];
     436    puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()];
     437#endif
     438
     439#if NH_3D_MLC
    416440    m_ppcCU[uiDepth]->initAvailableFlags();
     441#endif
    417442    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
     443#if NH_3D_MLC
    418444    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    419 #if H_3D_SPIVMP
     445#if NH_3D_SPIVMP
    420446      , pcMvFieldSP, puhInterDirSP
    421447#endif
    422448      , numValidMergeCand, uiMergeIndex );
    423449
    424     m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    425 #if H_3D_SPIVMP
     450    m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
     451#if NH_3D_VSP
     452      , vspFlag
     453#endif
     454#if NH_3D_SPIVMP
    426455      , bSPIVMPFlag
    427456#endif
    428457      , numValidMergeCand );
     458#endif
     459#if NH_3D_VSP
    429460    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    430 #else
    431 #if H_3D
    432     m_ppcCU[uiDepth]->initAvailableFlags();
    433     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    434     m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    435 #else
    436     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    437 #endif
    438 #endif
     461#endif
     462
    439463    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    440464
     
    448472        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    449473        pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    450 #if H_3D_VSP
     474#if NH_3D_VSP
    451475        if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
    452476        {
     
    481505      }
    482506    }
    483 #if H_3D_SPIVMP
     507#if NH_3D_SPIVMP
    484508    pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    485509    if (bSPIVMPFlag[uiMergeIndex])
     
    506530
    507531    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
    508 #if H_3D_IV_MERGE
     532#if NH_3D_IV_MERGE
    509533    xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    510534#endif
     
    531555#endif
    532556      xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
    533 #if H_3D_IV_MERGE
     557#if NH_3D_IV_MERGE
    534558      xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    535559#endif
     
    551575#endif
    552576  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
    553 #if H_3D_IV_MERGE
     577#if NH_3D_IV_MERGE
    554578  xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );
    555579#endif
     
    574598{
    575599  TComPic* pcPic = pCtu->getPic();
    576 #if !H_3D_IV_MERGE
     600#if !NH_3D_IV_MERGE
    577601  TComSlice * pcSlice = pCtu->getSlice();
    578602  const TComSPS &sps=*(pcSlice->getSPS());
     
    617641  {
    618642    case MODE_INTER:
    619 #if H_3D_DBBP
     643#if NH_3D_DBBP
    620644    if( m_ppcCU[uiDepth]->getDBBPFlag(0) )
    621645    {
     
    637661      }
    638662#endif
    639 #if H_3D_DBBP
     663#if NH_3D_DBBP
    640664    }
    641665#endif
     
    845869#endif
    846870
    847 #if H_3D_DBBP
     871#if NH_3D_DBBP
    848872Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    849873{
     
    851875  AOF(!pcCU->getSlice()->isIntra());
    852876  PartSize ePartSize = pcCU->getPartitionSize( 0 );
     877 
     878  Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
    853879 
    854880  // get collocated depth block
     
    871897 
    872898  // first, extract the two sets of motion parameters
    873   UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
     899  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4;
    874900  for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ )
    875901  {
     
    877903   
    878904    pDBBPTmpData->auhInterDir[uiSegment] = pcCU->getInterDir(uiPartAddr);
     905    assert( pDBBPTmpData->auhInterDir[uiSegment] == 1 || pDBBPTmpData->auhInterDir[uiSegment] == 2  );  // only uni-prediction allowed
    879906   
    880907    for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
     
    884911    }
    885912   
     913#if H_3D
    886914    AOF( pcCU->getARPW(uiPartAddr) == 0 );
    887915    AOF( pcCU->getICFlag(uiPartAddr) == false );
    888916    AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false );
    889917    AOF( pcCU->getVSPFlag(uiPartAddr) == 0 );
     918#endif
    890919  }
    891920 
     
    927956 
    928957  // reconstruct final prediction signal by combining both segments
    929   m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize);
     958  m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize, bitDepthY);
    930959
    931960  // inter recon
    932   xDecodeInterTexture( pcCU, 0, uiDepth );
     961  xDecodeInterTexture( pcCU, uiDepth );
    933962 
    934963  // clip for only non-zero cbp case
    935   if  ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) )
    936   {
    937     m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );
     964  if  ( ( pcCU->getCbf( 0, COMPONENT_Y ) ) || ( pcCU->getCbf( 0, COMPONENT_Cb ) ) || ( pcCU->getCbf(0, COMPONENT_Cr ) ) )
     965  {
     966    m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() );
    938967  }
    939968  else
Note: See TracChangeset for help on using the changeset viewer.