Ignore:
Timestamp:
11 Jun 2015, 01:07:43 (9 years ago)
Author:
ntt
Message:

Reactivation of VSP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev3-NTT/source/Lib/TLibCommon/TComDataCU.cpp

    r1233 r1255  
    128128  m_pDvInfo              = NULL;
    129129#endif
    130 #if H_3D_VSP
     130#if NH_3D_VSP
    131131  m_piVSPFlag            = NULL;
    132132#endif
     
    185185    m_pbMergeFlag        = (Bool*  )xMalloc(Bool,   uiNumPartition);
    186186    m_puhMergeIndex      = (UChar* )xMalloc(UChar,  uiNumPartition);
    187 #if H_3D_VSP
     187#if NH_3D_VSP
    188188    m_piVSPFlag          = (Char*  )xMalloc(Char,   uiNumPartition);
    189189#endif
     
    372372    }
    373373
    374 #if H_3D_VSP
    375     if ( m_piVSPFlag          ) { xFree(m_piVSPFlag);           m_piVSPFlag         = NULL; }
     374#if NH_3D_VSP
     375    if ( m_piVSPFlag )
     376    {
     377      xFree(m_piVSPFlag);
     378      m_piVSPFlag = NULL;
     379    }
    376380#endif
    377381#if H_3D_SPIVMP
     
    623627  memset( m_puhMergeIndex     , 0,                        m_uiNumPartition * sizeof( *m_puhMergeIndex ) );
    624628
    625 #if H_3D_VSP
    626     m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui];
     629#if NH_3D_VSP
     630  memset( m_piVSPFlag         , 0,                        m_uiNumPartition * sizeof( *m_piVSPFlag ) );
    627631#endif
    628632#if H_3D_SPIVMP
     
    638642    memset( m_bDISFlag          + firstElement, false,                    numElements * sizeof( *m_bDISFlag ) );
    639643    memset( m_uiDISType         + firstElement,     0,                    numElements * sizeof( *m_uiDISType) );
    640 #endif
    641 #if H_3D_VSP
    642     memset( m_piVSPFlag         + firstElement, 0,                        numElements * sizeof( *m_piVSPFlag ) );
    643644#endif
    644645#if H_3D_SPIVMP
     
    795796    m_pbMergeFlag[ui]   = 0;
    796797    m_puhMergeIndex[ui] = 0;
    797 #if H_3D_VSP
    798       m_piVSPFlag[ui] = 0;
     798#if NH_3D_VSP
     799    m_piVSPFlag[ui]    = 0;
    799800#endif
    800801#if H_3D_SPIVMP
     
    896897  memset( m_pbMergeFlag,        0, iSizeInBool  );
    897898  memset( m_puhMergeIndex,      0, iSizeInUchar );
    898 #if H_3D_VSP
     899#if NH_3D_VSP
    899900  memset( m_piVSPFlag,          0, sizeof( Char  ) * m_uiNumPartition );
    900901#endif
     
    976977      m_uiDISType[ui]   = pcCU->getDISType(uiPartOffset+ui);
    977978#endif
    978 #if H_3D_VSP
    979       m_piVSPFlag[ui]=pcCU->m_piVSPFlag[uiPartOffset+ui];
    980       m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui];
     979#if NH_3D_VSP
     980    m_piVSPFlag[ui] = pcCU->m_piVSPFlag[uiPartOffset+ui];
     981    m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui];
    981982#endif
    982983#if H_3D_SPIVMP
     
    10841085  m_pbMergeFlag         = pcCU->getMergeFlag()        + uiPart;
    10851086  m_puhMergeIndex       = pcCU->getMergeIndex()       + uiPart;
    1086 #if H_3D_VSP
     1087#if NH_3D_VSP
    10871088  m_piVSPFlag           = pcCU->getVSPFlag()          + uiPart;
    10881089#endif
     
    12381239  m_pbMergeFlag        = pcCU->getMergeFlag()             + uiAbsPartIdx;
    12391240  m_puhMergeIndex      = pcCU->getMergeIndex()            + uiAbsPartIdx;
    1240 #if H_3D_VSP
     1241#if NH_3D_VSP
    12411242  m_piVSPFlag          = pcCU->getVSPFlag()               + uiAbsPartIdx;
    12421243  m_pDvInfo            = pcCU->getDvInfo()                + uiAbsPartIdx;
     
    12961297  memcpy( m_pbMergeFlag         + uiOffset, pcCU->getMergeFlag(),         iSizeInBool  );
    12971298  memcpy( m_puhMergeIndex       + uiOffset, pcCU->getMergeIndex(),        iSizeInUchar );
    1298 #if H_3D_VSP
     1299#if NH_3D_VSP
    12991300  memcpy( m_piVSPFlag           + uiOffset, pcCU->getVSPFlag(),           sizeof( Char ) * uiNumPartition );
    13001301  memcpy( m_pDvInfo             + uiOffset, pcCU->getDvInfo(),            sizeof( *m_pDvInfo ) * uiNumPartition );
     
    14231424  memcpy( pCtu->getMergeFlag()         + m_absZIdxInCtu, m_pbMergeFlag,         iSizeInBool  );
    14241425  memcpy( pCtu->getMergeIndex()        + m_absZIdxInCtu, m_puhMergeIndex,       iSizeInUchar );
    1425   #if H_3D_VSP
    1426   memcpy( rpcCU->getVSPFlag()           + m_uiAbsIdxInLCU, m_piVSPFlag,           sizeof( Char ) * m_uiNumPartition );
    1427   memcpy( rpcCU->getDvInfo()            + m_uiAbsIdxInLCU, m_pDvInfo,             sizeof( *m_pDvInfo ) * m_uiNumPartition );
     1426#if NH_3D_VSP
     1427  memcpy( pCtu->getVSPFlag()           + m_absZIdxInCtu, m_piVSPFlag,           sizeof( Char ) * m_uiNumPartition );
    14281428#endif
    14291429#if H_3D_SPIVMP
     
    15161516#endif
    15171517
    1518 #if H_3D_VSP
    1519   memcpy( rpcCU->getVSPFlag()           + uiPartOffset, m_piVSPFlag,           sizeof(Char) * uiQNumPart );
    1520 #endif
    15211518#if H_3D_SPIVMP
    15221519  memcpy( rpcCU->getSPIVMPFlag()        + uiPartOffset, m_pbSPIVMPFlag,        sizeof(Bool) * uiQNumPart );
     
    25042501#endif
    25052502
    2506 #if H_3D_VSP
     2503#if NH_3D_VSP
    25072504Void TComDataCU::setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    25082505{
    25092506  setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    25102507}
    2511 #if H_3D_VSP
    25122508template<typename T>
    25132509Void TComDataCU::setSubPartT( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx )
    25142510{
    2515   UInt uiCurrPartNumQ = (m_pcPic->getNumPartInCU() >> (2 * uiCUDepth)) >> 2;
     2511  UInt uiCurrPartNumQ = (m_pcPic->getNumPartitionsInCtu() >> (2 * uiCUDepth)) >> 2;
    25162512  switch ( m_pePartSize[ uiCUAddr ] )
    25172513  {
     
    26452641}
    26462642#endif
    2647 #endif
    26482643
    26492644Void TComDataCU::setInterDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     
    27312726
    27322727// This is for use by a leaf/sub CU object only, with no additional AbsPartIdx
    2733 #if H_3D_IC
     2728#if H_3D_IC | NH_3D_VSP
    27342729Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU)
    27352730{
     
    30653060}
    30663061
    3067 #if H_3D_VSP
    3068 
     3062#if NH_3D_VSP
    30693063/** Add a VSP merging candidate
    30703064 * \Inputs
     
    31283122
    31293123  dirVSP = (predFlag[0] | (predFlag[1] << 1));
    3130   m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true, false);
     3124  m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true
     3125#if H_3D_SPIVMP
     3126    , false
     3127#endif
     3128    );
    31313129  if ( mrgCandIdx == iCount )
    31323130  {
     
    31383136  return false;
    31393137}
    3140 
    31413138#endif
    31423139
     
    32023199 */
    32033200Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    3204 #if H_3D_VSP
     3201#if NH_3D_VSP
    32053202  , Int* vspFlag
    32063203#endif
     
    32273224    extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID);
    32283225    extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
    3229 #if H_3D_VSP
     3226#if NH_3D_VSP
    32303227    vspFlag[ui] = 0;
    32313228#endif
     
    32383235    {
    32393236      m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt
    3240 #if H_3D_VSP
     3237#if NH_3D_VSP
    32413238        , vspFlag
    32423239#endif
     
    33133310  DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
    33143311  m_cDefaultDisInfo = cDisInfo;
     3312#elif NH_3D_VSP
     3313  // for xAddVspCand()
     3314  DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
    33153315#endif
    33163316
     
    33713371  {
    33723372    m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3373 #if H_3D_VSP
     3373#if NH_3D_VSP
    33743374    , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    33753375#if H_3D_IC
     
    33953395  {
    33963396    m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3397 #if H_3D_VSP
     3397#if NH_3D_VSP
    33983398    , false
    33993399#endif
     
    34093409  {
    34103410    m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3411 #if H_3D_VSP
    3412     ,
    3413       false
     3411#if NH_3D_VSP
     3412    , false
    34143413#endif
    34153414#if H_3D_SPIVMP
     
    34243423  {
    34253424    m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3426 #if H_3D_VSP
     3425#if NH_3D_VSP
    34273426    , false
    34283427#endif
     
    34383437  {
    34393438    m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands]
    3440 #if H_3D_VSP
     3439#if NH_3D_VSP
    34413440    , false
    34423441#endif
     
    37183717  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable;
    37193718
    3720 #if H_3D_VSP
     3719#if NH_3D_VSP
    37213720  /////////////////////////////////////////////////
    37223721  //////// VIEW SYNTHESIS PREDICTION (VSP) ////////
     
    37483747      return;
    37493748    }
    3750 #endif
    3751 #if H_3D_VSP
    37523749  }
    37533750#endif
     
    54675464Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth )
    54685465{
     5466#if NH_3D_VSP // bug fix
     5467  UInt uiCurrPartNumb = m_pcPic->getNumPartitionsInCtu() >> (uiDepth << 1);
     5468#else
    54695469  UInt uiCurrPartNumb = m_pcPic->getNumPartInCtuWidth() >> (uiDepth << 1);
     5470#endif
    54705471  for (UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    54715472  {
     
    54735474  }
    54745475}
    5475 #if H_3D_VSP
     5476#if NH_3D_VSP
    54765477Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth )
    54775478{
     
    60846085#endif
    60856086
    6086 #if H_3D_VSP
     6087#if NH_3D_VSP
    60876088Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
    60886089{
     
    61406141  TComCUMvField *cuMvField = cu->getCUMvField( refPicList );
    61416142  Int partAddrRasterSubPULine  = g_auiZscanToRaster[ partAddr ];
    6142   Int numPartsLine    = cu->getPic()->getNumPartInWidth();
     6143  Int numPartsLine    = cu->getPic()->getNumPartInCtuWidth();
    61436144
    61446145  Int nTxtPerMvInfoX = 4; // cu->getPic()->getMinCUWidth();
    61456146  Int nTxtPerMvInfoY = 4; // cu->getPic()->getMinCUHeight();
    61466147
    6147   Int refDepStride = picRefDepth->getStride();
     6148  Int refDepStride = picRefDepth->getStride( COMPONENT_Y );
    61486149
    61496150  TComMv tmpMv(0, 0);
     
    61516152
    61526153  Int refDepOffset  = ( (dv->getHor()+2) >> 2 ) + ( (dv->getVer()+2) >> 2 ) * refDepStride;
    6153   Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refDepOffset;
     6154  Pel *refDepth     = picRefDepth->getAddr( COMPONENT_Y, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refDepOffset;
    61546155
    61556156  if ((height % 8))
Note: See TracChangeset for help on using the changeset viewer.