Changeset 967 in SHVCSoftware


Ignore:
Timestamp:
6 Jan 2015, 19:22:06 (10 years ago)
Author:
seregin
Message:

port fix for the ticket #44 (rev 966)

Location:
branches/SHM-upgrade/source/Lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h

    r965 r967  
    293293#define R0157_RESTRICT_PPSID_FOR_CGS_LUT 1      ///< JCTVC-R0157: when pps_pic_parameter_set_id greater than or equal to 8, colour_mapping_enabled_flag shall be equal to 0
    294294
     295#define VPS_FIX_TO_MATCH_SPEC            1
     296
    295297/// scalability types
    296298enum ScalabilityType
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r965 r967  
    31193119  for(i = 1; i < numOutputLayerSets; i++)
    31203120  {
     3121#if VPS_FIX_TO_MATCH_SPEC
     3122    if( vps->getNumLayerSets() > 2 && i >= vps->getNumLayerSets() )
     3123#else
    31213124    if( i > (vps->getNumLayerSets() - 1) )
     3125#endif
    31223126    {
    31233127      Int numBits = 1;
     
    31343138    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
    31353139#if Q0078_ADD_LAYER_SETS
    3136     if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 )
    3137 #else
    3138     if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     3140#if VPS_FIX_TO_MATCH_SPEC
     3141    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2 )
     3142#else
     3143    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     3144#endif
     3145#else
     3146#if VPS_FIX_TO_MATCH_SPEC
     3147    if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 )
     3148#else
     3149    if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     3150#endif
    31393151#endif
    31403152    {
     
    31793191    for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++)
    31803192    {
     3193#if VPS_FIX_TO_MATCH_SPEC
     3194      if( vps->getNecessaryLayerFlag(i, j) && (vps->getNumProfileTierLevel()-1) > 0 )
     3195#else
    31813196      if( vps->getNecessaryLayerFlag(i, j) )
    3182       {
    3183         READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" );
     3197#endif
     3198      {
     3199        READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" );
    31843200        vps->setProfileLevelTierIdx(i, j, uiCode );
    31853201
     
    33713387  if( vps->getRepFormatIdxPresentFlag() )
    33723388  {
    3373     for(i = 1; i < vps->getMaxLayers(); i++)
     3389#if VPS_FIX_TO_MATCH_SPEC
     3390      for( i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++ )
     3391#else
     3392      for (i = 1; i < vps->getMaxLayers(); i++)
     3393#endif
    33743394    {
    33753395      Int numBits = 1;
     
    38603880#if DPB_INTERNAL_BL_SIG
    38613881            uiCode=0;
    3862         if(vps->getBaseLayerInternalFlag()  || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k)   !=  0 ) )
     3882
     3883#if VPS_FIX_TO_MATCH_SPEC
     3884        if( vps->getNecessaryLayerFlag(i, k) && ( vps->getBaseLayerInternalFlag() || vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) ) )
     3885#else
     3886        if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) !=  0 ) )
     3887#endif
    38633888#endif
    38643889          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     
    41314156  if (!uiCode)
    41324157  {
    4133     for(i = 0; i < vps->getMaxLayers(); i++)
     4158#if VPS_FIX_TO_MATCH_SPEC
     4159      for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
     4160#else
     4161      for (i = 0; i < vps->getMaxLayers(); i++)
     4162#endif
    41344163    {
    41354164      READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1));
     
    41454174#endif
    41464175
    4147     for(i = 1; i < vps->getMaxLayers(); i++)
     4176#if VPS_FIX_TO_MATCH_SPEC
     4177      for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ )
     4178#else
     4179      for (i = 1; i < vps->getMaxLayers(); i++)
     4180#endif
    41484181    {
    41494182      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
     
    41664199  if (!uiCode)
    41674200  {
    4168     for(i = 0; i < vps->getMaxLayers(); i++)
     4201#if VPS_FIX_TO_MATCH_SPEC
     4202      for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++)
     4203#else
     4204      for (i = 0; i < vps->getMaxLayers(); i++)
     4205#endif
    41694206    {
    41704207      READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1));
     
    41984235      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
    41994236      {
    4200         READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
    4201         if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
    4202         {
    4203           READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 );
    4204           if(vps->getCtuBasedOffsetEnabledFlag(i,j))
     4237#if VPS_FIX_TO_MATCH_SPEC
     4238        if( vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j) )
     4239        {
     4240#endif
     4241          READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
     4242          if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
    42054243          {
    4206             READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode );
     4244            READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 );
     4245            if(vps->getCtuBasedOffsetEnabledFlag(i,j))
     4246            {
     4247              READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode );
     4248            }
    42074249          }
    4208         }
     4250#if VPS_FIX_TO_MATCH_SPEC
     4251        }
     4252#endif
    42094253      }
    42104254    }
     
    46424686    }
    46434687  }
    4644   for (Int h = 1; h < vps->getNumOutputLayerSets(); h++)
    4645   {
    4646     Int lsIdx = vps->getOutputLayerSetIdx( h );
    4647     READ_UVLC( uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
    4648     for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ )
    4649     {
    4650       READ_UVLC( uiCode, "num_partitions_in_scheme_minus1[h][j]" ); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode);
    4651       for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ )
    4652       {
    4653         for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ )
    4654         {
    4655           READ_FLAG( uiCode, "layer_included_in_partition_flag[h][j][k][r]" ); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false);
    4656         }
    4657       }
    4658     }
    4659     for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ )
    4660     {
    4661       for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ )
    4662       {
    4663         READ_UVLC( uiCode, "num_bsp_schedules_minus1[h][i][t]");              vps->setNumBspSchedulesMinus1(h, i, t, uiCode);
    4664         for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
    4665         {
    4666           for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
     4688#if VPS_FIX_TO_MATCH_SPEC
     4689  if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0 )
     4690  {
     4691#endif
     4692    for (Int h = 1; h < vps->getNumOutputLayerSets(); h++)
     4693    {
     4694      Int lsIdx = vps->getOutputLayerSetIdx(h);
     4695      READ_UVLC(uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
     4696#if VPS_FIX_TO_MATCH_SPEC
     4697      for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++)
     4698#else
     4699      for (Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++)
     4700#endif
     4701      {
     4702        READ_UVLC(uiCode, "num_partitions_in_scheme_minus1[h][j]"); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode);
     4703        for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++)
     4704        {
     4705          for (Int r = 0; r < vps->getNumLayersInIdList(lsIdx); r++)
    46674706          {
    4668             READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
    4669             READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
     4707            READ_FLAG(uiCode, "layer_included_in_partition_flag[h][j][k][r]"); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false);
    46704708          }
    46714709        }
    46724710      }
    4673     }
    4674 
    4675     // To be done: Check each layer included in not more than one BSP in every partitioning scheme,
    4676     // and other related checks associated with layers in bitstream partitions.
    4677 
    4678   }
     4711      for (Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++)
     4712      {
     4713        for (Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++)
     4714        {
     4715          READ_UVLC(uiCode, "num_bsp_schedules_minus1[h][i][t]");              vps->setNumBspSchedulesMinus1(h, i, t, uiCode);
     4716          for (Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++)
     4717          {
     4718#if VPS_FIX_TO_MATCH_SPEC
     4719            for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
     4720#else
     4721            for (Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++)
     4722#endif
     4723            {
     4724#if VPS_FIX_TO_MATCH_SPEC
     4725              if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1 )
     4726              {
     4727#endif
     4728#if VPS_FIX_TO_MATCH_SPEC
     4729                Int numBits = 1;
     4730                while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams()))
     4731                {
     4732                  numBits++;
     4733                }
     4734                READ_CODE(numBits, uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
     4735#else
     4736                READ_UVLC(uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
     4737#endif
     4738#if VPS_FIX_TO_MATCH_SPEC
     4739              }
     4740#endif
     4741              READ_UVLC(uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
     4742            }
     4743          }
     4744        }
     4745      }
     4746
     4747      // To be done: Check each layer included in not more than one BSP in every partitioning scheme,
     4748      // and other related checks associated with layers in bitstream partitions.
     4749
     4750    }
     4751#if VPS_FIX_TO_MATCH_SPEC
     4752  }
     4753#endif
    46794754}
    46804755#endif
Note: See TracChangeset for help on using the changeset viewer.