Changeset 1172 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder


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/App/TAppEncoder
Files:
3 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);
Note: See TracChangeset for help on using the changeset viewer.