Changeset 644 in SHVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
25 Mar 2014, 21:51:30 (11 years ago)
Author:
seregin
Message:

merge with SHM-5.1-dev branch

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibEncoder/SEIwrite.cpp

    r595 r644  
    105105#endif
    106106#if SUB_BITSTREAM_PROPERTY_SEI
    107     case SEI::SUB_BITSTREAM_PROPERTY:
    108       fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
    109       break;
     107  case SEI::SUB_BITSTREAM_PROPERTY:
     108    fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
     109    break;
     110#endif
     111#if O0164_MULTI_LAYER_HRD
     112  case SEI::BSP_NESTING:
     113    fprintf( g_hTrace, "=========== Bitstream partition nesting SEI message ===========\n");
     114    break;
     115  case SEI::BSP_INITIAL_ARRIVAL_TIME:
     116    fprintf( g_hTrace, "=========== Bitstream parition initial arrival time SEI message ===========\n");
     117    break;
     118  case SEI::BSP_HRD:
     119    fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n");
     120    break;
    110121#endif
    111122#endif //SVC_EXTENSION
     
    117128#endif
    118129
     130#if O0164_MULTI_LAYER_HRD
     131void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei)
     132#else
    119133void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)
     134#endif
    120135{
    121136  switch (sei.payloadType())
     
    161176    break;
    162177  case SEI::SCALABLE_NESTING:
     178#if O0164_MULTI_LAYER_HRD
     179    xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), vps, sps);
     180#else
    163181    xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps);
     182#endif
    164183    break;
    165184#if SVC_EXTENSION
     
    179198     break;
    180199#endif
     200#if O0164_MULTI_LAYER_HRD
     201   case SEI::BSP_NESTING:
     202     xWriteSEIBspNesting(bs, *static_cast<const SEIBspNesting*>(&sei), vps, sps, nestingSei);
     203     break;
     204   case SEI::BSP_INITIAL_ARRIVAL_TIME:
     205     xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei), vps, sps, nestingSei, bspNestingSei);
     206     break;
     207   case SEI::BSP_HRD:
     208     xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei);
     209     break;
     210#endif
    181211#endif //SVC_EXTENSION
    182212  default:
     
    189219 * in bitstream bs.
    190220 */
     221#if O0164_MULTI_LAYER_HRD
     222Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)
     223#else
    191224Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps)
     225#endif
    192226{
    193227  /* calculate how large the payload data is */
     
    202236  g_HLSTraceEnable = false;
    203237#endif
     238#if O0164_MULTI_LAYER_HRD
     239  xWriteSEIpayloadData(bs_count, sei, vps, sps, *nestingSei, *bspNestingSei);
     240#else
    204241  xWriteSEIpayloadData(bs_count, sei, sps);
     242#endif
    205243#if ENC_DEC_TRACE
    206244  g_HLSTraceEnable = traceEnable;
     
    237275#endif
    238276
     277#if O0164_MULTI_LAYER_HRD
     278  xWriteSEIpayloadData(bs, sei, vps, sps, *nestingSei, *bspNestingSei);
     279#else
    239280  xWriteSEIpayloadData(bs, sei, sps);
     281#endif
    240282}
    241283
     
    367409    }
    368410  }
     411#if P0138_USE_ALT_CPB_PARAMS_FLAG
     412  if (sei.m_useAltCpbParamsFlagPresent)
     413  {
     414    WRITE_FLAG( sei.m_useAltCpbParamsFlag, "use_alt_cpb_params_flag");
     415  }
     416#endif
    369417  xWriteByteAlign();
    370418}
     
    571619}
    572620
     621#if O0164_MULTI_LAYER_HRD
     622Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps)
     623#else
    573624Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)
     625#endif
    574626{
    575627  WRITE_FLAG( sei.m_bitStreamSubsetFlag,             "bitstream_subset_flag"         );
     
    581633    for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++)
    582634    {
    583       WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );
    584635      WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3,  "nesting_max_temporal_id"       );
    585636      WRITE_UVLC( sei.m_nestingOpIdx[i],                  "nesting_op_idx"                );
     
    609660  for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++)
    610661  {
     662#if O0164_MULTI_LAYER_HRD
     663    writeSEImessage(bs, *(*it), vps, sps, &sei);
     664#else
    611665    writeSEImessage(bs, *(*it), sps);
     666#endif
    612667  }
    613668}
     
    693748}
    694749#endif
     750
     751#if O0164_MULTI_LAYER_HRD
     752Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei)
     753{
     754  WRITE_UVLC( sei.m_bspIdx, "bsp_idx" );
     755
     756  while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
     757  {
     758    WRITE_FLAG( 0, "bsp_nesting_zero_bit" );
     759  }
     760
     761  // write nested SEI messages
     762  for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++)
     763  {
     764    writeSEImessage(bs, *(*it), vps, sps, &nestingSei, &sei);
     765  }
     766}
     767
     768Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei)
     769{
     770  assert(vps->getVpsVuiPresentFlag());
     771
     772  UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);
     773  UInt len;
     774  UInt hrdIdx;
     775
     776  if (schedCombCnt > 0)
     777  {
     778    hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);
     779  }
     780  else
     781  {
     782    hrdIdx = 0;
     783  }
     784
     785  TComHRD *hrd = vps->getBspHrd(hrdIdx);
     786
     787  if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())
     788  {
     789    len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;
     790  }
     791  else
     792  {
     793    len = 23 + 1;
     794  }
     795
     796  if (hrd->getNalHrdParametersPresentFlag())
     797  {
     798    for(UInt i = 0; i < schedCombCnt; i++)
     799    {
     800      WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" );
     801    }
     802  }
     803  else
     804  {
     805    for(UInt i = 0; i < schedCombCnt; i++)
     806    {
     807      WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" );
     808    }
     809  }
     810}
     811
     812Void SEIWriter::xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei)
     813{
     814  WRITE_UVLC( sei.m_seiNumBspHrdParametersMinus1, "sei_num_bsp_hrd_parameters_minus1" );
     815  for (UInt i = 0; i <= sei.m_seiNumBspHrdParametersMinus1; i++)
     816  {
     817    if (i > 0)
     818    {
     819      WRITE_FLAG( sei.m_seiBspCprmsPresentFlag[i], "sei_bsp_cprms_present_flag" );
     820    }
     821    xCodeHrdParameters(sei.hrd, i==0 ? 1 : sei.m_seiBspCprmsPresentFlag[i], nestingSei.m_nestingMaxTemporalIdPlus1[0]-1);
     822  }
     823  for (UInt h = 0; h <= nestingSei.m_nestingNumOpsMinus1; h++)
     824  {
     825    UInt lsIdx = nestingSei.m_nestingOpIdx[h];
     826    WRITE_UVLC( sei.m_seiNumBitstreamPartitionsMinus1[lsIdx], "num_sei_bitstream_partitions_minus1[i]");
     827    for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++)
     828    {
     829      for (UInt j = 0; j < sei.m_vpsMaxLayers; j++)
     830      {
     831        if (sei.m_layerIdIncludedFlag[lsIdx][j])
     832        {
     833          WRITE_FLAG( sei.m_seiLayerInBspFlag[lsIdx][i][j], "sei_layer_in_bsp_flag[lsIdx][i][j]" );
     834        }
     835      }
     836    }
     837    WRITE_UVLC( sei.m_seiNumBspSchedCombinationsMinus1[lsIdx], "sei_num_bsp_sched_combinations_minus1[i]");
     838    for (UInt i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++)
     839    {
     840      for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++)
     841      {
     842        WRITE_UVLC( sei.m_seiBspCombHrdIdx[lsIdx][i][j], "sei_bsp_comb_hrd_idx[lsIdx][i][j]");
     843        WRITE_UVLC( sei.m_seiBspCombScheddx[lsIdx][i][j], "sei_bsp_comb_sched_idx[lsIdx][i][j]");
     844      }
     845    }
     846  }
     847}
     848
     849Void SEIWriter::xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 )
     850{
     851  if( commonInfPresentFlag )
     852  {
     853    WRITE_FLAG( hrd->getNalHrdParametersPresentFlag() ? 1 : 0 ,  "nal_hrd_parameters_present_flag" );
     854    WRITE_FLAG( hrd->getVclHrdParametersPresentFlag() ? 1 : 0 ,  "vcl_hrd_parameters_present_flag" );
     855    if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() )
     856    {
     857      WRITE_FLAG( hrd->getSubPicCpbParamsPresentFlag() ? 1 : 0,  "sub_pic_cpb_params_present_flag" );
     858      if( hrd->getSubPicCpbParamsPresentFlag() )
     859      {
     860        WRITE_CODE( hrd->getTickDivisorMinus2(), 8,              "tick_divisor_minus2" );
     861        WRITE_CODE( hrd->getDuCpbRemovalDelayLengthMinus1(), 5,  "du_cpb_removal_delay_length_minus1" );
     862        WRITE_FLAG( hrd->getSubPicCpbParamsInPicTimingSEIFlag() ? 1 : 0, "sub_pic_cpb_params_in_pic_timing_sei_flag" );
     863        WRITE_CODE( hrd->getDpbOutputDelayDuLengthMinus1(), 5,   "dpb_output_delay_du_length_minus1"  );
     864      }
     865      WRITE_CODE( hrd->getBitRateScale(), 4,                     "bit_rate_scale" );
     866      WRITE_CODE( hrd->getCpbSizeScale(), 4,                     "cpb_size_scale" );
     867      if( hrd->getSubPicCpbParamsPresentFlag() )
     868      {
     869        WRITE_CODE( hrd->getDuCpbSizeScale(), 4,                "du_cpb_size_scale" );
     870      }
     871      WRITE_CODE( hrd->getInitialCpbRemovalDelayLengthMinus1(), 5, "initial_cpb_removal_delay_length_minus1" );
     872      WRITE_CODE( hrd->getCpbRemovalDelayLengthMinus1(),        5, "au_cpb_removal_delay_length_minus1" );
     873      WRITE_CODE( hrd->getDpbOutputDelayLengthMinus1(),         5, "dpb_output_delay_length_minus1" );
     874    }
     875  }
     876  Int i, j, nalOrVcl;
     877  for( i = 0; i <= maxNumSubLayersMinus1; i ++ )
     878  {
     879    WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0,          "fixed_pic_rate_general_flag");
     880    if( !hrd->getFixedPicRateFlag( i ) )
     881    {
     882      WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag");
     883    }
     884    else
     885    {
     886      hrd->setFixedPicRateWithinCvsFlag( i, true );
     887    }
     888    if( hrd->getFixedPicRateWithinCvsFlag( i ) )
     889    {
     890      WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ),           "elemental_duration_in_tc_minus1");
     891    }
     892    else
     893    {
     894      WRITE_FLAG( hrd->getLowDelayHrdFlag( i ) ? 1 : 0,           "low_delay_hrd_flag");
     895    }
     896    if (!hrd->getLowDelayHrdFlag( i ))
     897    {
     898      WRITE_UVLC( hrd->getCpbCntMinus1( i ),                      "cpb_cnt_minus1");
     899    }
     900   
     901    for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
     902    {
     903      if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) ||
     904          ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) )
     905      {
     906        for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ )
     907        {
     908          WRITE_UVLC( hrd->getBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_value_minus1");
     909          WRITE_UVLC( hrd->getCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_value_minus1");
     910          if( hrd->getSubPicCpbParamsPresentFlag() )
     911          {
     912            WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 
     913            WRITE_UVLC( hrd->getDuBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_du_value_minus1");
     914          }
     915          WRITE_FLAG( hrd->getCbrFlag( i, j, nalOrVcl ) ? 1 : 0, "cbr_flag");
     916        }
     917      }
     918    }
     919  }
     920}
     921
     922#endif
     923
    695924#endif //SVC_EXTENSION
    696925
  • trunk/source/Lib/TLibEncoder/SEIwrite.h

    r595 r644  
    4747  virtual ~SEIWriter() {};
    4848
     49#if O0164_MULTI_LAYER_HRD
     50  void writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);
     51#else
    4952  void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps);
     53#endif
    5054
    5155protected:
     56#if O0164_MULTI_LAYER_HRD
     57  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei);
     58#else
    5259  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);
     60#endif
    5361  Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei);
    5462  Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei);
     
    6573  Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei);
    6674  Void xWriteSEISOPDescription(const SEISOPDescription& sei);
     75#if O0164_MULTI_LAYER_HRD
     76  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps);
     77#else
    6778  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
     79#endif
    6880  Void xWriteByteAlign();
    6981#if SVC_EXTENSION
     
    7789  Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
    7890#endif
     91#if O0164_MULTI_LAYER_HRD
     92  Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei);
     93  Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei);
     94  Void xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei);
     95  Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
     96#endif
    7997#endif //SVC_EXTENSION
    8098};
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r595 r644  
    251251  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
    252252  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
     253#if P0166_MODIFIED_PPS_EXTENSION
     254  WRITE_FLAG( 1, "pps_extension_flag" );
     255  if( 1 ) //pps_extension_flag
     256  {
     257#if !POC_RESET_IDC
     258    UInt ppsExtensionTypeFlag[8] = { 0, 1, 0, 0, 0, 0, 0, 0 };
     259#else
     260    UInt ppsExtensionTypeFlag[8] = { 1, 0, 0, 0, 0, 0, 0, 0 };
     261#endif
     262    for (UInt i = 0; i < 8; i++)
     263    {
     264      WRITE_FLAG( ppsExtensionTypeFlag[i], "pps_extension_type_flag" );
     265    }
     266#if POC_RESET_IDC
     267    if( ppsExtensionTypeFlag[0] )
     268    {
     269      WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag() ? 1 : 0, "poc_reset_info_present_flag" );
     270#endif
     271    }
     272  }
     273#else
    253274  WRITE_FLAG( 0, "pps_extension_flag" );
     275#endif
    254276}
    255277
     
    496518  WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
    497519
     520#if SPS_DPB_PARAMS
     521  if( pcSPS->getLayerId() == 0 )
     522  {
     523#endif
    498524  const Bool subLayerOrderingInfoPresentFlag = 1;
    499525  WRITE_FLAG(subLayerOrderingInfoPresentFlag,       "sps_sub_layer_ordering_info_present_flag");
     
    508534    }
    509535  }
     536#if SPS_DPB_PARAMS
     537  }
     538#endif
    510539  assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() );
    511540 
     
    632661      WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
    633662      WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
     663#if P0312_VERT_PHASE_ADJ
     664      WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_position_enable_flag" );
     665#endif
    634666    }
    635667  }
     
    776808{
    777809  // ... More syntax elements to be written here
     810#if P0300_ALT_OUTPUT_LAYER_FLAG
     811  Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1];
     812  Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1];
     813#endif
    778814#if VPS_EXTN_MASK_AND_DIM_INFO
    779815  UInt i = 0, j = 0;
     
    887923    if (vps->getMaxTSLayersPresentFlag())
    888924    {
    889         for( i = 0; i < vps->getMaxLayers() - 1; i++)
     925        for( i = 0; i < vps->getMaxLayers(); i++)
    890926        {
    891927            WRITE_CODE(vps->getMaxTSLayersMinus1(i), 3, "sub_layers_vps_max_minus1[i]" );
     
    9931029#endif
    9941030      Int lsIdx = vps->getOutputLayerSetIdx(i);
     1031#if NUM_OL_FLAGS
     1032      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++)
     1033#else
    9951034      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
     1035#endif
    9961036      {
    9971037        WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]");
     
    10041044    }
    10051045    WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" );     
    1006   }
    1007 
     1046#if P0300_ALT_OUTPUT_LAYER_FLAG
     1047    NumOutputLayersInOutputLayerSet[i] = 0;
     1048    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
     1049    for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++)
     1050    {
     1051      NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j);
     1052      if (vps->getOutputLayerFlag(i, j))
     1053      {
     1054        OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j);
     1055      }
     1056    }
     1057    if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0)
     1058    {
     1059      WRITE_FLAG(vps->getAltOuputLayerFlag(i), "alt_output_layer_flag[i]");
     1060    }
     1061#endif
     1062  }
     1063
     1064#if !P0300_ALT_OUTPUT_LAYER_FLAG
    10081065#if O0153_ALT_OUTPUT_LAYER_FLAG
    10091066  if( vps->getMaxLayers() > 1 )
     
    10111068    WRITE_FLAG( vps->getAltOuputLayerFlag(), "alt_output_layer_flag" );   
    10121069  }
     1070#endif
    10131071#endif
    10141072
     
    11241182#if P0307_VPS_NON_VUI_EXTENSION
    11251183  WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" );
     1184#if P0307_VPS_NON_VUI_EXT_UPDATE
     1185  for (i = 1; i <= vps->getVpsNonVuiExtLength(); i++)
     1186  {
     1187    WRITE_CODE(1, 8, "vps_non_vui_extension_data_byte");
     1188  }
     1189#else
    11261190  if ( vps->getVpsNonVuiExtLength() > 0 )
    11271191  {
    11281192    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
    11291193  }
     1194#endif
    11301195#endif
    11311196
     
    12171282Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps)
    12181283{
     1284#if DPB_PARAMS_MAXTLAYERS
     1285    Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()];
     1286    for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
     1287    {
     1288        UInt maxSLMinus1 = 0;
     1289#if CHANGE_NUMSUBDPB_IDX
     1290        Int optLsIdx = vps->getOutputLayerSetIdx( i );
     1291#else
     1292        Int optLsIdx = i;
     1293#endif
     1294        for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) {
     1295            Int  lId = vps->getLayerSetLayerIdList(optLsIdx, k);
     1296            maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId)));
     1297        }
     1298        MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1;
     1299    }
     1300#endif
     1301   
    12191302  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
    12201303  {
     
    12221305    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
    12231306#endif
    1224     WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 
     1307    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]");
     1308#if DPB_PARAMS_MAXTLAYERS
     1309    for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++)
     1310#else
    12251311    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1312#endif
    12261313    {
    12271314      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
     
    12661353#if IRAP_ALIGN_FLAG_IN_VPS_VUI
    12671354    WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
     1355#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
     1356    if(vps->getCrossLayerIrapAlignFlag())
     1357    {
     1358       WRITE_FLAG(vps->getCrossLayerAlignedIdrOnlyFlag(), "only_idr_for_IRAP_across_layers");
     1359    }
     1360#endif
    12681361#endif
    12691362#if O0223_PICTURE_TYPES_ALIGN_FLAG
     
    13751468  WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
    13761469#endif
     1470#endif
     1471#if P0312_VERT_PHASE_ADJ
     1472  WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" );
    13771473#endif
    13781474#if N0160_VUI_EXT_ILP_REF
     
    14241520#endif
    14251521#endif
     1522#if O0164_MULTI_LAYER_HRD
     1523    WRITE_FLAG(vps->getVpsVuiBspHrdPresentFlag(), "vps_vui_bsp_hrd_present_flag" );
     1524    if (vps->getVpsVuiBspHrdPresentFlag())
     1525    {
     1526      WRITE_UVLC( vps->getVpsNumBspHrdParametersMinus1(), "vps_num_bsp_hrd_parameters_minus1" );
     1527      for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
     1528      {
     1529        if( i > 0 )
     1530        {
     1531          WRITE_FLAG( vps->getBspCprmsPresentFlag(i), "bsp_cprms_present_flag[i]" );
     1532        }
     1533        codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
     1534      }
     1535      for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )
     1536      {
     1537        WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]");
     1538        for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ )
     1539        {
     1540          for( j = 0; j <= (vps->getMaxLayers()-1); j++ )
     1541          {
     1542            if (vps->getLayerIdIncludedFlag(h, j))
     1543            {
     1544              WRITE_FLAG( vps->getLayerInBspFlag(h, i, j), "layer_in_bsp_flag[h][i][j]" );
     1545            }
     1546          }
     1547        }
     1548        if (vps->getNumBitstreamPartitions(h))
     1549        {
     1550          WRITE_UVLC( vps->getNumBspSchedCombinations(h), "num_bsp_sched_combinations[h]");
     1551          for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ )
     1552          {
     1553            for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ )
     1554            {
     1555              WRITE_UVLC( vps->getBspCombHrdIdx(h, i, j), "bsp_comb_hrd_idx[h][i][j]");
     1556              WRITE_UVLC( vps->getBspCombSchedIdx(h, i, j), "bsp_comb_sched_idx[h][i][j]");
     1557            }
     1558          }
     1559        }
     1560      }
     1561    }
     1562#endif
     1563#if P0182_VPS_VUI_PS_FLAG
     1564    for(i = 1; i < vps->getMaxLayers(); i++)
     1565    {
     1566      if(vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0)
     1567      {
     1568        if ((vps->getSPSId(i) == 0) && (vps->getPPSId(i) == 0))
     1569        {
     1570          vps->setBaseLayerPSCompatibilityFlag(i, 1);
     1571          WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" );
     1572        }
     1573        else
     1574        {
     1575          vps->setBaseLayerPSCompatibilityFlag(i, 0);
     1576        }
     1577      }
     1578    }
     1579#endif
    14261580}
    14271581#endif
     
    14581612  if ( pcSlice->getRapPicFlag() )
    14591613  {
     1614#if NO_OUTPUT_OF_PRIOR_PICS
     1615    WRITE_FLAG( pcSlice->getNoOutputOfPriorPicsFlag(), "no_output_of_prior_pics_flag" );
     1616#else
    14601617    WRITE_FLAG( 0, "no_output_of_prior_pics_flag" );
     1618#endif
    14611619  }
    14621620  WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" );
     
    16901848#if ILP_SSH_SIG
    16911849#if ILP_SSH_SIG_FIX
    1692     if((pcSlice->getSPS()->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )
    1693 #else
    1694     if((pcSlice->getSPS()->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) )
    1695 #endif
    1696 #else
    1697     if((pcSlice->getSPS()->getLayerId() > 0)  &&  (pcSlice->getNumILRRefIdx() > 0) )
     1850    if((pcSlice->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )
     1851#else
     1852    if((pcSlice->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) )
     1853#endif
     1854#else
     1855    if((pcSlice->getLayerId() > 0)  &&  (pcSlice->getNumILRRefIdx() > 0) )
    16981856#endif
    16991857    {
     
    17261884      }
    17271885    }     
     1886#if P0312_VERT_PHASE_ADJ
     1887    for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
     1888    {
     1889      UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
     1890      if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
     1891      {
     1892        WRITE_FLAG( pcSlice->getVertPhasePositionFlag(refLayerIdc), "vert_phase_position_flag" );
     1893      }
     1894    }
     1895#endif
    17281896#endif //SVC_EXTENSION
    17291897
     
    18862054    }
    18872055  }
     2056
     2057#if !POC_RESET_IDC_SIGNALLING   // Wrong place to put slice header extension
    18882058  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
    18892059  {
    18902060    WRITE_UVLC(0,"slice_header_extension_length");
    18912061  }
     2062#endif
    18922063}
    18932064
     
    20252196}
    20262197
     2198#if POC_RESET_IDC_SIGNALLING
     2199Void  TEncCavlc::codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow )
     2200{
     2201  Int tmpBitsBeforeWriting = getNumberOfWrittenBits();
     2202  if(slice->getPPS()->getSliceHeaderExtensionPresentFlag())
     2203  {
     2204    // Derive the value of PocMsbValRequiredFlag
     2205    slice->setPocMsbValRequiredFlag( slice->getCraPicFlag() || slice->getBlaPicFlag()
     2206                                          /* || related to vps_poc_lsb_aligned_flag */
     2207                                          );
     2208
     2209    // Determine value of SH extension length.
     2210    Int shExtnLengthInBit = 0;
     2211    if (slice->getPPS()->getPocResetInfoPresentFlag())
     2212    {
     2213      shExtnLengthInBit += 2;
     2214    }
     2215    if (slice->getPocResetIdc() > 0)
     2216    {
     2217      shExtnLengthInBit += 6;
     2218    }
     2219    if (slice->getPocResetIdc() == 3)
     2220    {
     2221      shExtnLengthInBit += (slice->getSPS()->getBitsForPOC() + 1);
     2222    }
     2223
     2224
     2225    if( !slice->getPocMsbValRequiredFlag() /* &&  vps_poc_lsb_aligned_flag */ )
     2226    {
     2227      shExtnLengthInBit++;
     2228    }
     2229    else
     2230    {
     2231      if( slice->getPocMsbValRequiredFlag() )
     2232      {
     2233        slice->setPocMsbValPresentFlag( true );
     2234      }
     2235      else
     2236      {
     2237        slice->setPocMsbValPresentFlag( false );
     2238      }
     2239    }
     2240
     2241    if( slice->getPocMsbValPresentFlag() )
     2242    {
     2243      UInt lengthVal = 1;
     2244      UInt tempVal = slice->getPocMsbVal() + 1;
     2245      assert ( tempVal );
     2246      while( 1 != tempVal )
     2247      {
     2248        tempVal >>= 1;
     2249        lengthVal += 2;
     2250      }
     2251      shExtnLengthInBit += lengthVal;
     2252    }
     2253    Int shExtnAdditionalBits = 0;
     2254    if(shExtnLengthInBit % 8 != 0)
     2255    {
     2256      shExtnAdditionalBits = 8 - (shExtnLengthInBit % 8);
     2257    }
     2258    Int shExtnLength = (shExtnLengthInBit + shExtnAdditionalBits) / 8;
     2259    WRITE_UVLC( shExtnLength, "slice_header_extension_length" );
     2260
     2261    if(slice->getPPS()->getPocResetInfoPresentFlag())
     2262    {
     2263      WRITE_CODE( slice->getPocResetIdc(), 2,                                 "poc_reset_idc");
     2264    }
     2265    if(slice->getPocResetIdc() > 0)
     2266    {
     2267      WRITE_CODE( slice->getPocResetPeriodId(), 6,                            "poc_reset_period_id");
     2268    }
     2269    if(slice->getPocResetIdc() == 3)
     2270    {
     2271      WRITE_FLAG( slice->getFullPocResetFlag() ? 1 : 0,                       "full_poc_reset_flag");
     2272      WRITE_CODE( slice->getPocLsbVal(), slice->getSPS()->getBitsForPOC(),  "poc_lsb_val");
     2273    }
     2274
     2275    if( !slice->getPocMsbValRequiredFlag() /* &&  vps_poc_lsb_aligned_flag */ )
     2276    {
     2277      WRITE_FLAG( slice->getPocMsbValPresentFlag(),                           "poc_msb_val_present_flag" );
     2278    }
     2279    if( slice->getPocMsbValPresentFlag() )
     2280    {
     2281      WRITE_UVLC( slice->getPocMsbVal(),                                      "poc_msb_val" );
     2282    }
     2283    for (Int i = 0; i < shExtnAdditionalBits; i++)
     2284    {
     2285      WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit");
     2286    }
     2287  }
     2288  shBitsWrittenTillNow += ( getNumberOfWrittenBits() - tmpBitsBeforeWriting );
     2289 
     2290  // Slice header byte_alignment() included in xAttachSliceDataToNalUnit
     2291}
     2292#endif
     2293
    20272294Void TEncCavlc::codeTerminatingBit      ( UInt uilsLast )
    20282295{
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r595 r644  
    9696  Void  codeHrdParameters       ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    9797  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
     98#if POC_RESET_IDC_SIGNALLING
     99  Void  codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow );
     100#endif
    98101  Void  codeTerminatingBit      ( UInt uilsLast );
    99102  Void  codeSliceFinish         ();
    100103 
    101104  Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList );
     105#if SVC_EXTENSION
     106  Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);}
     107#else
    102108  Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);}
     109#endif
    103110  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    104111  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r595 r644  
    386386
    387387  Window   &getConformanceWindow()                           { return m_conformanceWindow; }
     388#if P0312_VERT_PHASE_ADJ
     389  Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false); }
     390#else
    388391  Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); }
     392#endif
    389393
    390394  Void      setFramesToBeEncoded            ( Int   i )      { m_framesToBeEncoded = i; }
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r595 r644  
    6060}
    6161
     62#if POC_RESET_IDC_SIGNALLING
     63Void  TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow )
     64{
     65  m_pcEntropyCoderIf->codeSliceHeaderExtn( pSlice, shBitsWrittenTillNow );
     66}
     67#endif
     68
    6269Void TEncEntropy::encodeTerminatingBit      ( UInt uiIsLast )
    6370{
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r595 r644  
    7474
    7575  virtual Void  codeTilesWPPEntryPoint  ( TComSlice* pSlice )     = 0;
     76#if POC_RESET_IDC_SIGNALLING
     77  virtual Void  codeSliceHeaderExtn     ( TComSlice* pSlice, Int shBitsWrittenTillNow )     = 0;
     78#endif
    7679  virtual Void  codeTerminatingBit      ( UInt uilsLast )                                       = 0;
    7780  virtual Void  codeSliceFinish         ()                                                      = 0;
     
    105108  virtual Void codeCoeffNxN      ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0;
    106109  virtual Void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType ) = 0;
     110#if SVC_EXTENSION
     111  virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false)    =0;
     112#else
    107113  virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false)    =0;
     114#endif
    108115  virtual Void estBit               (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0;
    109116 
     
    138145  Void    encodeSliceHeader         ( TComSlice* pcSlice );
    139146  Void    encodeTilesWPPEntryPoint( TComSlice* pSlice );
     147#if POC_RESET_IDC_SIGNALLING
     148Void      encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow );
     149#endif
    140150  Void    encodeTerminatingBit      ( UInt uiIsLast );
    141151  Void    encodeSliceFinish         ();
     
    184194 
    185195  Void estimateBit             ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType);
     196#if SVC_EXTENSION
     197  Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);}
     198#else
    186199  Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);}
     200#endif
    187201  static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize );
    188202
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r595 r644  
    303303    //nalu = NALUnit(NAL_UNIT_SEI);
    304304    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     305#if O0164_MULTI_LAYER_HRD
     306    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     307#else
    305308    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     309#endif
    306310    writeRBSPTrailingBits(nalu.m_Bitstream);
    307311    accessUnit.push_back(new NALUnitEBSP(nalu));
     
    316320    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
    317321    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     322#if O0164_MULTI_LAYER_HRD
     323    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     324#else
    318325    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     326#endif
    319327    writeRBSPTrailingBits(nalu.m_Bitstream);
    320328    accessUnit.push_back(new NALUnitEBSP(nalu));
     
    327335    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
    328336    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     337#if O0164_MULTI_LAYER_HRD
     338    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     339#else
    329340    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     341#endif
    330342    writeRBSPTrailingBits(nalu.m_Bitstream);
    331343    accessUnit.push_back(new NALUnitEBSP(nalu));
     
    338350    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
    339351    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     352#if O0164_MULTI_LAYER_HRD
     353    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     354#else
    340355    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     356#endif
    341357    writeRBSPTrailingBits(nalu.m_Bitstream);
    342358    accessUnit.push_back(new NALUnitEBSP(nalu));
     
    350366    SEILayersNotPresent *sei = xCreateSEILayersNotPresent ();
    351367    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     368#if O0164_MULTI_LAYER_HRD
     369    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     370#else
    352371    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     372#endif
    353373    writeRBSPTrailingBits(nalu.m_Bitstream);
    354374    accessUnit.push_back(new NALUnitEBSP(nalu));
     
    364384    nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, m_pcCfg->getNumLayer()-1); // For highest layer
    365385    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     386#if O0164_MULTI_LAYER_HRD
     387    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     388#else
    366389    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     390#endif
    367391    writeRBSPTrailingBits(nalu.m_Bitstream);
    368392    accessUnit.push_back(new NALUnitEBSP(nalu));
     
    797821          Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
    798822#endif*/
     823#if P0312_VERT_PHASE_ADJ
     824          //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom
     825          if( scalEL.getVertPhasePositionEnableFlag() )
     826          {
     827            pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc );
     828          }
     829#endif
    799830#if O0215_PHASE_ALIGNMENT
    800831#if O0194_JOINT_US_BITSHIFT
     
    928959      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP());
    929960    }
     961#if ALIGNED_BUMPING
     962    pcSlice->checkLeadingPictureRestrictions(rcListPic);
     963#endif
    930964    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    931965
     
    17161750      xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS());
    17171751
     1752#if O0164_MULTI_LAYER_HRD
     1753      if (pcSlice->getLayerId() == 0 && m_pcEncTop->getVPS()->getVpsVuiBspHrdPresentFlag())
     1754      {
     1755        nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, 1);
     1756        m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
     1757        m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     1758        SEIScalableNesting *scalableBspNestingSei = xCreateBspNestingSEI(pcSlice);
     1759        m_seiWriter.writeSEImessage(nalu.m_Bitstream, *scalableBspNestingSei, m_pcEncTop->getVPS(), pcSlice->getSPS());
     1760        writeRBSPTrailingBits(nalu.m_Bitstream);
     1761
     1762        UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
     1763        UInt offsetPosition = m_activeParameterSetSEIPresentInAU
     1764          + m_bufferingPeriodSEIPresentInAU
     1765          + m_pictureTimingSEIPresentInAU
     1766          + m_nestedPictureTimingSEIPresentInAU;  // Insert SEI after APS, BP and PT SEI
     1767        AccessUnit::iterator it;
     1768        for(j = 0, it = accessUnit.begin(); j < seiPositionInAu + offsetPosition; j++)
     1769        {
     1770          it++;
     1771        }
     1772        accessUnit.insert(it, new NALUnitEBSP(nalu));
     1773      }
     1774#endif
     1775
    17181776      m_bSeqFirst = false;
    17191777    }
     
    17501808      SOPDescriptionSEI.m_numPicsInSopMinus1 = i - 1;
    17511809
     1810#if O0164_MULTI_LAYER_HRD
     1811      m_seiWriter.writeSEImessage( nalu.m_Bitstream, SOPDescriptionSEI, m_pcEncTop->getVPS(), pcSlice->getSPS());
     1812#else
    17521813      m_seiWriter.writeSEImessage( nalu.m_Bitstream, SOPDescriptionSEI, pcSlice->getSPS());
     1814#endif
    17531815      writeRBSPTrailingBits(nalu.m_Bitstream);
    17541816      accessUnit.push_back(new NALUnitEBSP(nalu));
     
    18341896      sei_buffering_period.m_dpbDelayOffset = 0;
    18351897
     1898#if O0164_MULTI_LAYER_HRD
     1899      m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, m_pcEncTop->getVPS(), pcSlice->getSPS());
     1900#else
    18361901      m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, pcSlice->getSPS());
     1902#endif
    18371903      writeRBSPTrailingBits(nalu.m_Bitstream);
    18381904      {
     
    18551921        scalableNestingSEI.m_nestedSEIs.clear();
    18561922        scalableNestingSEI.m_nestedSEIs.push_back(&sei_buffering_period);
     1923#if O0164_MULTI_LAYER_HRD
     1924        m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS());
     1925#else
    18571926        m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, pcSlice->getSPS());
     1927#endif
    18581928        writeRBSPTrailingBits(naluTmp.m_Bitstream);
    18591929        UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
     
    18841954        seiGradualDecodingRefreshInfo.m_gdrForegroundFlag = true; // Indicating all "foreground"
    18851955
     1956#if O0164_MULTI_LAYER_HRD
     1957        m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiGradualDecodingRefreshInfo, m_pcEncTop->getVPS(), pcSlice->getSPS() );
     1958#else
    18861959        m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiGradualDecodingRefreshInfo, pcSlice->getSPS() );
     1960#endif
    18871961        writeRBSPTrailingBits(nalu.m_Bitstream);
    18881962        accessUnit.push_back(new NALUnitEBSP(nalu));
     
    19021976      sei_recovery_point.m_brokenLinkFlag    = false;
    19031977
     1978#if O0164_MULTI_LAYER_HRD
     1979      m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, m_pcEncTop->getVPS(), pcSlice->getSPS() );
     1980#else
    19041981      m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, pcSlice->getSPS() );
     1982#endif
    19051983      writeRBSPTrailingBits(nalu.m_Bitstream);
    19061984      accessUnit.push_back(new NALUnitEBSP(nalu));
     
    21282206            m_pcEntropyCoder->setEntropyCoder   ( m_pcCavlcCoder, pcSlice );
    21292207            m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     2208#if !POC_RESET_IDC_SIGNALLING
    21302209            m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice );
     2210#else
     2211            tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits();
     2212            m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice );
     2213            actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting );
     2214            m_pcEntropyCoder->encodeSliceHeaderExtn( pcSlice, actualHeadBits );
     2215#endif
    21312216
    21322217            // Substreams...
     
    22692354        /* write the SEI messages */
    22702355        m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
     2356#if O0164_MULTI_LAYER_HRD
     2357        m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recon_picture_digest, m_pcEncTop->getVPS(), pcSlice->getSPS());
     2358#else
    22712359        m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recon_picture_digest, pcSlice->getSPS());
     2360#endif
    22722361        writeRBSPTrailingBits(nalu.m_Bitstream);
    22732362
     
    22932382        /* write the SEI messages */
    22942383        m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
     2384#if O0164_MULTI_LAYER_HRD
     2385        m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_temporal_level0_index, m_pcEncTop->getVPS(), pcSlice->getSPS());
     2386#else
    22952387        m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_temporal_level0_index, pcSlice->getSPS());
     2388#endif
    22962389        writeRBSPTrailingBits(nalu.m_Bitstream);
    22972390
     
    24432536          m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
    24442537          pictureTimingSEI.m_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0;
     2538#if O0164_MULTI_LAYER_HRD
     2539          m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS());
     2540#else
    24452541          m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS());
     2542#endif
    24462543          writeRBSPTrailingBits(nalu.m_Bitstream);
    24472544          UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
     
    24622559            scalableNestingSEI.m_nestedSEIs.clear();
    24632560            scalableNestingSEI.m_nestedSEIs.push_back(&pictureTimingSEI);
     2561#if O0164_MULTI_LAYER_HRD
     2562            m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS());
     2563#else
    24642564            m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, pcSlice->getSPS());
     2565#endif
    24652566            writeRBSPTrailingBits(nalu.m_Bitstream);
    24662567            UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
     
    24942595            {
    24952596              // Insert before the first slice.
     2597#if O0164_MULTI_LAYER_HRD
     2598              m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, m_pcEncTop->getVPS(), pcSlice->getSPS());
     2599#else
    24962600              m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, pcSlice->getSPS());
     2601#endif
    24972602              writeRBSPTrailingBits(nalu.m_Bitstream);
    24982603
     
    25162621                {
    25172622                  // Insert before the first slice.
     2623#if O0164_MULTI_LAYER_HRD
     2624                  m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, m_pcEncTop->getVPS(), pcSlice->getSPS());
     2625#else
    25182626                  m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, pcSlice->getSPS());
     2627#endif
    25192628                  writeRBSPTrailingBits(nalu.m_Bitstream);
    25202629
     
    36523761}
    36533762#endif
     3763
     3764#if O0164_MULTI_LAYER_HRD
     3765SEIScalableNesting* TEncGOP::xCreateBspNestingSEI(TComSlice *pcSlice)
     3766{
     3767  SEIScalableNesting *seiScalableNesting = new SEIScalableNesting();
     3768  SEIBspInitialArrivalTime *seiBspInitialArrivalTime = new SEIBspInitialArrivalTime();
     3769  SEIBspNesting *seiBspNesting = new SEIBspNesting();
     3770  SEIBufferingPeriod *seiBufferingPeriod = new SEIBufferingPeriod();
     3771
     3772  // Scalable nesting SEI
     3773
     3774  seiScalableNesting->m_bitStreamSubsetFlag           = 1;      // If the nested SEI messages are picture buffereing SEI mesages, picure timing SEI messages or sub-picture timing SEI messages, bitstream_subset_flag shall be equal to 1
     3775  seiScalableNesting->m_nestingOpFlag                 = 1;
     3776  seiScalableNesting->m_defaultOpFlag                 = 0;
     3777  seiScalableNesting->m_nestingNumOpsMinus1           = 0;      //nesting_num_ops_minus1
     3778  seiScalableNesting->m_nestingOpIdx[0]               = 1;
     3779  seiScalableNesting->m_allLayersFlag                 = 0;
     3780  seiScalableNesting->m_nestingNoOpMaxTemporalIdPlus1 = 6 + 1;  //nesting_no_op_max_temporal_id_plus1
     3781  seiScalableNesting->m_nestingNumLayersMinus1        = 1 - 1;  //nesting_num_layers_minus1
     3782  seiScalableNesting->m_nestingLayerId[0]             = 0;
     3783  seiScalableNesting->m_callerOwnsSEIs                = true;
     3784
     3785  // Bitstream partition nesting SEI
     3786
     3787  seiBspNesting->m_bspIdx = 0;
     3788  seiBspNesting->m_callerOwnsSEIs = true;
     3789
     3790  // Buffering period SEI
     3791
     3792  UInt uiInitialCpbRemovalDelay = (90000/2);                      // 0.5 sec
     3793  seiBufferingPeriod->m_initialCpbRemovalDelay      [0][0]     = uiInitialCpbRemovalDelay;
     3794  seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][0]     = uiInitialCpbRemovalDelay;
     3795  seiBufferingPeriod->m_initialCpbRemovalDelay      [0][1]     = uiInitialCpbRemovalDelay;
     3796  seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][1]     = uiInitialCpbRemovalDelay;
     3797
     3798  Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale();
     3799
     3800  UInt uiTmp = (UInt)( dTmp * 90000.0 );
     3801  uiInitialCpbRemovalDelay -= uiTmp;
     3802  uiInitialCpbRemovalDelay -= uiTmp / ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2 );
     3803  seiBufferingPeriod->m_initialAltCpbRemovalDelay      [0][0]  = uiInitialCpbRemovalDelay;
     3804  seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][0]  = uiInitialCpbRemovalDelay;
     3805  seiBufferingPeriod->m_initialAltCpbRemovalDelay      [0][1]  = uiInitialCpbRemovalDelay;
     3806  seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][1]  = uiInitialCpbRemovalDelay;
     3807
     3808  seiBufferingPeriod->m_rapCpbParamsPresentFlag              = 0;
     3809  //for the concatenation, it can be set to one during splicing.
     3810  seiBufferingPeriod->m_concatenationFlag = 0;
     3811  //since the temporal layer HRD is not ready, we assumed it is fixed
     3812  seiBufferingPeriod->m_auCpbRemovalDelayDelta = 1;
     3813  seiBufferingPeriod->m_cpbDelayOffset = 0;
     3814  seiBufferingPeriod->m_dpbDelayOffset = 0;
     3815
     3816  // Intial arrival time SEI message
     3817
     3818  seiBspInitialArrivalTime->m_nalInitialArrivalDelay[0] = 0;
     3819  seiBspInitialArrivalTime->m_vclInitialArrivalDelay[0] = 0;
     3820
     3821
     3822  seiBspNesting->m_nestedSEIs.push_back(seiBufferingPeriod);
     3823  seiBspNesting->m_nestedSEIs.push_back(seiBspInitialArrivalTime);
     3824  seiScalableNesting->m_nestedSEIs.push_back(seiBspNesting); // BSP nesting SEI is contained in scalable nesting SEI
     3825
     3826  return seiScalableNesting;
     3827}
     3828#endif
     3829
    36543830#endif //SVC_EXTENSION
    36553831
  • trunk/source/Lib/TLibEncoder/TEncGOP.h

    r595 r644  
    211211  SEIInterLayerConstrainedTileSets* xCreateSEIInterLayerConstrainedTileSets();
    212212#endif
     213#if O0164_MULTI_LAYER_HRD
     214  SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice);
     215#endif
    213216#endif //SVC_EXTENSION
    214217};// END CLASS DEFINITION TEncGOP
  • trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r595 r644  
    463463  Int bitDepth = (compIdx== SAO_Y) ? g_bitDepthY : g_bitDepthC;
    464464  Int shift = 2 * DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8);
     465#if SVC_EXTENSION
     466  Int offsetTh = getSaoMaxOffsetQVal()[compIdx];  //inclusive
     467#else
    465468  Int offsetTh = g_saoMaxOffsetQVal[compIdx];  //inclusive
     469#endif
    466470
    467471  ::memset(quantOffsets, 0, sizeof(Int)*MAX_NUM_SAO_CLASSES);
     
    582586  modeParam[SAO_Y ].modeIdc = SAO_MODE_OFF;
    583587  m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]);
     588#if SVC_EXTENSION
     589  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true);
     590#else
    584591  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true);
     592#endif
    585593  m_pcRDGoOnSbacCoder->store(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]);
    586594
     
    590598  modeParam[compIdx].modeIdc = SAO_MODE_OFF;
    591599  m_pcRDGoOnSbacCoder->resetBits();
     600#if SVC_EXTENSION
     601  m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal());
     602#else
    592603  m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx]);
     604#endif
    593605  modeDist[compIdx] = 0;
    594606  minCost= m_lambda[compIdx]*((Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits());
     
    613625      m_pcRDGoOnSbacCoder->load(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]);
    614626      m_pcRDGoOnSbacCoder->resetBits();
     627#if SVC_EXTENSION
     628      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal());
     629#else
    615630      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]);
     631#endif
    616632      rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
    617633      cost = (Double)dist[compIdx] + m_lambda[compIdx]*((Double)rate);
     
    638654    modeDist [component] = 0;
    639655
     656#if SVC_EXTENSION
     657    m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component], getSaoMaxOffsetQVal());
     658#else
    640659    m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component]);
     660#endif
    641661
    642662    const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
     
    672692      dist[compIdx]= getDistortion(ctu, compIdx, typeIdc, testOffset[compIdx].typeAuxInfo, invQuantOffset, blkStats[ctu][compIdx][typeIdc]);
    673693
     694#if SVC_EXTENSION
     695      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal());
     696#else
    674697      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]);
     698#endif
    675699
    676700      const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
     
    699723  m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]);
    700724  m_pcRDGoOnSbacCoder->resetBits();
     725#if SVC_EXTENSION
     726  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     727#else
    701728  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     729#endif
    702730  modeNormCost += (Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
    703731
     
    742770    m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]);
    743771    m_pcRDGoOnSbacCoder->resetBits();
     772#if SVC_EXTENSION
     773    m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     774#else
    744775    m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     776#endif
    745777    Int rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
    746778
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r595 r644  
    266266}
    267267
     268#if POC_RESET_IDC_SIGNALLING
     269Void  TEncSbac::codeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow )
     270{
     271  assert (0);
     272  return;
     273}
     274#endif
    268275Void TEncSbac::codeTerminatingBit( UInt uilsLast )
    269276{
     
    15921599}
    15931600
     1601#if SVC_EXTENSION
     1602Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal)
     1603#else
    15941604Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled)
     1605#endif
    15951606{
    15961607  UInt uiSymbol;
     
    16391650    for(Int i=0; i< 4; i++)
    16401651    {
     1652#if SVC_EXTENSION
     1653      codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]),  saoMaxOffsetQVal[compIdx] ); //sao_offset_abs
     1654#else
    16411655      codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]),  g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs
     1656#endif
    16421657    }
    16431658
     
    16691684
    16701685Void TEncSbac::codeSAOBlkParam(SAOBlkParam& saoBlkParam
     1686#if SVC_EXTENSION
     1687                              , UInt* saoMaxOffsetQVal
     1688#endif
    16711689                              , Bool* sliceEnabled
    16721690                              , Bool leftMergeAvail
     
    17001718    for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++)
    17011719    {
     1720#if SVC_EXTENSION
     1721      codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx], saoMaxOffsetQVal);
     1722#else
    17021723      codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx]);
     1724#endif
    17031725    }
    17041726  }
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r595 r644  
    9595  Void  codeSliceHeader         ( TComSlice* pcSlice );
    9696  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
     97#if POC_RESET_IDC_SIGNALLING
     98  Void  codeSliceHeaderExtn     ( TComSlice* pSlice, Int shBitsWrittenTillNow );
     99#endif
    97100  Void  codeTerminatingBit      ( UInt uilsLast      );
    98101  Void  codeSliceFinish         ();
     
    104107  Void  codeScalingList      ( TComScalingList* /*scalingList*/     ){ assert (0);  return;};
    105108
     109#if SVC_EXTENSION
     110  Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal);
     111  Void codeSAOBlkParam(SAOBlkParam& saoBlkParam
     112                    , UInt* saoMaxOffsetQVal
     113                    , Bool* sliceEnabled
     114                    , Bool leftMergeAvail
     115                    , Bool aboveMergeAvail
     116                    , Bool onlyEstMergeInfo = false
     117                    );
     118#else
    106119  Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled);
    107120  Void codeSAOBlkParam(SAOBlkParam& saoBlkParam
     
    111124                    , Bool onlyEstMergeInfo = false
    112125                    );
     126#endif 
    113127
    114128private:
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r595 r644  
    13561356        }
    13571357
     1358#if SVC_EXTENSION
     1359        m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerId()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail);
     1360#else
    13581361        m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam,sliceEnabled, leftMergeAvail, aboveMergeAvail);
     1362#endif
    13591363      }
    13601364    }
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r595 r644  
    791791          TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
    792792#endif
     793#if O0194_DIFFERENT_BITDEPTH_EL_BL
     794          UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i);
     795          Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] );
     796
     797          if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths )
     798#else
    793799          if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets )
     800#endif
    794801          {
    795802            pcEPic->setSpatialEnhLayerFlag( i, true );
     
    846853          TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
    847854#endif
     855#if O0194_DIFFERENT_BITDEPTH_EL_BL
     856          UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i);
     857          Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] );
     858
     859          if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths )
     860#else
    848861          if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets )
     862#endif
    849863          {
    850864            rpcPic->setSpatialEnhLayerFlag( i, true );
     
    902916#endif
    903917    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
     918#if P0312_VERT_PHASE_ADJ
     919    m_cSPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() );
     920#endif
    904921  }
    905922#endif //SVC_EXTENSION
  • trunk/source/Lib/TLibEncoder/TEncTop.h

    r595 r644  
    139139#endif
    140140  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
     141#if P0312_VERT_PHASE_ADJ
     142  Bool                    m_vertPhasePositionEnableFlag[MAX_LAYERS];
     143#endif
    141144#if POC_RESET_FLAG
    142145  Int                     m_pocAdjustmentValue;
     
    213216  /// encode several number of pictures until end-of-sequence
    214217#if SVC_EXTENSION
    215   Void                    setLayerEnc(TEncTop** p) {m_ppcTEncTop = p;}
    216   TEncTop**               getLayerEnc()            {return m_ppcTEncTop;}
    217   Int                     getPOCLast            () { return m_iPOCLast;               }
    218   Int                     getNumPicRcvd         () { return m_iNumPicRcvd;            }
    219   Void                    setNumPicRcvd         ( Int num ) { m_iNumPicRcvd = num;      }
    220   Void                    setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }
    221   UInt                    getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }
     218  Void      setLayerEnc(TEncTop** p)            { m_ppcTEncTop = p;                  }
     219  TEncTop** getLayerEnc()                       { return m_ppcTEncTop;               }
     220  Int       getPOCLast            ()            { return m_iPOCLast;                 }
     221  Int       getNumPicRcvd         ()            { return m_iNumPicRcvd;              }
     222  Void      setNumPicRcvd         ( Int num )   { m_iNumPicRcvd = num;               }
     223  Void      setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
     224  UInt      getNumScaledRefLayerOffsets()      { return m_numScaledRefLayerOffsets; }
    222225#if O0098_SCALED_REF_LAYER_ID
    223   Void                    setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
    224   UInt                    getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
    225   Window&  getScaledRefLayerWindowForLayer(Int layerId);
    226 #endif
    227   Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
     226  Void      setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
     227  UInt      getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
     228  Window&   getScaledRefLayerWindowForLayer(Int layerId);
     229#endif
     230  Window&   getScaledRefLayerWindow(Int x)                 { return m_scaledRefLayerWindow[x];        }
     231#if P0312_VERT_PHASE_ADJ
     232  Void      setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b;    }
     233  UInt      getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
     234#endif
     235
    228236  TComPic** getIlpList() { return m_cIlpPic; }
    229237#if REF_IDX_MFM
    230   Void      setMFMEnabledFlag       (Bool flag)   {m_bMFMEnabledFlag = flag;}
    231   Bool      getMFMEnabledFlag()                   {return m_bMFMEnabledFlag;}   
     238  Void      setMFMEnabledFlag       (Bool flag)   { m_bMFMEnabledFlag = flag; }
     239  Bool      getMFMEnabledFlag()                   { return m_bMFMEnabledFlag; }   
    232240#endif
    233241#if O0194_WEIGHTED_PREDICTION_CGS
     
    247255#endif
    248256#if POC_RESET_FLAG
    249   Int  getPocAdjustmentValue()      { return m_pocAdjustmentValue;}
    250   Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x;   }
     257  Int       getPocAdjustmentValue()      { return m_pocAdjustmentValue;}
     258  Void      setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x;   }
    251259#endif
    252260#if NO_CLRAS_OUTPUT_FLAG
Note: See TracChangeset for help on using the changeset viewer.