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


Ignore:
Timestamp:
6 Oct 2014, 12:50:55 (11 years ago)
Author:
nokia
Message:

implementation for proposal JCTVC-R0042

File:
1 edited

Legend:

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

    r895 r898  
    295295    }
    296296  }
    297 
     297#if !R0042_PROFILE_INDICATION
    298298#if SCALINGLIST_INFERRING
    299299  if( pcPPS->getLayerId() > 0 )
     
    315315  {
    316316#endif
     317#endif
    317318
    318319    READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
     
    322323      parseScalingList( pcPPS->getScalingList() );
    323324    }
    324 
     325#if !R0042_PROFILE_INDICATION
    325326#if SCALINGLIST_INFERRING
    326327  }
     328#endif
    327329#endif
    328330
     
    336338  pcPPS->setSliceHeaderExtensionPresentFlag(uiCode);
    337339
     340#if !R0042_PROFILE_INDICATION
    338341  READ_FLAG( uiCode, "pps_extension_flag");
     342#else
     343  READ_FLAG( uiCode, "pps_extension_present_flag");
     344#endif
     345
     346#if !R0042_PROFILE_INDICATION
    339347#if POC_RESET_INFO_INFERENCE
    340348  pcPPS->setExtensionFlag( uiCode ? true : false );
     
    451459  }
    452460#endif
     461#else
     462  pcPPS->setExtensionFlag( uiCode ? true : false );
     463  if( pcPPS->getExtensionFlag() )
     464  {
     465    READ_FLAG( uiCode, "pps_range_extension_flag" );
     466    assert(uiCode == 0);
     467    READ_FLAG( uiCode, "pps_multilayer_extension_flag" );
     468    assert(uiCode == 1);
     469    READ_CODE(6, uiCode, "pps_extension_6bits");
     470    assert(uiCode == 0);
     471
     472    READ_FLAG( uiCode, "poc_reset_info_present_flag" );
     473    pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false);
     474
     475#if SCALINGLIST_INFERRING
     476    READ_FLAG( uiCode, "pps_infer_scaling_list_flag" );
     477    pcPPS->setInferScalingListFlag( uiCode );
     478
     479    if( pcPPS->getInferScalingListFlag() )
     480    {
     481      READ_UVLC( uiCode, "pps_scaling_list_ref_layer_id" );
     482      pcPPS->setScalingListRefLayerId( uiCode );
     483      // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     484      assert( pcPPS->getScalingListRefLayerId() <= 62 );
     485      pcPPS->setScalingListPresentFlag( false );
     486    }
     487#endif
     488
     489#if REF_REGION_OFFSET
     490    READ_UVLC( uiCode,      "num_ref_loc_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode);
     491    for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++)
     492    {
     493      READ_CODE( 6, uiCode,  "ref_loc_offset_layer_id" );  pcPPS->setScaledRefLayerId( i, uiCode );
     494      READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" );   pcPPS->setScaledRefLayerOffsetPresentFlag( i, uiCode );
     495      if (uiCode)
     496      {
     497        Window& scaledWindow = pcPPS->getScaledRefLayerWindow(i);
     498        READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
     499        READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
     500        READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
     501        READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
     502#if P0312_VERT_PHASE_ADJ
     503        READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode);
     504#endif
     505      }
     506      READ_FLAG( uiCode, "ref_region_offset_present_flag" );   pcPPS->setRefRegionOffsetPresentFlag( i, uiCode );
     507      if (uiCode)
     508      {
     509        Window& refWindow = pcPPS->getRefLayerWindow(i);
     510        READ_SVLC( iCode, "ref_region_left_offset" );    refWindow.setWindowLeftOffset  (iCode << 1);
     511        READ_SVLC( iCode, "ref_region_top_offset" );     refWindow.setWindowTopOffset   (iCode << 1);
     512        READ_SVLC( iCode, "ref_region_right_offset" );   refWindow.setWindowRightOffset (iCode << 1);
     513        READ_SVLC( iCode, "ref_region_bottom_offset" );  refWindow.setWindowBottomOffset(iCode << 1);
     514      }
     515#if R0209_GENERIC_PHASE
     516      READ_FLAG( uiCode, "resample_phase_set_present_flag" );   pcPPS->setResamplePhaseSetPresentFlag( i, uiCode );
     517      if (uiCode)
     518      {
     519        READ_UVLC( uiCode, "phase_hor_luma" );    pcPPS->setPhaseHorLuma ( i, uiCode );
     520        READ_UVLC( uiCode, "phase_ver_luma" );    pcPPS->setPhaseVerLuma ( i, uiCode );
     521        READ_UVLC( uiCode, "phase_hor_chroma_plus8" );  pcPPS->setPhaseHorChroma (i, uiCode - 8);
     522        READ_UVLC( uiCode, "phase_ver_chroma_plus8" );  pcPPS->setPhaseVerChroma (i, uiCode - 8);
     523      }
     524#endif
     525    }
     526#else
     527#if MOVE_SCALED_OFFSET_TO_PPS
     528      READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode);
     529      for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++)
     530      {
     531        Window& scaledWindow = pcPPS->getScaledRefLayerWindow(i);
     532#if O0098_SCALED_REF_LAYER_ID
     533        READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcPPS->setScaledRefLayerId( i, uiCode );
     534#endif
     535        READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
     536        READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
     537        READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
     538        READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
     539#if P0312_VERT_PHASE_ADJ
     540        READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode);
     541#endif
     542      }
     543#endif
     544#endif
     545#if Q0048_CGS_3D_ASYMLUT
     546      READ_FLAG( uiCode , "colour_mapping_enabled_flag" );
     547      pcPPS->setCGSFlag( uiCode );
     548      if( pcPPS->getCGSFlag() )
     549      {
     550        xParse3DAsymLUT( pc3DAsymLUT );
     551        pcPPS->setCGSOutputBitDepthY( pc3DAsymLUT->getOutputBitDepthY() );
     552        pcPPS->setCGSOutputBitDepthC( pc3DAsymLUT->getOutputBitDepthC() );
     553      }
     554#endif
     555  }
     556#endif
     557
    453558}
    454559
     
    643748#endif
    644749
     750#if R0042_PROFILE_INDICATION
     751  UInt uiTmp;
     752  bool bMultiLayerExtSpsFlag;
     753#endif
    645754  UInt  uiCode;
    646755  READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
     
    651760    READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
    652761    assert(uiCode <= 6);
    653 
     762#if SVC_EXTENSION
     763  }
     764#if R0042_PROFILE_INDICATION
     765  else
     766  {
     767    READ_CODE( 3,  uiCode, "sps_ext_or_max_sub_layers_minus1" );     uiTmp = uiCode;
     768  }
     769#endif
     770#if !SPS_DPB_PARAMS
     771  if(pcSPS->getLayerId() != 0)
     772  {
     773    pcSPS->setMaxTLayers           ( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getMaxTLayers()          );
     774  }
     775#endif
     776#endif
     777
     778#if SVC_EXTENSION
     779#if R0042_PROFILE_INDICATION
     780  bMultiLayerExtSpsFlag = ( pcSPS->getLayerId() != 0 && uiTmp == 7 );
     781#endif
     782#endif
     783
     784#if SVC_EXTENSION
     785#if !R0042_PROFILE_INDICATION
     786  if(pcSPS->getLayerId() == 0)
     787#else
     788  if(!bMultiLayerExtSpsFlag)
     789#endif
     790  {
     791#endif
    654792    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
    655793#if SVC_EXTENSION
     
    658796  else
    659797  {
    660     pcSPS->setMaxTLayers           ( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getMaxTLayers()          );
    661798    pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() );
    662799  }
     
    679816
    680817#ifdef SPS_PTL_FIX
     818#if !R0042_PROFILE_INDICATION
    681819  if ( pcSPS->getLayerId() == 0)
     820#else
     821  if(!bMultiLayerExtSpsFlag)
     822#endif
    682823  {
    683824    parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     
    691832
    692833#if REPN_FORMAT_IN_VPS
     834#if !R0042_PROFILE_INDICATION
    693835  if( pcSPS->getLayerId() > 0 )
     836#else
     837  if( bMultiLayerExtSpsFlag)
     838#endif
    694839  {
    695840    READ_FLAG( uiCode, "update_rep_format_flag" );
    696841    pcSPS->setUpdateRepFormatFlag( uiCode ? true : false );
     842#if R0042_PROFILE_INDICATION   
     843    if( bMultiLayerExtSpsFlag && uiCode)
     844    {
     845      READ_CODE(8, uiCode, "sps_rep_format_idx");
     846      pcSPS->setUpdateRepFormatIndex(uiCode);
     847    }
     848#endif
    697849  }
    698850  else
     
    704856#endif
    705857  }
     858
     859#if R0042_PROFILE_INDICATION 
     860  if( !bMultiLayerExtSpsFlag )
     861  {
     862#else
    706863#if O0096_REP_FORMAT_INDEX
    707864  if( pcSPS->getLayerId() == 0 )
    708865#else
    709866  if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
     867#endif
    710868#endif
    711869  {
     
    729887  }
    730888#if O0096_REP_FORMAT_INDEX
     889#if !R0042_PROFILE_INDICATION
    731890  else if ( pcSPS->getUpdateRepFormatFlag() )
    732891  {
     
    736895#endif
    737896#endif
     897#endif
    738898
    739899#if R0156_CONF_WINDOW_IN_REP_FORMAT
    740900#if REPN_FORMAT_IN_VPS
     901#if !R0042_PROFILE_INDICATION 
    741902#if O0096_REP_FORMAT_INDEX
    742903  if( pcSPS->getLayerId() == 0 )
    743904#else
    744905  if(  pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
     906#endif
    745907#endif
    746908  {
     
    770932
    771933#if REPN_FORMAT_IN_VPS
     934#if !R0042_PROFILE_INDICATION 
    772935#if O0096_REP_FORMAT_INDEX
    773936  if( pcSPS->getLayerId() == 0 )
    774937#else
    775938  if(  pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
     939#endif
    776940#endif
    777941  {
     
    789953  }
    790954#endif
     955#if R0042_PROFILE_INDICATION 
     956  }
     957#endif
     958
    791959  READ_UVLC( uiCode,    "log2_max_pic_order_cnt_lsb_minus4" );   pcSPS->setBitsForPOC( 4 + uiCode );
    792960  assert(uiCode <= 12);
    793961
    794962#if SPS_DPB_PARAMS
     963#if !R0042_PROFILE_INDICATION
    795964  if( pcSPS->getLayerId() == 0 ) 
    796965  {
     966#else
     967  if( !bMultiLayerExtSpsFlag ) 
     968  {
     969#endif
    797970#endif
    798971    UInt subLayerOrderingInfoPresentFlag;
     
    8511024  {
    8521025#if SCALINGLIST_INFERRING
     1026#if !R0042_PROFILE_INDICATION
    8531027    if( pcSPS->getLayerId() > 0 )
     1028#else
     1029    if( bMultiLayerExtSpsFlag )
     1030#endif
    8541031    {
    8551032      READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setInferScalingListFlag( uiCode );
     
    9321109  if( pcSPS->getExtensionFlag() )
    9331110  {
     1111#if !R0042_PROFILE_INDICATION
    9341112#if O0142_CONDITIONAL_SPS_EXTENSION
    9351113    UInt spsExtensionTypeFlag[8];
     
    9551133      }
    9561134    }
    957   }
     1135    }
     1136#else
     1137    READ_FLAG( uiCode, "sps_range_extension_flag" );
     1138    assert(uiCode == 0);
     1139    READ_FLAG( uiCode, "sps_multilayer_extension_flag" );
     1140    assert(uiCode == 1);
     1141    READ_CODE(6, uiCode, "sps_extension_6bits");
     1142    assert(uiCode == 0);
     1143    parseSPSExtension( pcSPS );
     1144  }
     1145#endif
    9581146#else
    9591147  if (uiCode)
Note: See TracChangeset for help on using the changeset viewer.