Ignore:
Timestamp:
5 Apr 2013, 17:33:21 (12 years ago)
Author:
vidyo
Message:

Adding missing syntax elements for VPS extension; by default this code is disabled. Turn on VPS_EXTN_MASK_AND_DIM_INFO to enable this code.

File:
1 edited

Legend:

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

    r114 r115  
    845845  UInt uiCode;
    846846  // ... More syntax elements to be parsed here
     847#if VPS_EXTN_MASK_AND_DIM_INFO
     848  UInt numScalabilityTypes = 0, i = 0, j = 0;
     849
     850  READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
     851  READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
     852
     853  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     854  {
     855    READ_FLAG( uiCode, "scalability_mask[i]" ); vps->setScalabilityMask(i, uiCode ? true : false);
     856    numScalabilityTypes += uiCode;
     857    if( i != 1 )
     858    {
     859      // Multiview and reserved masks are not used in this version of software
     860      assert( uiCode == 0 );
     861    }
     862  }
     863  vps->setNumScalabilityTypes(numScalabilityTypes);
     864
     865  for(j = 0; j < numScalabilityTypes; j++)
     866  {
     867    READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1);
     868  }
     869  if(vps->getSplittingFlag())
     870  {
     871    UInt numBits = 0;
     872    for(j = 0; j < numScalabilityTypes; j++)
     873    {
     874      numBits += vps->getDimensionIdLen(j);
     875    }
     876    assert( numBits <= 6 );
     877  }
     878
     879  READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false);
     880  vps->setLayerIdInNuh(0, 0);
     881  vps->setLayerIdInVps(0, 0);
     882  for(i = 1; i <= vps->getMaxLayerId(); i++) // TODO: we should use vps->getMaxLayers(), but currently it is always set to 1
     883  {
     884    if( vps->getNuhLayerIdPresentFlag() )
     885    {
     886      READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); vps->setLayerIdInNuh(i, uiCode);
     887      assert( uiCode > vps->getLayerIdInNuh(i-1) );
     888    }
     889    else
     890    {
     891      vps->setLayerIdInNuh(i, i);
     892    }
     893    vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
     894
     895    for(j = 0; j < numScalabilityTypes; j++)
     896    {
     897      READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);
     898      assert( uiCode <= vps->getMaxLayerId() );
     899    }
     900  }
     901#endif
     902
    847903#if VPS_EXTN_PROFILE_INFO
    848904  // Profile-tier-level signalling
Note: See TracChangeset for help on using the changeset viewer.