Ignore:
Timestamp:
11 Jul 2014, 03:49:39 (10 years ago)
Author:
mediatek-htm
Message:

Integration of Single Depth Mode proposed in JCT3V-I0095.
The MACRO is "MTK_SINGLE_DEPTH_MODE_I0095".

By Yi-Wen Chen (yiwen.chen@…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp

    r976 r983  
    6060 
    6161  m_skipFlag           = NULL;
    62 
     62#if MTK_SINGLE_DEPTH_MODE_I0095
     63  m_singleDepthFlag     = NULL;
     64  m_apSingleDepthValue  = NULL;
     65#endif 
    6366  m_pePartSize         = NULL;
    6467  m_pePredMode         = NULL;
     
    182185
    183186    m_skipFlag           = new Bool[ uiNumPartition ];
    184 
     187#if MTK_SINGLE_DEPTH_MODE_I0095
     188    m_singleDepthFlag     = new Bool[ uiNumPartition ];
     189    m_apSingleDepthValue  = (Pel*)xMalloc(Pel, uiNumPartition);
     190#endif
    185191    m_pePartSize         = new Char[ uiNumPartition ];
    186192    memset( m_pePartSize, SIZE_NONE,uiNumPartition * sizeof( *m_pePartSize ) );
     
    329335
    330336    if ( m_skipFlag           ) { delete[] m_skipFlag;          m_skipFlag          = NULL; }
    331 
     337#if MTK_SINGLE_DEPTH_MODE_I0095
     338    if ( m_singleDepthFlag    ) { delete[] m_singleDepthFlag;   m_singleDepthFlag     = NULL; }
     339    if ( m_apSingleDepthValue ) { xFree(m_apSingleDepthValue);  m_apSingleDepthValue  = NULL; }
     340#endif
    332341    if ( m_pePartSize         ) { delete[] m_pePartSize;        m_pePartSize        = NULL; }
    333342    if ( m_pePredMode         ) { delete[] m_pePredMode;        m_pePredMode        = NULL; }
     
    494503    TComDataCU * pcFrom = pcPic->getCU(getAddr());
    495504    m_skipFlag[ui]   = pcFrom->getSkipFlag(ui);
     505#if MTK_SINGLE_DEPTH_MODE_I0095
     506    m_singleDepthFlag[ui]    = pcFrom->getSingleDepthFlag(ui);
     507    m_apSingleDepthValue[ui] = pcFrom->getSingleDepthValue(ui);
     508#endif
    496509    m_pePartSize[ui] = pcFrom->getPartitionSize(ui);
    497510    m_pePredMode[ui] = pcFrom->getPredictionMode(ui);
     
    550563  {
    551564    memset( m_skipFlag          + firstElement, false,                    numElements * sizeof( *m_skipFlag ) );
    552 
     565#if MTK_SINGLE_DEPTH_MODE_I0095
     566    memset( m_singleDepthFlag     + firstElement, false,                  numElements * sizeof( *m_singleDepthFlag ) );
     567    memset( m_apSingleDepthValue  + firstElement,     0,                  numElements * sizeof( *m_apSingleDepthValue ) );
     568#endif
    553569    memset( m_pePartSize        + firstElement, SIZE_NONE,                numElements * sizeof( *m_pePartSize ) );
    554570    memset( m_pePredMode        + firstElement, MODE_NONE,                numElements * sizeof( *m_pePredMode ) );
     
    738754      m_puhTransformSkip[2][ui] = 0;
    739755      m_skipFlag[ui]   = false;
     756#if MTK_SINGLE_DEPTH_MODE_I0095
     757      m_singleDepthFlag[ui]     = false;
     758      m_apSingleDepthValue[ui]  = 0;
     759#endif
    740760      m_pePartSize[ui] = SIZE_NONE;
    741761      m_pePredMode[ui] = MODE_NONE;
     
    913933  {
    914934    m_skipFlag[ui]   = false;
     935#if MTK_SINGLE_DEPTH_MODE_I0095
     936    m_singleDepthFlag[ui]   = false;
     937    m_apSingleDepthValue[ui]= 0;
     938#endif
    915939    m_pePartSize[ui] = SIZE_NONE;
    916940    m_pePredMode[ui] = MODE_NONE;
     
    934958      m_puhTransformSkip[2][ui] = pcCU->getTransformSkip(uiPartOffset+ui,TEXT_CHROMA_V);
    935959      m_skipFlag[ui]   = pcCU->getSkipFlag(uiPartOffset+ui);
     960#if MTK_SINGLE_DEPTH_MODE_I0095
     961      m_singleDepthFlag[ui]    = pcCU->getSingleDepthFlag(uiPartOffset+ui);
     962      m_apSingleDepthValue[ui] = pcCU->getSingleDepthValue(uiPartOffset+ui);
     963#endif
    936964      m_pePartSize[ui] = pcCU->getPartitionSize(uiPartOffset+ui);
    937965      m_pePredMode[ui] = pcCU->getPredictionMode(uiPartOffset+ui);
     
    10831111 
    10841112  m_skipFlag=pcCU->getSkipFlag()          + uiPart;
    1085 
     1113#if MTK_SINGLE_DEPTH_MODE_I0095
     1114  m_singleDepthFlag     = pcCU->getSingleDepthFlag()   + uiPart;
     1115  m_apSingleDepthValue  = pcCU->getSingleDepthValue()  + uiPart;
     1116#endif 
    10861117  m_phQP=pcCU->getQP()                    + uiPart;
    10871118  m_pePartSize = pcCU->getPartitionSize() + uiPart;
     
    12211252 
    12221253  m_skipFlag           = pcCU->getSkipFlag ()             + uiAbsPartIdx;
    1223 
     1254#if MTK_SINGLE_DEPTH_MODE_I0095
     1255  m_singleDepthFlag     = pcCU->getSingleDepthFlag ()             + uiAbsPartIdx;
     1256  m_apSingleDepthValue  = pcCU->getSingleDepthValue ()            + uiAbsPartIdx;
     1257#endif 
    12241258  m_pePartSize         = pcCU->getPartitionSize ()        + uiAbsPartIdx;
    12251259#if H_3D_NBDV
     
    12971331  Int sizeInChar  = sizeof( Char ) * uiNumPartition;
    12981332  memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
     1333#if MTK_SINGLE_DEPTH_MODE_I0095
     1334  memcpy( m_singleDepthFlag     + uiOffset, pcCU->getSingleDepthFlag(),       sizeof( *m_singleDepthFlag )   * uiNumPartition );
     1335  memcpy( m_apSingleDepthValue  + uiOffset, pcCU->getSingleDepthValue(),      sizeof( *m_apSingleDepthValue ) * uiNumPartition);
     1336#endif
    12991337  memcpy( m_phQP       + uiOffset, pcCU->getQP(),             sizeInChar                        );
    13001338  memcpy( m_pePartSize + uiOffset, pcCU->getPartitionSize(),  sizeof( *m_pePartSize ) * uiNumPartition );
     
    14171455
    14181456  memcpy( rpcCU->getSkipFlag() + m_uiAbsIdxInLCU, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
    1419 
     1457#if MTK_SINGLE_DEPTH_MODE_I0095
     1458  memcpy( rpcCU->getSingleDepthFlag()  + m_uiAbsIdxInLCU, m_singleDepthFlag,    sizeof( *m_singleDepthFlag ) * m_uiNumPartition );
     1459  memcpy( rpcCU->getSingleDepthValue() + m_uiAbsIdxInLCU, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * m_uiNumPartition);
     1460#endif
    14201461  memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar  );
    14211462#if H_3D_NBDV
     
    15331574  Int sizeInChar  = sizeof( Char ) * uiQNumPart;
    15341575  memcpy( rpcCU->getSkipFlag()       + uiPartOffset, m_skipFlag,   sizeof( *m_skipFlag )   * uiQNumPart );
    1535 
     1576#if MTK_SINGLE_DEPTH_MODE_I0095
     1577  memcpy( rpcCU->getSingleDepthFlag()  + uiPartOffset, m_singleDepthFlag,    sizeof( *m_singleDepthFlag )   * uiQNumPart );
     1578  memcpy( rpcCU->getSingleDepthValue() + uiPartOffset, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * uiQNumPart);
     1579#endif
    15361580  memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar );
    15371581  memcpy( rpcCU->getPartitionSize()  + uiPartOffset, m_pePartSize, sizeof( *m_pePartSize ) * uiQNumPart );
     
    24532497  memset( m_skipFlag + absPartIdx, skip, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
    24542498}
    2455 
     2499#if MTK_SINGLE_DEPTH_MODE_I0095
     2500Void TComDataCU::setSingleDepthFlagSubParts( Bool singleDepth, UInt absPartIdx, UInt depth )
     2501{
     2502  assert( sizeof( *m_singleDepthFlag) == 1 );
     2503  memset( m_singleDepthFlag + absPartIdx, singleDepth, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
     2504}
     2505
     2506Void TComDataCU::setSingleDepthValueSubParts(Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth )
     2507{
     2508  setSubPartT<Pel>( singleDepthValue, m_apSingleDepthValue, uiAbsPartIdx, uiDepth, uiPUIdx );
     2509}
     2510#endif
    24562511Void TComDataCU::setPredModeSubParts( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth )
    24572512{
     
    60926147}
    60936148#endif
     6149
     6150#if MTK_SINGLE_DEPTH_MODE_I0095
     6151Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index)
     6152{
     6153
     6154  Bool bDepAvail = false;
     6155  Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
     6156  Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
     6157
     6158  Int xP, yP, nPSW, nPSH;
     6159  this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
     6160  UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight();
     6161  UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth();
     6162  switch(index)
     6163  {
     6164  case 0: // Mid Left
     6165    if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) )
     6166    {
     6167      *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ];
     6168      bDepAvail = true;
     6169    }
     6170    break;
     6171  case 1: // Mid Above
     6172    if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) )
     6173    {
     6174      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ];
     6175      bDepAvail = true;
     6176    }
     6177    break;
     6178  case 2: // Above
     6179    if(yP != 0)
     6180    {
     6181      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP) ];
     6182      bDepAvail = true;
     6183    }
     6184    break;
     6185  case 3: // Left
     6186    if(xP != 0)
     6187    {
     6188      *pNeighDepth = pDepth[ (yP) * iDepStride + (xP-1) ];
     6189      bDepAvail = true;
     6190    }
     6191    break;
     6192  case 4: // Above_Left
     6193    if(xP != 0 && yP != 0)
     6194    {
     6195      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP-1) ];
     6196      bDepAvail = true;
     6197    }
     6198    break;
     6199  default:
     6200      break;
     6201  }
     6202  return bDepAvail;
     6203}
     6204
     6205#endif
    60946206#if H_3D_NBDV
    60956207//Notes from QC:
Note: See TracChangeset for help on using the changeset viewer.