Changeset 559 in 3DVCSoftware


Ignore:
Timestamp:
9 Aug 2013, 07:59:16 (11 years ago)
Author:
mediatek-htm
Message:

Integration of JCT3V-E0173, fast texture encoding algorithm for dependent views
The MACRO is "MTK_FAST_TEXTURE_ENCODING_E0173"

by Na Zhang (Na.Zhang@…)

Location:
branches/HTM-DEV-2.0-dev2-MediaTek
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp

    r542 r559  
    52565256}
    52575257#endif
     5258#if  MTK_FAST_TEXTURE_ENCODING_E0173
     5259Void
     5260TComDataCU::getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD)
     5261{
     5262  TComSlice*    pcSlice         = getSlice (); 
     5263  Int iViewIndex = pDInfo->m_aVIdxCan;
     5264  //--- get base CU/PU and check prediction mode ---
     5265  TComPic*    pcBasePic   = pcSlice->getIvPic( false, iViewIndex );
     5266  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
     5267
     5268  UInt          uiPartAddr;
     5269  Int           iWidth;
     5270  Int           iHeight;
     5271  getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
     5272
     5273  Int  iCurrPosX, iCurrPosY;
     5274  pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
     5275
     5276  iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
     5277  iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
     5278
     5279  Bool depthRefineFlag = false;
     5280#if H_3D_NBDV_REF
     5281  depthRefineFlag = m_pcSlice->getVPS()->getDepthRefinementFlag( m_pcSlice->getLayerIdInVps() );
     5282#endif // H_3D_NBDV_REF
     5283
     5284  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     5285
     5286  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     5287  Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 ));
     5288  Int         iBaseLPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX - (iWidth >> 1) + ( (cDv.getHor() + 2 ) >> 2 ) );
     5289  Int         iBaseLPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 ));
     5290  Int         iBaseRPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + (iWidth >> 1) + 1 + ( (cDv.getHor() + 2 ) >> 2 ) );
     5291  Int         iBaseRPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 ));
     5292  Int         iBaseUPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     5293  Int         iBaseUPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY - (iHeight >> 1) + ( (cDv.getVer() + 2 ) >> 2 ));
     5294  Int         iBaseDPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     5295  Int         iBaseDPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + (iHeight >> 1) + 1 + ( (cDv.getVer() + 2 ) >> 2 ));
     5296
     5297  Int         iBaseCUAddr;
     5298  Int         iBaseAbsPartIdx;
     5299  Int         iBaseLCUAddr;
     5300  Int         iBaseLAbsPartIdx;
     5301  Int         iBaseRCUAddr;
     5302  Int         iBaseRAbsPartIdx;
     5303  Int         iBaseUCUAddr;
     5304  Int         iBaseUAbsPartIdx;
     5305  Int         iBaseDCUAddr;
     5306  Int         iBaseDAbsPartIdx;
     5307  pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
     5308  pcBaseRec->getCUAddrAndPartIdx( iBaseLPosX , iBaseLPosY , iBaseLCUAddr, iBaseLAbsPartIdx );
     5309  pcBaseRec->getCUAddrAndPartIdx( iBaseRPosX , iBaseRPosY , iBaseRCUAddr, iBaseRAbsPartIdx );
     5310  pcBaseRec->getCUAddrAndPartIdx( iBaseUPosX , iBaseUPosY , iBaseUCUAddr, iBaseUAbsPartIdx );
     5311  pcBaseRec->getCUAddrAndPartIdx( iBaseDPosX , iBaseDPosY , iBaseDCUAddr, iBaseDAbsPartIdx );
     5312  TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     5313  TComDataCU* pcBaseLCU    = pcBasePic->getCU( iBaseLCUAddr );
     5314  TComDataCU* pcBaseRCU    = pcBasePic->getCU( iBaseRCUAddr );
     5315  TComDataCU* pcBaseUCU    = pcBasePic->getCU( iBaseUCUAddr );
     5316  TComDataCU* pcBaseDCU    = pcBasePic->getCU( iBaseDCUAddr );
     5317  bIVFMerge = pcBaseLCU->getMergeFlag( iBaseLAbsPartIdx ) && pcBaseCU->getMergeFlag( iBaseAbsPartIdx ) && pcBaseRCU->getMergeFlag( iBaseRAbsPartIdx ) && pcBaseUCU->getMergeFlag( iBaseUAbsPartIdx ) && pcBaseDCU->getMergeFlag( iBaseDAbsPartIdx );
     5318  Int aiDepthL[5]; //depth level
     5319  aiDepthL[0] = pcBaseCU->getDepth(iBaseAbsPartIdx);
     5320  aiDepthL[1] = pcBaseLCU->getDepth(iBaseLAbsPartIdx);
     5321  aiDepthL[2] = pcBaseRCU->getDepth(iBaseRAbsPartIdx);
     5322  aiDepthL[3] = pcBaseUCU->getDepth(iBaseUAbsPartIdx);
     5323  aiDepthL[4] = pcBaseDCU->getDepth(iBaseDAbsPartIdx);
     5324  for (Int i = 0; i < 5; i++)
     5325  {
     5326    if (iIVFMaxD < aiDepthL[i])
     5327      iIVFMaxD = aiDepthL[i];
     5328  }
     5329}
     5330#endif
    52585331#if H_3D_IV_MERGE
    52595332Bool
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibCommon/TComDataCU.h

    r531 r559  
    485485#endif //H_3D_NBDV_REF
    486486#endif
     487#if  MTK_FAST_TEXTURE_ENCODING_E0173
     488  Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
     489#endif
    487490#if H_3D_IV_MERGE
    488491  Bool          getInterViewMergeCands          ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc );   
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibCommon/TypeDef.h

    r552 r559  
    9797                                              // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    9898#define SHARP_ILLUCOMP_REFINE_E0046       1
    99 
     99#define MTK_FAST_TEXTURE_ENCODING_E0173   1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
    100100
    101101#if H_3D_NBDV
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp

    r541 r559  
    481481  if(!bSliceEnd && !bSliceStart && bInsidePicture )
    482482  {
     483#if  MTK_FAST_TEXTURE_ENCODING_E0173
     484    Bool bIVFMerge = false;
     485    Int  iIVFMaxD = 0;
     486    Bool bFMD = false;
     487#endif
    483488    for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++)
    484489    {
     
    555560        }
    556561      }
     562#if  MTK_FAST_TEXTURE_ENCODING_E0173
     563      if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth())
     564      {
     565        PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
     566        rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     567        rpcTempCU->getIVNStatus( 0, &DvInfo,  bIVFMerge, iIVFMaxD);
     568        rpcTempCU->setPartSizeSubParts( ePartTemp, 0, uiDepth );
     569      }
     570#endif
    557571#endif
    558572      // do inter modes, SKIP and 2Nx2N
     
    570584          rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    571585#endif
     586#if  MTK_FAST_TEXTURE_ENCODING_E0173
     587          xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD );  rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N
     588#else
    572589          xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N
     590#endif
    573591        }
    574592        // SKIP
     
    577595#endif
    578596        xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N
     597#if  MTK_FAST_TEXTURE_ENCODING_E0173
     598        bFMD = bIVFMerge && rpcBestCU->isSkipped(0);
     599#endif
    579600        rpcTempCU->initEstData( uiDepth, iQP );
    580601
     
    598619            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    599620#endif
     621#if  MTK_FAST_TEXTURE_ENCODING_E0173
     622            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD );  rpcTempCU->initEstData( uiDepth, iQP );
     623#else
    600624            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData( uiDepth, iQP );
     625#endif
    601626            if(m_pcEncCfg->getUseCbfFastMode())
    602627            {
     
    677702                )
    678703              {
     704#if  MTK_FAST_TEXTURE_ENCODING_E0173
     705                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFMD  );
     706#else
    679707                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN   );
     708#endif
    680709                rpcTempCU->initEstData( uiDepth, iQP );
    681710              }
     
    690719            )
    691720          {
     721#if  MTK_FAST_TEXTURE_ENCODING_E0173
     722            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFMD  );
     723#else
    692724            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N  );
     725#endif
    693726            rpcTempCU->initEstData( uiDepth, iQP );
    694727            if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_Nx2N )
     
    703736            )
    704737          {
     738#if  MTK_FAST_TEXTURE_ENCODING_E0173
     739            xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN, bFMD  );
     740#else
    705741            xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN  );
     742#endif
    706743            rpcTempCU->initEstData( uiDepth, iQP );
    707744            if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxN)
     
    735772                )
    736773              {
     774#if  MTK_FAST_TEXTURE_ENCODING_E0173
     775                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD );
     776#else
    737777                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
     778#endif
    738779                rpcTempCU->initEstData( uiDepth, iQP );
    739780                if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU )
     
    748789                )
    749790              {
     791#if  MTK_FAST_TEXTURE_ENCODING_E0173
     792                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD );
     793#else
    750794                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
     795#endif
    751796                rpcTempCU->initEstData( uiDepth, iQP );
    752797                if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD )
     
    765810                )
    766811              {
     812#if  MTK_FAST_TEXTURE_ENCODING_E0173
     813                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD, true );
     814#else
    767815                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, true );
     816#endif
    768817                rpcTempCU->initEstData( uiDepth, iQP );
    769818                if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU )
     
    778827                )
    779828              {
     829#if  MTK_FAST_TEXTURE_ENCODING_E0173
     830                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD, true );
     831#else
    780832                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, true );
     833#endif
    781834                rpcTempCU->initEstData( uiDepth, iQP );
    782835                if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD )
     
    797850                )
    798851              {
     852#if  MTK_FAST_TEXTURE_ENCODING_E0173
     853                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD );
     854#else
    799855                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
     856#endif
    800857                rpcTempCU->initEstData( uiDepth, iQP );
    801858                if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N )
     
    810867                )
    811868              {
     869#if  MTK_FAST_TEXTURE_ENCODING_E0173
     870                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD );
     871#else
    812872                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
     873#endif
    813874                rpcTempCU->initEstData( uiDepth, iQP );
    814875              }
     
    823884                )
    824885              {
     886#if  MTK_FAST_TEXTURE_ENCODING_E0173
     887                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD, true );
     888#else
    825889                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, true );
     890#endif
    826891                rpcTempCU->initEstData( uiDepth, iQP );
    827892                if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N )
     
    836901                )
    837902              {
     903#if  MTK_FAST_TEXTURE_ENCODING_E0173
     904                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD, true );
     905#else
    838906                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, true );
     907#endif
    839908                rpcTempCU->initEstData( uiDepth, iQP );
    840909              }
     
    868937#endif
    869938        }
    870 
     939#if  MTK_FAST_TEXTURE_ENCODING_E0173
     940        if(!bFMD)
     941        {
     942#endif
    871943        // do normal intra modes
    872944#if H_3D_DIM_ENC
     
    924996          }
    925997        }
     998#if  MTK_FAST_TEXTURE_ENCODING_E0173
     999        }
     1000#endif
    9261001        if (isAddLowestQP && (iQP == lowestQP))
    9271002        {
     
    9661041      bSubBranch = true;
    9671042    }
     1043#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1044    if(rpcBestCU->getSlice()->getViewIndex() && !rpcBestCU->getSlice()->getIsDepth() && (uiDepth >=iIVFMaxD) && rpcBestCU->isSkipped(0))
     1045    {
     1046      bSubBranch = false;
     1047    }
     1048#endif
    9681049  }
    9691050  else if(!(bSliceEnd && bInsidePicture))
     
    17861867
    17871868#if AMP_MRG
     1869#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1870Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFMD, Bool bUseMRG)
     1871#else
    17881872Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG)
     1873#endif
    17891874#else
    17901875Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize )
    17911876#endif
    17921877{
     1878#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1879  if(!(bFMD && (ePartSize == SIZE_2Nx2N)))  //have  motion estimation or merge check
     1880  {
     1881#endif
    17931882  UChar uhDepth = rpcTempCU->getDepth( 0 );
    17941883#if H_3D_ARP
     
    18641953#if AMP_MRG
    18651954  rpcTempCU->setMergeAMP (true);
     1955#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1956  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bFMD, false, bUseMRG );
     1957#else
    18661958  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG );
     1959#endif
    18671960#else 
    18681961  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
     
    19302023  }
    19312024#endif
     2025#if  MTK_FAST_TEXTURE_ENCODING_E0173
     2026  }
     2027#endif
    19322028}
    19332029
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibEncoder/TEncCu.h

    r537 r559  
    145145
    146146#if AMP_MRG
     147#if  MTK_FAST_TEXTURE_ENCODING_E0173
     148  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize,  Bool bFMD, Bool bUseMRG = false  ) ;
     149#else
    147150  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG = false  );
     151#endif
    148152#else
    149153  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp

    r537 r559  
    36543654 */
    36553655#if AMP_MRG
     3656#if  MTK_FAST_TEXTURE_ENCODING_E0173
     3657Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bFMD, Bool bUseRes, Bool bUseMRG )
     3658#else
    36563659Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
     3660#endif
    36573661#else
    36583662Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes )
     
    37623766#if AMP_MRG
    37633767    Bool bTestNormalMC = true;
    3764    
     3768#if  MTK_FAST_TEXTURE_ENCODING_E0173
     3769    if (bFMD||( bUseMRG && pcCU->getWidth( 0 ) > 8 && iNumPart == 2 ))
     3770#else           
    37653771    if ( bUseMRG && pcCU->getWidth( 0 ) > 8 && iNumPart == 2 )
     3772#endif
    37663773    {
    37673774      bTestNormalMC = false;
  • branches/HTM-DEV-2.0-dev2-MediaTek/source/Lib/TLibEncoder/TEncSearch.h

    r531 r559  
    196196                                  TComYuv*&   rpcResiYuv,
    197197                                  TComYuv*&   rpcRecoYuv,
     198#if MTK_FAST_TEXTURE_ENCODING_E0173
     199                                  Bool        bFMD,
     200#endif
    198201                                  Bool        bUseRes = false
    199202#if AMP_MRG
Note: See TracChangeset for help on using the changeset viewer.