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

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

Location:
branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComDataCU.h

    r983 r1001  
    766766
    767767#endif
     768
     769#if SHARP_DMM1_I0110
     770  Bool         isDMM1UpscaleMode       ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; };
     771  UInt         getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth =  uiWidth; } return uiBaseWidth; }
     772#endif
     773
    768774};
    769775
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComPrediction.cpp

    r994 r1001  
    440440    case( DMM1_IDX ):
    441441      {
     442#if SHARP_DMM1_I0110
     443        dmmSegmentation = pcCU->isDMM1UpscaleMode((UInt)iWidth) ?
     444            &(g_dmmWedgeLists[ g_aucConvertToBit[pcCU->getDMM1BasePatternWidth((UInt)iWidth)] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]) :
     445            &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
     446#else
    442447        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
     448#endif
    443449      } break;
    444450    case( DMM4_IDX ):
     
    458464    }
    459465    assert( dmmSegmentation );
     466#if SHARP_DMM1_I0110
     467    if( dimType == DMM1_IDX && pcCU->isDMM1UpscaleMode((UInt)iWidth) )
     468    {
     469        biSegPattern = dmmSegmentation->getScaledPattern((UInt)iWidth);
     470        patternStride = iWidth;
     471    }
     472    else
     473    {
     474        biSegPattern  = dmmSegmentation->getPattern();
     475        patternStride = dmmSegmentation->getStride ();
     476    }
     477#else
    460478    biSegPattern  = dmmSegmentation->getPattern();
    461479    patternStride = dmmSegmentation->getStride ();
     480#endif
    462481  }
    463482#endif
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComRom.cpp

    r976 r1001  
    336336  HALF_PEL,    //   8x8
    337337  FULL_PEL,    //  16x16
     338#if SHARP_DMM1_I0110
     339  FULL_PEL,    //  32x32
     340  FULL_PEL,    //  64x64
     341  FULL_PEL     // 128x128
     342#else
    338343  DOUBLE_PEL,  //  32x32
    339344  DOUBLE_PEL,  //  64x64
    340345  DOUBLE_PEL   // 128x128
     346#endif
    341347};
    342348
     
    348354{ //2x2   4x4   8x8 16x16 32x32 64x64
    349355     0,    4,    7,    8,    8,    0 };
     356
     357#if SHARP_DMM1_I0110
     358Bool g_wedgePattern[32*32];
     359#endif
    350360
    351361extern std::vector< std::vector<TComWedgelet> >   g_dmmWedgeLists;
     
    646656  if( !g_dmmWedgeLists.empty() ) return;
    647657
     658#if SHARP_DMM1_I0110
     659  for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]); ui++ )
     660#else
    648661  for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]+1); ui++ )
     662#endif
    649663  {
    650664    UInt uiWedgeBlockSize = ((UInt)DIM_MIN_SIZE)<<ui;
     
    730744  switch( eWedgeRes )
    731745  {
     746#if !SHARP_DMM1_I0110
    732747  case( DOUBLE_PEL ): { uiBlockSize = (uiWidth>>1); break; }
     748#endif
    733749  case(   FULL_PEL ): { uiBlockSize =  uiWidth;     break; }
    734750  case(   HALF_PEL ): { uiBlockSize = (uiWidth<<1); break; }
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComRom.h

    r976 r1001  
    166166extern const UChar                                           g_dmm3IntraTabIdxBits[6];
    167167
     168#if SHARP_DMM1_I0110
     169extern Bool                                                  g_wedgePattern[32*32];
     170#endif
     171
    168172extern       std::vector< std::vector<TComWedgelet> >        g_dmmWedgeLists;
    169173extern       std::vector< std::vector<TComWedgeRef> >        g_dmmWedgeRefLists;
  • 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{
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TComWedgelet.h

    r994 r1001  
    7979enum WedgeResolution
    8080{
     81#if !SHARP_DMM1_I0110
    8182  DOUBLE_PEL,
     83#endif
    8284  FULL_PEL,
    8385  HALF_PEL
     
    104106
    105107  Bool* m_pbPattern;
     108#if SHARP_DMM1_I0110
     109  Bool* m_pbScaledPattern;
     110#endif
    106111
    107112  Void  xGenerateWedgePattern();
     
    129134  Bool            getIsCoarse() { return m_bIsCoarse; }
    130135  UInt            getAng     () { return m_uiAng; }
     136#if SHARP_DMM1_I0110
     137  Bool*           getScaledPattern(UInt uiWidth);
     138#endif
    131139
    132140  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibCommon/TypeDef.h

    r1000 r1001  
    295295#define H_3D_DIM_DLT                      1   // Depth Lookup Table
    296296#define HS_DMM_SIGNALLING_I0120  1   
     297#define SHARP_DMM1_I0110                  1   // LUT size reduction for DMM1 proposed in JCT3V-I0110
    297298#define FIX_WARNING                       1   // fix narrowing conversion of NumPocStCurr0,NumPocStCurr1 at TComSlice.cpp
    298299
Note: See TracChangeset for help on using the changeset viewer.