Changeset 1418 in SHVCSoftware


Ignore:
Timestamp:
4 Aug 2015, 20:21:46 (9 years ago)
Author:
seregin
Message:

remove global variables g_reducedSetIntraModes and g_predefSetIntraModes, and make them TComDataCU members

Location:
branches/SHM-dev/source/Lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r1395 r1418  
    102102
    103103  m_bDecSubCu          = false;
     104
     105#if FAST_INTRA_SHVC
     106  ::memset( m_reducedSetIntraModes, 0, sizeof(m_reducedSetIntraModes) );
     107#endif
    104108}
    105109
     
    33683372  {
    33693373    return( NUM_INTRA_MODE-1 );
    3370   }
    3371 
    3372   // compute set of enabled modes g_reducedSetIntraModes[...]
     3374  }   
     3375
     3376  // compute set of enabled modes m_reducedSetIntraModes[...]
    33733377  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};
    33743378  Int nbModes;
    33753379  for (nbModes=0; nbModes<3; nbModes++)  // add 3 MPMs 1st
    33763380  {
    3377     g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];
     3381    m_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];
    33783382    authorizedMode[ uiIntraDirPred[nbModes] ] = 0;
    33793383  }
     
    33823386  if ( authorizedMode[iColBaseDir] )  //possibly add BL mode
    33833387  {
    3384     g_reducedSetIntraModes[nbModes++] = iColBaseDir;
     3388    m_reducedSetIntraModes[nbModes++] = iColBaseDir;
    33853389    authorizedMode[ iColBaseDir ] = 0;
    33863390  }
     
    33893393  if ( iRefMode > 1 )    //add neighboring modes of refMode
    33903394  {
    3391     UInt Left  = iRefMode;
    3392     UInt Right = iRefMode;
     3395    UInt left  = iRefMode;
     3396    UInt right = iRefMode;
    33933397    while ( nbModes < NB_REMAIN_MODES+3 )
    33943398    {
    3395       Left = ((Left + 29) % 32) + 2;
    3396       Right = ((Right - 1 ) % 32) + 2;
    3397       if ( authorizedMode[Left] )   g_reducedSetIntraModes[nbModes++] = Left;
    3398       if ( authorizedMode[Right] )  g_reducedSetIntraModes[nbModes++] = Right;
     3399      left = ((left + 29) % 32) + 2;
     3400      right = ((right - 1 ) % 32) + 2;
     3401      if( authorizedMode[left] )
     3402      {
     3403        m_reducedSetIntraModes[nbModes++] = left;
     3404      }
     3405      if( authorizedMode[right] )
     3406      {
     3407        m_reducedSetIntraModes[nbModes++] = right;
     3408      }
    33993409    }
    34003410  }
    34013411  else      //add pre-defined modes
    34023412  {
     3413    const UChar 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};
     3414
    34033415    Int  idx = 0;
    3404     while ( nbModes < NB_REMAIN_MODES+3 )
    3405     {
    3406       UInt mode = g_predefSetIntraModes[idx++];
    3407       if ( authorizedMode[mode] )   g_reducedSetIntraModes[nbModes++] = mode;
     3416    while( nbModes < NB_REMAIN_MODES+3 )
     3417    {
     3418      UInt mode = predefSetIntraModes[idx++];
     3419      if( authorizedMode[mode] )
     3420      {
     3421        m_reducedSetIntraModes[nbModes++] = mode;
     3422      }
    34083423    }
    34093424  }
    34103425
    34113426  fullSetOfModes = 0;
    3412   return ( nbModes );
     3427
     3428  return nbModes;
    34133429}
    34143430#endif
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h

    r1395 r1418  
    8989#if SVC_EXTENSION
    9090  UInt          m_layerId;          ///< layer id
     91#if FAST_INTRA_SHVC
     92  UChar         m_reducedSetIntraModes[NUM_INTRA_MODE-1];
     93#endif
    9194#endif
    9295
     
    474477 
    475478#if SVC_EXTENSION
    476   Void          setLayerId (UInt layerId) { m_layerId = layerId; }
    477   UInt          getLayerId ()               { return m_layerId; }
    478   UInt          getLayerIdx ()              { return m_pcSlice->getVPS()->getLayerIdxInVps(m_layerId); }
     479  Void          setLayerId (UInt layerId)       { m_layerId = layerId; }
     480  UInt          getLayerId ()                   { return m_layerId; }
     481  UInt          getLayerIdx ()                  { return m_pcSlice->getVPS()->getLayerIdxInVps(m_layerId); }
    479482#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    480483  Bool          isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1);
    481484#endif
    482485#if FAST_INTRA_SHVC
    483   Int           reduceSetOfIntraModes              (  UInt   uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes );
     486  Int           reduceSetOfIntraModes(  UInt   uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes );
    484487#endif
    485488#if REF_IDX_ME_ZEROMV
     
    490493  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false );
    491494  Void          scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );
     495#if FAST_INTRA_SHVC
     496  UChar         getReducedSetIntraModes(UChar idx)     { assert( idx < NUM_INTRA_MODE-1 ); return m_reducedSetIntraModes[idx]; }
     497#endif
    492498#endif
    493499};
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1377 r1418  
    726726
    727727#if SVC_EXTENSION
    728 #if FAST_INTRA_SHVC
    729 UInt 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 };
    730 UInt 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};
    731 #endif
    732728Int g_mvScalingFactor  [MAX_LAYERS][2] = {{0,0}, {0,0}};
    733729Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1355 r1418  
    172172
    173173#if SVC_EXTENSION
    174 #if FAST_INTRA_SHVC
    175 extern UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1];
    176 extern UInt g_predefSetIntraModes[NUM_INTRA_MODE-1];
    177 #endif
    178174extern Int g_mvScalingFactor  [MAX_LAYERS][2];
    179175extern Int g_posScalingFactor [MAX_LAYERS][2];
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1407 r1418  
    22902290          for( Int i=0; i < numModesForFullRD; i++ )
    22912291          {
    2292             uiRdModeList[ i ] = g_reducedSetIntraModes[ i ];
     2292            uiRdModeList[ i ] = pcCU->getReducedSetIntraModes(i);
    22932293          }
    22942294        }
     
    23272327            break;
    23282328          }
    2329           uiMode = ( iMode==0 ) ? g_reducedSetIntraModes[modeIdx] : uiMode; //(iMode=0) indicates reduced set of modes
     2329          uiMode = ( iMode==0 ) ? pcCU->getReducedSetIntraModes(modeIdx) : uiMode; //(iMode=0) indicates reduced set of modes
    23302330        }
    23312331#endif
Note: See TracChangeset for help on using the changeset viewer.