Ignore:
Timestamp:
11 Jun 2013, 20:35:00 (11 years ago)
Author:
zhang
Message:

Implementation of ARP from QC

File:
1 edited

Legend:

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

    r456 r464  
    115115  m_pDvInfo              = NULL;
    116116#endif
     117
     118#if H_3D_ARP
     119  m_puhARPW              = NULL;
     120#endif
    117121}
    118122
     
    208212    m_acCUMvField[1].create( uiNumPartition );
    209213   
     214#if H_3D_ARP
     215    m_puhARPW            = new UChar[ uiNumPartition];
     216#endif
    210217  }
    211218  else
     
    293300    if ( m_pDvInfo            ) { xFree(m_pDvInfo);             m_pDvInfo           = NULL; }
    294301#endif
     302
     303#if H_3D_ARP
     304    if ( m_puhARPW            ) { delete[] m_puhARPW;           m_puhARPW           = NULL; }
     305#endif
     306
    295307    m_acCUMvField[0].destroy();
    296308    m_acCUMvField[1].destroy();
     
    402414    m_CUTransquantBypass[ui] = pcFrom->getCUTransquantBypass(ui);
    403415    m_puhDepth[ui] = pcFrom->getDepth(ui);
     416#if H_3D_ARP
     417    m_puhARPW   [ui] = pcFrom->getARPW( ui );
     418#endif
    404419    m_puhWidth  [ui] = pcFrom->getWidth(ui);
    405420    m_puhHeight [ui] = pcFrom->getHeight(ui);
     
    455470    memset( m_puhCbf[2]         + firstElement, 0,                        numElements * sizeof( *m_puhCbf[2] ) );
    456471    memset( m_pbIPCMFlag        + firstElement, false,                    numElements * sizeof( *m_pbIPCMFlag ) );
     472#if H_3D_ARP
     473    memset( m_puhARPW           + firstElement, 0,                        numElements * sizeof( UChar )         );
     474#endif
    457475  }
    458476 
     
    590608      m_puhCbf[1][ui] = 0;
    591609      m_puhCbf[2][ui] = 0;
     610#if H_3D_ARP
     611      m_puhARPW[ui] = 0;
     612#endif
    592613    }
    593614  }
     
    662683#if H_3D_NBDV
    663684  m_pDvInfo->bDV = false;
     685#endif
     686#if H_3D_ARP
     687  memset( m_puhARPW,            0, iSizeInUchar  );
    664688#endif
    665689  UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
     
    706730      m_puhCbf[2][ui]=pcCU->m_puhCbf[2][uiPartOffset+ui];
    707731
     732#if H_3D_ARP
     733      m_puhARPW           [ui] = pcCU->getARPW( uiPartOffset+ui );
     734#endif
    708735    }
    709736  }
     
    816843  m_puhMergeIndex       = pcCU->getMergeIndex()       + uiPart;
    817844
     845#if H_3D_ARP
     846  m_puhARPW             = pcCU->getARPW()             + uiPart;
     847#endif
     848
    818849  m_puhLumaIntraDir     = pcCU->getLumaIntraDir()     + uiPart;
    819850  m_puhChromaIntraDir   = pcCU->getChromaIntraDir()   + uiPart;
     
    932963  m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx;
    933964 
     965#if H_3D_ARP
     966  m_puhARPW            = pcCU->getARPW()                  + uiAbsPartIdx;
     967#endif
     968
    934969  m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx );
    935970
     
    10191054  memcpy( m_sliceStartCU        + uiOffset, pcCU->m_sliceStartCU,        sizeof( UInt ) * uiNumPartition  );
    10201055  memcpy( m_sliceSegmentStartCU + uiOffset, pcCU->m_sliceSegmentStartCU, sizeof( UInt ) * uiNumPartition  );
     1056
     1057#if H_3D_ARP
     1058  memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
     1059#endif
    10211060}
    10221061
     
    10941133  memcpy( rpcCU->m_sliceStartCU        + m_uiAbsIdxInLCU, m_sliceStartCU,        sizeof( UInt ) * m_uiNumPartition  );
    10951134  memcpy( rpcCU->m_sliceSegmentStartCU + m_uiAbsIdxInLCU, m_sliceSegmentStartCU, sizeof( UInt ) * m_uiNumPartition  );
     1135
     1136#if H_3D_ARP
     1137  memcpy( rpcCU->getARPW()             + m_uiAbsIdxInLCU, m_puhARPW,             iSizeInUchar );
     1138#endif
    10961139}
    10971140
     
    11661209  memcpy( rpcCU->m_sliceStartCU        + uiPartOffset, m_sliceStartCU,        sizeof( UInt ) * uiQNumPart  );
    11671210  memcpy( rpcCU->m_sliceSegmentStartCU + uiPartOffset, m_sliceSegmentStartCU, sizeof( UInt ) * uiQNumPart  );
     1211
     1212#if H_3D_ARP
     1213  memcpy( rpcCU->getARPW()             + uiPartOffset, m_puhARPW,             iSizeInUchar );
     1214#endif
    11681215}
    11691216
     
    18071854  return uiCtx;
    18081855}
     1856
     1857#if H_3D_ARP
     1858UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx )
     1859{
     1860  TComDataCU* pcTempCU;
     1861  UInt        uiTempPartIdx;
     1862  UInt        uiCtx = 0;
     1863 
     1864  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     1865  uiCtx    = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0;
     1866 
     1867  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     1868  uiCtx   += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0;
     1869 
     1870  return uiCtx;
     1871}
     1872#endif
    18091873
    18101874UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
     
    42464310}
    42474311#endif
     4312#if H_3D_ARP
     4313Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth )
     4314{
     4315  assert( sizeof( *m_puhARPW) == 1 );
     4316  memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) );
     4317}
     4318#endif
    42484319//! \}
Note: See TracChangeset for help on using the changeset viewer.