Changeset 966 in SHVCSoftware


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

fix for the ticket #44, patch was provided by Jay Padia <jpadia@…>

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

Legend:

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

    r964 r966  
    292292#endif
    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
     294
     295#define VPS_FIX_TO_MATCH_SPEC            1
    294296
    295297/// scalability types
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r964 r966  
    17261726  for(i = 1; i < numOutputLayerSets; i++)
    17271727  {
     1728#if VPS_FIX_TO_MATCH_SPEC
     1729    if( vps->getNumLayerSets() > 2 && i >= vps->getNumLayerSets() )
     1730#else
    17281731    if( i > (vps->getNumLayerSets() - 1) )
     1732#endif
    17291733    {
    17301734      Int numBits = 1;
     
    17411745    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
    17421746#if Q0078_ADD_LAYER_SETS
    1743     if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 )
    1744 #else
    1745     if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1747#if VPS_FIX_TO_MATCH_SPEC
     1748    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2 )
     1749#else
     1750    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1751#endif
     1752#else
     1753#if VPS_FIX_TO_MATCH_SPEC
     1754    if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 )
     1755#else
     1756    if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1757#endif
    17461758#endif
    17471759    {
     
    17861798    for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++)
    17871799    {
     1800#if VPS_FIX_TO_MATCH_SPEC
     1801      if( vps->getNecessaryLayerFlag(i, j) && (vps->getNumProfileTierLevel()-1) > 0 )
     1802#else
    17881803      if( vps->getNecessaryLayerFlag(i, j) )
     1804#endif
    17891805      {
    17901806        READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" );
     
    19771993  if( vps->getRepFormatIdxPresentFlag() )
    19781994  {
    1979     for(i = 1; i < vps->getMaxLayers(); i++)
     1995#if VPS_FIX_TO_MATCH_SPEC
     1996      for( i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++ )
     1997#else
     1998      for (i = 1; i < vps->getMaxLayers(); i++)
     1999#endif
    19802000    {
    19812001      Int numBits = 1;
     
    24662486#if DPB_INTERNAL_BL_SIG
    24672487            uiCode=0;
    2468         if(vps->getBaseLayerInternalFlag()  || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k)   !=  0 ) )
     2488
     2489#if VPS_FIX_TO_MATCH_SPEC
     2490        if( vps->getNecessaryLayerFlag(i, k) && ( vps->getBaseLayerInternalFlag() || vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) ) )
     2491#else
     2492        if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) !=  0 ) )
     2493#endif
    24692494#endif
    24702495          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     
    27372762  if (!uiCode)
    27382763  {
    2739     for(i = 0; i < vps->getMaxLayers(); i++)
     2764#if VPS_FIX_TO_MATCH_SPEC
     2765      for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
     2766#else
     2767      for (i = 0; i < vps->getMaxLayers(); i++)
     2768#endif
    27402769    {
    27412770      READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1));
     
    27512780#endif
    27522781
    2753     for(i = 1; i < vps->getMaxLayers(); i++)
     2782#if VPS_FIX_TO_MATCH_SPEC
     2783      for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ )
     2784#else
     2785      for (i = 1; i < vps->getMaxLayers(); i++)
     2786#endif
    27542787    {
    27552788      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
     
    27722805  if (!uiCode)
    27732806  {
    2774     for(i = 0; i < vps->getMaxLayers(); i++)
     2807#if VPS_FIX_TO_MATCH_SPEC
     2808      for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++)
     2809#else
     2810      for (i = 0; i < vps->getMaxLayers(); i++)
     2811#endif
    27752812    {
    27762813      READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1));
     
    28042841      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
    28052842      {
    2806         READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
    2807         if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
    2808         {
    2809           READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 );
    2810           if(vps->getCtuBasedOffsetEnabledFlag(i,j))
     2843#if VPS_FIX_TO_MATCH_SPEC
     2844        if( vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j) )
     2845        {
     2846#endif
     2847          READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
     2848          if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
    28112849          {
    2812             READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode );
     2850            READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 );
     2851            if(vps->getCtuBasedOffsetEnabledFlag(i,j))
     2852            {
     2853              READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode );
     2854            }
    28132855          }
    2814         }
     2856#if VPS_FIX_TO_MATCH_SPEC
     2857        }
     2858#endif
    28152859      }
    28162860    }
     
    48124856    }
    48134857  }
    4814   for (Int h = 1; h < vps->getNumOutputLayerSets(); h++)
    4815   {
    4816     Int lsIdx = vps->getOutputLayerSetIdx( h );
    4817     READ_UVLC( uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
    4818     for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ )
    4819     {
    4820       READ_UVLC( uiCode, "num_partitions_in_scheme_minus1[h][j]" ); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode);
    4821       for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ )
    4822       {
    4823         for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ )
    4824         {
    4825           READ_FLAG( uiCode, "layer_included_in_partition_flag[h][j][k][r]" ); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false);
    4826         }
    4827       }
    4828     }
    4829     for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ )
    4830     {
    4831       for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ )
    4832       {
    4833         READ_UVLC( uiCode, "num_bsp_schedules_minus1[h][i][t]");              vps->setNumBspSchedulesMinus1(h, i, t, uiCode);
    4834         for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
    4835         {
    4836           for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
     4858#if VPS_FIX_TO_MATCH_SPEC
     4859  if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0 )
     4860  {
     4861#endif
     4862    for (Int h = 1; h < vps->getNumOutputLayerSets(); h++)
     4863    {
     4864      Int lsIdx = vps->getOutputLayerSetIdx(h);
     4865      READ_UVLC(uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
     4866#if VPS_FIX_TO_MATCH_SPEC
     4867      for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++)
     4868#else
     4869      for (Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++)
     4870#endif
     4871      {
     4872        READ_UVLC(uiCode, "num_partitions_in_scheme_minus1[h][j]"); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode);
     4873        for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++)
     4874        {
     4875          for (Int r = 0; r < vps->getNumLayersInIdList(lsIdx); r++)
    48374876          {
    4838             READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
    4839             READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
     4877            READ_FLAG(uiCode, "layer_included_in_partition_flag[h][j][k][r]"); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false);
    48404878          }
    48414879        }
    48424880      }
    4843     }
    4844 
    4845     // To be done: Check each layer included in not more than one BSP in every partitioning scheme,
    4846     // and other related checks associated with layers in bitstream partitions.
    4847 
    4848   }
     4881      for (Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++)
     4882      {
     4883        for (Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++)
     4884        {
     4885          READ_UVLC(uiCode, "num_bsp_schedules_minus1[h][i][t]");              vps->setNumBspSchedulesMinus1(h, i, t, uiCode);
     4886          for (Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++)
     4887          {
     4888#if VPS_FIX_TO_MATCH_SPEC
     4889            for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
     4890#else
     4891            for (Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++)
     4892#endif
     4893            {
     4894#if VPS_FIX_TO_MATCH_SPEC
     4895              if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1 )
     4896              {
     4897#endif
     4898#if VPS_FIX_TO_MATCH_SPEC
     4899                Int numBits = 1;
     4900                while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams()))
     4901                {
     4902                  numBits++;
     4903                }
     4904                READ_CODE(numBits, uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
     4905#else
     4906                READ_UVLC(uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
     4907#endif
     4908#if VPS_FIX_TO_MATCH_SPEC
     4909              }
     4910#endif
     4911              READ_UVLC(uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
     4912            }
     4913          }
     4914        }
     4915      }
     4916
     4917      // To be done: Check each layer included in not more than one BSP in every partitioning scheme,
     4918      // and other related checks associated with layers in bitstream partitions.
     4919
     4920    }
     4921#if VPS_FIX_TO_MATCH_SPEC
     4922  }
     4923#endif
    48494924}
    48504925#endif
Note: See TracChangeset for help on using the changeset viewer.