Changeset 898 in SHVCSoftware


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

implementation for proposal JCTVC-R0042

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

Legend:

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

    r894 r898  
    16631663  Bool        m_extensionFlag;
    16641664  UInt        m_numScaledRefLayerOffsets;
     1665#if R0042_PROFILE_INDICATION 
     1666  Int         m_NumDirectRefLayers;
     1667#endif
    16651668#if P0312_VERT_PHASE_ADJ
    16661669 Bool         m_vertPhasePositionEnableFlag[MAX_LAYERS];
     
    18301833  Int      getExtensionFlag()                  { return m_extensionFlag;  }
    18311834  Void     setExtensionFlag(Int n)             { m_extensionFlag = n;     }
     1835#if R0042_PROFILE_INDICATION
     1836  Int      getNumDirectRefLayers()                  { return  m_NumDirectRefLayers;  }
     1837  Void     setNumDirectRefLayers(Int n)             {  m_NumDirectRefLayers = n;     }
     1838#endif
    18321839#if !MOVE_SCALED_OFFSET_TO_PPS
    18331840  UInt     getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r894 r898  
    7575#define R0227_REP_FORMAT_CONSTRAINT      1      ///< JCTVC-R0227, Conformance checking such that representation format of a particular layer shall not be greater than the one defined in VPS for that layer
    7676#define R0227_BR_PR_ADD_LAYER_SET        1      ///< JCTVC-R0227, Signalling of bit-rate and picture rate for additional layer set
     77#define R0042_PROFILE_INDICATION         1      ///< JCTVC-R0042, Profile indication for additional layer sets
    7778
    7879#define Q0108_TSA_STSA                   1      ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers
  • 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)
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r894 r898  
    225225  }
    226226
     227#if !R0042_PROFILE_INDICATION
    227228#if SCALINGLIST_INFERRING
    228229  if( pcPPS->getLayerId() > 0 )
     
    241242  {
    242243#endif
     244#endif
    243245
    244246  WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" );
     
    247249    codeScalingList( m_pcSlice->getScalingList() );
    248250  }
    249 
     251#if !R0042_PROFILE_INDICATION
    250252#if SCALINGLIST_INFERRING
    251253  }
     254#endif
    252255#endif
    253256
     
    256259  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
    257260#if P0166_MODIFIED_PPS_EXTENSION
     261#if !R0042_PROFILE_INDICATION
    258262  WRITE_FLAG( pcPPS->getExtensionFlag() ? 1 : 0, "pps_extension_flag" );
     263#else
     264  WRITE_FLAG( pcPPS->getExtensionFlag() ? 1 : 0, "pps_extension_present_flag" );
     265#endif
    259266
    260267  if( pcPPS->getExtensionFlag() )
    261268  {
     269#if !R0042_PROFILE_INDICATION
    262270#if !POC_RESET_IDC
    263271    UInt ppsExtensionTypeFlag[8] = { 0, 1, 0, 0, 0, 0, 0, 0 };
     
    335343#endif
    336344    }
     345#else
     346  WRITE_FLAG( 0, "pps_range_extension_flag" );
     347  WRITE_FLAG( 1, "pps_multilayer_extension_flag" );
     348  WRITE_CODE( 0, 6,  "pps_extension_6bits" );     
     349
     350  WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag() ? 1 : 0, "poc_reset_info_present_flag" );
     351#if SCALINGLIST_INFERRING
     352  WRITE_FLAG( pcPPS->getInferScalingListFlag() ? 1 : 0, "pps_infer_scaling_list_flag" );
     353  if( pcPPS->getInferScalingListFlag() )
     354  {
     355    // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     356    assert( pcPPS->getScalingListRefLayerId() <= 62 );
     357    WRITE_UVLC( pcPPS->getScalingListRefLayerId(), "pps_scaling_list_ref_layer_id" );
     358  }
     359#endif
     360
     361#if REF_REGION_OFFSET
     362  WRITE_UVLC( pcPPS->getNumScaledRefLayerOffsets(),      "num_ref_loc_offsets" );
     363  for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++)
     364  {
     365    WRITE_CODE( pcPPS->getScaledRefLayerId(i), 6, "ref_loc_offset_layer_id" );
     366    WRITE_FLAG( pcPPS->getScaledRefLayerOffsetPresentFlag(i) ? 1 : 0, "scaled_ref_layer_offset_prsent_flag" );
     367    if (pcPPS->getScaledRefLayerOffsetPresentFlag(i))
     368    {
     369      Window scaledWindow = pcPPS->getScaledRefLayerWindow(i);
     370      WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
     371      WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
     372      WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
     373      WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
     374    }
     375    WRITE_FLAG( pcPPS->getRefRegionOffsetPresentFlag(i) ? 1 : 0, "ref_region_offset_prsent_flag" );
     376    if (pcPPS->getRefRegionOffsetPresentFlag(i))
     377    {
     378      Window refWindow = pcPPS->getRefLayerWindow(i);
     379      WRITE_SVLC( refWindow.getWindowLeftOffset()   >> 1, "ref_region_left_offset" );
     380      WRITE_SVLC( refWindow.getWindowTopOffset()    >> 1, "ref_region_top_offset" );
     381      WRITE_SVLC( refWindow.getWindowRightOffset()  >> 1, "ref_region_right_offset" );
     382      WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" );
     383    }
     384#if R0209_GENERIC_PHASE
     385    WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(i) ? 1 : 0, "resample_phase_set_present_flag" );
     386    if (pcPPS->getResamplePhaseSetPresentFlag(i))
     387    {
     388      WRITE_UVLC( pcPPS->getPhaseHorLuma(i), "phase_hor_luma" );
     389      WRITE_UVLC( pcPPS->getPhaseVerLuma(i), "phase_ver_luma" );
     390      WRITE_UVLC( pcPPS->getPhaseHorChroma(i) + 8, "phase_hor_chroma_plus8" );
     391      WRITE_UVLC( pcPPS->getPhaseVerChroma(i) + 8, "phase_ver_chroma_plus8" );
     392    }
     393#endif
     394  }
     395#else
     396#if MOVE_SCALED_OFFSET_TO_PPS
     397  WRITE_UVLC( pcPPS->getNumScaledRefLayerOffsets(),      "num_scaled_ref_layer_offsets" );
     398  for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++)
     399  {
     400    Window scaledWindow = pcPPS->getScaledRefLayerWindow(i);
     401#if O0098_SCALED_REF_LAYER_ID
     402    WRITE_CODE( pcPPS->getScaledRefLayerId(i), 6,          "scaled_ref_layer_id" );
     403#endif
     404    WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
     405    WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
     406    WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
     407    WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
     408  }
     409#endif
     410#endif
     411#if Q0048_CGS_3D_ASYMLUT
     412  UInt uiPos = getNumberOfWrittenBits();
     413  WRITE_FLAG( pcPPS->getCGSFlag() , "colour_mapping_enabled_flag" );
     414  if( pcPPS->getCGSFlag() )
     415  {
     416    assert( pc3DAsymLUT != NULL );
     417    xCode3DAsymLUT( pc3DAsymLUT );
     418  }
     419  pc3DAsymLUT->setPPSBit( getNumberOfWrittenBits() - uiPos );
     420#endif
     421#endif
    337422  }
    338423#else
     
    502587Void TEncCavlc::codeSPS( TComSPS* pcSPS )
    503588{
     589#if R0042_PROFILE_INDICATION
     590  bool bMultiLayerExtSpsFlag = (pcSPS->getNumDirectRefLayers() != 0 ) ;
     591#endif
    504592#if ENC_DEC_TRACE 
    505593  xTraceSPSHeader (pcSPS);
     
    511599#endif
    512600    WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
     601#if SVC_EXTENSION
     602  }
     603#if R0042_PROFILE_INDICATION
     604  else
     605  {
     606    WRITE_CODE(bMultiLayerExtSpsFlag? 7:(pcSPS->getMaxTLayers() - 1) ,  3,       "sps_ext_or_max_sub_layers_minus1" );
     607  }
     608#endif
     609#endif
     610
     611#if SVC_EXTENSION
     612#if !R0042_PROFILE_INDICATION
     613  if(pcSPS->getLayerId() == 0)
     614#else
     615  if(!bMultiLayerExtSpsFlag)
     616#endif
     617  {
     618#endif
    513619    WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "sps_temporal_id_nesting_flag" );
    514620#if SVC_EXTENSION
     
    516622#endif
    517623#ifdef SPS_PTL_FIX
     624#if !R0042_PROFILE_INDICATION
    518625  if (pcSPS->getLayerId() == 0)
     626#else
     627  if(!bMultiLayerExtSpsFlag)
     628#endif
    519629  {
    520630    codePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     
    525635  WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
    526636#if REPN_FORMAT_IN_VPS
     637#if !R0042_PROFILE_INDICATION
    527638  if( pcSPS->getLayerId() > 0 )
     639#else
     640  if(bMultiLayerExtSpsFlag)
     641#endif
    528642  {
    529643    WRITE_FLAG( pcSPS->getUpdateRepFormatFlag(), "update_rep_format_flag" );
    530644  }
     645#if R0042_PROFILE_INDICATION
     646  if( bMultiLayerExtSpsFlag && pcSPS->getUpdateRepFormatFlag())
     647  {
     648    WRITE_CODE( pcSPS->getUpdateRepFormatIndex(), 8,   "sps_rep_format_idx");
     649  }
     650#endif
     651
     652#if R0042_PROFILE_INDICATION
     653  if(!bMultiLayerExtSpsFlag)
     654  {
     655#endif
     656#if !R0042_PROFILE_INDICATION
    531657#if O0096_REP_FORMAT_INDEX
    532658  if( pcSPS->getLayerId() == 0 )
    533659#else
    534660  if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
     661#endif
    535662#endif
    536663  {
     
    548675#if REPN_FORMAT_IN_VPS
    549676  }
     677#if !R0042_PROFILE_INDICATION
    550678#if O0096_REP_FORMAT_INDEX
    551679  else if (pcSPS->getUpdateRepFormatFlag())
     
    555683#endif
    556684#endif
     685#endif
    557686
    558687#if R0156_CONF_WINDOW_IN_REP_FORMAT
    559688#if REPN_FORMAT_IN_VPS
     689#if !R0042_PROFILE_INDICATION
    560690#if O0096_REP_FORMAT_INDEX
    561691  if( pcSPS->getLayerId() == 0 )
     
    563693  if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
    564694#endif 
     695#endif
    565696  {
    566697#endif
     
    590721
    591722#if REPN_FORMAT_IN_VPS
     723#if !R0042_PROFILE_INDICATION
    592724#if O0096_REP_FORMAT_INDEX
    593725  if( pcSPS->getLayerId() == 0 )
    594726#else
    595727  if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
    596 #endif 
     728#endif
     729#endif
    597730  {
    598731    assert( pcSPS->getBitDepthY() >= 8 );
     
    604737  }
    605738#endif
     739#if R0042_PROFILE_INDICATION
     740  }
     741#endif
     742
    606743  WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
    607744
    608745#if SPS_DPB_PARAMS
     746#if !R0042_PROFILE_INDICATION
    609747  if( pcSPS->getLayerId() == 0 )
     748#else
     749  if(!bMultiLayerExtSpsFlag)
     750#endif
    610751  {
    611752#endif
     
    637778  {
    638779#if SCALINGLIST_INFERRING
     780#if !R0042_PROFILE_INDICATION
    639781    if( pcSPS->getLayerId() > 0 )
     782#else
     783    if( bMultiLayerExtSpsFlag)
     784#endif
    640785    {
    641786      WRITE_FLAG( pcSPS->getInferScalingListFlag() ? 1 : 0, "sps_infer_scaling_list_flag" );
     
    706851
    707852#if SVC_EXTENSION
     853#if !R0042_PROFILE_INDICATION
    708854  WRITE_FLAG( pcSPS->getExtensionFlag() ? 1 : 0, "sps_extension_flag" );
     855#else
     856  WRITE_FLAG( pcSPS->getExtensionFlag() ? 1 : 0, "sps_extension_present_flag" );
     857#endif
    709858
    710859  if( pcSPS->getExtensionFlag() )
    711860  {
     861#if !R0042_PROFILE_INDICATION
    712862#if O0142_CONDITIONAL_SPS_EXTENSION
    713863    UInt spsExtensionTypeFlag[8] = { 0, 1, 0, 0, 0, 0, 0, 0 };
     
    723873    codeSPSExtension( pcSPS );
    724874    WRITE_FLAG( 0, "sps_extension2_flag" );
     875#endif
     876#else
     877    WRITE_FLAG( 0, "sps_range_extension_flag" );
     878    WRITE_FLAG( 1, "sps_multilayer_extension_flag" );
     879    WRITE_CODE( 0, 6,  "sps_extension_6bits" );   
     880    codeSPSExtension( pcSPS ); //it is sps_multilayer_extension
    725881#endif
    726882  }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r894 r898  
    985985#if SVC_EXTENSION
    986986  m_cSPS.setExtensionFlag( m_layerId > 0 ? true : false );
    987 
     987#if R0042_PROFILE_INDICATION
     988  m_cSPS.setNumDirectRefLayers(m_numAddLayerSets);
     989#endif
    988990#if Q0078_ADD_LAYER_SETS
    989991  if( !m_numDirectRefLayers && m_numAddLayerSets )
Note: See TracChangeset for help on using the changeset viewer.