Changeset 1152 in 3DVCSoftware


Ignore:
Timestamp:
27 Feb 2015, 08:24:20 (10 years ago)
Author:
hisilicon-htm
Message:

Integration of K0048

Location:
branches/HTM-13.1-dev2-HiSilicon
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TComDataCU.cpp

    r1142 r1152  
    23222322    Int iPictureWidth  = depthPicYuv->getWidth();
    23232323    Int iPictureHeight = depthPicYuv->getHeight();
    2324    
     2324 
     2325#if !HS_DBBP_CLEAN_K0048
    23252326    Int iWidth  = uiWidth;
    23262327    Int iHeight = uiHeight;
     2328#endif
    23272329   
    23282330    Bool depthRefineFlag = false;
     
    23372339    }
    23382340   
     2341#if HS_DBBP_CLEAN_K0048
     2342    Int depthPosX = Clip3(0,   iPictureWidth - 1,  iBlkX + ((cDv.getHor()+2)>>2));
     2343    Int depthPosY = Clip3(0,   iPictureHeight - 1, iBlkY + ((cDv.getVer()+2)>>2));
     2344#else
    23392345    Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
    23402346    Int depthPosY = Clip3(0,   iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2));
     2347#endif
    23412348   
    23422349    pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride;
  • branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TComPrediction.cpp

    r1133 r1152  
    630630
    631631#if H_3D_DBBP
     632#if HS_DBBP_CLEAN_K0048
     633PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU)
     634#else
    632635PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize)
     636#endif
    633637{
    634638  // find virtual partitioning for this CU based on depth block
    635639  // segmentation of texture block --> mask IDs
    636   Pel*  pDepthBlockStart      = pDepthPels;
     640  Pel*  pDepthBlockStart    = pDepthPels;
    637641 
    638642  // first compute average of depth block for thresholding
    639643  Int iSumDepth = 0;
    640644  Int iSubSample = 4;
     645#if HS_DBBP_CLEAN_K0048
     646  Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth();
     647  Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight();
     648  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
     649  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     650  {
     651    cDv.setVer(0);
     652  }
     653  Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);
     654  Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);
     655  UInt t=0;
     656
    641657  for (Int y=0; y<uiSize; y+=iSubSample)
    642   {
     658   {
    643659    for (Int x=0; x<uiSize; x+=iSubSample)
    644     {
    645       Int depthPel = pDepthPels[x];
    646      
    647       iSumDepth += depthPel;
    648     }
     660   {
     661if (iBlkX+x>iPictureWidth)
     662{
     663    Int depthPel = pDepthPels[t];
     664    iSumDepth += depthPel;
     665}
     666else
     667{
     668    Int depthPel = pDepthPels[x];
     669    t=x;
     670    iSumDepth += depthPel;
     671}
     672   }
    649673   
    650674    // next row
     675    if (!(iBlkY+y+4>iPictureHeight))
    651676    pDepthPels += uiDepthStride*iSubSample;
     677#else
     678  for (Int y=0; y<uiSize; y+=iSubSample)
     679  {
     680     for (Int x=0; x<uiSize; x+=iSubSample)
     681        {
     682                  Int depthPel = pDepthPels[x];
     683
     684                  iSumDepth += depthPel;
     685        }
     686
     687          // next row
     688          pDepthPels += uiDepthStride*iSubSample;
     689#endif
    652690  }
    653691 
     
    667705    for (Int x=0; x<uiSize; x+=iSubSample)
    668706    {
    669       Int depthPel = pDepthPels[x];
     707#if HS_DBBP_CLEAN_K0048
     708      Int depthPel = 0;
     709if (iBlkX+x>iPictureWidth)
     710{
     711    depthPel = pDepthPels[t];
     712}
     713else
     714{
     715    depthPel = pDepthPels[x];
     716     t=x;
     717}
     718#else
     719            Int depthPel = pDepthPels[x];
     720#endif
    670721     
    671722      // decide which segment this pixel belongs to
     
    696747   
    697748    // next row
     749#if HS_DBBP_CLEAN_K0048
     750    if (!(iBlkY+y+4>iPictureHeight))
     751#endif
    698752    pDepthPels += uiDepthStride*iSubSample;
    699753  }
     
    719773}
    720774
    721 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask )
     775#if HS_DBBP_CLEAN_K0048
     776Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU)
     777#else
     778Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask)
     779#endif
    722780{
    723781  // segmentation of texture block --> mask IDs
     
    728786  Int uiMinDepth = MAX_INT;
    729787  Int uiMaxDepth = 0;
    730 
     788#if HS_DBBP_CLEAN_K0048
     789  uiMinDepth = pDepthPels[ 0 ];
     790  uiMaxDepth = pDepthPels[ 0 ];
     791  iSumDepth  = pDepthPels[ 0 ];
     792    UInt t=0;
     793  Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth();
     794  Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); 
     795  TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag(  ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV;
     796  if( pcCU->getSlice()->getDepthRefinementFlag(  ) )
     797  {
     798      cDv.setVer(0);
     799  }
     800  Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);
     801  Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);
     802if (iBlkX>(Int)(iPictureWidth - uiWidth))
     803{
     804  iSumDepth += pDepthPels[ iPictureWidth - iBlkX - 1 ];
     805  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ iPictureWidth - iBlkX - 1 ]);
     806  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ iPictureWidth - iBlkX - 1 ]);
     807}
     808else
     809{
     810  iSumDepth += pDepthPels[ uiWidth - 1 ];
     811  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiWidth - 1 ]);
     812  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiWidth - 1 ]);
     813}
     814if (iBlkY>(Int)(iPictureHeight - uiHeight))
     815{
     816  iSumDepth += pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) ];
     817  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) ]);
     818  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) ]);
     819}
     820else
     821{
     822  iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) ];
     823  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
     824  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
     825}
     826if (iBlkY>(Int)(iPictureHeight - uiHeight) && iBlkX>(Int)(iPictureWidth - uiWidth))
     827{
     828  iSumDepth += pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + iPictureWidth - iBlkX - 1 ];
     829  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + iPictureWidth - iBlkX - 1 ]);
     830  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + iPictureWidth - iBlkX - 1 ]);
     831}
     832else if (iBlkY>(Int)(iPictureHeight - uiHeight))
     833{
     834  iSumDepth += pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + uiWidth - 1 ];
     835  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + uiWidth - 1 ]);
     836  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + uiWidth - 1 ]);
     837}
     838else if (iBlkX>(Int)(iPictureWidth - uiWidth))
     839{
     840  iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) + iPictureWidth - iBlkX - 1 ];
     841  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + iPictureWidth - iBlkX - 1 ]);
     842  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + iPictureWidth - iBlkX - 1 ]);
     843}
     844else
     845{
     846  iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ];
     847  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
     848  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
     849}
     850#else
    731851  iSumDepth  = pDepthPels[ 0 ];
    732852  iSumDepth += pDepthPels[ uiWidth - 1 ];
     
    743863  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
    744864  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
    745 
     865#endif
    746866 
    747867  // don't generate mask for blocks with small depth range (encoder decision)
     
    765885    for (Int x=0; x<uiHeight; x++)
    766886    {
     887#if HS_DBBP_CLEAN_K0048
     888      Int depthPel = 0;
     889      if (iBlkX+x>iPictureWidth)
     890      {
     891        depthPel = pDepthPels[t];
     892      }
     893      else
     894      {
     895        depthPel = pDepthPels[x];
     896         t=x;
     897      }
     898#else
    767899      Int depthPel = pDepthPels[x];
     900#endif
    768901     
    769902      // decide which segment this pixel belongs to
     
    783916   
    784917    // next row
     918#if HS_DBBP_CLEAN_K0048
     919    if (!(iBlkY+y+1>iPictureHeight))
     920#endif
    785921    pDepthPels += uiDepthStride;
    786922    pMask += MAX_CU_SIZE;
  • branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TComPrediction.h

    r1084 r1152  
    175175 
    176176#if H_3D_DBBP
     177#if HS_DBBP_CLEAN_K0048
     178  PartSize      getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU);
     179  Bool          getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU);
     180#else
    177181  PartSize      getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize);
    178182  Bool          getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask );
     183#endif
    179184  Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize );
    180185#endif
  • branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TypeDef.h

    r1143 r1152  
    265265                                              // SEC_DBBP_DMM4_THRESHOLD_I0076     Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
    266266                                              // SEC_DBBP_VIEW_REF_CHECK_J0037     1   // Signaling dbbp_flag when the current slice has view reference picture(s), JCT3V-J0037 item4
     267#define HS_DBBP_CLEAN_K0048     1
    267268
    268269#define H_3D_DDD                          1   // Disparity derived depth coding
  • branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibDecoder/TDecCu.cpp

    r1133 r1152  
    835835  // compute mask by segmenting depth block
    836836  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
     837#if HS_DBBP_CLEAN_K0048
     838  Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask, pcCU);
     839#else
    837840  Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask);
     841#endif
    838842  AOF(bValidMask);
    839843 
  • branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibEncoder/TEncCu.cpp

    r1133 r1152  
    25222522  AOF( uiDepthStride != 0 );
    25232523 
     2524#if HS_DBBP_CLEAN_K0048
     2525  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU);
     2526
    25242527  // derive partitioning from depth
     2528  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
     2529  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU);
     2530#else
    25252531  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth);
    25262532 
     
    25282534  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
    25292535  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask);
     2536#endif
    25302537 
    25312538  if( !bValidMask )
Note: See TracChangeset for help on using the changeset viewer.