Opened 9 years ago

Closed 9 years ago

#77 closed defect (fixed)

Broken logic when sps_sub_layer_ordering_info_present_flag==0

Reported by: johnnyVidyo Owned by: Vadim
Priority: major Milestone: SHM-9.0
Component: SHM software Version:
Keywords: Cc: Vadim, jct-vc@…

Description

There is an error in decoding the SPS. When sps_sub_layer_ordering_info_present_flag is 0, the values of sps_max_dec_pic_buffering_minus1[] are handled incorrectly.

Existing problematic code in parseSPS():

  UInt subLayerOrderingInfoPresentFlag;
  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");

  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
  {
    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
    pcSPS->setNumReorderPics(uiCode, i);
    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    pcSPS->setMaxLatencyIncrease( uiCode, i );

    if (!subLayerOrderingInfoPresentFlag)
    {
      for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
      {
#if SVC_EXTENSION
        // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1 - 1, inclusive,
        // due to sps_sub_layer_ordering_info_present_flag being equal to 0, it is inferred to be equal to sps_max_dec_pic_buffering_minus1[ sps_max_sub_layers_minus1 ].
        pcSPS->setMaxDecPicBuffering( pcSPS->getMaxDecPicBuffering(pcSPS->getMaxTLayers()-1), i );
#else
        pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
#endif
        pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
        pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
      }
      break;
    }

Recommended fix to better reflect wording of the spec:

  UInt subLayerOrderingInfoPresentFlag;
  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");

  for(UInt i = subLayerOrderingInfoPresentFlag ? 0 : pcSPS->getMaxTLayers()-1; i <= pcSPS->getMaxTLayers()-1; i++)
  {
    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
    pcSPS->setNumReorderPics(uiCode, i);
    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    pcSPS->setMaxLatencyIncrease( uiCode, i );

    if (!subLayerOrderingInfoPresentFlag)
    {
      for(UInt j = 0; j < i; j++)
      {
#if SVC_EXTENSION
        // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1 - 1, inclusive,
        // due to sps_sub_layer_ordering_info_present_flag being equal to 0, it is inferred to be equal to sps_max_dec_pic_buffering_minus1[ sps_max_sub_layers_minus1 ].
        pcSPS->setMaxDecPicBuffering( pcSPS->getMaxDecPicBuffering(i), j );
#else
        pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
#endif
        pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(i), j);
        pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(i), j);
      }
      break;
    }

Change history (3)

comment:1 Changed 9 years ago by DefaultCC Plugin

  • Cc Vadim jct-vc@… added

comment:2 Changed 9 years ago by Vadim

I removed incorrect changes under SVC_EXTENSION macro in the quoted code.

Should this ticket (better implementation) be raised for HM core?

comment:3 Changed 9 years ago by Vadim

  • Resolution set to fixed
  • Status changed from new to closed

If better implementation is needed, please open the ticket for HM core.

Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • Gerhard Tech(Always)
  • jct-vc@…(Subscriber)
  • johnnyVidyo(Reporter)
  • Karsten Suehring(Always)
  • Vadim Seregin(Owner, Subscriber, Participant)