Ignore:
Timestamp:
16 Jun 2013, 05:33:39 (11 years ago)
Author:
lg
Message:

1.IC and full pel depth coding are integrated and is guarded by Macro H_3D_IC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComDataCU.cpp

    r464 r468  
    119119  m_puhARPW              = NULL;
    120120#endif
     121
     122#if H_3D_IC
     123  m_pbICFlag             = NULL;
     124#endif
    121125}
    122126
     
    214218#if H_3D_ARP
    215219    m_puhARPW            = new UChar[ uiNumPartition];
     220#endif
     221#if H_3D_IC
     222    m_pbICFlag           = (Bool* )xMalloc(Bool,   uiNumPartition);
    216223#endif
    217224  }
     
    304311    if ( m_puhARPW            ) { delete[] m_puhARPW;           m_puhARPW           = NULL; }
    305312#endif
    306 
     313#if H_3D_IC
     314    if ( m_pbICFlag           ) { xFree(m_pbICFlag);            m_pbICFlag          = NULL; }
     315#endif
    307316    m_acCUMvField[0].destroy();
    308317    m_acCUMvField[1].destroy();
     
    437446    m_puhCbf[2][ui]=pcFrom->m_puhCbf[2][ui];
    438447    m_pbIPCMFlag[ui] = pcFrom->m_pbIPCMFlag[ui];
     448#if H_3D_IC
     449    m_pbICFlag[ui]   =  pcFrom->m_pbICFlag[ui];
     450#endif
    439451  }
    440452 
     
    472484#if H_3D_ARP
    473485    memset( m_puhARPW           + firstElement, 0,                        numElements * sizeof( UChar )         );
     486#endif
     487#if H_3D_IC
     488    memset( m_pbICFlag          + firstElement, false,                    numElements * sizeof( *m_pbICFlag )   );
    474489#endif
    475490  }
     
    611626      m_puhARPW[ui] = 0;
    612627#endif
     628#if H_3D_IC
     629      m_pbICFlag[ui]  = false;
     630#endif
    613631    }
    614632  }
     
    692710  memset( m_puhHeight,         uhHeight, iSizeInUchar );
    693711  memset( m_pbIPCMFlag,        0, iSizeInBool  );
     712#if H_3D_IC
     713  memset( m_pbICFlag,          0, iSizeInBool  );
     714#endif
    694715  for (UInt ui = 0; ui < m_uiNumPartition; ui++)
    695716  {
     
    733754      m_puhARPW           [ui] = pcCU->getARPW( uiPartOffset+ui );
    734755#endif
     756#if H_3D_IC
     757      m_pbICFlag[ui] = pcCU->m_pbICFlag[uiPartOffset+ui];
     758#endif
    735759    }
    736760  }
     
    846870  m_puhARPW             = pcCU->getARPW()             + uiPart;
    847871#endif
     872#if H_3D_IC
     873  m_pbICFlag            = pcCU->getICFlag()           + uiPart;
     874#endif
    848875
    849876  m_puhLumaIntraDir     = pcCU->getLumaIntraDir()     + uiPart;
     
    9731000#if H_3D_NBDV
    9741001  }
     1002#endif
     1003#if H_3D_IC
     1004  m_pbICFlag           = pcCU->getICFlag()                + uiAbsPartIdx;
    9751005#endif
    9761006}
     
    10581088  memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
    10591089#endif
     1090#if H_3D_IC
     1091  memcpy( m_pbICFlag            + uiOffset, pcCU->getICFlag(),            iSizeInBool );
     1092#endif
    10601093}
    10611094
     
    11361169#if H_3D_ARP
    11371170  memcpy( rpcCU->getARPW()             + m_uiAbsIdxInLCU, m_puhARPW,             iSizeInUchar );
     1171#endif
     1172#if H_3D_IC
     1173  memcpy( rpcCU->getICFlag()           + m_uiAbsIdxInLCU, m_pbICFlag,            iSizeInBool );
    11381174#endif
    11391175}
     
    12131249  memcpy( rpcCU->getARPW()             + uiPartOffset, m_puhARPW,             iSizeInUchar );
    12141250#endif
     1251#if H_3D_IC
     1252  memcpy( rpcCU->getICFlag()           + uiPartOffset, m_pbICFlag,            iSizeInBool );
     1253#endif
    12151254}
    12161255
     
    18721911#endif
    18731912
     1913#if H_3D_IC
     1914UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx )
     1915{
     1916  UInt        uiCtx = 0;
     1917
     1918  return uiCtx;
     1919}
     1920#endif
     1921
    18741922UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
    18751923{
     
    21702218}
    21712219
     2220#if H_3D_IC
     2221Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU)
     2222{
     2223  UInt uiNumPartition  = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition;
     2224  UInt  uiTmpAbsPartIdx  = bLCU ? uiAbsPartIdx : 0;
     2225
     2226  switch ( m_pePartSize[uiTmpAbsPartIdx] )
     2227  {
     2228  case SIZE_2NxN:
     2229    riWidth = getWidth( uiTmpAbsPartIdx );      riHeight = getHeight( uiTmpAbsPartIdx ) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1;
     2230    break;
     2231  case SIZE_Nx2N:
     2232    riWidth = getWidth( uiTmpAbsPartIdx ) >> 1; riHeight = getHeight( uiTmpAbsPartIdx );      ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2;
     2233    break;
     2234  case SIZE_NxN:
     2235    riWidth = getWidth( uiTmpAbsPartIdx ) >> 1; riHeight = getHeight( uiTmpAbsPartIdx ) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx;
     2236    break;
     2237  case SIZE_2NxnU:
     2238    riWidth     = getWidth( uiTmpAbsPartIdx );
     2239    riHeight    = ( uiPartIdx == 0 ) ?  getHeight( uiTmpAbsPartIdx ) >> 2 : ( getHeight( uiTmpAbsPartIdx ) >> 2 ) + ( getHeight( uiTmpAbsPartIdx ) >> 1 );
     2240    ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3;
     2241    break;
     2242  case SIZE_2NxnD:
     2243    riWidth     = getWidth( uiTmpAbsPartIdx );
     2244    riHeight    = ( uiPartIdx == 0 ) ?  ( getHeight( uiTmpAbsPartIdx ) >> 2 ) + ( getHeight( uiTmpAbsPartIdx ) >> 1 ) : getHeight( uiTmpAbsPartIdx ) >> 2;
     2245    ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3);
     2246    break;
     2247  case SIZE_nLx2N:
     2248    riWidth     = ( uiPartIdx == 0 ) ? getWidth( uiTmpAbsPartIdx ) >> 2 : ( getWidth( uiTmpAbsPartIdx ) >> 2 ) + ( getWidth( uiTmpAbsPartIdx ) >> 1 );
     2249    riHeight    = getHeight( uiTmpAbsPartIdx );
     2250    ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4;
     2251    break;
     2252  case SIZE_nRx2N:
     2253    riWidth     = ( uiPartIdx == 0 ) ? ( getWidth( uiTmpAbsPartIdx ) >> 2 ) + ( getWidth( uiTmpAbsPartIdx ) >> 1 ) : getWidth( uiTmpAbsPartIdx ) >> 2;
     2254    riHeight    = getHeight( uiTmpAbsPartIdx );
     2255    ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4);
     2256    break;
     2257  default:
     2258    assert ( m_pePartSize[uiTmpAbsPartIdx] == SIZE_2Nx2N );
     2259    riWidth = getWidth( uiTmpAbsPartIdx );      riHeight = getHeight( uiTmpAbsPartIdx );      ruiPartAddr = 0;
     2260    break;
     2261  }
     2262}
     2263#else
    21722264Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight )
    21732265{
     
    22092301  }
    22102302}
     2303#endif
    22112304
    22122305
     
    31113204{
    31123205  Int  iMvShift = 2;
     3206#if H_3D_IC
     3207  if( getSlice()->getIsDepth() )
     3208    iMvShift = 0;
     3209#endif
    31133210  Int iOffset = 8;
    31143211  Int iHorMax = ( m_pcSlice->getSPS()->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift;
     
    43174414}
    43184415#endif
     4416
     4417#if H_3D_IC
     4418Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     4419{
     4420  memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) );
     4421}
     4422
     4423Bool TComDataCU::isICFlagRequired( UInt uiAbsPartIdx )
     4424{
     4425  UInt uiPartAddr;
     4426  UInt iNumbPart;
     4427
     4428  if( !( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) )
     4429  {
     4430    return false;
     4431  }
     4432
     4433  if( getSlice()->getIcSkipParseFlag() )
     4434  {
     4435    if( getMergeFlag( uiAbsPartIdx ) && getMergeIndex( uiAbsPartIdx ) == 0 )
     4436    {
     4437      return false;
     4438    }
     4439  }
     4440
     4441  if( getMergeFlag( uiAbsPartIdx ) )
     4442  {
     4443    return true;
     4444  }
     4445
     4446
     4447  Int iWidth, iHeight;
     4448
     4449  iNumbPart = ( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ? 1 : ( getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ) );
     4450
     4451  for(UInt i = 0; i < iNumbPart; i++)
     4452  {
     4453    getPartIndexAndSize( i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true );
     4454    uiPartAddr += uiAbsPartIdx;
     4455
     4456    for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
     4457    {
     4458      RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     4459      Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
     4460
     4461      if( ( getInterDir( uiPartAddr ) & ( uiRefIdx+1 ) ) && iBestRefIdx >= 0 && getSlice()->getViewIndex() != getSlice()->getRefPic( eRefList, iBestRefIdx )->getViewIndex() )
     4462      {
     4463        return true;
     4464      }
     4465    }
     4466  }
     4467
     4468  return false;
     4469}
     4470#endif
    43194471//! \}
Note: See TracChangeset for help on using the changeset viewer.