Changeset 805 in SHVCSoftware


Ignore:
Timestamp:
17 Jun 2014, 16:58:15 (11 years ago)
Author:
nokia
Message:

Fix layer set array sizes

Location:
branches/SHM-6-dev/source
Files:
7 edited

Legend:

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

    r804 r805  
    11191119#endif
    11201120#if Q0078_ADD_LAYER_SETS
     1121  vps->setVpsNumLayerSetsMinus1(vps->getNumLayerSets() - 1);
    11211122  vps->setNumAddLayerSets(m_numAddLayerSets);
     1123  vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets());
    11221124  if (m_numAddLayerSets > 0)
    11231125  {
     
    12471249  }
    12481250#endif
    1249   // Target output layer
    1250   vps->setNumOutputLayerSets(vps->getNumLayerSets());
    1251   vps->setNumProfileTierLevel(vps->getNumLayerSets());
    1252 #if P0295_DEFAULT_OUT_LAYER_IDC
    1253   vps->setDefaultTargetOutputLayerIdc(1);
    1254 #else
    1255 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC
    1256   vps->setDefaultOneTargetOutputLayerIdc(1);
    1257 #else
    1258   vps->setDefaultOneTargetOutputLayerFlag(true);
    1259 #endif
    1260 #endif
    1261   for(i = 1; i < vps->getNumLayerSets(); i++)
    1262   {
    1263     vps->setProfileLevelTierIdx(i, i);
    1264     vps->setOutputLayerSetIdx(i, i);
    1265   } 
    1266 #endif
    1267  #if VPS_DPB_SIZE_TABLE
    1268   // The Layer ID List variables can be derived here. 
    1269 #if DERIVE_LAYER_ID_LIST_VARIABLES
    1270   vps->deriveLayerIdListVariables();
    1271 #endif
    1272 #if RESOLUTION_BASED_DPB
    1273   vps->assignSubDpbIndices();
    1274 #else
    1275   vps->deriveNumberOfSubDpbs();
    1276 #endif
    1277 
    1278   // derive OutputLayerFlag[i][j]
    1279   if( vps->getDefaultTargetOutputLayerIdc() == 1 )
    1280   {
    1281     // 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
    1282     // 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.
    1283 
    1284     // Include the highest layer as output layer for each layer set
    1285     for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++)
    1286     {
    1287       for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )
    1288       {
    1289         if( vps->getLayerIdIncludedFlag(lsIdx, layer) )     
    1290         {       
    1291           vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
    1292         }
    1293       }
    1294     }
    1295   }
    1296   else
    1297   {
    1298     // cases when default_output_layer_idc is not equal to 1
    1299     assert(!"default_output_layer_idc not equal to 1 is not yet supported");
    1300   }
    1301 
    1302   // Initialize dpb_size_table() for all ouput layer sets in the VPS extension
    1303   for(i = 1; i < vps->getNumOutputLayerSets(); i++)
    1304   {
    1305 #if CHANGE_NUMSUBDPB_IDX
    1306     Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
    1307 #endif
    1308     Int layerSetId = vps->getOutputLayerSetIdx(i);
    1309 
    1310     for(Int j = 0; j < vps->getMaxTLayers(); j++)
    1311     {
    1312 
    1313       Int maxNumReorderPics = -1;
    1314 #if CHANGE_NUMSUBDPB_IDX
    1315 #if RESOLUTION_BASED_DPB
    1316       for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++)
    1317 #else
    1318       for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
    1319 #endif
    1320 #else
    1321       for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
    1322 #endif
    1323       {
    1324         Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set
    1325 #if RESOLUTION_BASED_DPB
    1326         vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
    1327         // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated
    1328         // at the encoder, modify below
    1329         Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );
    1330         oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1;
    1331         vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue );
    1332 #else
    1333         vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
    1334 #endif
    1335         maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));
    1336       }
    1337 #if RESOLUTION_BASED_DPB
    1338       for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
    1339       {
    1340         // Decrement m_maxVpsDecPicBufferingMinus1
    1341         Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );
    1342         vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 );
    1343       }
    1344 #endif
    1345       vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);
    1346       vps->determineSubDpbInfoFlags();
    1347     }
    1348   }
    1349 #endif
    13501251#if VPS_EXTN_DIRECT_REF_LAYERS
    13511252  // Direct reference layers
     
    13541255  Bool isDefaultDirectDependencyTypeSet = false;
    13551256#endif
    1356   for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    1357   {
    1358     vps->setNumDirectRefLayers( layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers() );
    1359     maxDirectRefLayers = max<UInt>( maxDirectRefLayers, vps->getNumDirectRefLayers( layerCtr ) );
    1360 
    1361     for(i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)
    1362     {
    1363       vps->setRefLayerId( layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i) );
     1257  for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     1258  {
     1259    vps->setNumDirectRefLayers(layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers());
     1260    maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layerCtr));
     1261
     1262    for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)
     1263    {
     1264      vps->setRefLayerId(layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i));
    13641265    }
    13651266    // Set direct dependency flag
    13661267    // Initialize flag to 0
    1367     for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
    1368     {
    1369       vps->setDirectDependencyFlag( layerCtr, refLayerCtr, false );
    1370     }
    1371     for(i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)
    1372     {
    1373       vps->setDirectDependencyFlag( layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true);
     1268    for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
     1269    {
     1270      vps->setDirectDependencyFlag(layerCtr, refLayerCtr, false);
     1271    }
     1272    for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)
     1273    {
     1274      vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true);
    13741275    }
    13751276    // prediction indications
    13761277    vps->setDirectDepTypeLen(2); // sample and motion types are encoded
    1377     for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
    1378     {
    1379       if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr))
     1278    for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
     1279    {
     1280      if (vps->getDirectDependencyFlag(layerCtr, refLayerCtr))
    13801281      {
    13811282        assert(m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) || m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr));
    1382         vps->setDirectDependencyType( layerCtr, refLayerCtr, ((m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) ? 1 : 0) |
    1383                                                               (m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr) ? 2 : 0)) - 1);
     1283        vps->setDirectDependencyType(layerCtr, refLayerCtr, ((m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) ? 1 : 0) |
     1284          (m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr) ? 2 : 0)) - 1);
    13841285#if O0096_DEFAULT_DEPENDENCY_TYPE
    13851286        if (!isDefaultDirectDependencyTypeSet)
     
    13971298      else
    13981299      {
    1399         vps->setDirectDependencyType( layerCtr, refLayerCtr, 0 );
     1300        vps->setDirectDependencyType(layerCtr, refLayerCtr, 0);
    14001301      }
    14011302    }
     
    14051306  vps->setNumRefLayers();
    14061307
    1407   if(vps->getMaxLayers() > MAX_REF_LAYERS)
    1408   {
    1409     for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    1410     {
    1411       assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS);
     1308  if (vps->getMaxLayers() > MAX_REF_LAYERS)
     1309  {
     1310    for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     1311    {
     1312      assert(vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS);
    14121313    }
    14131314  }
     
    14161317  vps->setPredictedLayerIds();
    14171318  vps->setTreePartitionLayerIdList();
    1418 #endif
     1319  vps->setLayerIdIncludedFlagsForAddLayerSets();
     1320#endif
     1321#endif
     1322  // Target output layer
     1323  vps->setNumOutputLayerSets(vps->getNumLayerSets());
     1324  vps->setNumProfileTierLevel(vps->getNumLayerSets());
     1325#if P0295_DEFAULT_OUT_LAYER_IDC
     1326  vps->setDefaultTargetOutputLayerIdc(1);
     1327#else
     1328#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     1329  vps->setDefaultOneTargetOutputLayerIdc(1);
     1330#else
     1331  vps->setDefaultOneTargetOutputLayerFlag(true);
     1332#endif
     1333#endif
     1334  for(i = 1; i < vps->getNumLayerSets(); i++)
     1335  {
     1336    vps->setProfileLevelTierIdx(i, i);
     1337    vps->setOutputLayerSetIdx(i, i);
     1338  } 
     1339#endif
     1340 #if VPS_DPB_SIZE_TABLE
     1341  // The Layer ID List variables can be derived here. 
     1342#if DERIVE_LAYER_ID_LIST_VARIABLES
     1343  vps->deriveLayerIdListVariables();
     1344#endif
     1345#if RESOLUTION_BASED_DPB
     1346  vps->assignSubDpbIndices();
     1347#else
     1348  vps->deriveNumberOfSubDpbs();
     1349#endif
     1350
     1351  // derive OutputLayerFlag[i][j]
     1352  if( vps->getDefaultTargetOutputLayerIdc() == 1 )
     1353  {
     1354    // 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
     1355    // 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.
     1356
     1357    // Include the highest layer as output layer for each layer set
     1358    for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++)
     1359    {
     1360      for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )
     1361      {
     1362#if !Q0078_ADD_LAYER_SETS  // the following condition is incorrect and is not needed anyway
     1363        if( vps->getLayerIdIncludedFlag(lsIdx, layer) )     
     1364#endif
     1365        {       
     1366          vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
     1367        }
     1368      }
     1369    }
     1370  }
     1371  else
     1372  {
     1373    // cases when default_output_layer_idc is not equal to 1
     1374    assert(!"default_output_layer_idc not equal to 1 is not yet supported");
     1375  }
     1376
     1377  // Initialize dpb_size_table() for all ouput layer sets in the VPS extension
     1378  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
     1379  {
     1380#if CHANGE_NUMSUBDPB_IDX
     1381    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
     1382#endif
     1383    Int layerSetId = vps->getOutputLayerSetIdx(i);
     1384
     1385    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1386    {
     1387
     1388      Int maxNumReorderPics = -1;
     1389#if CHANGE_NUMSUBDPB_IDX
     1390#if RESOLUTION_BASED_DPB
     1391      for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++)
     1392#else
     1393      for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
     1394#endif
     1395#else
     1396      for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1397#endif
     1398      {
     1399        Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set
     1400#if RESOLUTION_BASED_DPB
     1401        vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
     1402        // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated
     1403        // at the encoder, modify below
     1404        Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );
     1405        oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1;
     1406        vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue );
     1407#else
     1408        vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
     1409#endif
     1410        maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));
     1411      }
     1412#if RESOLUTION_BASED_DPB
     1413      for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1414      {
     1415        // Decrement m_maxVpsDecPicBufferingMinus1
     1416        Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );
     1417        vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 );
     1418      }
     1419#endif
     1420      vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);
     1421      vps->determineSubDpbInfoFlags();
     1422    }
     1423  }
    14191424#endif
    14201425    vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
     
    15051510  {
    15061511    vps->setVpsVuiBspHrdPresentFlag(true);
     1512#if Q0078_ADD_LAYER_SETS
     1513    vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1);
     1514#else
    15071515    vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2);
     1516#endif
    15081517    vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1);
    15091518    for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
     
    15381547      vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) );
    15391548    }
     1549#if Q0078_ADD_LAYER_SETS
     1550    for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
     1551#else
    15401552    for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++)
     1553#endif
    15411554    {
    15421555      vps->setNumBitstreamPartitions(h, 1);
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComRom.h

    r778 r805  
    159159
    160160#ifndef ENC_DEC_TRACE
    161 # define ENC_DEC_TRACE 1
     161# define ENC_DEC_TRACE 0
    162162#endif
    163163
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp

    r799 r805  
    27112711  setNumIndependentLayers(numIndependentLayers);
    27122712}
     2713
     2714void TComVPS::setLayerIdIncludedFlagsForAddLayerSets()
     2715{
     2716  for (UInt i = 0; i < getNumAddLayerSets(); i++)
     2717  {
     2718    for (UInt j = 1; j < getNumIndependentLayers(); j++)
     2719    {
     2720      Int layerNum = 0;
     2721      Int lsIdx = getVpsNumLayerSetsMinus1() + 1 + i;
     2722      for (Int layerId = 0; layerId < MAX_VPS_LAYER_ID_PLUS1; layerId++)
     2723      {
     2724        setLayerIdIncludedFlag(false, lsIdx, layerId);
     2725      }
     2726      for (Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++)
     2727      {
     2728        for (Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1(i, j); layerCnt++)
     2729        {
     2730          setLayerSetLayerIdList(lsIdx, layerNum, getTreePartitionLayerId(treeIdx, layerCnt));
     2731          setLayerIdIncludedFlag(true, lsIdx, getTreePartitionLayerId(treeIdx, layerCnt));
     2732          layerNum++;
     2733        }
     2734      }
     2735      setNumLayersInIdList(lsIdx, layerNum);
     2736    }
     2737  }
     2738}
     2739
    27132740#endif
    27142741
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h

    r798 r805  
    140140 
    141141  Void  create  (Int numberOfEntries);
    142 #if Q0078_ADD_LAYER_SETS
    143   Void  copy(TComRPSList& a);
    144 #endif
    145142  Void  destroy();
    146143
     
    487484#if SVC_EXTENSION
    488485#if DERIVE_LAYER_ID_LIST_VARIABLES
     486#if Q0078_ADD_LAYER_SETS
     487  Int         m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1];
     488  Int         m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS];
     489#else
    489490  Int         m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    490491  Int         m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
     492#endif
    491493#endif
    492494#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
     
    498500  UInt        m_numLayerSets;
    499501#if Q0078_ADD_LAYER_SETS
    500   Bool        m_layerIdIncludedFlag[2*MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     502  UInt        m_vpsNumLayerSetsMinus1;
     503  Bool        m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1];
    501504#else
    502505  Bool        m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     
    520523#endif
    521524#if BITRATE_PICRATE_SIGNALLING
     525#if Q0078_ADD_LAYER_SETS
     526  UInt       m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS];
     527#else
    522528  UInt       m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1];
     529#endif
    523530#endif
    524531   
     
    536543  // Target output layer signalling related
    537544  UInt       m_numOutputLayerSets;
     545#if Q0078_ADD_LAYER_SETS
     546  UInt       m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
     547  Bool       m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1];
     548#else
    538549  UInt       m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1];
    539550  Bool       m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     551#endif
    540552#endif
    541553#if VPS_EXTN_DIRECT_REF_LAYERS
     
    633645
    634646#if P0300_ALT_OUTPUT_LAYER_FLAG
     647#if Q0078_ADD_LAYER_SETS
     648  Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
     649#else
    635650  Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1];
     651#endif
    636652#else
    637653#if O0153_ALT_OUTPUT_LAYER_FLAG
     
    664680#if Q0078_ADD_LAYER_SETS
    665681  Int        m_numAddLayerSets;
    666   UInt       m_highestLayerIdxPlus1[MAX_VPS_LAYER_SETS_PLUS1][MAX_NUM_LAYER_IDS];
    667   UInt       m_predictedLayerId[MAX_NUM_LAYER_IDS][64];
     682  UInt       m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
     683  UInt       m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
    668684  UInt       m_numPredictedLayers[MAX_NUM_LAYER_IDS];
    669685  Int        m_numIndependentLayers;
     
    684700  Int        m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    685701#if CHANGE_NUMSUBDPB_IDX
     702#if Q0078_ADD_LAYER_SETS
     703  Int        m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
     704#else
    686705  Int        m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1];
     706#endif
    687707#else
    688708  Int        m_numSubDpbs                  [MAX_VPS_OP_LAYER_SETS_PLUS1];
     
    816836#endif
    817837#if Q0078_ADD_LAYER_SETS
     838  void    setLayerIdIncludedFlagsForAddLayerSets();
     839  UInt    getVpsNumLayerSetsMinus1()                                             { return m_vpsNumLayerSetsMinus1; }
     840  Void    setVpsNumLayerSetsMinus1(UInt x)                                       { m_vpsNumLayerSetsMinus1 = x; }
    818841  UInt    getNumAddLayerSets()                                                   { return m_numAddLayerSets; }
    819842  Void    setNumAddLayerSets(UInt x)                                             { m_numAddLayerSets = x; }
    820   UInt    getHighestLayerIdxPlus1(UInt set, UInt idx)                             { return m_highestLayerIdxPlus1[set][idx]; }
    821   Void    setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx)              { m_highestLayerIdxPlus1[set][idx] = layerIdx; }
     843  UInt    getHighestLayerIdxPlus1(UInt set, UInt idx)                            { return m_highestLayerIdxPlus1[set][idx]; }
     844  Void    setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx)             { m_highestLayerIdxPlus1[set][idx] = layerIdx; }
    822845  Void    setPredictedLayerIds();
    823846  UInt    getPredictedLayerId(UInt layerIdx, UInt predIdx)                       { return m_predictedLayerId[layerIdx][predIdx]; }
  • branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h

    r804 r805  
    204204
    205205#define Q0078_ADD_LAYER_SETS             1      ///< JCTVC-Q0078: additional layer sets and layer set config
     206#if Q0078_ADD_LAYER_SETS
     207#define MAX_NUM_ADD_LAYER_SETS           1023
     208#endif
    206209
    207210#define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r802 r805  
    973973  assert( pcVPS->getMaxLayerId()       < MAX_VPS_LAYER_ID_PLUS1 );
    974974  READ_CODE( 6, uiCode, "vps_max_layer_id" );           pcVPS->setMaxLayerId( uiCode );
     975#if Q0078_ADD_LAYER_SETS
     976  READ_UVLC(uiCode, "vps_num_layer_sets_minus1");  pcVPS->setVpsNumLayerSetsMinus1(uiCode);
     977  pcVPS->setNumLayerSets(pcVPS->getVpsNumLayerSetsMinus1() + 1);
     978  for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++)
     979#else
    975980  READ_UVLC(    uiCode, "vps_num_layer_sets_minus1" );  pcVPS->setNumLayerSets( uiCode + 1 );
    976981  for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ )
     982#endif
    977983  {
    978984    // Operation point set
     
    13101316      }
    13111317    }
    1312 
    1313     for (i = 0; i < vps->getNumAddLayerSets(); i++)
    1314     {
    1315       for (j = 1; j < vps->getNumIndependentLayers(); j++)
    1316       {
    1317         Int layerNum = 0;
    1318         Int lsIdx = vps->getNumLayerSets() + i;
    1319         for (Int layerId = 0; layerId < MAX_VPS_LAYER_ID_PLUS1; layerId++)
    1320         {
    1321           vps->setLayerIdIncludedFlag(false, lsIdx, layerId);
    1322         }
    1323         for (Int treeIdx = 1; treeIdx < vps->getNumIndependentLayers(); treeIdx++)
    1324         {
    1325           for (Int layerCnt = 0; layerCnt < vps->getHighestLayerIdxPlus1(i, j); layerCnt++)
    1326           {
    1327             vps->setLayerSetLayerIdList(lsIdx, layerNum, vps->getTreePartitionLayerId(treeIdx, layerCnt));
    1328             vps->setLayerIdIncludedFlag(true, lsIdx, vps->getTreePartitionLayerId(treeIdx, layerCnt));
    1329             layerNum++;
    1330           }
    1331         }
    1332         vps->setNumLayersInIdList(lsIdx, layerNum);
    1333       }
    1334     }
     1318    vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets());
     1319    vps->setLayerIdIncludedFlagsForAddLayerSets();
    13351320  }
    13361321#endif
     
    13941379      vps->setOutputLayerSetIdx( i, i );
    13951380    }
     1381#if Q0078_ADD_LAYER_SETS
     1382    if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1383#else
    13961384    if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1385#endif
    13971386    {
    13981387      Int lsIdx = vps->getOutputLayerSetIdx(i);
     
    21352124  Bool parseFlag = vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag();
    21362125
     2126#if Q0078_ADD_LAYER_SETS
     2127  for( i = 0; i <= vps->getVpsNumLayerSetsMinus1(); i++ )
     2128#else
    21372129  for( i = 0; i < vps->getNumLayerSets(); i++ )
     2130#endif
    21382131  {
    21392132#if BITRATE_PICRATE_SIGNALLING
     
    23672360        parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
    23682361      }
     2362#if Q0078_ADD_LAYER_SETS
     2363      for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
     2364#else
    23692365      for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )
     2366#endif
    23702367      {
    23712368        READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode);
     
    27762773          if(rpcSlice->getVPS()->getVpsExtensionFlag()==1)
    27772774          {
     2775#if Q0078_ADD_LAYER_SETS
     2776              for (Int ii = 1; ii < (rpcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++)  // prevent assert error when num_add_layer_sets > 0
     2777#else
    27782778              for (Int ii=1; ii< rpcSlice->getVPS()->getNumOutputLayerSets(); ii++ )
     2779#endif
    27792780              {
    27802781                  Int layerSetIdxForOutputLayerSet = rpcSlice->getVPS()->getOutputLayerSetIdx( ii );
     
    27892790                  if(chkAssert)
    27902791                  {
     2792                      // There may be something wrong here (layer id assumed to be layer idx?)
    27912793                      assert(rps->getNumberOfNegativePictures() <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)));
    27922794                      assert(rps->getNumberOfPositivePictures() <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)) - rps->getNumberOfNegativePictures());
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r802 r805  
    745745#endif
    746746  WRITE_CODE( pcVPS->getMaxLayerId(), 6,                       "vps_max_layer_id" );
     747#if Q0078_ADD_LAYER_SETS
     748  WRITE_UVLC(pcVPS->getVpsNumLayerSetsMinus1(),                "vps_num_layer_sets_minus1");
     749  for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++)
     750#else
    747751  WRITE_UVLC( pcVPS->getNumLayerSets() - 1,                 "vps_num_layer_sets_minus1" );
    748   for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ )
     752  for (UInt opsIdx = 1; opsIdx <= (pcVPS->getNumLayerSets() - 1); opsIdx++)
     753#endif
    749754  {
    750755    // Operation point set
     
    10651070#if P0295_DEFAULT_OUT_LAYER_IDC
    10661071    }
     1072#if Q0078_ADD_LAYER_SETS
     1073    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
     1074#else
    10671075    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
     1076#endif
    10681077    {
    10691078#endif
     
    14691478  if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() )
    14701479  {
     1480#if Q0078_ADD_LAYER_SETS
     1481    for( i = 0; i <= vps->getVpsNumLayerSetsMinus1(); i++ )
     1482#else
    14711483    for( i = 0; i < vps->getNumLayerSets(); i++ )
     1484#endif
    14721485    {
    14731486#if BITRATE_PICRATE_SIGNALLING
     
    16411654        codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
    16421655      }
     1656#if Q0078_ADD_LAYER_SETS
     1657      for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ )
     1658#else
    16431659      for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )
     1660#endif
    16441661      {
    16451662        WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]");
Note: See TracChangeset for help on using the changeset viewer.