Ignore:
Timestamp:
29 Jan 2014, 03:07:07 (11 years ago)
Author:
ntt
Message:

Integration of G0148

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev1-NTT/source/Lib/TLibCommon/TComDataCU.cpp

    r801 r809  
    35393539  for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
    35403540  {
     3541#if NTT_STORE_SPDV_VSP_G0148
     3542    if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
     3543#else
    35413544    if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )
     3545#endif
    35423546    {
    35433547      continue;
     
    40524056    iPosLeftAbove[0] = numA1B1B0;
    40534057#if H_3D_VSP
     4058#if NTT_STORE_SPDV_VSP_G0148
     4059    if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
     4060#else
    40544061    if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
     4062#endif
    40554063#if H_3D_IC
    40564064      && !bICFlag
     
    40754083    iPosLeftAbove[1] = numA1B1B0;
    40764084#if H_3D_VSP
     4085#if NTT_STORE_SPDV_VSP_G0148
     4086    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
     4087#else
    40774088    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1)
     4089#endif
    40784090#if H_3D_IC
    40794091      && !bICFlag
     
    40984110  {
    40994111#if H_3D_VSP
     4112#if NTT_STORE_SPDV_VSP_G0148
     4113    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
     4114#else
    41004115    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)
     4116#endif
    41014117#if H_3D_IC
    41024118      && !bICFlag
     
    41194135  {
    41204136#if H_3D_VSP
     4137#if NTT_STORE_SPDV_VSP_G0148
     4138    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
     4139#else
    41214140    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
     4141#endif
    41224142#if H_3D_IC
    41234143      && !bICFlag
     
    41424162  {
    41434163#if H_3D_VSP
     4164#if NTT_STORE_SPDV_VSP_G0148
     4165    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
     4166#else
    41444167    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)
     4168#endif
    41454169#if H_3D_IC
    41464170      && !bICFlag
     
    78697893#endif
    78707894
     7895#if NTT_STORE_SPDV_VSP_G0148
     7896Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
     7897{
     7898  // Get depth reference
     7899  Int depthRefViewIdx = pcCU->getDvInfo(partAddr).m_aVIdxCan;
     7900 
     7901#if H_3D_FCO_VSP_DONBDV_E0163
     7902  TComPic* pRefPicBaseDepth = 0;
     7903  Bool     bIsCurrDepthCoded = false;
     7904  pRefPicBaseDepth  = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );
     7905  if ( pRefPicBaseDepth->getPicYuvRec() != NULL  )
     7906  {
     7907    bIsCurrDepthCoded = true;
     7908  }
     7909  else
     7910  {
     7911    pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
     7912  }
     7913#else
     7914  TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
     7915#endif
     7916  assert(pRefPicBaseDepth != NULL);
     7917  TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
     7918  assert(pcBaseViewDepthPicYuv != NULL);
     7919  pcBaseViewDepthPicYuv->extendPicBorder();
     7920
     7921  // Get texture reference
     7922  assert(iRefIdx >= 0);
     7923  TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx );
     7924  TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec();
     7925  assert(pcBaseViewTxtPicYuv != NULL);
     7926
     7927  // Initialize LUT according to the reference viewIdx
     7928  Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex();
     7929  Int* pShiftLUT    = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx );
     7930  assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() );
     7931
     7932  // prepare Dv to access depth map or reference view
     7933  TComMv cDv  = pcCU->getDvInfo(partAddr).m_acNBDV;
     7934  pcCU->clipMv(cDv);
     7935
     7936#if H_3D_FCO_VSP_DONBDV_E0163
     7937  if ( bIsCurrDepthCoded )
     7938  {
     7939      cDv.setZero();
     7940  }
     7941#endif
     7942
     7943  // fetch virtual depth map & convert depth to motion vector, which are stored in the motion memory
     7944  xSetMvFieldForVSP( pcCU, pcBaseViewDepthPicYuv, &cDv, partAddr, width, height, pShiftLUT, eRefPicList, iRefIdx, pcCU->getSlice()->getIsDepth(), vspSize );
     7945}
     7946
     7947Void TComDataCU::xSetMvFieldForVSP( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize )
     7948{
     7949  TComCUMvField *cuMvField = cu->getCUMvField( refPicList );
     7950  Int partAddrRasterSubPULine  = g_auiZscanToRaster[ partAddr ];
     7951  Int numPartsLine    = cu->getPic()->getNumPartInWidth();
     7952
     7953  Int nTxtPerMvInfoX = 4; // cu->getPic()->getMinCUWidth();
     7954  Int nTxtPerMvInfoY = 4; // cu->getPic()->getMinCUHeight();
     7955
     7956  Int refDepStride = picRefDepth->getStride();
     7957
     7958  TComMv tmpMv(0, 0);
     7959  tmpMv.setIDVFlag(false);
     7960
     7961  Int refDepOffset  = ( (dv->getHor()+2) >> 2 ) + ( (dv->getVer()+2) >> 2 ) * refDepStride;
     7962  Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refDepOffset;
     7963
     7964  if ((height % 8))
     7965  {
     7966    vspSize = 1; // 8x4
     7967  }
     7968  else if ((width % 8))
     7969  {
     7970    vspSize = 0; // 4x8
     7971  }
     7972  else
     7973  {
     7974    Bool ULvsBR, URvsBL;
     7975    ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
     7976    URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
     7977    vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
     7978  }
     7979 
     7980  Int subBlockW, subBlockH;
     7981  if (vspSize)
     7982  {
     7983    subBlockW = 8;
     7984    subBlockH = 4;
     7985  }
     7986  else
     7987  {
     7988    subBlockW = 4;
     7989    subBlockH = 8;
     7990  }
     7991 
     7992  Int numPartsInSubPUW = subBlockW / nTxtPerMvInfoX;
     7993  Int numPartsInSubPUH = subBlockH / nTxtPerMvInfoY * numPartsLine;
     7994
     7995  for( Int y=0; y<height; y+=subBlockH, partAddrRasterSubPULine+=numPartsInSubPUH )
     7996  {
     7997    Pel *refDepthTmp[4];
     7998    refDepthTmp[0] = refDepth + refDepStride * y;
     7999    refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
     8000    refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
     8001    refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
     8002
     8003    Int partAddrRasterSubPU = partAddrRasterSubPULine;
     8004    for( Int x=0; x<width; x+=subBlockW, partAddrRasterSubPU+=numPartsInSubPUW )
     8005    {
     8006      Pel  maxDepthVal;
     8007      maxDepthVal = refDepthTmp[0][x];
     8008      maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
     8009      maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
     8010      maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
     8011      tmpMv.setHor( (Short) shiftLUT[ maxDepthVal ] );
     8012
     8013      Int partAddrRasterPartLine = partAddrRasterSubPU;
     8014      for( Int sY=0; sY<numPartsInSubPUH; sY+=numPartsLine, partAddrRasterPartLine += numPartsLine )
     8015      {
     8016        Int partAddrRasterPart = partAddrRasterPartLine;
     8017        for( Int sX=0; sX<numPartsInSubPUW; sX+=1, partAddrRasterPart++ )
     8018        {
     8019          cuMvField->setMv    ( g_auiRasterToZscan[ partAddrRasterPart ], tmpMv );
     8020          cuMvField->setRefIdx( g_auiRasterToZscan[ partAddrRasterPart ], refIdx );
     8021        }
     8022      }
     8023    }
     8024  }
     8025
     8026  vspSize = (vspSize<<2)+1;
     8027
     8028}
     8029#endif // NTT_STORE_SPDV_VSP_G0148
    78718030
    78728031//! \}
Note: See TracChangeset for help on using the changeset viewer.