Changeset 1172 in SHVCSoftware for branches/SHM-dev/source/Lib


Ignore:
Timestamp:
8 Jul 2015, 01:45:57 (10 years ago)
Author:
seregin
Message:

macro cleanup: Q0078_ADD_LAYER_SETS

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r1098 r1172  
    4242#include "TypeDef.h"
    4343#include "libmd5/MD5.h"
    44 #if Q0078_ADD_LAYER_SETS
     44#if SVC_EXTENSION
    4545#include "TLibCommon/NAL.h"
    4646#endif
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1171 r1172  
    32193219#endif
    32203220
    3221 #if Q0078_ADD_LAYER_SETS
    32223221Void TComVPS::setPredictedLayerIds()
    32233222{
     
    32883287  }
    32893288}
    3290 #endif
    32913289
    32923290#if VIEW_ID_RELATED_SIGNALING
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1171 r1172  
    596596  TComPTL     m_pcPTLList[MAX_NUM_LAYER_IDS + 1];
    597597#endif
    598 #if Q0078_ADD_LAYER_SETS
     598
    599599  std::vector< std::vector<Int> >     m_layerSetLayerIdList;
    600600  std::vector<Int>                    m_numLayerInIdList;
    601 #else
    602   Int         m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    603   Int         m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
    604 #endif
     601
    605602  UInt        m_maxLayerId;
    606603  UInt        m_numLayerSets;
    607 #if Q0078_ADD_LAYER_SETS
     604
    608605  UInt        m_vpsNumLayerSetsMinus1;
    609606  Bool        m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
    610 #else
    611   Bool        m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    612 #endif
    613607
    614608  // ------------------------------------------
     
    626620  UInt       m_numScalabilityTypes;
    627621  UInt       m_layerIdxInVps[MAX_NUM_LAYER_IDS];            // Maps layer_id_in_nuh with the layer ID in the VPS
    628 
    629 #if Q0078_ADD_LAYER_SETS
    630622  UInt       m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS];
    631 #else
    632   UInt       m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1];
    633 #endif
    634623  Bool       m_ilpSshSignalingEnabledFlag;
    635624
     
    642631  // Target output layer signalling related
    643632  UInt       m_numOutputLayerSets;
    644 #if Q0078_ADD_LAYER_SETS
    645633  UInt       m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
    646634  Bool       m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1];
    647 #else
    648   UInt       m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1];
    649   Bool       m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    650 #endif
    651 
    652635  Bool       m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    653636  UInt       m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1];
     
    709692  Int        m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    710693
    711 #if Q0078_ADD_LAYER_SETS
    712694  Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
    713 #else
    714   Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1];
    715 #endif
    716695
    717696#if REPN_FORMAT_IN_VPS
     
    734713  Bool       m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
    735714#endif
    736 #if Q0078_ADD_LAYER_SETS
    737715  Int        m_numAddLayerSets;
    738716  UInt       m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
     
    742720  Int        m_numLayersInTreePartition[MAX_LAYERS];
    743721  UInt       m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS];
    744 #endif
     722
    745723  Int        m_TolsIdx;
    746724#if VPS_DPB_SIZE_TABLE
     
    750728  Int        m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    751729  Int        m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    752 #if Q0078_ADD_LAYER_SETS
    753730  Int        m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
    754 #else
    755   Int        m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1];
    756 #endif
    757731#endif
    758732
     
    905879  Void    setNumRefLayers();
    906880#endif
    907 #if Q0078_ADD_LAYER_SETS
     881
    908882  void    deriveLayerIdListVariablesForAddLayerSets();
    909883  UInt    getVpsNumLayerSetsMinus1()                                             { return m_vpsNumLayerSetsMinus1; }
     
    925899  UInt    getTreePartitionLayerId(Int idx, Int layerIdx)                         { return m_treePartitionLayerIdList[idx][layerIdx]; }
    926900  Void    setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId)           { m_treePartitionLayerIdList[idx][layerIdx] = layerId; }
    927 #endif
     901
    928902  UInt    getMaxLayerId()                                       { return m_maxLayerId;   }
    929903  Void    setMaxLayerId(UInt v)                                 { m_maxLayerId = v;      }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1171 r1172  
    130130#endif
    131131
    132 #define Q0078_ADD_LAYER_SETS             1      ///< JCTVC-Q0078: additional layer sets and layer set config
    133132#define MULTIPLE_PTL_SUPPORT             1      ///< Profile, tier and level signalling
    134133
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1170 r1172  
    10461046  assert( pcVPS->getMaxLayerId()       < MAX_NUM_LAYER_IDS );
    10471047  READ_CODE( 6, uiCode, "vps_max_layer_id" );           pcVPS->setMaxLayerId( uiCode );
    1048 #if Q0078_ADD_LAYER_SETS
    10491048  READ_UVLC(uiCode, "vps_num_layer_sets_minus1");  pcVPS->setVpsNumLayerSetsMinus1(uiCode);
    10501049  pcVPS->setNumLayerSets(pcVPS->getVpsNumLayerSetsMinus1() + 1);
     1050
    10511051  for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++)
    1052 #else
    1053   READ_UVLC(    uiCode, "vps_num_layer_sets_minus1" );  pcVPS->setNumLayerSets( uiCode + 1 );
    1054   for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ )
    1055 #endif
    10561052  {
    10571053    // Operation point set
     
    14551451      }
    14561452#if DPB_CONSTRAINTS
    1457       if(pcSlice->getVPS()->getVpsExtensionFlag()==1)
    1458       {
    1459 #if Q0078_ADD_LAYER_SETS
    1460         for (Int ii = 1; ii < (pcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++)  // prevent assert error when num_add_layer_sets > 0
    1461 #else
    1462         for (Int ii=1; ii< pcSlice->getVPS()->getNumOutputLayerSets(); ii++ )
    1463 #endif
     1453      if( pcSlice->getVPS()->getVpsExtensionFlag() == 1 )
     1454      {
     1455        for( Int ii = 1; ii < (pcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++ )  // prevent assert error when num_add_layer_sets > 0
    14641456        {
    14651457          Int layerSetIdxForOutputLayerSet = pcSlice->getVPS()->getOutputLayerSetIdx( ii );
     
    14721464            }
    14731465          }
    1474           if(chkAssert)
     1466
     1467          if( chkAssert )
    14751468          {
    14761469            UInt layerIdc = pcSlice->getVPS()->getLayerIdcForOls( ii, pcSlice->getLayerId() );
     
    14801473          }
    14811474        }
    1482 
    1483 
    1484       }
     1475      }
     1476
    14851477      if(pcSlice->getLayerId() == 0)
    14861478      {
     
    27852777  }
    27862778
    2787 #if Q0078_ADD_LAYER_SETS
    27882779#if O0092_0094_DEPENDENCY_CONSTRAINT // Moved here
    27892780  vps->setNumRefLayers();
     
    27992790  vps->setPredictedLayerIds();
    28002791  vps->setTreePartitionLayerIdList();
    2801 #endif
    2802 #if Q0078_ADD_LAYER_SETS
    2803   if (vps->getNumIndependentLayers() > 1)
     2792
     2793  if( vps->getNumIndependentLayers() > 1 )
    28042794  {
    28052795    READ_UVLC(uiCode, "num_add_layer_sets"); vps->setNumAddLayerSets(uiCode);
    2806     for (i = 0; i < vps->getNumAddLayerSets(); i++)
    2807     {
    2808       for (j = 1; j < vps->getNumIndependentLayers(); j++)
    2809       {
    2810         int len = 1;
    2811         while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1))
     2796
     2797    for( i = 0; i < vps->getNumAddLayerSets(); i++ )
     2798    {
     2799      for( j = 1; j < vps->getNumIndependentLayers(); j++ )
     2800      {
     2801        Int len = 1;
     2802        while( (1 << len) < (vps->getNumLayersInTreePartition(j) + 1) )
    28122803        {
    28132804          len++;
    28142805        }
     2806
    28152807        READ_CODE(len, uiCode, "highest_layer_idx_plus1[i][j]"); vps->setHighestLayerIdxPlus1(i, j, uiCode);
    28162808      }
     
    28232815    vps->setNumAddLayerSets(0);
    28242816  }
    2825 #endif
    28262817
    28272818  READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false);
     
    29372928    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
    29382929
    2939 #if Q0078_ADD_LAYER_SETS
    29402930    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2 )
    2941 #else
    2942     if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 )
    2943 #endif
    29442931    {
    29452932      for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++ )
     
    31263113    }
    31273114  }
    3128 
    3129 #if !Q0078_ADD_LAYER_SETS
    3130 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved up
    3131   vps->setNumRefLayers();
    3132 
    3133   if(vps->getMaxLayers() > MAX_REF_LAYERS)
    3134   {
    3135     for(i = 1;i < vps->getMaxLayers(); i++)
    3136     {
    3137       assert( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) <= MAX_REF_LAYERS);
    3138     }
    3139   }
    3140 #endif
    3141 #endif
    31423115
    31433116  READ_UVLC( uiCode,           "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode);
     
    36033576      parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
    36043577    }
    3605 #if Q0078_ADD_LAYER_SETS
    36063578    for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
    3607 #else
    3608     for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )
    3609 #endif
    36103579    {
    36113580      READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1171 r1172  
    817817
    818818  WRITE_CODE( pcVPS->getMaxLayerId(), 6,                       "vps_max_layer_id" );
    819 #if Q0078_ADD_LAYER_SETS
    820819  WRITE_UVLC(pcVPS->getVpsNumLayerSetsMinus1(),                "vps_num_layer_sets_minus1");
    821   for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++)
    822 #else
    823   WRITE_UVLC( pcVPS->getNumLayerSets() - 1,                 "vps_num_layer_sets_minus1" );
    824   for (UInt opsIdx = 1; opsIdx <= (pcVPS->getNumLayerSets() - 1); opsIdx++)
    825 #endif
     820
     821  for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++ )
    826822  {
    827823    // Operation point set
     
    20712067  }
    20722068
    2073 #if Q0078_ADD_LAYER_SETS
    2074   if (vps->getNumIndependentLayers() > 1)
     2069  if( vps->getNumIndependentLayers() > 1 )
    20752070  {
    20762071    WRITE_UVLC( vps->getNumAddLayerSets(), "num_add_layer_sets" );
    2077     for (i = 0; i < vps->getNumAddLayerSets(); i++)
    2078     {
    2079       for (j = 1; j < vps->getNumIndependentLayers(); j++)
    2080       {
    2081         int len = 1;
    2082         while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1))
     2072
     2073    for( i = 0; i < vps->getNumAddLayerSets(); i++ )
     2074    {
     2075      for( j = 1; j < vps->getNumIndependentLayers(); j++ )
     2076      {
     2077        Int len = 1;
     2078        while( (1 << len) < (vps->getNumLayersInTreePartition(j) + 1) )
    20832079        {
    20842080          len++;
     
    20882084    }
    20892085  }
    2090 #endif
    20912086
    20922087  WRITE_FLAG( vps->getMaxTSLayersPresentFlag(), "vps_sub_layers_max_minus1_present_flag");
     
    21622157      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "layer_set_idx_for_ols_minus1");
    21632158    }
    2164 #if Q0078_ADD_LAYER_SETS
    2165     if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
    2166 #else
    2167     if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
    2168 #endif
    2169     {
    2170       for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++ )
     2159
     2160    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
     2161    {
     2162      for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++ )
    21712163      {
    21722164        WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]");
     
    23922384  if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() )
    23932385  {
    2394 #if Q0078_ADD_LAYER_SETS
    23952386    for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getNumLayerSets(); i++ )
    2396 #else
    2397     for( i = 0; i < vps->getNumLayerSets(); i++ )
    2398 #endif
    23992387    {
    24002388      for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ )
     
    24042392          WRITE_FLAG( vps->getBitRatePresentFlag( i, j),        "bit_rate_present_flag[i][j]" );
    24052393        }
     2394
    24062395        if( vps->getPicRatePresentVpsFlag() )
    24072396        {
    24082397          WRITE_FLAG( vps->getPicRatePresentFlag( i, j),        "pic_rate_present_flag[i][j]" );
    24092398        }
     2399
    24102400        if( vps->getBitRatePresentFlag(i, j) )
    24112401        {
     
    24132403          WRITE_CODE( vps->getAvgBitRate( i, j ), 16, "max_bit_rate[i][j]" );
    24142404        }
     2405
    24152406        if( vps->getPicRatePresentFlag(i, j) )
    24162407        {
     
    25392530        codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
    25402531      }
    2541 #if Q0078_ADD_LAYER_SETS
    25422532      for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ )
    2543 #else
    2544       for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )
    2545 #endif
    25462533      {
    25472534        WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]");
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1150 r1172  
    23702370#if SVC_EXTENSION
    23712371      nalu = NALUnit(NAL_UNIT_SPS, 0, m_layerId);
     2372
     2373      if( m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0 )
     2374      {
     2375        // For independent base layer rewriting
     2376        nalu.m_layerId = 0;
     2377      }
    23722378#else
    23732379      nalu = NALUnit(NAL_UNIT_SPS);
    23742380#endif
    2375 #if Q0078_ADD_LAYER_SETS
    2376       if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0)
    2377       {
    2378         nalu.m_layerId = 0; // For independent base layer rewriting
    2379       }
    2380 #endif
     2381
    23812382      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    23822383      if (m_bSeqFirst)
     
    24152416#if SVC_EXTENSION
    24162417      nalu = NALUnit(NAL_UNIT_PPS, 0, m_layerId);
     2418
     2419      if( m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0 )
     2420      {
     2421        // For independent base layer rewriting
     2422        nalu.m_layerId = 0;
     2423      }
    24172424#else
    24182425      nalu = NALUnit(NAL_UNIT_PPS);
    24192426#endif
    2420 #if Q0078_ADD_LAYER_SETS
    2421       if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0)
    2422       {
    2423         nalu.m_layerId = 0; // For independent base layer rewriting
    2424       }
    2425 #endif
     2427
    24262428      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    24272429#if O0092_0094_DEPENDENCY_CONSTRAINT
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1163 r1172  
    743743  m_cSPS.setNumDirectRefLayers(m_numDirectRefLayers);
    744744#endif
    745 #if Q0078_ADD_LAYER_SETS
     745
    746746  if( !m_numDirectRefLayers && m_numAddLayerSets )
    747747  {
     
    752752    m_cSPS.setLayerId(m_layerId);
    753753  }
    754 #else
    755   m_cSPS.setLayerId(m_layerId);
    756 #endif
    757754#endif //SVC_EXTENSION
     755
    758756  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
    759757  profileTierLevel.setLevelIdc(m_level);
     
    10291027#endif
    10301028
    1031 #if Q0078_ADD_LAYER_SETS
    10321029  if( !m_numDirectRefLayers && m_numAddLayerSets )
    10331030  {
    10341031    m_cPPS.setLayerId(0); // layer ID 0 for independent layers
    10351032  }
    1036 #endif
    10371033
    10381034  if( m_layerId > 0 )
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h

    r1148 r1172  
    147147  Bool                    m_interLayerWeightedPredFlag;
    148148#endif
    149 #if Q0078_ADD_LAYER_SETS
    150   int                     m_numAddLayerSets;
    151 #endif
     149  Int                     m_numAddLayerSets;
    152150#if P0297_VPS_POC_LSB_ALIGNED_FLAG
    153151  Bool                    m_pocDecrementedInDPBFlag;
     
    270268  Void      setNoOutputOfPriorPicsFlags(Bool x)   { m_noOutputOfPriorPicsFlags = x;   }
    271269#endif
    272 #if Q0078_ADD_LAYER_SETS
    273270  Void      setNumAddLayerSets(Int x)             { m_numAddLayerSets = x; }
    274271  Int       getNumAddLayerSets()                  { return m_numAddLayerSets; }
    275 #endif
    276272#if P0297_VPS_POC_LSB_ALIGNED_FLAG
    277273  Void      setPocDecrementedInDPBFlag(Bool x)    { m_pocDecrementedInDPBFlag = x; }
Note: See TracChangeset for help on using the changeset viewer.