Changeset 552 in 3DVCSoftware


Ignore:
Timestamp:
5 Aug 2013, 09:49:41 (11 years ago)
Author:
sharpjp-htm
Message:

Integration of E0046 (CE4 related:IC improvement&simplification)

Location:
branches/HTM-DEV-2.0-dev2-Sharp
Files:
2 added
3 edited

Legend:

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

    r537 r552  
    3939#include "TComPrediction.h"
    4040
     41#if SHARP_ILLUCOMP_REFINE_E0046
     42#define IC_REG_COST_SHIFT 7
     43#define IC_CONST_SHIFT 5
     44#define IC_SHIFT_DIFF 12
     45#endif
     46
    4147//! \ingroup TLibCommon
    4248//! \{
     
    131137  }
    132138#if H_3D_IC
     139#if SHARP_ILLUCOMP_REFINE_E0046
     140  m_uiaShift[0] = 0;
    133141  for( Int i = 1; i < 64; i++ )
    134142  {
     143    m_uiaShift[i] = ( (1 << 15) + i/2 ) / i;
     144  }
     145#else
     146  for( Int i = 1; i < 64; i++ )
     147  {
    135148    m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i;
    136149  }
     150#endif
    137151#endif
    138152}
     
    679693#endif
    680694      , bICFlag );
     695#if SHARP_ILLUCOMP_REFINE_E0046
     696    bICFlag = bICFlag && (iWidth > 8);
     697#endif
    681698    xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    682699#if H_3D_ARP
     
    973990  if( bICFlag )
    974991  {
     992#if SHARP_ILLUCOMP_REFINE_E0046
     993    Int a, b, i, j;
     994    const Int iShift = IC_CONST_SHIFT;
     995
     996    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA );
     997#else
    975998    Int a, b, iShift, i, j;
    976999
    9771000    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA );
     1001#endif
     1002
    9781003
    9791004    for ( i = 0; i < height; i++ )
     
    10931118  if( bICFlag )
    10941119  {
     1120#if SHARP_ILLUCOMP_REFINE_E0046
     1121    Int a, b, i, j;
     1122    const Int iShift = IC_CONST_SHIFT;
     1123    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb
     1124#else
    10951125    Int a, b, iShift, i, j;
    10961126    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb
     1127#endif
    10971128    for ( i = 0; i < cxHeight; i++ )
    10981129    {
     
    11091140      dstCb += dstStride;
    11101141    }
     1142#if SHARP_ILLUCOMP_REFINE_E0046
     1143    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr
     1144#else
    11111145    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr
     1146#endif
    11121147    for ( i = 0; i < cxHeight; i++ )
    11131148    {
     
    13161351/** Function for deriving LM illumination compensation.
    13171352 */
     1353#if SHARP_ILLUCOMP_REFINE_E0046
     1354Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType )
     1355#else
    13181356Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType )
     1357#endif
    13191358{
    13201359  TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec();
     
    13441383
    13451384  Int x = 0, y = 0, xx = 0, xy = 0;
     1385#if SHARP_ILLUCOMP_REFINE_E0046
     1386  Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
     1387#endif
    13461388
    13471389  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 )
     
    13651407    }
    13661408
     1409#if SHARP_ILLUCOMP_REFINE_E0046
     1410    for( j = 0; j < uiWidth; j+=2 )
     1411#else
    13671412    for( j = 0; j < uiWidth; j++ )
     1413#endif
    13681414    {
    13691415      x += pRef[j];
    13701416      y += pRec[j];
     1417#if SHARP_ILLUCOMP_REFINE_E0046
     1418      xx += (pRef[j] * pRef[j])>>precShift;
     1419      xy += (pRef[j] * pRec[j])>>precShift;
     1420#else
    13711421      xx += pRef[j] * pRef[j];
    13721422      xy += pRef[j] * pRec[j];
    1373     }
     1423#endif
     1424    }
     1425#if SHARP_ILLUCOMP_REFINE_E0046
     1426    iCountShift += g_aucConvertToBit[ uiWidth ] + 1;
     1427#else
    13741428    iCountShift += g_aucConvertToBit[ uiWidth ] + 2;
     1429#endif
    13751430  }
    13761431
     
    13961451    }
    13971452
     1453#if SHARP_ILLUCOMP_REFINE_E0046
     1454    for( i = 0; i < uiHeight; i+=2 )
     1455#else
    13981456    for( i = 0; i < uiHeight; i++ )
     1457#endif
    13991458    {
    14001459      x += pRef[0];
    14011460      y += pRec[0];
     1461#if SHARP_ILLUCOMP_REFINE_E0046
     1462      xx += (pRef[0] * pRef[0])>>precShift;
     1463      xy += (pRef[0] * pRec[0])>>precShift;
     1464
     1465      pRef += iRefStride*2;
     1466      pRec += iRecStride*2;
     1467#else
    14021468      xx += pRef[0] * pRef[0];
    14031469      xy += pRef[0] * pRec[0];
     
    14051471      pRef += iRefStride;
    14061472      pRec += iRecStride;
    1407     }
     1473#endif
     1474    }
     1475#if SHARP_ILLUCOMP_REFINE_E0046
     1476    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 );
     1477#else
    14081478    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 );
    1409   }
    1410 
     1479#endif
     1480  }
     1481
     1482#if SHARP_ILLUCOMP_REFINE_E0046
     1483  xy += xx >> IC_REG_COST_SHIFT;
     1484  xx += xx >> IC_REG_COST_SHIFT;
     1485  Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift);
     1486  Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift);
     1487  const Int iShift = IC_CONST_SHIFT;
     1488  {
     1489#else
    14111490  Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;
    14121491
     
    14321511    Int a1 = ( xy << iCountShift ) - y * x;
    14331512    Int a2 = ( xx << iCountShift ) - x * x;             
    1434 
     1513#endif
    14351514    {
    14361515      const Int iShiftA2 = 6;
     1516#if !SHARP_ILLUCOMP_REFINE_E0046
    14371517      const Int iShiftA1 = 15;
     1518#endif
    14381519      const Int iAccuracyShift = 15;
    14391520
     
    14431524      Int a2s = a2;
    14441525
     1526#if SHARP_ILLUCOMP_REFINE_E0046
     1527      a1 = Clip3(0, 2*a2, a1);
     1528      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
     1529      iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
     1530#else
    14451531      iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;
    14461532      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 
     1533#endif
    14471534
    14481535      if( iScaleShiftA1 < 0 )
     
    14581545      Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
    14591546
     1547
    14601548      a2s = a2 >> iScaleShiftA2;
    14611549
    14621550      a1s = a1 >> iScaleShiftA1;
    14631551
     1552#if SHARP_ILLUCOMP_REFINE_E0046
     1553      a = a1s * m_uiaShift[ a2s ];
     1554      a = a >> iScaleShiftA;
     1555#else
    14641556      if (a2s >= 1)
    14651557      {
     
    14941586        iShift -= (9-n);
    14951587      }
    1496 
     1588#endif
    14971589      b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
    14981590    }
  • branches/HTM-DEV-2.0-dev2-Sharp/source/Lib/TLibCommon/TComPrediction.h

    r531 r552  
    7676  Int    m_iLumaRecStride;       ///< stride of #m_pLumaRecBuffer array
    7777#if H_3D_IC
     78#if SHARP_ILLUCOMP_REFINE_E0046
     79  UInt   m_uiaShift[ 64 ];       // Table for multiplication to substitue of division operation
     80#else
    7881  UInt   m_uiaShift[ 63 ];       // Table for multiplication to substitue of division operation
     82#endif
    7983#endif
    8084
     
    127131  Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
    128132#if H_3D_IC
     133#if SHARP_ILLUCOMP_REFINE_E0046
     134  Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType );
     135#else
    129136  Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType );
     137#endif
    130138#endif
    131139  Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight );
  • branches/HTM-DEV-2.0-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h

    r543 r552  
    9696                                              // Unifying rounding offset, for IC part, JCT3V-D0135
    9797                                              // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     98#define SHARP_ILLUCOMP_REFINE_E0046       1
     99
     100
    98101#if H_3D_NBDV
    99102#define H_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
Note: See TracChangeset for help on using the changeset viewer.