Changeset 466 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
13 Nov 2013, 23:25:47 (11 years ago)
Author:
nokia
Message:

Integration of O0194: Support different bit-depth values for different layers, enable weighted prediction for ILR for color gamut scalability.

Location:
branches/SHM-4.0-dev/source/Lib/TLibDecoder
Files:
5 edited

Legend:

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

    r464 r466  
    187187  assert(uiCode <= 63);
    188188  pcPPS->setPPSId (uiCode);
    189  
     189
    190190  READ_UVLC( uiCode, "pps_seq_parameter_set_id");
    191191  assert(uiCode <= 15);
    192192  pcPPS->setSPSId (uiCode);
    193  
     193
    194194  READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag"    );    pcPPS->setDependentSliceSegmentsEnabledFlag   ( uiCode == 1 );
    195195  READ_FLAG( uiCode, "output_flag_present_flag" );                    pcPPS->setOutputFlagPresentFlag( uiCode==1 );
     
    293293
    294294#if IL_SL_SIGNALLING_N0371
    295   pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 
     295  pcPPS->setPPS( pcPPS->getLayerId(), pcPPS );
    296296#endif
    297297
     
    301301    pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() );
    302302
    303     if( pcPPS->getLayerId() > 0 ) 
     303    if( pcPPS->getLayerId() > 0 )
    304304    {
    305305      READ_FLAG( uiCode, "pps_pred_scaling_list_flag" );           pcPPS->setPredScalingListFlag( uiCode ? true : false );
    306306      pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() );
    307      
     307
    308308      if( pcPPS->getPredScalingListFlag() )
    309309      {
     
    319319        }
    320320
    321         // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 
     321        // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
    322322        // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id
    323323        assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );
    324324
    325         // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 
     325        // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
    326326        // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
    327327        assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true );
     
    450450  {
    451451    READ_FLAG(   uiCode, "tiles_fixed_structure_flag");               pcVUI->setTilesFixedStructureFlag(uiCode);
     452#if M0464_TILE_BOUNDARY_ALIGNED_FLAG
     453    if ( pcSPS->getLayerId() > 0 )
     454    {
     455      READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 );
     456    }
     457#endif
    452458    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    453459    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
     
    536542}
    537543
    538 #if SVC_EXTENSION
     544#if SPS_SUB_LAYER_INFO
    539545Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager)
    540546#else
     
    548554  UInt  uiCode;
    549555  READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
    550 #if SVC_EXTENSION
     556#if SPS_SUB_LAYER_INFO
    551557  if(pcSPS->getLayerId() == 0)
    552558  {
     
    554560    READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
    555561    assert(uiCode <= 6);
    556  
     562
    557563    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
    558 #if SVC_EXTENSION
     564#if SPS_SUB_LAYER_INFO
    559565  }
    560566  else
     
    563569    pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() );
    564570  }
     571#endif
    565572#if IL_SL_SIGNALLING_N0371
    566573  pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) );
    567574  pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );
    568575#endif
    569 #endif
    570576  if ( pcSPS->getMaxTLayers() == 1 )
    571577  {
    572578    // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
    573 #if SVC_EXTENSION
     579#if SPS_SUB_LAYER_INFO
    574580    assert( pcSPS->getTemporalIdNestingFlag() == true );
    575581#else
     
    592598  if( pcSPS->getLayerId() > 0 )
    593599  {
    594     READ_FLAG( uiCode, "update_rep_format_flag" );                 
     600    READ_FLAG( uiCode, "update_rep_format_flag" );
    595601    pcSPS->setUpdateRepFormatFlag( uiCode ? true : false );
    596602  }
     
    599605    pcSPS->setUpdateRepFormatFlag( true );
    600606  }
    601   if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 
     607  if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
    602608  {
    603609#endif
     
    633639  }
    634640#if REPN_FORMAT_IN_VPS
    635   if(  pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 
     641  if(  pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
    636642  {
    637643#endif
     
    653659  UInt subLayerOrderingInfoPresentFlag;
    654660  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
    655  
     661
    656662  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    657663  {
     
    722728          }
    723729
    724           // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 
     730          // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
    725731          // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id
    726732          assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );
    727733
    728           // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 
     734          // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
    729735          // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
    730736          assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true );
     
    835841  assert( uiCode == 0 );
    836842#endif
     843#if SCALED_REF_LAYER_OFFSETS
    837844  if( pcSPS->getLayerId() > 0 )
    838845  {
    839     Int iCode; 
     846    Int iCode;
    840847    READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode);
    841848    for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
     
    848855    }
    849856  }
     857#endif
    850858#if M0463_VUI_EXT_ILP_REF
    851859  ////   sps_extension_vui_parameters( )
    852860  if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
    853   { 
    854     READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 
    855     for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 
    856     { 
    857       READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 
    858       if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 
    859       { 
    860         READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 
    861         if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 
    862         {
    863           READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 
    864         }
    865       } 
    866     } 
    867   } 
     861  {
     862    READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );
     863    for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
     864    {
     865      READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );
     866      if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
     867      {
     868        READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );
     869        if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )
     870        {
     871          READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );
     872        }
     873      }
     874    }
     875  }
    868876  ////   sps_extension_vui_parameters( ) END
    869877#endif
     
    9921000}
    9931001
    994 #if SVC_EXTENSION
    9951002#if VPS_EXTNS
    9961003Void TDecCavlc::parseVPSExtension(TComVPS *vps)
     
    10111018  vps->setNumScalabilityTypes(numScalabilityTypes);
    10121019
     1020#if VPS_SPLIT_FLAG
    10131021  for(j = 0; j < numScalabilityTypes - vps->getSplittingFlag(); j++)
     1022#else
     1023  for(j = 0; j < numScalabilityTypes; j++)
     1024#endif
    10141025  {
    10151026    READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1);
    10161027  }
    1017 
     1028#if VPS_SPLIT_FLAG
    10181029  if(vps->getSplittingFlag())
    10191030  {
     
    10271038    numBits = 6;
    10281039  }
     1040#else
     1041  if(vps->getSplittingFlag())
     1042  {
     1043    UInt numBits = 0;
     1044    for(j = 0; j < numScalabilityTypes; j++)
     1045    {
     1046      numBits += vps->getDimensionIdLen(j);
     1047    }
     1048    assert( numBits <= 6 );
     1049  }
     1050#endif
    10291051
    10301052  READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false);
     
    10441066    vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
    10451067
    1046     if( !vps->getSplittingFlag() )
    1047     {
    1048       for(j = 0; j < numScalabilityTypes; j++)
    1049       {
    1050         READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);
    1051         assert( uiCode <= vps->getMaxLayerId() );
    1052       }
    1053     }
    1054   }
    1055 #endif
    1056 #if VIEW_ID_RELATED_SIGNALING 
    1057   // if ( pcVPS->getNumViews() > 1 ) 
    1058   //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 
     1068#if VPS_SPLIT_FLAG
     1069    if(!vps->getSplittingFlag())
     1070#endif
     1071    for(j = 0; j < numScalabilityTypes; j++)
     1072    {
     1073      READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);
     1074      assert( uiCode <= vps->getMaxLayerId() );
     1075    }
     1076  }
     1077#endif
     1078#if VIEW_ID_RELATED_SIGNALING
     1079  // if ( pcVPS->getNumViews() > 1 )
     1080  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    10591081  {
    10601082    READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode );
     
    10661088  }
    10671089#endif
     1090#if VPS_MOVE_DIR_DEPENDENCY_FLAG
    10681091#if VPS_EXTN_DIRECT_REF_LAYERS
    10691092  // For layer 0
     
    10851108  }
    10861109#endif
     1110#endif
    10871111#if JCTVC_M0203_INTERLAYER_PRED_IDC
    10881112#if N0120_MAX_TID_REF_PRESENT_FLAG
     
    10951119#if N0120_MAX_TID_REF_CFG
    10961120      assert( uiCode <= vps->getMaxTLayers());
    1097 #else 
     1121#else
    10981122      assert( uiCode <= vps->getMaxTLayers()+ 1 );
    1099 #endif 
    1100     }
    1101   }
    1102   else 
     1123#endif
     1124    }
     1125  }
     1126  else
    11031127  {
    11041128    for(i = 0; i < vps->getMaxLayers() - 1; i++)
     
    11201144#if VPS_EXTN_PROFILE_INFO
    11211145  // Profile-tier-level signalling
     1146#if VPS_PROFILE_OUTPUT_LAYERS
    11221147  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" );     assert( uiCode == (vps->getNumLayerSets() - 1) );
    11231148  READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
    11241149  vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
    11251150  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
     1151#else
     1152  vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets());
     1153  for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)
     1154#endif
    11261155  {
    11271156    READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false);
    11281157    if( !vps->getProfilePresentFlag(idx) )
    11291158    {
     1159#if VPS_PROFILE_OUTPUT_LAYERS
    11301160      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
     1161#else
     1162      READ_UVLC( uiCode, "vps_profile_layer_set_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
     1163#endif
    11311164      assert( vps->getProfileLayerSetRef(idx) < idx );
    1132 
    11331165      // Copy profile information as indicated
    11341166      vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) );
     
    11381170#endif
    11391171
     1172#if VPS_PROFILE_OUTPUT_LAYERS
    11401173  READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false );
    11411174  Int numOutputLayerSets = 0;
     
    11981231    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
    11991232  }
    1200 
     1233#else
     1234#if VPS_EXTN_OP_LAYER_SETS
     1235  // Target output layer signalling
     1236  READ_UVLC( uiCode,            "vps_num_output_layer_sets"); vps->setNumOutputLayerSets(uiCode);
     1237  for(i = 0; i < vps->getNumOutputLayerSets(); i++)
     1238  {
     1239#if VPS_OUTPUT_LAYER_SET_IDX
     1240    READ_UVLC( uiCode,           "vps_output_layer_set_idx_minus1[i]"); vps->setOutputLayerSetIdx(i, uiCode + 1);
     1241#else
     1242    READ_UVLC( uiCode,           "vps_output_layer_set_idx[i]"); vps->setOutputLayerSetIdx(i, uiCode);
     1243#endif
     1244    Int lsIdx = vps->getOutputLayerSetIdx(i);
     1245    for(j = 0; j <= vps->getMaxLayerId(); j++)
     1246    {
     1247      if(vps->getLayerIdIncludedFlag(lsIdx, j))
     1248      {
     1249        READ_FLAG( uiCode, "vps_output_layer_flag[lsIdx][j]"); vps->setOutputLayerFlag(lsIdx, j, uiCode);
     1250      }
     1251    }
     1252  }
     1253#endif
     1254#endif
    12011255#if REPN_FORMAT_IN_VPS
    1202   READ_FLAG( uiCode, "rep_format_idx_present_flag"); 
     1256  READ_FLAG( uiCode, "rep_format_idx_present_flag");
    12031257  vps->setRepFormatIdxPresentFlag( uiCode ? true : false );
    12041258
     
    12191273    parseRepFormat( vps->getVpsRepFormat(i) );
    12201274  }
    1221  
     1275
    12221276  // Default assignment for layer 0
    12231277  vps->setVpsRepFormatIdx( 0, 0 );
     
    12581312  READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" );
    12591313  vps->setCrossLayerIrapAlignFlag(uiCode);
    1260 #endif
    1261 
     1314#endif
     1315
     1316#if !VPS_MOVE_DIR_DEPENDENCY_FLAG
     1317#if VPS_EXTN_DIRECT_REF_LAYERS
     1318  // For layer 0
     1319  vps->setNumDirectRefLayers(0, 0);
     1320  // For other layers
     1321  for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     1322  {
     1323    UInt numDirectRefLayers = 0;
     1324    for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
     1325    {
     1326      READ_FLAG(uiCode, "direct_dependency_flag[i][j]" ); vps->setDirectDependencyFlag(layerCtr, refLayerCtr, uiCode? true : false);
     1327      if(uiCode)
     1328      {
     1329        vps->setRefLayerId(layerCtr, numDirectRefLayers, refLayerCtr);
     1330        numDirectRefLayers++;
     1331      }
     1332    }
     1333    vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers);
     1334  }
     1335#endif
     1336#endif
    12621337#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
    12631338  READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
     
    12791354    {
    12801355      for(j = 0; j < i; j++)
    1281         {     
     1356        {
    12821357          vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) );
    12831358        }
     
    12981373    }
    12991374    parseVPSVUI(vps);
    1300 #endif 
     1375#endif
    13011376  }
    13021377}
     
    13071382  UInt uiCode;
    13081383  READ_CODE( 2, uiCode, "chroma_format_idc" );               repFormat->setChromaFormatVpsIdc( uiCode );
    1309  
     1384
    13101385  if( repFormat->getChromaFormatVpsIdc() == 3 )
    13111386  {
     
    13151390  READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" );     repFormat->setPicWidthVpsInLumaSamples ( uiCode );
    13161391  READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" );    repFormat->setPicHeightVpsInLumaSamples( uiCode );
    1317  
     1392
    13181393  READ_CODE( 4, uiCode, "bit_depth_luma_minus8" );           repFormat->setBitDepthVpsLuma  ( uiCode + 8 );
    13191394  READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" );         repFormat->setBitDepthVpsChroma( uiCode + 8 );
     
    13811456    for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
    13821457    {
    1383       READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1));     
    1384     }
    1385   } 
    1386 #endif 
     1458      READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1));
     1459    }
     1460  }
     1461#endif
    13871462#if N0160_VUI_EXT_ILP_REF
    1388     READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 
     1463    READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 );
    13891464  if( vps->getNumIlpRestrictedRefLayers())
    13901465  {
     
    13931468      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
    13941469      {
    1395         READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 
    1396         if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 
    1397         { 
    1398           READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 
    1399           if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 
     1470        READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
     1471        if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
     1472        {
     1473          READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 );
     1474          if(vps->getCtuBasedOffsetEnabledFlag(i,j))
    14001475          {
    1401             READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 
     1476            READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode );
    14021477          }
    1403         } 
    1404       } 
    1405     }
    1406   }
    1407 #endif
    1408 }
    1409 #endif
    1410 #endif //SVC_EXTENSION
    1411 
     1478        }
     1479      }
     1480    }
     1481  }
     1482#endif
     1483}
     1484#endif
    14121485Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)
    14131486{
     
    14821555  if(!rpcSlice->getDependentSliceSegmentFlag())
    14831556  {
    1484 #if SVC_EXTENSION
    14851557#if POC_RESET_FLAG
    1486     Int iBits = 0; 
     1558    Int iBits = 0;
    14871559    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
    14881560    {
     
    15001572    }
    15011573#else
     1574#if SH_DISCARDABLE_FLAG
    15021575    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0)
    15031576    {
     
    15081581      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    15091582    }
    1510 #endif
    1511 #else //SVC_EXTENSION
     1583#else
    15121584    for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
    15131585    {
    15141586      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    15151587    }
    1516 #endif //SVC_EXTENSION
     1588#endif
     1589#endif
    15171590
    15181591    READ_UVLC (    uiCode, "slice_type" );            rpcSlice->setSliceType((SliceType)uiCode);
     
    16761749            rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt);
    16771750            rps->setCheckLTMSBPresent(j,false);
    1678            
     1751
    16791752            // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present
    16801753            if( j == offset+(numOfLtrp-numLtrpInSPS)-1 )
     
    17791852#else
    17801853    else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == false )
    1781 #endif 
     1854#endif
    17821855    {
    17831856      rpcSlice->setInterLayerPredEnabledFlag(true);
     
    20072080
    20082081#if REPN_FORMAT_IN_VPS
     2082#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     2083    g_bitDepthYLayer[rpcSlice->getLayerId()]     = rpcSlice->getBitDepthY();
     2084    g_bitDepthCLayer[rpcSlice->getLayerId()]     = rpcSlice->getBitDepthC();
     2085#endif
    20092086    assert( rpcSlice->getSliceQp() >= -rpcSlice->getQpBDOffsetY() );
    20102087#else
     
    21172194  {
    21182195    Int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation();
    2119    
     2196
    21202197    // Adjust endOfSliceHeaderLocation to account for emulation prevention bytes in the slice segment header
    21212198    for ( UInt curByteIdx  = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ )
     
    25232600#if IL_SL_SIGNALLING_N0371
    25242601      if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )
    2525       { 
     2602      {
    25262603        READ_FLAG( code, "scaling_list_pred_mode_flag");
    25272604        scalingListPredModeFlag = (code) ? true : false;
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r452 r466  
    7272  Void  parseQtRootCbf      ( UInt uiAbsPartIdx, UInt& uiQtRootCbf );
    7373  Void  parseVPS            ( TComVPS* pcVPS );
    74 #if SPS_EXTENSION
    7574#if VPS_EXTNS
    7675  Void  parseVPSExtension   ( TComVPS* pcVPS );
     
    8382  Void  parseRepFormat      ( RepFormat *repFormat );
    8483#endif
     84#if SPS_SUB_LAYER_INFO
    8585  Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager );
    86   Void  parseSPSExtension    ( TComSPS* pcSPS );
    87 #else //SVC_EXTENSION
     86#else
    8887  Void  parseSPS            ( TComSPS* pcSPS );
    89 #endif //SVC_EXTENSION
     88#endif
     89#if SPS_EXTENSION
     90  Void parseSPSExtension    ( TComSPS* pcSPS );
     91#endif
    9092  Void  parsePPS            ( TComPPS* pcPPS);
    9193  Void  parseVUI            ( TComVUI* pcVUI, TComSPS* pcSPS );
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r442 r466  
    616616    curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();
    617617  }
     618#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     619#if REPN_FORMAT_IN_VPS
     620  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), eText, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset );
     621#else
    618622  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );
     623#endif
     624#else
     625  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );
     626#endif
    619627
    620628  Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText];
     
    768776  // Cb and Cr
    769777  Int curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb();
     778#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     779#if REPN_FORMAT_IN_VPS
     780  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset );
     781#else
    770782  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );
     783#endif
     784#else
     785  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );
     786#endif
    771787
    772788  uiWidth  >>= 1;
     
    776792
    777793  curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();
     794#if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     795#if REPN_FORMAT_IN_VPS
     796  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset );
     797#else
    778798  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );
     799#endif
     800#else
     801  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset );
     802#endif
    779803
    780804  piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr();
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecEntropy.h

    r452 r466  
    6666
    6767  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    68 #if SVC_EXTENSION
     68#if SPS_SUB_LAYER_INFO
    6969  virtual Void  parseSPS                  ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager )           = 0;
    7070#else
     
    134134  Void    resetEntropy                ( TComSlice* p)           { m_pcEntropyDecoderIf->resetEntropy(p);                    }
    135135  Void    decodeVPS                   ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); }
    136 #if SVC_EXTENSION
     136#if SPS_SUB_LAYER_INFO
    137137  Void    decodeSPS                   ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager )    { m_pcEntropyDecoderIf->parseSPS(pcSPS, parameterSetManager);                    }
    138138#else
  • branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecSbac.h

    r452 r466  
    7676  Void  setBitstream              ( TComInputBitstream* p  ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); }
    7777  Void  parseVPS                  ( TComVPS* /*pcVPS*/ ) {}
    78 #if SVC_EXTENSION
     78#if SPS_SUB_LAYER_INFO
    7979  Void  parseSPS                  ( TComSPS* /*pcSPS*/, ParameterSetManagerDecoder * /*parameterSetManager*/ ) {}
    8080#else
Note: See TracChangeset for help on using the changeset viewer.