Changeset 414 in SHVCSoftware for branches/SHM-3.1-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
8 Oct 2013, 11:25:37 (12 years ago)
Author:
sony
Message:

IL_SL_SIGNALLING_N0371

Location:
branches/SHM-3.1-dev/source/Lib/TLibDecoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r411 r414  
    291291  }
    292292  READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
     293
     294#if IL_SL_SIGNALLING_N0371
     295  pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 
     296#endif
     297
    293298  if(pcPPS->getScalingListPresentFlag ())
    294299  {
     300#if IL_SL_SIGNALLING_N0371
     301    pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() );
     302
     303    if( pcPPS->getLayerId() > 0 )
     304    {
     305      READ_FLAG( uiCode, "pps_pred_scaling_list_flag" );           pcPPS->setPredScalingListFlag( uiCode ? true : false );
     306      pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() );
     307     
     308      if( pcPPS->getPredScalingListFlag() )
     309      {
     310        READ_UVLC ( uiCode, "scaling_list_pps_ref_layer_id" );   pcPPS->setScalingListRefLayerId( uiCode );
     311
     312        // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     313        assert( pcPPS->getScalingListRefLayerId() >= 0 && pcPPS->getScalingListRefLayerId() <= 62 );
     314
     315        // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of pps_scaling_list_ref_layer_id shall be greater than 0
     316        if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() )
     317        {
     318          assert( pcPPS->getScalingListRefLayerId() > 0 );
     319        }
     320
     321        // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
     322        // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id
     323        assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );
     324
     325        // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
     326        // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
     327        assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true );
     328
     329        pcPPS->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() );
     330        parseScalingList( pcPPS->getScalingList() );
     331      }
     332      else
     333      {
     334        parseScalingList( pcPPS->getScalingList() );
     335      }
     336    }
     337    else
     338    {
     339      parseScalingList( pcPPS->getScalingList() );
     340    }
     341#else
    295342    parseScalingList( pcPPS->getScalingList() );
     343#endif
    296344  }
    297345
     
    522570  }
    523571#endif
     572#if IL_SL_SIGNALLING_N0371
     573  pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) );
     574  pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );
     575#endif
    524576  if ( pcSPS->getMaxTLayers() == 1 )
    525577  {
     
    647699  Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() );
    648700  pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth );
    649 
    650701  READ_FLAG( uiCode, "scaling_list_enabled_flag" );                 pcSPS->setScalingListFlag ( uiCode );
     702
    651703  if(pcSPS->getScalingListFlag())
    652704  {
     
    654706    if(pcSPS->getScalingListPresentFlag ())
    655707    {
     708
     709#if IL_SL_SIGNALLING_N0371
     710      pcSPS->getScalingList()->setLayerId( pcSPS->getLayerId() );
     711
     712      if( pcSPS->getLayerId() > 0 )
     713      {
     714        READ_FLAG( uiCode, "sps_pred_scaling_list_flag" );  pcSPS->setPredScalingListFlag ( uiCode );
     715        pcSPS->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() );
     716
     717        if( pcSPS->getPredScalingListFlag() )
     718        {
     719          READ_UVLC( uiCode, "scaling_list_sps_ref_layer_id" );    pcSPS->setScalingListRefLayerId( uiCode );
     720
     721          // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     722          assert( pcSPS->getScalingListRefLayerId() >= 0 && pcSPS->getScalingListRefLayerId() <= 62 );
     723
     724          // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
     725          if( pcSPS->getVPS()->getAvcBaseLayerFlag() )
     726          {
     727            assert( pcSPS->getScalingListRefLayerId() > 0 );
     728          }
     729
     730          // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
     731          // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id
     732          assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );
     733
     734          // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
     735          // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
     736          assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true );
     737
     738          pcSPS->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() );
     739          parseScalingList( pcSPS->getScalingList() );
     740        }
     741        else
     742        {
     743          parseScalingList( pcSPS->getScalingList() );
     744        }
     745      }
     746      else
     747      {
     748        parseScalingList( pcSPS->getScalingList() );
     749      }
     750#else
    656751      parseScalingList( pcSPS->getScalingList() );
     752#endif
     753
    657754    }
    658755  }
     
    12431340    }
    12441341  }
    1245 #endif
     1342
     1343#endif
     1344
     1345#if IL_SL_SIGNALLING_N0371
     1346  for(i = 1; i < vps->getMaxLayers(); i++)
     1347    {
     1348      for(j = 0; j < i; j++)
     1349        {     
     1350          vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) );
     1351        }
     1352    }
     1353#endif
     1354
    12461355#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    12471356  READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false);
     
    24472556  UInt  code, sizeId, listId;
    24482557  Bool scalingListPredModeFlag;
     2558
    24492559  //for each size
    24502560  for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     
    24522562    for(listId = 0; listId <  g_scalingListNum[sizeId]; listId++)
    24532563    {
     2564#if IL_SL_SIGNALLING_N0371
     2565      if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )
     2566      {
     2567        READ_FLAG( code, "scaling_list_pred_mode_flag");
     2568        scalingListPredModeFlag = (code) ? true : false;
     2569        if(!scalingListPredModeFlag) //Copy Mode
     2570        {
     2571          READ_UVLC( code, "scaling_list_pred_matrix_id_delta");
     2572          scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));
     2573          if( sizeId > SCALING_LIST_8x8 )
     2574          {
     2575            scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))));
     2576          }
     2577          scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));
     2578
     2579        }
     2580        else //DPCM Mode
     2581        {
     2582          xDecodeScalingList(scalingList, sizeId, listId);
     2583        }
     2584      }
     2585      else
     2586      {
     2587        READ_FLAG( code, "scaling_list_pred_mode_flag");
     2588        scalingListPredModeFlag = (code) ? true : false;
     2589        if(!scalingListPredModeFlag) //Copy Mode
     2590        {
     2591          READ_UVLC( code, "scaling_list_pred_matrix_id_delta");
     2592          scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));
     2593          if( sizeId > SCALING_LIST_8x8 )
     2594          {
     2595            scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))));
     2596          }
     2597          scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));
     2598
     2599        }
     2600        else //DPCM Mode
     2601        {
     2602          xDecodeScalingList(scalingList, sizeId, listId);
     2603        }
     2604      }
     2605#else
    24542606      READ_FLAG( code, "scaling_list_pred_mode_flag");
    24552607      scalingListPredModeFlag = (code) ? true : false;
     
    24692621        xDecodeScalingList(scalingList, sizeId, listId);
    24702622      }
     2623#endif
    24712624    }
    24722625  }
     
    24902643  if( sizeId > SCALING_LIST_8x8 )
    24912644  {
     2645#if IL_SL_SIGNALLING_N0371
     2646    if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )
     2647    {
     2648      ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId);
     2649      scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]);
     2650    }
     2651    else
     2652    {
     2653      READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8");
     2654      scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8);
     2655      nextCoef = scalingList->getScalingListDC(sizeId,listId);
     2656      ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId);
     2657    }
     2658#else
    24922659    READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8");
    24932660    scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8);
    24942661    nextCoef = scalingList->getScalingListDC(sizeId,listId);
     2662#endif
    24952663  }
    24962664
    24972665  for(i = 0; i < coefNum; i++)
    24982666  {
     2667#if IL_SL_SIGNALLING_N0371
     2668    if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )
     2669    {
     2670      ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]];
     2671      dst[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i];
     2672    }
     2673    else
     2674    {
     2675      READ_SVLC( data, "scaling_list_delta_coef");
     2676      nextCoef = (nextCoef + data + 256 ) % 256;
     2677      dst[scan[i]] = nextCoef;
     2678      ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]];
     2679    }
     2680#else
    24992681    READ_SVLC( data, "scaling_list_delta_coef");
    25002682    nextCoef = (nextCoef + data + 256 ) % 256;
    25012683    dst[scan[i]] = nextCoef;
     2684#endif
    25022685  }
    25032686}
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r389 r414  
    7575  Void  parseVPSExtension   ( TComVPS* pcVPS );
    7676#endif
     77
    7778#if VPS_VUI
    7879  Void  parseVPSVUI   ( TComVPS* pcVPS );
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r412 r414  
    12321232  if(pcSlice->getSPS()->getScalingListFlag())
    12331233  {
     1234#if IL_SL_SIGNALLING_N0371
     1235    pcSlice->getSPS()->getScalingList()->setLayerId( m_layerId );
     1236#endif
     1237
    12341238    pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList()  );
     1239
    12351240    if(pcSlice->getPPS()->getScalingListPresentFlag())
    12361241    {
     1242#if IL_SL_SIGNALLING_N0371
     1243      pcSlice->getPPS()->getScalingList()->setLayerId( m_layerId );
     1244#endif
     1245
    12371246      pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList()  );
    12381247    }
     
    12401249    if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag())
    12411250    {
     1251#if IL_SL_SIGNALLING_N0371
     1252      pcSlice->setDefaultScalingList( m_layerId );
     1253#else
    12421254      pcSlice->setDefaultScalingList();
     1255#endif
    12431256    }
    12441257    m_cTrQuant.setScalingListDec(pcSlice->getScalingList());
     
    12471260  else
    12481261  {
     1262#if IL_SL_SIGNALLING_N0371
     1263    m_cTrQuant.setFlatScalingList( m_layerId );
     1264#else
    12491265    m_cTrQuant.setFlatScalingList();
     1266#endif
    12501267    m_cTrQuant.setUseScalingList(false);
    12511268  }
     
    12781295  sps->setLayerId(m_layerId);
    12791296#endif
     1297
    12801298#if SPS_SUB_LAYER_INFO
    12811299  m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder[0] );
     
    13011319{
    13021320  TComPPS* pps = new TComPPS();
     1321
     1322#if IL_SL_SIGNALLING_N0371
     1323  pps->setLayerId(m_layerId);
     1324#endif
     1325
    13031326  m_cEntropyDecoder.decodePPS( pps );
    13041327#if SVC_EXTENSION
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h

    r411 r414  
    7979
    8080  TComSlice*              m_apcSlicePilot;
    81  
     81
    8282  SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices
    8383
Note: See TracChangeset for help on using the changeset viewer.