Changeset 1162 in SHVCSoftware for branches/SHM-dev/source/App


Ignore:
Timestamp:
8 Jul 2015, 00:59:51 (9 years ago)
Author:
seregin
Message:

macro cleanup: OUTPUT_LAYER_SETS_CONFIG

Location:
branches/SHM-dev/source/App/TAppEncoder
Files:
3 edited

Legend:

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

    r1150 r1162  
    111111#endif
    112112, m_maxTidRefPresentFlag(1)
    113 #if OUTPUT_LAYER_SETS_CONFIG
    114113, m_defaultTargetOutputLayerIdc (-1)
    115114, m_numOutputLayerSets          (-1)
    116 #endif
    117115, m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
    118116, m_snrInternalColourSpace(false)
     
    952950  }
    953951#endif
    954 #if OUTPUT_LAYER_SETS_CONFIG
    955952  string* cfg_numOutputLayersInOutputLayerSet = new string;
    956953  string* cfg_listOfOutputLayers     = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
    957954  string* cfg_outputLayerSetIdx      = new string;
    958 #endif
    959955#if MULTIPLE_PTL_SUPPORT
    960956  string* cfg_listOfLayerPTLOfOlss   = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
     
    10641060  ("NumLayers",                                     m_numLayers,                                             1, "Number of layers to code") 
    10651061#if Q0078_ADD_LAYER_SETS
    1066 #if OUTPUT_LAYER_SETS_CONFIG
    10671062  ("NumLayerSets",                                  m_numLayerSets,                                          1, "Number of layer sets")
    1068 #else
    1069   ("NumLayerSets",                                  m_numLayerSets,                                          0, "Number of layer sets")
    1070 #endif
    10711063  ("NumLayerInIdList%d",                            cfg_numLayerInIdList,            0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set")
    10721064  ("LayerSetLayerIdList%d",                         cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set")
     
    10751067  ("HighestLayerIdx%d",                             cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set")
    10761068#endif
    1077 #if OUTPUT_LAYER_SETS_CONFIG
    10781069  ("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")
    10791070  ("NumOutputLayerSets",                            m_numOutputLayerSets,                                    1, "Number of output layer sets excluding the 0-th output layer set")
     
    10811072  ("ListOfOutputLayers%d",                          cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]")
    10821073  ("OutputLayerSetIdx",                             cfg_outputLayerSetIdx,                       string(""), 1, "Corresponding layer set index, only for non-default output layer sets")
    1083 #endif
    10841074#if AUXILIARY_PICTURES
    10851075  ("AuxId%d",                                       cfg_auxId,                                   0, MAX_LAYERS, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh")
     
    24402430
    24412431#if Q0078_ADD_LAYER_SETS
    2442 #if OUTPUT_LAYER_SETS_CONFIG
    24432432  for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++)
    24442433  {
    24452434    // Simplifying the code in the #else section, and allowing 0-th layer set t
    24462435    assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) );
    2447 #else
    2448   for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++)
    2449   {
    2450     if (m_numLayerInIdList[layerSet] > 0)
    2451     {
    2452       Char* layerSetLayerIdListDup = cfg_layerSetLayerIdList[layerSet].empty() ? NULL : strdup(cfg_layerSetLayerIdList[layerSet].c_str());
    2453       Int  i = 0;
    2454       char *layerId = strtok(layerSetLayerIdListDup, " ,-");
    2455       while (layerId != NULL)
    2456       {
    2457         if (i >= m_numLayerInIdList[layerSet])
    2458         {
    2459           printf("NumLayerInIdList%d: The number of layers in the set is larger than the allowed number of layers.\n", layerSet);
    2460           exit(EXIT_FAILURE);
    2461         }
    2462         m_layerSetLayerIdList[layerSet][i] = atoi(layerId);
    2463         layerId = strtok(NULL, " ,-");
    2464         i++;
    2465       }
    2466 
    2467       if( layerSetLayerIdListDup )
    2468       {
    2469         free( layerSetLayerIdListDup );
    2470         layerSetLayerIdListDup = NULL;
    2471       }
    2472     }
    2473 #endif
    24742436  }
    24752437  for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++)
    24762438  {
    2477 #if OUTPUT_LAYER_SETS_CONFIG
    24782439    // Simplifying the code in the #else section
    24792440    assert( scanStringToArray( cfg_highestLayerIdx[addLayerSet], m_numHighestLayerIdx[addLayerSet], "HighestLayerIdx", m_highestLayerIdx[addLayerSet] ) );
    2480 #else
    2481     if (m_numHighestLayerIdx[addLayerSet] > 0)
    2482     {
    2483       Char* highestLayrIdxListDup = cfg_highestLayerIdx[addLayerSet].empty() ? NULL : strdup(cfg_highestLayerIdx[addLayerSet].c_str());
    2484       Int  i = 0;
    2485       char *layerIdx = strtok(highestLayrIdxListDup, " ,-");
    2486       while (layerIdx != NULL)
    2487       {
    2488         if (i >= m_numLayerInIdList[addLayerSet])
    2489         {
    2490           printf("NumLayerInIdList%d: The number of layer idx's in the highest layer idx list is larger than the allowed number of idx's.\n", addLayerSet);
    2491           exit(EXIT_FAILURE);
    2492         }
    2493         m_highestLayerIdx[addLayerSet][i] = atoi(layerIdx);
    2494         layerIdx = strtok(NULL, " ,-");
    2495         i++;
    2496       }
    2497 
    2498       if( highestLayrIdxListDup )
    2499       {
    2500         free( highestLayrIdxListDup );
    2501         highestLayrIdxListDup = NULL;
    2502       }
    2503     }
    2504 #endif
    2505   }
    2506 #endif
    2507 #if OUTPUT_LAYER_SETS_CONFIG
     2441  }
     2442#endif
     2443
    25082444  if( m_defaultTargetOutputLayerIdc != -1 )
    25092445  {
     
    25932529  delete [] cfg_listOfOutputLayers;
    25942530  delete cfg_outputLayerSetIdx;
    2595 #endif
    25962531#else //SVC_EXTENSION
    25972532  switch (m_conformanceWindowMode)
     
    46844619
    46854620#if SVC_EXTENSION
    4686 #if OUTPUT_LAYER_SETS_CONFIG
    46874621Void TAppEncCfg::cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString)
    4688 #else
    4689 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString)
    4690 #endif
    46914622{
    46924623  Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());
     
    46974628    *arr = new Int[numEntries];
    46984629
    4699 #if OUTPUT_LAYER_SETS_CONFIG
    47004630    if( tempChar == NULL )
    47014631    {
     
    47064636      arrayEntry = strtok( tempChar, " ,");
    47074637    }
    4708 #else
    4709     arrayEntry = strtok( tempChar, " ,");
    4710 #endif
     4638
    47114639    while(arrayEntry != NULL)
    47124640    {
     
    47384666}
    47394667
    4740 #if OUTPUT_LAYER_SETS_CONFIG
    47414668Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray)
    47424669{
     
    47554682  return false;
    47564683}
     4684
    47574685Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector)
    47584686{
     
    47724700  return false;
    47734701}
    4774 #endif
    4775 
    4776 #if OUTPUT_LAYER_SETS_CONFIG
     4702
    47774703Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString)
    47784704{
     
    48424768  return false;
    48434769}
    4844 #endif
    48454770#endif //SVC_EXTENSION
    48464771//! \}
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1150 r1162  
    8181  Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    8282#endif
    83 #if OUTPUT_LAYER_SETS_CONFIG
    84   std::vector<Int>                m_outputLayerSetIdx;
    8583  Int       m_defaultTargetOutputLayerIdc;
    8684  Int       m_numOutputLayerSets;
     85  std::vector<Int>                m_outputLayerSetIdx;
    8786  std::vector<Int>                m_numOutputLayersInOutputLayerSet;
    8887  std::vector< std::vector<Int> > m_listOfOutputLayers;
    89 #endif
    9088  Bool      m_isField;                                        ///< enable field coding
    9189  Bool      m_isTopFieldFirst;
     
    556554  Int  getWaveFrontSynchro(Int layerIdx)        { return m_acLayerCfg[layerIdx].m_waveFrontSynchro; }
    557555  Void getDirFilename(string& filename, string& dir, const string path);
    558 #if OUTPUT_LAYER_SETS_CONFIG
     556
    559557  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray);
    560558  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> &  returnVector);
     
    563561  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> &  returnVector);
    564562  Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString);
    565 #else
    566   Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString);
    567 #endif
     563
    568564#if REPN_FORMAT_IN_VPS
    569565  RepFormatCfg* getRepFormatCfg(Int i)  { return &m_repFormatCfg[i]; }
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1161 r1162  
    12581258
    12591259#if Q0078_ADD_LAYER_SETS
    1260 #if OUTPUT_LAYER_SETS_CONFIG
    12611260  if (m_numLayerSets > 1)
    12621261  {
    12631262    vps->setNumLayerSets(m_numLayerSets);
    1264 #else
    1265   if (m_numLayerSets > 0)
    1266   {
    1267     vps->setNumLayerSets(m_numLayerSets+1);
    1268 #endif
     1263
    12691264    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
    12701265    {
     
    12761271    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
    12771272    {
    1278 #if OUTPUT_LAYER_SETS_CONFIG
    12791273      for( i = 0; i < m_numLayerInIdList[setId]; i++ )
    12801274      {
    12811275        Int layerId = m_layerSetLayerIdList[setId][i];
    12821276        Int layerIdx = vps->getLayerIdxInVps(m_layerSetLayerIdList[setId][i]);
    1283 #else
    1284       for( i = 0; i < m_numLayerInIdList[setId-1]; i++ )
    1285       {
    1286         Int layerId = m_layerSetLayerIdList[setId-1][i];
    1287 #endif
    12881277#if O0194_DIFFERENT_BITDEPTH_EL_BL
    12891278        //4
     
    15441533#endif
    15451534
    1546 #if OUTPUT_LAYER_SETS_CONFIG
    1547 
    15481535  vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file
    15491536
     
    15691556    }
    15701557  }
    1571 #endif
     1558
    15721559  // Target output layer
    15731560#if !MULTIPLE_PTL_SUPPORT
     
    15851572
    15861573  // derive OutputLayerFlag[i][j]
    1587 #if !OUTPUT_LAYER_SETS_CONFIG
    1588   if( vps->getDefaultTargetOutputLayerIdc() == 1 )
    1589 #endif
    1590   {
    1591     // default_output_layer_idc equal to 1 specifies that only the layer with the highest value of nuh_layer_id such that nuh_layer_id equal to nuhLayerIdA and
    1592     // AuxId[ nuhLayerIdA ] equal to 0 in each of the output layer sets with index in the range of 1 to vps_num_layer_sets_minus1, inclusive, is an output layer of its output layer set.
    1593 
    1594     // Include the highest layer as output layer for each layer set
    1595     for(Int lsIdx = 1; lsIdx <= vps->getVpsNumLayerSetsMinus1(); lsIdx++)
    1596     {
    1597       for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )
    1598       {
     1574  // default_output_layer_idc equal to 1 specifies that only the layer with the highest value of nuh_layer_id such that nuh_layer_id equal to nuhLayerIdA and
     1575  // AuxId[ nuhLayerIdA ] equal to 0 in each of the output layer sets with index in the range of 1 to vps_num_layer_sets_minus1, inclusive, is an output layer of its output layer set.
     1576
     1577  // Include the highest layer as output layer for each layer set
     1578  for(Int lsIdx = 1; lsIdx <= vps->getVpsNumLayerSetsMinus1(); lsIdx++)
     1579  {
     1580    for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )
     1581    {
    15991582#if !Q0078_ADD_LAYER_SETS  // the following condition is incorrect and is not needed anyway
    1600         if( vps->getLayerIdIncludedFlag(lsIdx, layer) )     
    1601 #endif
     1583      if( vps->getLayerIdIncludedFlag(lsIdx, layer) )     
     1584#endif
     1585      {
     1586        switch(vps->getDefaultTargetOutputLayerIdc())
    16021587        {
    1603 #if OUTPUT_LAYER_SETS_CONFIG
    1604           switch(vps->getDefaultTargetOutputLayerIdc())
    1605           {
    1606             case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 );
    1607               break;
    1608             case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
    1609               break;
    1610             case 2:
    1611             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()
    1612                                                                                                            : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] );
    1613               break;
    1614           }
    1615 #else
    1616           vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
    1617 #endif
     1588        case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 );
     1589          break;
     1590        case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
     1591          break;
     1592        case 2:
     1593        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()
     1594                  : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] );
     1595          break;
    16181596        }
    16191597      }
    16201598    }
    1621 #if OUTPUT_LAYER_SETS_CONFIG
    1622     for( Int olsIdx = vps->getVpsNumLayerSetsMinus1() + 1; olsIdx < vps->getNumOutputLayerSets(); olsIdx++ )
    1623     {
    1624       for( UInt layer = 0; layer < vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)); layer++ )
    1625       {
    1626         vps->setOutputLayerFlag( olsIdx, layer, (layer != vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)) - 1) ? std::find( m_listOfOutputLayers[olsIdx].begin(), m_listOfOutputLayers[olsIdx].end(), vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer)) != m_listOfOutputLayers[olsIdx].end()
    1627                                                                                                                             : m_listOfOutputLayers[olsIdx][m_listOfOutputLayers[olsIdx].size()-1] == vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer) );
    1628       }
    1629     }
    1630 #endif
    1631   }
    1632 #if !OUTPUT_LAYER_SETS_CONFIG
    1633   else
    1634   {
    1635     // cases when default_output_layer_idc is not equal to 1
    1636     assert(!"default_output_layer_idc not equal to 1 is not yet supported");
    1637   }
    1638 #endif
     1599  }
     1600
     1601  for( Int olsIdx = vps->getVpsNumLayerSetsMinus1() + 1; olsIdx < vps->getNumOutputLayerSets(); olsIdx++ )
     1602  {
     1603    for( UInt layer = 0; layer < vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)); layer++ )
     1604    {
     1605      vps->setOutputLayerFlag( olsIdx, layer, (layer != vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)) - 1) ? std::find( m_listOfOutputLayers[olsIdx].begin(), m_listOfOutputLayers[olsIdx].end(), vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer)) != m_listOfOutputLayers[olsIdx].end()
     1606        : m_listOfOutputLayers[olsIdx][m_listOfOutputLayers[olsIdx].size()-1] == vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer) );
     1607    }
     1608  }
    16391609
    16401610  vps->deriveNecessaryLayerFlag();
Note: See TracChangeset for help on using the changeset viewer.