Changeset 981 in SHVCSoftware for branches/SHM-upgrade/source/Lib/TLibEncoder


Ignore:
Timestamp:
13 Jan 2015, 23:17:29 (10 years ago)
Author:
seregin
Message:

port fix for the ticket #49 (rev 980)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp

    r972 r981  
    23702370  {
    23712371    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
     2372#if VPS_FIX_TO_MATCH_SPEC
     2373    if( vps->getNumLayerSets() > 2 && i >= vps->getNumLayerSets() )
     2374#else
    23722375    if( i > (vps->getNumLayerSets() - 1) )
     2376#endif
    23732377    {
    23742378      Int numBits = 1;
     
    23992403    for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++)
    24002404    {
     2405#if VPS_FIX_TO_MATCH_SPEC
     2406      if( vps->getNecessaryLayerFlag(i, j) && (vps->getNumProfileTierLevel() - 1) > 0 )
     2407#else
    24012408      if( vps->getNecessaryLayerFlag(i, j) )
     2409#endif
    24022410      {
    24032411        WRITE_CODE( vps->getProfileLevelTierIdx(i, j), numBitsForPtlIdx, "profile_level_tier_idx[i]" );
     
    24682476  if( vps->getRepFormatIdxPresentFlag() )
    24692477  {
     2478#if VPS_FIX_TO_MATCH_SPEC
     2479    for( i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++ )
     2480#else
    24702481    for(i = 1; i < vps->getMaxLayers(); i++)
     2482#endif
    24712483    {
    24722484      Int numBits = 1;
     
    25602572  else
    25612573  {
     2574#if VPS_FIX_TO_MATCH_SPEC
     2575    for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ )
     2576#else
    25622577    for(i = 1; i < vps->getMaxLayers(); i++)
    2563     {
     2578#endif
     2579    {
     2580#if VPS_FIX_TO_MATCH_SPEC
     2581      for( j = vps->getBaseLayerInternalFlag() ? 0 : 1; j < i; j++ )
     2582#else
    25642583      for(j = 0; j < i; j++)
     2584#endif
    25652585      {
    25662586        if (vps->getDirectDependencyFlag(i, j))
     
    27752795        {
    27762796#if DPB_INTERNAL_BL_SIG
     2797#if VPS_FIX_TO_MATCH_SPEC
     2798        if( vps->getNecessaryLayerFlag(i, k) && (vps->getBaseLayerInternalFlag() || (vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) != 0)) )
     2799#else
    27772800        if(vps->getBaseLayerInternalFlag()  || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k)   !=  0 ) )
     2801#endif
    27782802#endif
    27792803          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" );
     
    29052929  if (!vps->getTilesNotInUseFlag())
    29062930  {
     2931#if VPS_FIX_TO_MATCH_SPEC
     2932    for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
     2933#else
    29072934    for(i = 0; i < vps->getMaxLayers(); i++)
     2935#endif
    29082936    {
    29092937      WRITE_FLAG( vps->getTilesInUseFlag(i) ? 1 : 0 , "tiles_in_use_flag[ i ]" );
     
    29152943#endif
    29162944
     2945#if VPS_FIX_TO_MATCH_SPEC
     2946    for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ )
     2947#else
    29172948    for(i = 1; i < vps->getMaxLayers(); i++)
     2949#endif
    29182950    {
    29192951      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
     
    29362968  if (!vps->getWppNotInUseFlag())
    29372969  {
     2970#if VPS_FIX_TO_MATCH_SPEC
     2971    for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
     2972#else
    29382973    for(i = 0; i < vps->getMaxLayers(); i++)
     2974#endif
    29392975    {
    29402976      WRITE_FLAG( vps->getWppInUseFlag(i) ? 1 : 0 , "wpp_in_use_flag[ i ]" );
     
    29673003    {
    29683004      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
    2969       {       
    2970         WRITE_UVLC(vps->getMinSpatialSegmentOffsetPlus1( i, j),    "min_spatial_segment_offset_plus1[i][j]");
    2971        
    2972         if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
    2973         { 
    2974           WRITE_FLAG( vps->getCtuBasedOffsetEnabledFlag( i, j) ? 1 : 0 , "ctu_based_offset_enabled_flag[i][j]" );   
    2975          
    2976           if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 
    2977           {
    2978             WRITE_UVLC(vps->getMinHorizontalCtuOffsetPlus1( i, j),    "min_horizontal_ctu_offset_plus1[i][j]");           
     3005      {
     3006#if VPS_FIX_TO_MATCH_SPEC
     3007        if (vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j))
     3008        {
     3009#endif
     3010          WRITE_UVLC(vps->getMinSpatialSegmentOffsetPlus1( i, j),    "min_spatial_segment_offset_plus1[i][j]");
     3011
     3012          if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
     3013          { 
     3014            WRITE_FLAG( vps->getCtuBasedOffsetEnabledFlag( i, j) ? 1 : 0 , "ctu_based_offset_enabled_flag[i][j]" );   
     3015
     3016            if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 
     3017            {
     3018              WRITE_UVLC(vps->getMinHorizontalCtuOffsetPlus1( i, j),    "min_horizontal_ctu_offset_plus1[i][j]");           
     3019            }
    29793020          }
    2980         } 
     3021#if VPS_FIX_TO_MATCH_SPEC
     3022        }
     3023#endif
    29813024      } 
    29823025    }
     
    33513394    codeHrdParameters(vps->getBspHrd(j), i == 0 ? true : vps->getCprmsAddPresentFlag(j), vps->getNumSubLayerHrdMinus1(j));
    33523395  }
     3396
     3397#if VPS_FIX_TO_MATCH_SPEC
     3398  if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0 )
     3399  {
     3400#endif
    33533401  for( Int h = 1; h < vps->getNumOutputLayerSets(); h++ )
    33543402  {
    33553403    Int lsIdx = vps->getOutputLayerSetIdx( h );
    33563404    WRITE_UVLC( vps->getNumSignalledPartitioningSchemes(h), "num_signalled_partitioning_schemes[h]");
     3405
     3406#if VPS_FIX_TO_MATCH_SPEC
     3407    for( Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++ )
     3408#else
    33573409    for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ )
     3410#endif
    33583411    {
    33593412      WRITE_UVLC( vps->getNumPartitionsInSchemeMinus1(h, j), "num_partitions_in_scheme_minus1[h][j]" );
     
    33663419      }
    33673420    }
     3421
    33683422    for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ )
    33693423    {
     
    33713425      {
    33723426        WRITE_UVLC(vps->getNumBspSchedulesMinus1(h, i, t), "num_bsp_schedules_minus1[h][i][t]");
     3427
    33733428        for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
    33743429        {
     3430#if VPS_FIX_TO_MATCH_SPEC
     3431          for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++)
     3432#else
    33753433          for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
     3434#endif
    33763435          {
     3436#if VPS_FIX_TO_MATCH_SPEC
     3437            if (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1)
     3438            {
     3439              Int numBits = 1;
     3440              while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams()))
     3441              {
     3442                numBits++;
     3443              }
     3444              WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_comb_hrd_idx[h][i][t][j][k]");
     3445            }
     3446#else
    33773447            WRITE_UVLC( vps->getBspHrdIdx(h, i, t, j, k),   "bsp_comb_hrd_idx[h][i][t][j][k]");
     3448#endif
    33783449            WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_comb_sched_idx[h][i][t][j][k]");
    33793450          }
     
    33823453    }
    33833454  }
     3455#if VPS_FIX_TO_MATCH_SPEC
     3456  }
     3457#endif
    33843458}
    33853459#endif
Note: See TracChangeset for help on using the changeset viewer.