Ignore:
Timestamp:
27 Mar 2014, 23:17:21 (10 years ago)
Author:
tech
Message:

Cleanups part 6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r880 r881  
    151151#endif
    152152
    153 #if MTK_DDD_G0063
     153#if H_3D_DDD
    154154  m_pucDisparityDerivedDepth = NULL;
    155155  m_pbUseDDD = NULL;
     
    293293  m_pcPattern            = (TComPattern*)xMalloc(TComPattern, 1);
    294294 
    295 #if MTK_DDD_G0063
     295#if H_3D_DDD
    296296  m_pucDisparityDerivedDepth         = (UChar*  )xMalloc( UChar,  uiNumPartition);
    297297  m_pbUseDDD                         = (Bool*  ) xMalloc( Bool,   uiNumPartition);
     
    377377#endif
    378378
    379 #if MTK_DDD_G0063
     379#if H_3D_DDD
    380380    if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth);          m_pucDisparityDerivedDepth        = NULL; }
    381381    if ( m_pbUseDDD                 ) { xFree(m_pbUseDDD);                          m_pbUseDDD                        = NULL; }
     
    505505#endif
    506506
    507 #if MTK_DDD_G0063
     507#if H_3D_DDD
    508508    m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui];
    509509    m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui];
     
    588588#endif
    589589
    590 #if MTK_DDD_G0063
     590#if H_3D_DDD
    591591    memset( m_pucDisparityDerivedDepth        + firstElement, 0,           numElements * sizeof( *m_pucDisparityDerivedDepth ) );
    592592    memset( m_pbUseDDD                        + firstElement, 0,           numElements * sizeof( *m_pbUseDDD ) );
     
    762762#endif
    763763
    764 #if MTK_DDD_G0063
     764#if H_3D_DDD
    765765      m_pucDisparityDerivedDepth[ui] = 0;
    766766      m_pbUseDDD[ui] = 0;
     
    869869#endif
    870870
    871 #if MTK_DDD_G0063
     871#if H_3D_DDD
    872872  memset( m_pucDisparityDerivedDepth,         0, iSizeInUchar );
    873873  memset( m_pbUseDDD,                         0, iSizeInBool );
     
    956956#endif
    957957
    958 #if MTK_DDD_G0063
     958#if H_3D_DDD
    959959      m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui];
    960960      m_pbUseDDD[ui]                 = pcCU->m_pbUseDDD[uiPartOffset+ui];
     
    11021102#endif
    11031103
    1104 #if MTK_DDD_G0063
     1104#if H_3D_DDD
    11051105  m_pucDisparityDerivedDepth          = pcCU->getDDDepth()        + uiPart;
    11061106  m_pbUseDDD                          = pcCU->getUseDDD()         + uiPart;
     
    12521252#endif
    12531253
    1254 #if MTK_DDD_G0063
     1254#if H_3D_DDD
    12551255  m_pucDisparityDerivedDepth         = pcCU->getDDDepth()              + uiAbsPartIdx;
    12561256  m_pbUseDDD                         = pcCU->getUseDDD()              + uiAbsPartIdx;
     
    13171317  memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar );
    13181318 
    1319 #if MTK_DDD_G0063
     1319#if H_3D_DDD
    13201320  memcpy( m_pucDisparityDerivedDepth          + uiOffset, pcCU->getDDDepth(),         iSizeInUchar );
    13211321  memcpy( m_pbUseDDD                          + uiOffset, pcCU->getUseDDD(),          iSizeInBool );
     
    14171417#endif
    14181418
    1419 #if MTK_DDD_G0063
     1419#if H_3D_DDD
    14201420  memcpy( rpcCU->getDDDepth()          + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth,         iSizeInUchar  );
    14211421  memcpy( rpcCU->getUseDDD()           + m_uiAbsIdxInLCU, m_pbUseDDD,                         iSizeInBool  );
     
    15511551  memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar );
    15521552 
    1553 #if MTK_DDD_G0063
     1553#if H_3D_DDD
    15541554  memcpy( rpcCU->getDDDepth()          + uiPartOffset, m_pucDisparityDerivedDepth,         iSizeInUchar );
    15551555  memcpy( rpcCU->getUseDDD()           + uiPartOffset, m_pbUseDDD,                         iSizeInBool );
     
    16211621}
    16221622
    1623 #if MTK_DDD_G0063
     1623#if H_3D_DDD
    16241624Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    16251625{
     
    38473847  UChar tmpDir;
    38483848
    3849 #if MTK_DDD_G0063
     3849#if H_3D_DDD
    38503850  m_iUseDDDCandIdx = -1;
    38513851#endif
     
    42254225    }
    42264226  }
    4227 #if MTK_DDD_G0063
     4227#if H_3D_DDD
    42284228  if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0  && bMPIFlag )
    42294229  {
    4230       UInt uiPartIdx;
    4231       TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
    4232       TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 
    4233 
    4234 
    4235       tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    4236       tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    4237       tmpDir = 0;
    4238 
    4239       xDeriveCenterIdx( uiPUIdx, uiPartIdx);
    4240 
    4241       if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
    4242       {
    4243 
    4244           TComMvField cMVField;
    4245 #if !HTM10RC1_FIX
    4246           UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx );
    4247 #endif
    4248           Int iDV = 0;
    4249           Int iViewIdx = 0;
    4250 #if !HTM10RC1_FIX
    4251           if( ucInterDir & 1 )
     4230    UInt uiPartIdx;
     4231    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
     4232    TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 
     4233
     4234
     4235    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     4236    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     4237    tmpDir = 0;
     4238
     4239    xDeriveCenterIdx( uiPUIdx, uiPartIdx);
     4240
     4241    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
     4242    {
     4243
     4244      TComMvField cMVField;
     4245      Int iDV = 0;
     4246      Int iViewIdx = 0;
     4247      pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
     4248      if( cMVField.getRefIdx() >= 0 )
     4249      {
     4250        if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
     4251        {
     4252          iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
     4253          iDV = cMVField.getHor();
     4254
     4255
     4256          Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
     4257
     4258          if( iValidDepRef >= 0 )
    42524259          {
    4253 #endif
    4254               pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
    4255 #if HTM10RC1_FIX
    4256               if( cMVField.getRefIdx() >= 0 )
    4257               {
    4258 #endif
    4259               if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
    4260               {
    4261                   iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
    4262                   iDV = cMVField.getHor();
    4263 
    4264 
    4265                   Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
    4266 
    4267                   if( iValidDepRef >= 0 )
    4268                   {
    4269                       const TComMv cAdd( 2, 2 );
    4270                       cMVField.getMv() += cAdd;
    4271                       cMVField.getMv() >>= 2;
    4272                       clipMv( cMVField.getMv() );
    4273                       tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
    4274                       tmpDir = 1;
    4275                   }
    4276               }
     4260            const TComMv cAdd( 2, 2 );
     4261            cMVField.getMv() += cAdd;
     4262            cMVField.getMv() >>= 2;
     4263            clipMv( cMVField.getMv() );
     4264            tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
     4265            tmpDir = 1;
    42774266          }
    4278 
    4279 #if !HTM10RC1_FIX
    4280           if( !tmpDir && ( ucInterDir & 2 ))
     4267        }
     4268      }
     4269
     4270      pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
     4271
     4272      if( !tmpDir && cMVField.getRefIdx() >= 0 )
     4273      {
     4274        if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
     4275        {
     4276          iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
     4277          iDV = cMVField.getHor();
     4278
     4279          Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
     4280
     4281          if( iValidDepRef >= 0 )
    42814282          {
    4282 #endif
    4283               pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
    4284 
    4285 #if HTM10RC1_FIX
    4286               if( !tmpDir && cMVField.getRefIdx() >= 0 )
    4287               {
    4288 #endif
    4289               if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
    4290               {
    4291                   iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
    4292                   iDV = cMVField.getHor();
    4293 
    4294                   Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
    4295 
    4296                   if( iValidDepRef >= 0 )
    4297                   {
    4298                       const TComMv cAdd( 2, 2 );
    4299                       cMVField.getMv() += cAdd;
    4300                       cMVField.getMv() >>= 2;
    4301                       clipMv( cMVField.getMv() );
    4302                       tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
    4303                       tmpDir = 2;
    4304                   }
    4305               }
     4283            const TComMv cAdd( 2, 2 );
     4284            cMVField.getMv() += cAdd;
     4285            cMVField.getMv() >>= 2;
     4286            clipMv( cMVField.getMv() );
     4287            tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
     4288            tmpDir = 2;
    43064289          }
    4307           if( tmpDir != 0 )
    4308           {
    4309               rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4310               m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    4311               m_iUseDDDCandIdx = iCount;
    4312 
    4313               if( tmpDir == 1 )
    4314               {
    4315                   pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
    4316               }
    4317               else if( tmpDir == 2  )
    4318               {
    4319                   pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
    4320               }
    4321 
    4322               abCandIsInter        [ iCount ] = true;
    4323               puhInterDirNeighbours[ iCount ] = tmpDir;
    4324 
    4325               if ( mrgCandIdx == iCount )
    4326               {
    4327                   return;
    4328               }
    4329               iCount ++;
    4330 
    4331               Int iLeftAboveAvail = 0;
    4332               if( iPosLeftAbove[ 0 ] != -1 )
    4333               {
    4334                   iPosLeftAbove[ 0 ] = iCount;
    4335                   iLeftAboveAvail = 1;
    4336               }
    4337               if( iPosLeftAbove[ 1 ] != -1 )
    4338               {
    4339                   iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    4340               }
    4341 
    4342           }
    4343       }     
    4344 
     4290        }
     4291      }
     4292      if( tmpDir != 0 )
     4293      {
     4294        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4295        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
     4296        m_iUseDDDCandIdx = iCount;
     4297
     4298        if( tmpDir == 1 )
     4299        {
     4300          pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
     4301        }
     4302        else if( tmpDir == 2  )
     4303        {
     4304          pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
     4305        }
     4306
     4307        abCandIsInter        [ iCount ] = true;
     4308        puhInterDirNeighbours[ iCount ] = tmpDir;
     4309
     4310        if ( mrgCandIdx == iCount )
     4311        {
     4312          return;
     4313        }
     4314        iCount ++;
     4315
     4316        Int iLeftAboveAvail = 0;
     4317        if( iPosLeftAbove[ 0 ] != -1 )
     4318        {
     4319          iPosLeftAbove[ 0 ] = iCount;
     4320          iLeftAboveAvail = 1;
     4321        }
     4322        if( iPosLeftAbove[ 1 ] != -1 )
     4323        {
     4324          iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
     4325        }
     4326      }
     4327    }
    43454328  }
    43464329#endif
     
    44134396      for(; iCnloop >= 0; iCnloop --)
    44144397      {
    4415 #if MTK_DDD_G0063
     4398#if H_3D_DDD
    44164399          if( iCnloop == m_iUseDDDCandIdx )
    44174400          {
     
    46144597#endif
    46154598
    4616 #if MTK_DDD_G0063
     4599#if H_3D_DDD
    46174600  // early termination
    46184601  if ( iCount >= getSlice()->getMaxNumMergeCand())
Note: See TracChangeset for help on using the changeset viewer.