Changeset 1001 in 3DVCSoftware


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.

Location:
branches/HTM-11.2-dev3-Sharp/source/Lib
Files:
9 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
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibDecoder/TDecCu.cpp

    r983 r1001  
    12981298  {
    12991299    Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
    1300    
     1300
     1301#if SHARP_DMM1_I0110
     1302    WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode(uiWidth) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] :  &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     1303#else
    13011304    WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     1305#endif
    13021306    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
    1303    
     1307
    13041308    uiNumSegments = 2;
     1309
     1310#if SHARP_DMM1_I0110
     1311    pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     1312    uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
     1313#else
    13051314    pbMask = pcWedgelet->getPattern();
    13061315    uiMaskStride = pcWedgelet->getStride();
     1316#endif
    13071317  }
    13081318  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
  • branches/HTM-11.2-dev3-Sharp/source/Lib/TLibEncoder/TEncSearch.cpp

    r994 r1001  
    19701970      UInt dimType   = getDimType  ( uiLumaPredMode );
    19711971      UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
     1972#if SHARP_DMM1_I0110
     1973      UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth;
     1974      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiBaseWidth]].size() && dimType == DMM1_IDX )
     1975#else
    19721976      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
    1973       {
     1977#endif
     1978      {
     1979#if SHARP_DMM1_I0110
     1980        if (g_aucConvertToBit[uiBaseWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
     1981#else
    19741982        if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
     1983#endif
    19751984        {                                   
    19761985          patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
     
    20342043    Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
    20352044
     2045#if SHARP_DMM1_I0110
     2046    WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     2047#else
    20362048    WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     2049#endif
    20372050    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
    20382051
    20392052    uiNumSegments = 2;
     2053#if SHARP_DMM1_I0110
     2054    pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern( uiWidth ) : pcWedgelet->getPattern();
     2055    uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
     2056#else
    20402057    pbMask = pcWedgelet->getPattern();
    20412058    uiMaskStride = pcWedgelet->getStride();
     2059#endif
    20422060  }
    20432061  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
     
    31383156              xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx );
    31393157              pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType,  uiPartOffset, uiDepth + uiInitTrDepth );
     3158#if SHARP_DMM1_I0110
     3159              biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ?
     3160                  &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
     3161#else
    31403162              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
     3163#endif
    31413164            } break;
    31423165
     
    31533176          if( biSegmentation )
    31543177          {
     3178#if SHARP_DMM1_I0110
     3179            if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){
     3180                xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3181            }
     3182            else
     3183            {
     3184                xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3185            }
     3186#else
    31553187            xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3188#endif
    31563189            pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 );
    31573190            pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 );
     
    76797712
    76807713  Pel refDC1 = 0; Pel refDC2 = 0;
     7714#if SHARP_DMM1_I0110
     7715  WedgeList*     pacWedgeList     = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     7716  WedgeNodeList* pacWedgeNodeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeNodeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     7717#else
    76817718  WedgeList*     pacWedgeList     = &g_dmmWedgeLists    [(g_aucConvertToBit[uiWidth])];
    76827719  WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     7720#endif
    76837721
    76847722  // coarse wedge search
     
    76887726  {
    76897727    TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx()));
     7728#if SHARP_DMM1_I0110
     7729    Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     7730    UInt uiStride   = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();
     7731    xCalcBiSegDCs  ( piRef,  uiRefStride,  pbPattern, uiStride, refDC1, refDC2 );
     7732    xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );
     7733#else
    76907734    xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    76917735    xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
     7736#endif
    76927737
    76937738    Dist uiActDist = RDO_DIST_MAX;
     
    77257770    {
    77267771      TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId )));
     7772#if SHARP_DMM1_I0110
     7773      Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     7774      UInt uiStride   = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();
     7775      xCalcBiSegDCs  ( piRef,  uiRefStride,  pbPattern, uiStride, refDC1, refDC2 );
     7776      xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );
     7777#else
    77277778      xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    77287779      xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    7729 
     7780#endif
    77307781      Dist uiActDist = RDO_DIST_MAX;
    77317782#if H_3D_VSO
Note: See TracChangeset for help on using the changeset viewer.