Changeset 795 in 3DVCSoftware


Ignore:
Timestamp:
24 Jan 2014, 02:36:31 (10 years ago)
Author:
mediatek-htm
Message:

Integration of DDD (JCT3V-G0063)

Location:
branches/HTM-9.3-dev1-MediaTek
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev1-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp

    r779 r795  
    914914          }
    915915#endif
     916
     917#if MTK_DDD_G0063
     918          m_acTEncTopList[ layer ]->getSliceEncoder()->setDDDPar( m_cCameraData.getCodedScale()[0][ m_acTEncTopList[layer]->getViewIndex() ],
     919              m_cCameraData.getCodedOffset()[0][ m_acTEncTopList[layer]->getViewIndex() ],
     920              m_cCameraData.getCamParsCodedPrecision() );
     921#endif
    916922        Int   iNumEncoded = 0;
    917923
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp

    r793 r795  
    153153  m_pucInterSDCMask       = NULL;
    154154#endif
     155
     156#if MTK_DDD_G0063
     157  m_pucDisparityDerivedDepth = NULL;
     158  m_pbUseDDD = NULL;
     159#endif
    155160}
    156161
     
    298303  m_pcPattern            = (TComPattern*)xMalloc(TComPattern, 1);
    299304 
     305#if MTK_DDD_G0063
     306  m_pucDisparityDerivedDepth         = (UChar*  )xMalloc( UChar,  uiNumPartition);
     307  m_pbUseDDD                         = (Bool*  ) xMalloc( Bool,   uiNumPartition);
     308#endif
     309
    300310  // create motion vector fields
    301311 
     
    375385#if H_3D_NBDV
    376386    if ( m_pDvInfo            ) { xFree(m_pDvInfo);             m_pDvInfo           = NULL; }
     387#endif
     388
     389#if MTK_DDD_G0063
     390    if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth);          m_pucDisparityDerivedDepth        = NULL; }
     391    if ( m_pbUseDDD                 ) { xFree(m_pbUseDDD);                          m_pbUseDDD                        = NULL; }
    377392#endif
    378393
     
    525540    m_pbICFlag[ui]   =  pcFrom->m_pbICFlag[ui];
    526541#endif
     542
     543#if MTK_DDD_G0063
     544    m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui];
     545    m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui];
     546#endif
     547
    527548    m_puhWidth  [ui] = pcFrom->getWidth(ui);
    528549    m_puhHeight [ui] = pcFrom->getHeight(ui);
     
    602623    memset( m_pbICFlag          + firstElement, false,                    numElements * sizeof( *m_pbICFlag )   );
    603624#endif
     625
     626#if MTK_DDD_G0063
     627    memset( m_pucDisparityDerivedDepth        + firstElement, 0,           numElements * sizeof( *m_pucDisparityDerivedDepth ) );
     628    memset( m_pbUseDDD                        + firstElement, 0,           numElements * sizeof( *m_pbUseDDD ) );
     629#endif
     630
    604631#if H_3D_DIM
    605632    for( Int i = 0; i < DIM_NUM_TYPE; i++ )
     
    774801      m_pbICFlag[ui]  = false;
    775802#endif
     803
     804#if MTK_DDD_G0063
     805      m_pucDisparityDerivedDepth[ui] = 0;
     806      m_pbUseDDD[ui] = 0;
     807#endif
     808
    776809#if H_3D_DIM
    777810      for( Int i = 0; i < DIM_NUM_TYPE; i++ )
     
    879912  memset( m_puhARPW,            0, iSizeInUchar  );
    880913#endif
     914
     915#if MTK_DDD_G0063
     916  memset( m_pucDisparityDerivedDepth,         0, iSizeInUchar );
     917  memset( m_pbUseDDD,                         0, iSizeInBool );
     918#endif
     919
    881920  UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
    882921  UChar uhHeight = g_uiMaxCUHeight >> uiDepth;
     
    9641003      m_pbICFlag          [ui] = pcCU->m_pbICFlag[uiPartOffset+ui];
    9651004#endif
     1005
     1006#if MTK_DDD_G0063
     1007      m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui];
     1008      m_pbUseDDD[ui]                 = pcCU->m_pbUseDDD[uiPartOffset+ui];
     1009#endif
     1010
    9661011#if H_3D_DIM
    9671012      for( Int i = 0; i < DIM_NUM_TYPE; i++ )
     
    11091154#endif
    11101155
     1156#if MTK_DDD_G0063
     1157  m_pucDisparityDerivedDepth          = pcCU->getDDDepth()        + uiPart;
     1158  m_pbUseDDD                          = pcCU->getUseDDD()         + uiPart;
     1159#endif
     1160
    11111161  m_puhLumaIntraDir     = pcCU->getLumaIntraDir()     + uiPart;
    11121162  m_puhChromaIntraDir   = pcCU->getChromaIntraDir()   + uiPart;
     
    12561306#if H_3D_ARP
    12571307  m_puhARPW            = pcCU->getARPW()                  + uiAbsPartIdx;
     1308#endif
     1309
     1310#if MTK_DDD_G0063
     1311  m_pucDisparityDerivedDepth         = pcCU->getDDDepth()              + uiAbsPartIdx;
     1312  m_pbUseDDD                         = pcCU->getUseDDD()              + uiAbsPartIdx;
    12581313#endif
    12591314
     
    13141369  memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar );
    13151370 
     1371#if MTK_DDD_G0063
     1372  memcpy( m_pucDisparityDerivedDepth          + uiOffset, pcCU->getDDDepth(),         iSizeInUchar );
     1373  memcpy( m_pbUseDDD                          + uiOffset, pcCU->getUseDDD(),          iSizeInBool );
     1374#endif
     1375
     1376
    13161377#if H_3D_DIM
    13171378  for( Int i = 0; i < DIM_NUM_TYPE; i++ )
     
    14101471#if H_3D_NBDV
    14111472  memcpy( rpcCU->getDvInfo()         + m_uiAbsIdxInLCU, m_pDvInfo,    sizeof(* m_pDvInfo)     * m_uiNumPartition );
     1473#endif
     1474
     1475#if MTK_DDD_G0063
     1476  memcpy( rpcCU->getDDDepth()          + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth,         iSizeInUchar  );
     1477  memcpy( rpcCU->getUseDDD()           + m_uiAbsIdxInLCU, m_pbUseDDD,                         iSizeInBool  );
    14121478#endif
    14131479
     
    15441610  memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar );
    15451611 
     1612#if MTK_DDD_G0063
     1613  memcpy( rpcCU->getDDDepth()          + uiPartOffset, m_pucDisparityDerivedDepth,         iSizeInUchar );
     1614  memcpy( rpcCU->getUseDDD()           + uiPartOffset, m_pbUseDDD,                         iSizeInBool );
     1615#endif
     1616
    15461617#if H_3D_DIM
    15471618  for( Int i = 0; i < DMM_NUM_TYPE; i++ )
     
    16111682#endif
    16121683}
     1684
     1685#if MTK_DDD_G0063
     1686Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     1687{
     1688    setSubPart<UChar>( ucDDD, m_pucDisparityDerivedDepth, uiAbsPartIdx, uiDepth, uiPartIdx );
     1689}
     1690
     1691Void TComDataCU::setUseDDD        ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     1692{
     1693    setSubPart<Bool>( bUseDDD, m_pbUseDDD, uiAbsPartIdx, uiDepth, uiPartIdx );
     1694}
     1695
     1696Void TComDataCU::setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth )
     1697{
     1698    memset( m_pbUseDDD + uiAbsPartIdx, bUseDDD, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) );
     1699}
     1700
     1701#endif
    16131702
    16141703// --------------------------------------------------------------------------------------------------------------------
     
    38813970  TComMvField tmpMV[2];
    38823971  UChar tmpDir;
     3972
     3973#if MTK_DDD_G0063
     3974  m_iUseDDDCandIdx = -1;
     3975#endif
    38833976
    38843977  //////////////////////////////////
     
    43284421#endif
    43294422  }
    4330 
     4423#if MTK_DDD_G0063
     4424  if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0  )
     4425  {
     4426      UInt uiPartIdx;
     4427      TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
     4428      TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 
     4429
     4430
     4431      tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     4432      tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     4433      tmpDir = 0;
     4434
     4435      xDeriveCenterIdx( uiPUIdx, uiPartIdx);
     4436
     4437      if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
     4438      {
     4439
     4440          TComMvField cMVField;
     4441          UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx );
     4442
     4443          Int iDV = 0;
     4444          Int iViewIdx = 0;
     4445          if( ucInterDir & 1 )
     4446          {
     4447              pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
     4448              if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
     4449              {
     4450                  iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
     4451                  iDV = cMVField.getHor();
     4452
     4453
     4454                  Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
     4455
     4456                  if( iValidDepRef >= 0 )
     4457                  {
     4458                      const TComMv cAdd( 2, 2 );
     4459                      cMVField.getMv() += cAdd;
     4460                      cMVField.getMv() >>= 2;
     4461                      clipMv( cMVField.getMv() );
     4462                      tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
     4463                      tmpDir = 1;
     4464                  }
     4465              }
     4466          }
     4467          if( !tmpDir && ( ucInterDir & 2 ))
     4468          {
     4469              pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
     4470              if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
     4471              {
     4472                  iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
     4473                  iDV = cMVField.getHor();
     4474
     4475                  Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
     4476
     4477                  if( iValidDepRef >= 0 )
     4478                  {
     4479                      const TComMv cAdd( 2, 2 );
     4480                      cMVField.getMv() += cAdd;
     4481                      cMVField.getMv() >>= 2;
     4482                      clipMv( cMVField.getMv() );
     4483                      tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
     4484                      tmpDir = 2;
     4485                  }
     4486              }
     4487          }
     4488          if( tmpDir != 0 )
     4489          {
     4490              rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4491              m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
     4492              m_iUseDDDCandIdx = iCount;
     4493
     4494              if( tmpDir == 1 )
     4495              {
     4496                  pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
     4497              }
     4498              else if( tmpDir == 2  )
     4499              {
     4500                  pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
     4501              }
     4502
     4503              abCandIsInter        [ iCount ] = true;
     4504              puhInterDirNeighbours[ iCount ] = tmpDir;
     4505
     4506              if ( mrgCandIdx == iCount )
     4507              {
     4508                  return;
     4509              }
     4510              iCount ++;
     4511
     4512              Int iLeftAboveAvail = 0;
     4513              if( iPosLeftAbove[ 0 ] != -1 )
     4514              {
     4515                  iPosLeftAbove[ 0 ] = iCount;
     4516                  iLeftAboveAvail = 1;
     4517              }
     4518              if( iPosLeftAbove[ 1 ] != -1 )
     4519              {
     4520                  iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
     4521              }
     4522
     4523          }
     4524      }     
     4525
     4526  }
     4527#endif
    43314528  /////////////////////////////////////////////////////////////////
    43324529  //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC  Candidates /////
     
    43984595      for(; iCnloop >= 0; iCnloop --)
    43994596      {
     4597#if MTK_DDD_G0063
     4598          if( iCnloop == m_iUseDDDCandIdx )
     4599          {
     4600              continue;
     4601          }
     4602#endif
    44004603        if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1])  // F0125 compatible with F0093
    44014604        {
     
    45954798#endif
    45964799
     4800#if MTK_DDD_G0063
     4801  // early termination
     4802  if ( iCount >= getSlice()->getMaxNumMergeCand())
     4803  {
     4804      return;
     4805  }
     4806#endif
    45974807
    45984808#if H_3D_IV_MERGE
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.h

    r787 r795  
    250250#endif
    251251
     252#if MTK_DDD_G0063
     253  UChar*        m_pucDisparityDerivedDepth;
     254  Bool*         m_pbUseDDD;
     255  Int           m_iUseDDDCandIdx;
     256  UChar         m_ucDDTmpDepth;
     257#endif
     258
    252259protected:
    253260 
     
    755762  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
    756763
     764#if MTK_DDD_G0063
     765  UChar*       getDDDepth        ()                        { return m_pucDisparityDerivedDepth;        }
     766  UChar        getDDDepth        ( UInt uiIdx )            { return m_pucDisparityDerivedDepth[uiIdx]; }
     767  Void         setDDDepth        ( UInt uiIdx, UChar n )   { m_pucDisparityDerivedDepth[uiIdx] = n;    }
     768  Void         setDDDepthSubParts( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     769
     770  Bool*        getUseDDD        ()                        { return m_pbUseDDD;        }
     771  Bool         getUseDDD        ( UInt uiIdx )            { return m_pbUseDDD[uiIdx]; }
     772  Void         setUseDDD        ( UInt uiIdx, Bool n )     { m_pbUseDDD[uiIdx] = n;    }
     773  Void         setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth );
     774
     775  Void         setUseDDD        ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     776
     777  UChar        getDDTmpDepth(){ return m_ucDDTmpDepth; }
     778  Int          getUseDDDCandIdx(){ return m_iUseDDDCandIdx;}
     779
     780#endif
    757781};
    758782
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComPrediction.cpp

    r773 r795  
    783783  TComMv      cMv         = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
    784784  pcCU->clipMv(cMv);
     785
     786#if MTK_DDD_G0063
     787  if( pcCU->getUseDDD( uiPartAddr ) )
     788  {
     789      assert( pcCU->getSPIVMPFlag( uiPartAddr ) == 0 );
     790      assert( pcCU->getSlice()->getViewIndex() != 0 );
     791
     792      Int dstStride = rpcYuvPred->getStride();
     793      Int dstStrideC = rpcYuvPred->getCStride();
     794      Pel *dst      = rpcYuvPred->getLumaAddr( uiPartAddr );
     795      Pel *dstU     = rpcYuvPred->getCbAddr( uiPartAddr );
     796      Pel *dstV     = rpcYuvPred->getCrAddr( uiPartAddr );
     797
     798      Int iWidthC  = iWidth >> 1;
     799      Int iHeightC = iHeight >> 1;
     800      Int DefaultC = 1 << ( g_bitDepthY - 1);
     801      for ( Int i = 0; i < iHeight; i++)
     802      {
     803          for ( Int j = 0; j < iWidth ; j++)
     804          {
     805              dst[j] = pcCU->getDDDepth( uiPartAddr );
     806          }
     807          dst += dstStride;
     808      }
     809      for ( Int i = 0; i < iHeightC; i++)
     810      {
     811          for ( Int j = 0; j < iWidthC; j++)
     812          {
     813              dstU[j] = dstV[j] = DefaultC;
     814          }
     815          dstU += dstStrideC;
     816          dstV += dstStrideC;
     817      }
     818
     819      //return;
     820  } else
     821#endif
    785822#if H_3D_ARP
    786823  if(pcCU->getARPW( uiPartAddr ) > 0  && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC())
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComSlice.cpp

    r773 r795  
    32723272#endif
    32733273
     3274#if MTK_DDD_G0063
     3275  if( getIsDepth() && getViewIndex() > 0 )
     3276  {
     3277      TComSlice *pcTextSlice = getTexturePic()->getSlice( 0 );
     3278      memcpy( m_aiDDDInvScale, pcTextSlice->m_aiDDDInvScale, sizeof( Int ) * getViewIndex() );
     3279      memcpy( m_aiDDDInvOffset, pcTextSlice->m_aiDDDInvOffset, sizeof( Int ) * getViewIndex() );
     3280      memcpy( m_aiDDDShift, pcTextSlice->m_aiDDDShift, sizeof( Int ) * getViewIndex() );             
     3281  } 
     3282#endif
     3283
    32743284  if( !setupLUT )
    32753285    return;
     
    33193329      m_depthToDisparityF[ i ][ d ] = ( invCodScale[ i ] * d + invOffset ) >> log2Div;
    33203330    }
    3321   }
    3322 }
    3323 #endif
    3324 #endif
     3331
     3332#if MTK_DDD_G0063
     3333    InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
     3334#endif
     3335  }
     3336}
     3337#endif
     3338#endif
     3339
     3340#if MTK_DDD_G0063
     3341Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
     3342{
     3343    UInt uiViewId     = getViewIndex();
     3344
     3345    if( uiViewId == 0 )
     3346    {
     3347        m_aiDDDInvScale[ iBaseViewIdx ] = m_aiDDDInvOffset[ iBaseViewIdx ] = m_aiDDDShift[ iBaseViewIdx ] = 0;
     3348        return;
     3349    }
     3350
     3351
     3352    Int iSign = iCodedScale >= 0 ? 1 : -1;
     3353    iCodedScale = abs( iCodedScale );
     3354
     3355    Int iBitWidth = 0;
     3356
     3357    const Int iInvPres = 9;
     3358
     3359    while( ((( 1 << iBitWidth ) << 1 ) <= iCodedScale ) )
     3360    {
     3361        iBitWidth ++;
     3362    }
     3363    iBitWidth += iInvPres;
     3364    Int iTargetValue =  1 << iBitWidth;
     3365
     3366    Int iMinError = MAX_INT;
     3367    Int iBestD = 1 << ( iInvPres - 1 );
     3368    for( Int d = 1 << ( iInvPres - 1 ); d < ( 1 << iInvPres ); d++ )
     3369    {
     3370        Int iError = abs( iCodedScale * d - iTargetValue );
     3371        if( iError < iMinError )
     3372        {
     3373            iMinError = iError;
     3374            iBestD = d;
     3375        }
     3376        if( iMinError == 0 )
     3377        {
     3378            break;
     3379        }
     3380    }
     3381    Int iRoundingDir = 0;
     3382    if( iCodedScale * iBestD > iTargetValue )
     3383    {
     3384        iRoundingDir = -1;
     3385    }
     3386    else if( iCodedScale * iBestD < iTargetValue )
     3387    {
     3388        iRoundingDir = 1;
     3389    }
     3390    Int iCamPres = uiCamParsCodedPrecision - 1;
     3391    m_aiDDDInvScale [ iBaseViewIdx ] = ( iBestD << ( iCamPres + g_bitDepthY )) * iSign;
     3392    m_aiDDDInvOffset[ iBaseViewIdx ] = -iSign * iBestD * ( iCodedOffset << g_bitDepthY );
     3393    m_aiDDDShift    [ iBaseViewIdx ] = iBitWidth;
     3394    m_aiDDDInvOffset[ iBaseViewIdx ] += 1 << ( m_aiDDDShift[ iBaseViewIdx ] - 1 );
     3395    m_aiDDDInvOffset[ iBaseViewIdx ] += ( 1 << ( m_aiDDDShift[ iBaseViewIdx ] - 4 ) ) * iRoundingDir;
     3396
     3397    return;
     3398}
     3399#endif
     3400
    33253401/** get scaling matrix from RefMatrixID
    33263402 * \param sizeId size index
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComSlice.h

    r779 r795  
    20622062#endif
    20632063#endif
     2064
     2065#if MTK_DDD_G0063
     2066  Int          m_aiDDDInvScale [MAX_NUM_LAYERS];
     2067  Int          m_aiDDDInvOffset[MAX_NUM_LAYERS];
     2068  UInt         m_aiDDDShift    [MAX_NUM_LAYERS];
     2069#endif
     2070
    20642071public:
    20652072  TComSlice();
     
    24082415  TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId );
    24092416#endif
     2417
     2418#if MTK_DDD_G0063
     2419  Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
     2420  Int  getDepthFromDV( Int iDV, Int iBaseViewIdx )
     2421  {
     2422      return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]);
     2423  }
     2424#endif
     2425
    24102426protected:
    24112427  TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TypeDef.h

    r793 r795  
    258258#define MTK_RBIP_VSP_G0069                1   // Restricted bi-prediction for VSP
    259259#endif
     260
     261#define MTK_DDD_G0063                     1   // Disparity derived depth coding
    260262
    261263///// ***** ILLUMATION COMPENSATION *********
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp

    r787 r795  
    213213  DTRACE_CU("cqtDepth"  , uiDepth)
    214214#endif
     215
    215216  TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx());
    216217  Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr();
     
    274275#if H_MV_ENC_DEC_TRAC
    275276  DTRACE_CU_S("=========== coding_unit ===========\n")
     277#endif
     278
     279
     280#if MTK_DDD_G0063
     281      pcCU->setUseDDD( false, uiAbsPartIdx, uiDepth );
    276282#endif
    277283
     
    437443#endif
    438444    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
     445
     446#if MTK_DDD_G0063
     447    if( uiMergeIndex == m_ppcCU[uiDepth]->getUseDDDCandIdx() )
     448    {
     449        assert( pcCU->getSlice()->getViewIndex() != 0 );
     450        pcCU->setUseDDD( true, uiAbsPartIdx, 0, uiDepth );
     451        pcCU->setDDDepthSubParts( m_ppcCU[uiDepth]->getDDTmpDepth(),uiAbsPartIdx, 0, uiDepth );
     452    }
     453#endif
    439454
    440455    TComMv cTmpMv( 0, 0 );
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp

    r773 r795  
    320320      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    321321
     322#if MTK_DDD_G0063
     323      if( uiMergeIndex == pcSubCU->getUseDDDCandIdx() )
     324      {
     325          assert( pcCU->getSlice()->getViewIndex() != 0 );
     326          pcCU->setUseDDD( true, uiSubPartIdx, uiPartIdx, uiDepth );
     327          pcCU->setDDDepthSubParts( pcSubCU->getDDTmpDepth(),uiSubPartIdx, uiPartIdx, uiDepth );
     328      }
     329      else
     330      {
     331          pcCU->setUseDDD( false, uiSubPartIdx, uiPartIdx, uiDepth );
     332      }
     333#endif
     334
    322335      TComMv cTmpMv( 0, 0 );
    323336      for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibDecoder/TDecTop.h

    r773 r795  
    8282#endif
    8383
     84#if MTK_DDD_G0063
     85  Int getCodedScale( Int iBaseView, Int iCureView){ return m_aaiCodedScale[ iBaseView ][ iCureView ];}
     86  Int getCodedOffset( Int iBaseView, Int iCureView){ return m_aaiCodedOffset[ iBaseView ][ iCureView ];}
     87  UInt getCamParsCodedPrecision(){ return m_uiCamParsCodedPrecision; }
     88#endif
     89
    8490private:
    8591  Bool  xIsComplete ();
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp

    r787 r795  
    18811881
    18821882#endif
     1883
     1884#if MTK_DDD_G0063
     1885    Int iDDDCand = rpcTempCU->getUseDDDCandIdx();
     1886    UChar ucDDDepth = rpcTempCU->getDDTmpDepth();
     1887    rpcTempCU->setUseDDD( false, 0, uhDepth );
     1888#endif
     1889
    18831890  for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual )
    18841891  {
     
    19141921          rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
    19151922#endif
     1923
     1924#if MTK_DDD_G0063
     1925          if( rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewIndex() != 0 && iDDDCand == uiMergeCand )
     1926          {
     1927              rpcTempCU->setUseDDD( true, 0, 0, uhDepth );
     1928              rpcTempCU->setDDDepthSubParts( ucDDDepth, 0, 0, uhDepth );
     1929          }
     1930          else
     1931          {
     1932              rpcTempCU->setUseDDD( false, 0, 0, uhDepth );
     1933          }
     1934#endif
     1935
    19161936#if H_3D_SPIVMP
    19171937          rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth);
     
    21222142  rpcTempCU->setCUTransquantBypassSubParts  ( m_pcEncCfg->getCUTransquantBypassFlagValue(),      0, uhDepth );
    21232143 
     2144#if MTK_DDD_G0063
     2145  rpcTempCU->setUseDDD( false, 0, uhDepth );
     2146#endif
     2147
    21242148#if H_3D_ARP
    21252149  rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp

    r773 r795  
    36753675#endif
    36763676
     3677#if MTK_DDD_G0063
     3678      if( uiMergeCand == pcCU->getUseDDDCandIdx() )
     3679      {
     3680          pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3681          pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3682      }
     3683      else
     3684      {
     3685          pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     3686      }
     3687#endif
     3688
    36773689      xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() );
    36783690      uiBitsCand = uiMergeCand + 1;
     
    43724384        pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    43734385#endif
     4386
     4387#if MTK_DDD_G0063
     4388        if( uiMRGIndex == pcCU->getUseDDDCandIdx() )
     4389        {
     4390            assert( vspFlag[uiMRGIndex]     == 0 );
     4391            assert( bSPIVMPFlag[uiMRGIndex] == 0 );
     4392            pcCU->setUseDDD( true, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4393            pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4394        }
     4395        else
     4396        {
     4397            pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4398        }
     4399#endif
     4400
    43744401#if H_3D_SPIVMP
    43754402        pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 
     
    44224449#if H_3D_SPIVMP       
    44234450        pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4451#endif
     4452
     4453#if MTK_DDD_G0063
     4454        pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    44244455#endif
    44254456        // set ME result
  • branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibEncoder/TEncSlice.h

    r655 r795  
    107107  UInt                    m_uiSliceIdx;
    108108  std::vector<TEncSbac*> CTXMem;
     109
     110#if MTK_DDD_G0063
     111  Int          m_iDDDScale;
     112  Int          m_iDDDOffset;
     113  UInt         m_uiDDDPrecision;
     114#endif
    109115public:
    110116  TEncSlice();
     
    147153  Void      setCtxMem( TEncSbac* sb, Int b )   { CTXMem[b] = sb; }
    148154
     155#if MTK_DDD_G0063
     156  Void setDDDPar( Int iScale, Int iOffset, UInt uiPrecision ){ m_iDDDScale = iScale; m_iDDDOffset = iOffset; m_uiDDDPrecision = uiPrecision; }
     157#endif
     158
    149159private:
    150160  Double  xGetQPValueAccordingToLambda ( Double lambda );
Note: See TracChangeset for help on using the changeset viewer.