Ignore:
Timestamp:
18 Jul 2014, 06:18:17 (10 years ago)
Author:
sharpjp-htm
Message:

LUT size reduction for DMM1 proposed in JCTVC-I0110 was integrated with a macro: SHARP_DMM1_I0110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComWedgelet.cpp

    r655 r1001  
    6868                                                            m_uiHeight ( rcWedge.m_uiHeight  ),
    6969                                                            m_pbPattern( (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ) )
     70#if SHARP_DMM1_I0110
     71                                                            ,m_pbScaledPattern( g_wedgePattern )
     72#endif
    7073{
    7174  ::memcpy( m_pbPattern, rcWedge.m_pbPattern, sizeof(Bool) * (m_uiWidth * m_uiHeight));
     
    8588
    8689  m_pbPattern = (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) );
     90#if SHARP_DMM1_I0110
     91  m_pbScaledPattern = g_wedgePattern;
     92#endif
    8793}
    8894
     
    181187  switch( m_eWedgeRes )
    182188  {
     189#if !SHARP_DMM1_I0110
    183190  case( DOUBLE_PEL ): { uiTempBlockSize =  m_uiWidth;     uhXs = (m_uhXs<<1); uhYs = (m_uhYs<<1); uhXe = (m_uhXe<<1); uhYe = (m_uhYe<<1); } break;
     191#endif
    184192  case(   FULL_PEL ): { uiTempBlockSize =  m_uiWidth;     uhXs =  m_uhXs;     uhYs =  m_uhYs;     uhXe =  m_uhXe;     uhYe =  m_uhYe;     } break;
    185193  case(   HALF_PEL ): { uiTempBlockSize = (m_uiWidth<<1); uhXs =  m_uhXs;     uhYs =  m_uhYs;     uhXe =  m_uhXe;     uhYe =  m_uhYe;     } break;
    186194  }
    187195
     196#if !SHARP_DMM1_I0110
    188197  if( m_eWedgeRes == DOUBLE_PEL) // adjust line-end for DOUBLE_PEL resolution
    189198  {
     
    194203    if( m_uhOri == 5 ) { uhXs = uiTempBlockSize-1; }
    195204  }
     205#endif
    196206
    197207  Bool* pbTempPattern = new Bool[ (uiTempBlockSize * uiTempBlockSize) ];
     
    223233  switch( m_eWedgeRes )
    224234  {
     235#if !SHARP_DMM1_I0110
    225236  case( DOUBLE_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break;
     237#endif
    226238  case(   FULL_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break;
    227239  case(   HALF_PEL ): // sub-sampling by factor 2
     
    315327}
    316328
     329#if SHARP_DMM1_I0110
     330Bool* TComWedgelet::getScaledPattern(UInt uiDstSize)
     331{
     332    Bool *pbSrcPat = this->getPattern();
     333    UInt uiSrcSize = this->getStride();
     334
     335    Int scale = (g_aucConvertToBit[uiDstSize] - g_aucConvertToBit[uiSrcSize]);
     336    assert(scale>=0);
     337    for (Int y=0; y<uiDstSize; y++)
     338    {
     339       for (Int x=0; x<uiDstSize; x++)
     340       {
     341           Int srcX = x>>scale;
     342           Int srcY = y>>scale;
     343           m_pbScaledPattern[y*uiDstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ];
     344       }
     345   }
     346   return m_pbScaledPattern;
     347}
     348#endif
     349
    317350TComWedgeNode::TComWedgeNode()
    318351{
Note: See TracChangeset for help on using the changeset viewer.