Changeset 253 in 3DVCSoftware for branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon


Ignore:
Timestamp:
4 Feb 2013, 02:57:15 (12 years ago)
Author:
lg
Message:

Integration of JCT3V-C0046

Location:
branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TComDataCU.cpp

    r251 r253  
    30963096}
    30973097
     3098#if LGE_ILLUCOMP_DEPTH_C0046
     3099//This modification is not needed after integrating JCT3V-C0137
     3100Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx, UInt uiDepth)
     3101{
     3102  UInt uiPartAddr;
     3103  UInt iNumbPart;
     3104
     3105  if(!getSlice()->getIsDepth())
     3106  {
     3107    Int iWidth, iHeight;
     3108
     3109    iNumbPart = ( getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ? 1 : (getPartitionSize(uiAbsPartIdx) == SIZE_NxN ? 4 : 2) );
     3110
     3111    for(UInt i = 0; i < iNumbPart; i++)
     3112    {
     3113      getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true);
     3114      uiPartAddr += uiAbsPartIdx;
     3115
     3116      for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
     3117      {
     3118        RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     3119        Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
     3120
     3121        if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx))
     3122        {
     3123          return true;
     3124        }
     3125      }
     3126    }
     3127  }
     3128  else
     3129  {
     3130    iNumbPart = getPic()->getNumPartInCU() >> (uiDepth << 1);
     3131
     3132    for(UInt i = 0; i < iNumbPart; i++)
     3133    {
     3134      uiPartAddr = uiAbsPartIdx + i;
     3135
     3136      for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
     3137      {
     3138        RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     3139        Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
     3140
     3141        if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx))
     3142        {
     3143          return true;
     3144        }
     3145      }
     3146    }
     3147  }
     3148
     3149  return false;
     3150}
     3151#else
    30983152Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx)
    30993153{
     
    31243178  return false;
    31253179}
     3180#endif
    31263181#endif
    31273182
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TComDataCU.h

    r251 r253  
    482482  Void          setICFlag             ( UInt uiIdx, Bool  uh )  { m_pbICFlag[uiIdx] = uh;          }
    483483  Void          setICFlagSubParts     ( Bool bICFlag,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     484#if LGE_ILLUCOMP_DEPTH_C0046
     485  Bool          isICFlagRequired      (UInt uiAbsPartIdx, UInt uiDepth); //This modification is not needed after integrating JCT3V-C0137
     486#else
    484487  Bool          isICFlagRequired      (UInt uiAbsPartIdx);
     488#endif
    485489#endif
    486490
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TComPrediction.cpp

    r251 r253  
    786786    UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 );
    787787    UInt uiOffset = bi ? IF_INTERNAL_OFFS : 0;
     788#if LGE_ILLUCOMP_DEPTH_C0046
     789    Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId());
     790#endif
    788791#if DEPTH_MAP_GENERATION
    789     xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, 0, 0, rpcYuvPred, uiRShift, uiOffset );
     792    xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, 0, 0, rpcYuvPred, uiRShift, uiOffset
     793#if LGE_ILLUCOMP_DEPTH_C0046
     794        , bICFlag
     795#endif
     796        );
    790797#else
    791798    xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, uiOffset );
     
    889896Void
    890897#if DEPTH_MAP_GENERATION
    891 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset )
     898TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset
     899#if LGE_ILLUCOMP_DEPTH_C0046
     900, Bool bICFlag
     901#endif
     902)
    892903#else
    893904TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset )
     
    941952    }
    942953  }
     954
     955#if LGE_ILLUCOMP_DEPTH_C0046
     956  if(bICFlag)
     957  {
     958    Int a, b, iShift;
     959    TComMv tTmpMV(pcMv->getHor()<<2, pcMv->getVer()<<2);
     960
     961    piRefY      = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     962    piDstY      = rpcYuv->getLumaAddr( uiPartAddr );
     963
     964    xGetLLSICPrediction(pcCU, &tTmpMV, pcPicYuvRef, a, b, iShift);
     965
     966    for( Int y = 0; y < iHeight; y++, piDstY += iDstStride, piRefY += iRefStride )
     967    {
     968      for( Int x = 0; x < iWidth; x++ )
     969      {
     970        if(uiOffset)
     971        {
     972          Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement );
     973          piDstY[ x ] = ( (a*piDstY[ x ]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS;
     974        }
     975        else
     976          piDstY[ x ] = Clip( ( (a*piDstY[ x ]) >> iShift ) + b );
     977      }
     978    }
     979  }
     980#endif
    943981}
    944982
     
    17041742  iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
    17051743  iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
     1744#if FIX_LGE_ILLUCOMP_B0045
     1745  iRefX   = iCUPelX + (pMv->getHor() >> 2);
     1746  iRefY   = iCUPelY + (pMv->getVer() >> 2);
     1747#else
    17061748  iRefX   = iCUPelX + (pMv->getHor() >> 3);
    17071749  iRefY   = iCUPelY + (pMv->getVer() >> 3);
     1750#endif
    17081751  uiWidth = pcCU->getWidth(0) >> 1;
    17091752  uiHeight = pcCU->getHeight(0) >> 1;
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TComPrediction.h

    r251 r253  
    9090#if DEPTH_MAP_GENERATION
    9191  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );
    92   Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset );
     92  Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset
     93#if LGE_ILLUCOMP_DEPTH_C0046
     94      , Bool bICFlag = false
     95#endif
     96      );
    9397#else
    9498  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx          );
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TComSlice.cpp

    r210 r253  
    13821382    Int iRefStride = pcRefPicYuvOrg->getStride();
    13831383    Int iSumOrgSAD = 0;
     1384#if LGE_ILLUCOMP_DEPTH_C0046
     1385    Double dThresholdOrgSAD = getIsDepth() ? 0.1 : 0.05;
     1386#else
    13841387    double dThresholdOrgSAD = 0.05;
     1388#endif
    13851389    // Histogram building - luminance
    13861390    for ( Int y = 0; y < iHeight; y++)
  • branches/HTM-5.1-dev1-LG/source/Lib/TLibCommon/TypeDef.h

    r251 r253  
    140140#if LGE_ILLUCOMP_B0045
    141141#define LGE_ILLUCOMP_B0045_ENCSIMP        1
     142#define FIX_LGE_ILLUCOMP_B0045            1
     143#define LGE_ILLUCOMP_DEPTH_C0046          1   // JCT2-C0046 Apply illumination compensation to depth
    142144#endif
    143145
Note: See TracChangeset for help on using the changeset viewer.