Changeset 778 in SHVCSoftware for branches/SHM-6-dev/source/App


Ignore:
Timestamp:
28 May 2014, 13:26:07 (11 years ago)
Author:
nokia
Message:

JCTVC-Q0078/R0042: Additional layer sets and independent non-base layer rewriting tool (utils/BLRewrite)

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

Legend:

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

    r776 r778  
    492492#endif
    493493  }
     494#if Q0078_ADD_LAYER_SETS
     495  Int* cfg_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
     496  string cfg_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1];
     497  string* cfg_layerSetLayerIdListPtr[MAX_VPS_LAYER_SETS_PLUS1];
     498  Int* cfg_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
     499  string cfg_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
     500  string* cfg_highestLayerIdxPtr[MAX_VPS_LAYER_SETS_PLUS1];
     501  for (UInt i = 0; i < MAX_VPS_LAYER_SETS_PLUS1; i++)
     502  {
     503    cfg_numLayerInIdList[i] = &m_numLayerInIdList[i];
     504    cfg_layerSetLayerIdListPtr[i] = &cfg_layerSetLayerIdList[i];
     505    cfg_highestLayerIdxPtr[i] = &cfg_highestLayerIdx[i];
     506    cfg_numHighestLayerIdx[i] = &m_numHighestLayerIdx[i];
     507  }
     508#endif
    494509#if AVC_BASE
    495510  string  cfg_BLInputFile;
     
    546561#endif
    547562  ("NumLayers",               m_numLayers, 1, "Number of layers to code")
     563#if Q0078_ADD_LAYER_SETS
     564  ("NumLayerSets",            m_numLayerSets, 0, "Number of layer sets")
     565  ("NumLayerInIdList%d",      cfg_numLayerInIdList, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of layers in the set")
     566  ("LayerSetLayerIdList%d",   cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set")
     567  ("NumAddLayerSets",         m_numAddLayerSets, 0, "Number of additional layer sets")
     568  ("NumHighestLayerIdx%d",    cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of highest layer idx")
     569  ("HighestLayerIdx%d",       cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Highest layer idx for an additional layer set")
     570#endif
    548571#if AUXILIARY_PICTURES
    549572  ("InputChromaFormat%d",     cfg_tmpInputChromaFormat,  420, MAX_LAYERS, "InputChromaFormatIDC for layer %d")
     
    13211344  }
    13221345#endif
     1346#if Q0078_ADD_LAYER_SETS
     1347  for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++)
     1348  {
     1349    if (m_numLayerInIdList[layerSet] > 0)
     1350    {
     1351      Char* layerSetLayerIdListDup = cfg_layerSetLayerIdList[layerSet].empty() ? NULL : strdup(cfg_layerSetLayerIdList[layerSet].c_str());
     1352      Int  i = 0;
     1353      char *layerId = strtok(layerSetLayerIdListDup, " ,-");
     1354      while (layerId != NULL)
     1355      {
     1356        if (i >= m_numLayerInIdList[layerSet])
     1357        {
     1358          printf("NumLayerInIdList%d: The number of layers in the set is larger than the allowed number of layers.\n", layerSet);
     1359          exit(EXIT_FAILURE);
     1360        }
     1361        m_layerSetLayerIdList[layerSet][i] = atoi(layerId);
     1362        layerId = strtok(NULL, " ,-");
     1363        i++;
     1364      }
     1365    }
     1366  }
     1367  for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++)
     1368  {
     1369    if (m_numHighestLayerIdx[addLayerSet] > 0)
     1370    {
     1371      Char* highestLayrIdxListDup = cfg_highestLayerIdx[addLayerSet].empty() ? NULL : strdup(cfg_highestLayerIdx[addLayerSet].c_str());
     1372      Int  i = 0;
     1373      char *layerIdx = strtok(highestLayrIdxListDup, " ,-");
     1374      while (layerIdx != NULL)
     1375      {
     1376        if (i >= m_numLayerInIdList[addLayerSet])
     1377        {
     1378          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);
     1379          exit(EXIT_FAILURE);
     1380        }
     1381        m_highestLayerIdx[addLayerSet][i] = atoi(layerIdx);
     1382        layerIdx = strtok(NULL, " ,-");
     1383        i++;
     1384      }
     1385    }
     1386  }
     1387#endif
    13231388#endif //SVC_EXTENSION
    13241389  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h

    r776 r778  
    7474#endif
    7575  Bool      m_maxTidRefPresentFlag;
     76#if Q0078_ADD_LAYER_SETS
     77  Int       m_numLayerSets;
     78  Int       m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
     79  Int       m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     80  Int       m_numAddLayerSets;
     81  Int       m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
     82  Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     83#endif
    7684#else
    7785  Char*     m_pchInputFile;                                   ///< source file name
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r776 r778  
    632632    m_acTEncTop[layer].setCGSMaxYPartNumLog2( m_nCGSMaxYPartNumLog2 );
    633633    m_acTEncTop[layer].setCGSLUTBit( m_nCGSLUTBit );
     634#endif
     635#if Q0078_ADD_LAYER_SETS
     636    m_acTEncTop[layer].setNumAddLayerSets( m_numAddLayerSets );
    634637#endif
    635638  }
     
    10361039  vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false );
    10371040
    1038   vps->setNumLayerSets(m_numLayers);
    1039   for(Int setId = 1; setId < vps->getNumLayerSets(); setId++)
    1040   {
    1041     for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++)
    1042     {
     1041#if Q0078_ADD_LAYER_SETS
     1042  if (m_numLayerSets > 0)
     1043  {
     1044    vps->setNumLayerSets(m_numLayerSets+1);
     1045    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
     1046    {
     1047      for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++)
     1048      {
     1049        vps->setLayerIdIncludedFlag(false, setId, layerId);
     1050      }
     1051    }
     1052    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
     1053    {
     1054      for (Int i = 0; i < m_numLayerInIdList[setId-1]; i++)
     1055      {
     1056        Int layerId = m_layerSetLayerIdList[setId-1][i];
     1057
    10431058#if O0194_DIFFERENT_BITDEPTH_EL_BL
    1044       //4
    1045       g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY;
    1046       g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC;
    1047 
    1048       g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY;
    1049       g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC;
    1050 #endif
    1051       if( layerId <= setId )
    1052       {
     1059        //4
     1060        g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY;
     1061        g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC;
     1062
     1063        g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY;
     1064        g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC;
     1065#endif
     1066
    10531067        vps->setLayerIdIncludedFlag(true, setId, layerId);
    10541068      }
    1055       else
    1056       {
    1057         vps->setLayerIdIncludedFlag(false, setId, layerId);
    1058       }
    1059     }
    1060   }
     1069    }
     1070  }
     1071  else
     1072  {
     1073    // Default layer sets
     1074#endif
     1075    vps->setNumLayerSets(m_numLayers);
     1076    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
     1077    {
     1078      for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++)
     1079      {
     1080#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1081        //4
     1082        g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY;
     1083        g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC;
     1084
     1085        g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY;
     1086        g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC;
     1087#endif
     1088        if (layerId <= setId)
     1089        {
     1090          vps->setLayerIdIncludedFlag(true, setId, layerId);
     1091        }
     1092        else
     1093        {
     1094          vps->setLayerIdIncludedFlag(false, setId, layerId);
     1095        }
     1096      }
     1097    }
     1098#if Q0078_ADD_LAYER_SETS
     1099  }
     1100#endif
     1101#if Q0078_ADD_LAYER_SETS
     1102  vps->setNumAddLayerSets(m_numAddLayerSets);
     1103  if (m_numAddLayerSets > 0)
     1104  {
     1105    for (Int setId = 0; setId < m_numAddLayerSets; setId++)
     1106    {
     1107      for (Int j = 0; j < m_numHighestLayerIdx[setId]; j++)
     1108      {
     1109        vps->setHighestLayerIdxPlus1(setId, j + 1, m_highestLayerIdx[setId][j] + 1);
     1110      }
     1111    }
     1112  }
     1113#endif
    10611114#if VPS_EXTN_MASK_AND_DIM_INFO
    10621115  UInt i = 0, dimIdLen = 0;
     
    13471400  }
    13481401#endif
     1402#if Q0078_ADD_LAYER_SETS
     1403  vps->setPredictedLayerIds();
     1404  vps->setTreePartitionLayerIdList();
     1405#endif
    13491406#endif
    13501407    vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
     
    13541411      if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0  )
    13551412      {
     1413#if Q0078_ADD_LAYER_SETS
     1414        vps->setPocLsbNotPresentFlag(i, true); // make independedent layers base-layer compliant
     1415#else
    13561416        vps->setPocLsbNotPresentFlag(i, false);
     1417#endif
    13571418      }
    13581419    }
Note: See TracChangeset for help on using the changeset viewer.