Changeset 805 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibDecoder


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

Fix layer set array sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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());
Note: See TracChangeset for help on using the changeset viewer.