Changeset 1172 in SHVCSoftware


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

macro cleanup: Q0078_ADD_LAYER_SETS

Location:
branches/SHM-dev/source
Files:
12 edited

Legend:

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

    r1162 r1172  
    935935#endif
    936936  }
    937 #if Q0078_ADD_LAYER_SETS
     937
    938938  Int* cfg_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
    939939  string cfg_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1];
     
    942942  string cfg_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
    943943  string* cfg_highestLayerIdxPtr[MAX_VPS_LAYER_SETS_PLUS1];
     944
    944945  for (UInt i = 0; i < MAX_VPS_LAYER_SETS_PLUS1; i++)
    945946  {
     
    949950    cfg_numHighestLayerIdx[i] = &m_numHighestLayerIdx[i];
    950951  }
    951 #endif
     952
    952953  string* cfg_numOutputLayersInOutputLayerSet = new string;
    953954  string* cfg_listOfOutputLayers     = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
     
    10591060
    10601061  ("NumLayers",                                     m_numLayers,                                             1, "Number of layers to code") 
    1061 #if Q0078_ADD_LAYER_SETS
     1062
    10621063  ("NumLayerSets",                                  m_numLayerSets,                                          1, "Number of layer sets")
    10631064  ("NumLayerInIdList%d",                            cfg_numLayerInIdList,            0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set")
     
    10661067  ("NumHighestLayerIdx%d",                          cfg_numHighestLayerIdx,          0, MAX_VPS_LAYER_IDX_PLUS1, "Number of highest layer idx")
    10671068  ("HighestLayerIdx%d",                             cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set")
    1068 #endif
     1069
    10691070  ("DefaultTargetOutputLayerIdc",                   m_defaultTargetOutputLayerIdc,                           1, "Default target output layers. 0: All layers are output layer, 1: Only highest layer is output layer, 2 or 3: No default output layers")
    10701071  ("NumOutputLayerSets",                            m_numOutputLayerSets,                                    1, "Number of output layer sets excluding the 0-th output layer set")
     
    24292430  } //for(Int layer = 0; layer < MAX_LAYERS; layer++)
    24302431
    2431 #if Q0078_ADD_LAYER_SETS
    24322432  for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++)
    24332433  {
     
    24352435    assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) );
    24362436  }
     2437
    24372438  for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++)
    24382439  {
     
    24402441    assert( scanStringToArray( cfg_highestLayerIdx[addLayerSet], m_numHighestLayerIdx[addLayerSet], "HighestLayerIdx", m_highestLayerIdx[addLayerSet] ) );
    24412442  }
    2442 #endif
    24432443
    24442444  if( m_defaultTargetOutputLayerIdc != -1 )
     
    24462446    assert( m_defaultTargetOutputLayerIdc >= 0 && m_defaultTargetOutputLayerIdc <= 3 );
    24472447  }
     2448
    24482449  assert( m_numOutputLayerSets != 0 );
    24492450  assert( m_numOutputLayerSets >= m_numLayerSets + m_numAddLayerSets ); // Number of output layer sets must be at least as many as layer sets.
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1162 r1172  
    7373#endif
    7474  Bool      m_maxTidRefPresentFlag;
    75 #if Q0078_ADD_LAYER_SETS
     75
    7676  Int       m_numLayerSets;
     77  Int       m_numAddLayerSets;
    7778  Int       m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
    7879  Int       m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    79   Int       m_numAddLayerSets;
    8080  Int       m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
    8181  Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    82 #endif
     82
    8383  Int       m_defaultTargetOutputLayerIdc;
    8484  Int       m_numOutputLayerSets;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1171 r1172  
    804804#endif
    805805#endif
    806 #if Q0078_ADD_LAYER_SETS
    807806    m_acTEncTop[layer].setNumAddLayerSets                        ( m_numAddLayerSets );
    808 #endif
    809807  }
    810808}
     
    12561254  vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false );
    12571255
    1258 #if Q0078_ADD_LAYER_SETS
    1259   if (m_numLayerSets > 1)
     1256  if( m_numLayerSets > 1 )
    12601257  {
    12611258    vps->setNumLayerSets(m_numLayerSets);
     
    12901287  {
    12911288    // Default layer sets
    1292 #endif
    12931289    vps->setNumLayerSets(m_numLayers);
    12941290    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
     
    13151311      }
    13161312    }
    1317 #if Q0078_ADD_LAYER_SETS
    1318   }
    1319 #endif
    1320 #if Q0078_ADD_LAYER_SETS
     1313  }
     1314
    13211315  vps->setVpsNumLayerSetsMinus1(vps->getNumLayerSets() - 1);
    13221316  vps->setNumAddLayerSets(m_numAddLayerSets);
    13231317  vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets());
    1324   if (m_numAddLayerSets > 0)
     1318
     1319  if( m_numAddLayerSets > 0 )
    13251320  {
    13261321    for (Int setId = 0; setId < m_numAddLayerSets; setId++)
     
    13321327    }
    13331328  }
    1334 #endif
    13351329
    13361330#if AVC_BASE
     
    14941488  // The Layer ID List variables should be derived here.
    14951489  vps->deriveLayerIdListVariables();
    1496 #if Q0078_ADD_LAYER_SETS
    14971490  vps->setPredictedLayerIds();
    14981491  vps->setTreePartitionLayerIdList();
    14991492  vps->deriveLayerIdListVariablesForAddLayerSets();
    1500 #endif
    15011493
    15021494  vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file
     
    15381530    for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )
    15391531    {
    1540 #if !Q0078_ADD_LAYER_SETS  // the following condition is incorrect and is not needed anyway
    1541       if( vps->getLayerIdIncludedFlag(lsIdx, layer) )     
    1542 #endif
    1543       {
    1544         switch(vps->getDefaultTargetOutputLayerIdc())
    1545         {
    1546         case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 );
    1547           break;
    1548         case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
    1549           break;
    1550         case 2:
    1551         case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end()
    1552                   : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] );
    1553           break;
    1554         }
     1532      switch( vps->getDefaultTargetOutputLayerIdc() )
     1533      {
     1534      case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 );
     1535        break;
     1536      case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
     1537        break;
     1538      case 2:
     1539      case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end()
     1540                : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] );
     1541        break;
    15551542      }
    15561543    }
     
    16161603    vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
    16171604#if O0062_POC_LSB_NOT_PRESENT_FLAG
    1618     for(i = 1; i< vps->getMaxLayers(); i++)
     1605    for( i = 1; i< vps->getMaxLayers(); i++ )
    16191606    {
    16201607      if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0  )
    16211608      {
    1622 #if Q0078_ADD_LAYER_SETS
    1623         vps->setPocLsbNotPresentFlag(i, true); // make independedent layers base-layer compliant
    1624 #else
    1625         vps->setPocLsbNotPresentFlag(i, false);
    1626 #endif
     1609        // make independedent layers base-layer compliant
     1610        vps->setPocLsbNotPresentFlag(i, true);
    16271611      }
    16281612    }
     
    17391723  {
    17401724    vps->setVpsVuiBspHrdPresentFlag(true);
    1741 #if Q0078_ADD_LAYER_SETS
    17421725    vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1);
    1743 #else
    1744     vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2);
    1745 #endif
    17461726    vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1);
    17471727    for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
     
    17761756      vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) );
    17771757    }
    1778 #if Q0078_ADD_LAYER_SETS
    17791758    for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
    1780 #else
    1781     for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++)
    1782 #endif
    17831759    {
    17841760      vps->setNumBitstreamPartitions(h, 1);
  • 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.