Changeset 1143 in 3DVCSoftware for branches/HTM-13.1-dev2-Sharp/source/Lib


Ignore:
Timestamp:
25 Feb 2015, 05:14:58 (10 years ago)
Author:
sharpjp-htm
Message:

Integration of K0042

Location:
branches/HTM-13.1-dev2-Sharp/source/Lib/TLibCommon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev2-Sharp/source/Lib/TLibCommon/TComRom.cpp

    r1133 r1143  
    739739  assert( uiWidth == uiHeight );
    740740
     741#if SHARP_DMM_CLEAN_K0042
     742  Int posStart = 0, posEnd = 0;
     743#else
    741744  UChar    uhStartX = 0,    uhStartY = 0,    uhEndX = 0,    uhEndY = 0;
    742745  Int   iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0;
     746#endif
    743747
    744748  UInt uiBlockSize = 0;
     
    752756  for( UInt uiOri = 0; uiOri < 6; uiOri++ )
    753757  {
     758#if !SHARP_DMM_CLEAN_K0042
    754759    // init the edge line parameters for each of the 6 wedgelet types
    755760    switch( uiOri )
     
    762767    case( 5 ): {  uhStartX = (uiBlockSize-1); uhStartY = 0;               uhEndX = 0;               uhEndY = 0;               iStepStartX =  0; iStepStartY = +1; iStepEndX =  0; iStepEndY = +1; break; }
    763768    }
    764 
     769#endif
     770
     771#if SHARP_DMM_CLEAN_K0042
     772    posEnd = racWedgeList.size();
     773    if (uiOri == 0 || uiOri == 4)
     774    {
     775#endif
    765776    for( Int iK = 0; iK < uiBlockSize; iK += (uiWidth>=16 ?2:1))
    766777    {
    767778      for( Int iL = 0; iL < uiBlockSize; iL += ((uiWidth>=16 && uiOri<4)?2:1) )
    768779      {
     780#if SHARP_DMM_CLEAN_K0042
     781        Int xS = iK;
     782        Int yS = 0;
     783        Int xE = (uiOri == 0) ? 0 : iL;
     784        Int yE = (uiOri == 0) ? iL : uiBlockSize - 1;
     785        cTempWedgelet.setWedgelet( xS, yS, xE, yE, uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) );
     786#else
    769787        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) );
     788#endif
    770789        addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
    771790      }
    772791    }
     792#if SHARP_DMM_CLEAN_K0042
     793    }
     794    else
     795    {
     796      for (Int pos = posStart; pos < posEnd; pos++)
     797      {
     798        cTempWedgelet.generateWedgePatternByRotate(racWedgeList[pos], uiOri);
     799        addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
     800      }
     801    }
     802    posStart = posEnd;
     803#endif
    773804  }
    774805
  • branches/HTM-13.1-dev2-Sharp/source/Lib/TLibCommon/TComWedgelet.cpp

    r1084 r1143  
    177177}
    178178
     179#if SHARP_DMM_CLEAN_K0042
     180Void TComWedgelet::generateWedgePatternByRotate(const TComWedgelet &rcWedge, Int rotate)
     181{
     182  Int stride = m_uiWidth;
     183  Int sinc, offsetI, offsetJ;
     184 
     185  sinc = 1;
     186  offsetI = ( sinc) < 0 ? stride-1 : 0; // 0
     187  offsetJ = (-sinc) < 0 ? stride-1 : 0; // stride - 1
     188
     189  for (Int y = 0; y < stride; y++)
     190  {
     191    for (Int x = 0; x < stride; x++)
     192    {
     193      Int i = offsetI + sinc * y; // y
     194      Int j = offsetJ - sinc * x; // stride - 1 - x
     195      m_pbPattern[(y * stride) + x] = !rcWedge.m_pbPattern[(j * stride) + i];
     196    }
     197  }
     198  Int blocksize = rcWedge.m_uiWidth * (rcWedge.m_eWedgeRes == HALF_PEL ? 2 : 1);
     199  Int offsetX = (-sinc) < 0 ? blocksize - 1 : 0;
     200  Int offsetY = ( sinc) < 0 ? blocksize - 1 : 0;
     201  m_uhXs = offsetX - sinc * rcWedge.m_uhYs;
     202  m_uhYs = offsetY + sinc * rcWedge.m_uhXs;
     203  m_uhXe = offsetX - sinc * rcWedge.m_uhYe;
     204  m_uhYe = offsetY + sinc * rcWedge.m_uhXe;
     205  m_uhOri = rotate;
     206  m_eWedgeRes = rcWedge.m_eWedgeRes;
     207  m_bIsCoarse = rcWedge.m_bIsCoarse;
     208  m_uiAng = rcWedge.m_uiAng;
     209  m_uiWidth  = rcWedge.m_uiWidth;
     210  m_uiHeight = rcWedge.m_uiHeight;
     211}
     212#endif
     213
    179214Void TComWedgelet::xGenerateWedgePattern()
    180215{
     
    193228  xDrawEdgeLine( uhXs, uhYs, uhXe, uhYe, pbTempPattern, iTempStride );
    194229
     230#if SHARP_DMM_CLEAN_K0042
     231  Int shift = (m_eWedgeRes == HALF_PEL) ? 1 : 0;
     232  Int endPos = uhYe>>shift;
     233  for (Int y = 0; y <= endPos; y++)
     234  {
     235    for (Int x = 0; x < m_uiWidth && pbTempPattern[(y * m_uiWidth) + x] == 0; x++)
     236    {
     237      pbTempPattern[(y * m_uiWidth) + x] = true;
     238    }
     239  }
     240  for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ )
     241  {
     242    m_pbPattern[k] = pbTempPattern[k];
     243  };
     244#else
    195245  switch( m_uhOri )
    196246  {
     
    252302    break;
    253303  }
     304#endif
    254305
    255306  if( pbTempPattern )
     
    294345  for( Int x = x0; x <= x1; x++ )
    295346  {
     347#if SHARP_DMM_CLEAN_K0042
     348    Int shift = (m_eWedgeRes == HALF_PEL) ? 1 : 0;
     349    Int stride = iPatternStride >> shift;
     350    if( steep ) { pbPattern[((x>>shift) * stride) + (y>>shift)] = true; }
     351    else        { pbPattern[((y>>shift) * stride) + (x>>shift)] = true; }
     352#else
    296353    if( steep ) { pbPattern[(x * iPatternStride) + y] = true; }
    297354    else        { pbPattern[(y * iPatternStride) + x] = true; }
     355#endif
    298356
    299357    error += deltaerr;
  • branches/HTM-13.1-dev2-Sharp/source/Lib/TLibCommon/TComWedgelet.h

    r1084 r1143  
    124124  Bool*           getScaledPattern(UInt uiWidth);
    125125
     126#if SHARP_DMM_CLEAN_K0042
     127  Void  generateWedgePatternByRotate(const TComWedgelet &rcWedge, Int rotate);
     128#endif
    126129  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
    127130  Void  findClosestAngle();
  • branches/HTM-13.1-dev2-Sharp/source/Lib/TLibCommon/TypeDef.h

    r1142 r1143  
    350350                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    351351                                              // LG_ZEROINTRADEPTHRESI_A0087
     352#define SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
    352353
    353354#define TICKET083_IVPFLAG_FIX             1
Note: See TracChangeset for help on using the changeset viewer.