Changeset 212 in SHVCSoftware for branches/SHM-2.1-dev/source


Ignore:
Timestamp:
17 May 2013, 13:38:34 (12 years ago)
Author:
canon
Message:

integration M0115 - Fast Intra Decision - cfg parameter: FIS (off by default)
edouard.francois@…

Location:
branches/SHM-2.1-dev/source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r211 r212  
    634634  ("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting")
    635635  ("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting")
     636#if FAST_INTRA_SHVC
     637  ("FIS", m_useFastIntraScalable, false, "Fast Intra Decision for Scalable HEVC")
     638#endif
    636639#if RATE_CONTROL_LAMBDA_DOMAIN
    637640#if RC_SHVC_HARMONIZATION
     
    19571960  printf("CFM:%d ", m_bUseCbfFastMode         );
    19581961  printf("ESD:%d ", m_useEarlySkipDetection  );
     1962#if FAST_INTRA_SHVC
     1963  printf("FIS:%d ", m_useFastIntraScalable  );
     1964#endif
    19591965  printf("RQT:%d ", 1     );
    19601966  printf("TransformSkip:%d ",     m_useTransformSkip              );
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h

    r211 r212  
    208208  Bool      m_bUseCbfFastMode;                              ///< flag for using Cbf Fast PU Mode Decision
    209209  Bool      m_useEarlySkipDetection;                         ///< flag for using Early SKIP Detection
     210#if FAST_INTRA_SHVC
     211  Bool      m_useFastIntraScalable;                          ///< flag for using Fast Intra Decision for Scalable HEVC
     212#endif
    210213  Int       m_sliceMode;                                     ///< 0: no slice limits, 1 : max number of CTBs per slice, 2: max number of bytes per slice,
    211214                                                             ///< 3: max number of tiles per slice
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r211 r212  
    225225    m_acTEncTop[layer].setUseCbfFastMode               ( m_bUseCbfFastMode  );
    226226    m_acTEncTop[layer].setUseEarlySkipDetection        ( m_useEarlySkipDetection );
     227#if FAST_INTRA_SHVC
     228    m_acTEncTop[layer].setUseFastIntraScalable         ( m_useFastIntraScalable );
     229#endif
    227230
    228231    m_acTEncTop[layer].setUseTransformSkip             ( m_useTransformSkip      );
     
    555558  m_cTEncTop.setUseCbfFastMode            ( m_bUseCbfFastMode  );
    556559  m_cTEncTop.setUseEarlySkipDetection            ( m_useEarlySkipDetection );
     560#if FAST_INTRA_SHVC
     561  m_cTEncTop.setUseFastIntraScalable            ( m_useFastIntraScalable );
     562#endif
    557563
    558564  m_cTEncTop.setUseTransformSkip             ( m_useTransformSkip      );
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r210 r212  
    16471647  Int         iLeftIntraDir, iAboveIntraDir;
    16481648  Int         uiPredNum = 0;
    1649  
     1649
    16501650  // Get intra direction of left PU
    16511651  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     
    17381738  return uiPredNum;
    17391739}
     1740
     1741
     1742#if FAST_INTRA_SHVC
     1743/** generate limited set of remaining modes
     1744*\param   uiAbsPartIdx
     1745*\param   uiIntraDirPred  pointer to the array for MPM storage
     1746*\returns Number of intra coding modes (nb of remaining modes + 3 MPMs)
     1747*/
     1748Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes )
     1749{
     1750  // check BL mode
     1751  UInt          uiCUAddrBase, uiAbsPartAddrBase;
     1752  TComDataCU*   pcTempCU = getBaseColCU( uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );
     1753
     1754  if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
     1755    return( NUM_INTRA_MODE-1 );
     1756
     1757  // compute set of enabled modes g_reducedSetIntraModes[...]
     1758  Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
     1759  Int nbModes;
     1760  for (nbModes=0; nbModes<3; nbModes++)  // add 3 MPMs 1st
     1761  {
     1762    g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];
     1763    authorizedMode[ uiIntraDirPred[nbModes] ] = 0;
     1764  }
     1765
     1766  Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );
     1767  if ( authorizedMode[iColBaseDir] )  //possibly add BL mode
     1768  {
     1769    g_reducedSetIntraModes[nbModes++] = iColBaseDir;
     1770    authorizedMode[ iColBaseDir ] = 0;
     1771  }
     1772
     1773  Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0];
     1774  if ( iRefMode > 1 )    //add neighboring modes of refMode
     1775  {
     1776    UInt Left  = iRefMode;
     1777    UInt Right = iRefMode;
     1778    while ( nbModes < NB_REMAIN_MODES+3 )
     1779    {
     1780      Left = ((Left + 29) % 32) + 2;
     1781      Right = ((Right - 1 ) % 32) + 2;
     1782      if ( authorizedMode[Left] )   g_reducedSetIntraModes[nbModes++] = Left;
     1783      if ( authorizedMode[Right] )  g_reducedSetIntraModes[nbModes++] = Right;
     1784    }
     1785  }
     1786  else      //add pre-defined modes
     1787  {
     1788    Int  idx = 0;
     1789    while ( nbModes < NB_REMAIN_MODES+3 )
     1790    {
     1791      UInt mode = g_predefSetIntraModes[idx++];
     1792      if ( authorizedMode[mode] )   g_reducedSetIntraModes[nbModes++] = mode;
     1793    }
     1794  }
     1795
     1796  fullSetOfModes = 0;
     1797  return ( nbModes );
     1798}
     1799#endif
     1800
    17401801
    17411802UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth )
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.h

    r191 r212  
    533533#endif 
    534534
     535#if FAST_INTRA_SHVC
     536  Int           reduceSetOfIntraModes              (  UInt   uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes );
     537#endif
     538
    535539#if REF_IDX_ME_ZEROMV
    536540  Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1);
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TComRom.cpp

    r191 r212  
    9999UInt g_auiPUOffset[8] = { 0, 8, 4, 4, 2, 10, 1, 5};
    100100
     101#if FAST_INTRA_SHVC
     102UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
     103UInt g_predefSetIntraModes[NUM_INTRA_MODE-1] = {26,10,18,34,2,22,14,30,6,24,12,28,8,20,16,32,4,17,19,15,21,13,23,11,25,9,27,7,29,5,31,3,33,0,2};
     104#endif
     105
    101106Void initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx )
    102107{
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TComRom.h

    r191 r212  
    132132
    133133extern const UChar  g_aucIntraModeNumFast[7];
     134
     135#if FAST_INTRA_SHVC
     136extern       UInt  g_reducedSetIntraModes[NUM_INTRA_MODE-1];
     137extern       UInt  g_predefSetIntraModes[NUM_INTRA_MODE-1];
     138#endif
    134139
    135140// ====================================================================================================================
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h

    r211 r212  
    115115#define ILP_DECODED_PICTURE              0
    116116#define SYNTAX_OUTPUT                    0
     117#endif
     118
     119#define FAST_INTRA_SHVC                  1      ///< M0115: reduction number of intra modes in the EL (encoder only)
     120#if FAST_INTRA_SHVC
     121  #define NB_REMAIN_MODES                2      ///< nb of remaining modes (M0115)
    117122#endif
    118123
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCfg.h

    r191 r212  
    204204  Bool      m_bUseCbfFastMode;
    205205  Bool      m_useEarlySkipDetection;
     206#if FAST_INTRA_SHVC
     207  Bool      m_useFastIntraScalable;
     208#endif
    206209  Bool      m_useTransformSkip;
    207210  Bool      m_useTransformSkipFast;
     
    507510  Void      setUseCbfFastMode            ( Bool  b )     { m_bUseCbfFastMode = b; }
    508511  Void      setUseEarlySkipDetection        ( Bool  b )     { m_useEarlySkipDetection = b; }
     512#if FAST_INTRA_SHVC
     513  Void      setUseFastIntraScalable         ( Bool  b )     { m_useFastIntraScalable = b; }
     514#endif
    509515  Void      setUseConstrainedIntraPred      ( Bool  b )     { m_bUseConstrainedIntraPred = b; }
    510516  Void      setPCMInputBitDepthFlag         ( Bool  b )     { m_bPCMInputBitDepthFlag = b; }
     
    531537  Bool      getUseCbfFastMode           ()      { return m_bUseCbfFastMode; }
    532538  Bool      getUseEarlySkipDetection        ()      { return m_useEarlySkipDetection; }
     539#if FAST_INTRA_SHVC
     540  Bool      getUseFastIntraScalable         ()      { return m_useFastIntraScalable; }
     541#endif
    533542  Bool      getUseConstrainedIntraPred      ()      { return m_bUseConstrainedIntraPred; }
    534543  Bool      getPCMInputBitDepthFlag         ()      { return m_bPCMInputBitDepthFlag;   }
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r191 r212  
    25062506    {
    25072507      assert(numModesForFullRD < numModesAvailable);
     2508#if FAST_INTRA_SHVC
     2509      Int   uiPreds[3] = {-1, -1, -1};
     2510      Int   iMode = -1;
     2511      Bool  skipFastHAD = false;
     2512      Int numCand = pcCU->getIntraDirLumaPredictor( uiPartOffset, uiPreds, &iMode );
     2513
     2514      if ( m_pcEncCfg->getUseFastIntraScalable() )
     2515      {
     2516        if( pcCU->getLayerId() > 0 )
     2517        {
     2518          numModesAvailable = pcCU->reduceSetOfIntraModes(uiPartOffset, uiPreds, iMode );
     2519          if( numModesForFullRD > numModesAvailable ) //fast HAD can be skipped
     2520          {
     2521            skipFastHAD = true;
     2522            numModesForFullRD = numModesAvailable;
     2523            for( Int i=0; i < numModesForFullRD; i++ )
     2524              uiRdModeList[ i ] = g_reducedSetIntraModes[ i ];
     2525          }
     2526        }
     2527      }
     2528#endif
    25082529
    25092530      for( Int i=0; i < numModesForFullRD; i++ )
     
    25162537      {
    25172538        UInt uiMode = modeIdx;
     2539#if FAST_INTRA_SHVC
     2540        if ( m_pcEncCfg->getUseFastIntraScalable() )
     2541        {
     2542          if( skipFastHAD )//indicates that fast HAD can be skipped
     2543            break;
     2544          uiMode = ( iMode==0 ) ? g_reducedSetIntraModes[modeIdx] : uiMode; //(iMode=0) indicates reduced set of modes
     2545        }
     2546#endif
    25182547
    25192548        predIntraLumaAng( pcCU->getPattern(), uiMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     
    25292558   
    25302559#if FAST_UDI_USE_MPM
     2560#if FAST_INTRA_SHVC == 0
    25312561      Int uiPreds[3] = {-1, -1, -1};
    25322562      Int iMode = -1;
    25332563      Int numCand = pcCU->getIntraDirLumaPredictor( uiPartOffset, uiPreds, &iMode );
     2564#endif
    25342565      if( iMode >= 0 )
    25352566      {
Note: See TracChangeset for help on using the changeset viewer.