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


Ignore:
Timestamp:
14 Jul 2015, 02:49:33 (10 years ago)
Author:
seregin
Message:

port rev 4252

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

Legend:

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

    r1254 r1257  
    301301    }
    302302  }
    303   READ_FLAG( uiCode, "loop_filter_across_slices_enabled_flag" );       pcPPS->setLoopFilterAcrossSlicesEnabledFlag( uiCode ? true : false );
     303  READ_FLAG( uiCode, "pps_loop_filter_across_slices_enabled_flag" );   pcPPS->setLoopFilterAcrossSlicesEnabledFlag( uiCode ? true : false );
    304304  READ_FLAG( uiCode, "deblocking_filter_control_present_flag" );       pcPPS->setDeblockingFilterControlPresentFlag( uiCode ? true : false );
    305305  if(pcPPS->getDeblockingFilterControlPresentFlag())
     
    337337#endif
    338338  {
     339#if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
     340    static const char *syntaxStrings[]={ "pps_range_extension_flag",
     341                                         "pps_multilayer_extension_flag",
     342                                         "pps_extension_6bits[0]",
     343                                         "pps_extension_6bits[1]",
     344                                         "pps_extension_6bits[2]",
     345                                         "pps_extension_6bits[3]",
     346                                         "pps_extension_6bits[4]",
     347                                         "pps_extension_6bits[5]" };
     348#endif
     349
    339350    Bool pps_extension_flags[NUM_PPS_EXTENSION_FLAGS];
    340351    for(Int i=0; i<NUM_PPS_EXTENSION_FLAGS; i++)
    341352    {
    342       READ_FLAG( uiCode, "pps_extension_flag[]" );
     353      READ_FLAG( uiCode, syntaxStrings[i] );
    343354      pps_extension_flags[i] = uiCode!=0;
    344355    }
     
    356367            if (pcPPS->getUseTransformSkip())
    357368            {
    358               READ_UVLC( uiCode, "log2_transform_skip_max_size_minus2");
     369              READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
    359370              pcPPS->setTransformSkipLog2MaxSize(uiCode+2);
    360371            }
    361372
    362             READ_FLAG( uiCode, "cross_component_prediction_flag");
     373            READ_FLAG( uiCode, "cross_component_prediction_enabled_flag");
    363374            pcPPS->setUseCrossComponentPrediction(uiCode != 0);
    364375
    365             READ_FLAG( uiCode, "chroma_qp_adjustment_enabled_flag");
     376            READ_FLAG( uiCode, "chroma_qp_offset_list_enabled_flag");
    366377            if (uiCode == 0)
    367378            {
     
    371382            else
    372383            {
    373               READ_UVLC(uiCode, "diff_cu_chroma_qp_adjustment_depth"); pcPPS->setMaxCuChromaQpAdjDepth(uiCode);
     384              READ_UVLC(uiCode, "diff_cu_chroma_qp_offset_depth"); pcPPS->setMaxCuChromaQpAdjDepth(uiCode);
    374385              UInt tableSizeMinus1 = 0;
    375               READ_UVLC(tableSizeMinus1, "chroma_qp_adjustment_table_size_minus1");
     386              READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");
    376387              /* skip zero index */
    377388              for (Int chromaQpAdjustmentIndex = 1; chromaQpAdjustmentIndex <= (tableSizeMinus1 + 1); chromaQpAdjustmentIndex++)
     
    379390                Int cbOffset;
    380391                Int crOffset;
    381                 READ_SVLC(cbOffset, "cb_qp_adjustment[i]");
    382                 READ_SVLC(crOffset, "cr_qp_adjustment[i]");
     392                READ_SVLC(cbOffset, "cb_qp_offset_list[i]");
     393                READ_SVLC(crOffset, "cr_qp_offset_list[i]");
    383394                pcPPS->setChromaQpAdjTableAt(chromaQpAdjustmentIndex, cbOffset, crOffset);
    384395              }
     
    386397            }
    387398
    388             READ_UVLC( uiCode, "sao_luma_bit_shift");
     399            READ_UVLC( uiCode, "log2_sao_offset_scale_luma");
    389400            pcPPS->setSaoOffsetBitShift(CHANNEL_TYPE_LUMA, uiCode);
    390             READ_UVLC( uiCode, "sao_chroma_bit_shift");
     401            READ_UVLC( uiCode, "log2_sao_offset_scale_chroma");
    391402            pcPPS->setSaoOffsetBitShift(CHANNEL_TYPE_CHROMA, uiCode);
    392403            break;
     
    505516      READ_CODE(8, uiCode, "colour_primaries");                       pcVUI->setColourPrimaries(uiCode);
    506517      READ_CODE(8, uiCode, "transfer_characteristics");               pcVUI->setTransferCharacteristics(uiCode);
    507       READ_CODE(8, uiCode, "matrix_coefficients");                    pcVUI->setMatrixCoefficients(uiCode);
     518      READ_CODE(8, uiCode, "matrix_coeffs");                          pcVUI->setMatrixCoefficients(uiCode);
    508519    }
    509520  }
     
    550561    }
    551562
    552     READ_FLAG(     uiCode, "hrd_parameters_present_flag");              pcVUI->setHrdParametersPresentFlag(uiCode);
     563    READ_FLAG(     uiCode, "vui_hrd_parameters_present_flag");        pcVUI->setHrdParametersPresentFlag(uiCode);
    553564    if( pcVUI->getHrdParametersPresentFlag() )
    554565    {
     
    563574    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    564575    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
    565     READ_UVLC( uiCode, "min_spatial_segmentation_idc");            pcVUI->setMinSpatialSegmentationIdc(uiCode);
     576    READ_UVLC(   uiCode, "min_spatial_segmentation_idc");             pcVUI->setMinSpatialSegmentationIdc(uiCode);
    566577    assert(uiCode < 4096);
    567578    READ_UVLC(   uiCode, "max_bytes_per_pic_denom" );                 pcVUI->setMaxBytesPerPicDenom(uiCode);
    568     READ_UVLC(   uiCode, "max_bits_per_mincu_denom" );                pcVUI->setMaxBitsPerMinCuDenom(uiCode);
     579    READ_UVLC(   uiCode, "max_bits_per_min_cu_denom" );               pcVUI->setMaxBitsPerMinCuDenom(uiCode);
    569580    READ_UVLC(   uiCode, "log2_max_mv_length_horizontal" );           pcVUI->setLog2MaxMvLengthHorizontal(uiCode);
    570581    READ_UVLC(   uiCode, "log2_max_mv_length_vertical" );             pcVUI->setLog2MaxMvLengthVertical(uiCode);
     
    581592    if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() )
    582593    {
    583       READ_FLAG( uiCode, "sub_pic_cpb_params_present_flag" );         hrd->setSubPicCpbParamsPresentFlag( uiCode == 1 ? true : false );
     594      READ_FLAG( uiCode, "sub_pic_hrd_params_present_flag" );         hrd->setSubPicCpbParamsPresentFlag( uiCode == 1 ? true : false );
    584595      if( hrd->getSubPicCpbParamsPresentFlag() )
    585596      {
    586597        READ_CODE( 8, uiCode, "tick_divisor_minus2" );                hrd->setTickDivisorMinus2( uiCode );
    587         READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode );
     598        READ_CODE( 5, uiCode, "du_cpb_removal_delay_increment_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode );
    588599        READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false );
    589600        READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1"  ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode );
     
    802813    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    803814    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    804     READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
     815    READ_UVLC ( uiCode, "sps_max_num_reorder_pics[i]" );
    805816    pcSPS->setNumReorderPics(uiCode, i);
    806817    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
     
    830841  }
    831842#endif
    832   READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" );
     843  READ_UVLC( uiCode, "log2_min_luma_coding_block_size_minus3" );
    833844  Int log2MinCUSize = uiCode + 3;
    834845  pcSPS->setLog2MinCodingBlockSize(log2MinCUSize);
    835   READ_UVLC( uiCode, "log2_diff_max_min_coding_block_size" );
     846  READ_UVLC( uiCode, "log2_diff_max_min_luma_coding_block_size" );
    836847  pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode);
    837848 
     
    844855  pcSPS->setMaxCUWidth  ( 1<<(log2MinCUSize + maxCUDepthDelta) );
    845856  pcSPS->setMaxCUHeight ( 1<<(log2MinCUSize + maxCUDepthDelta) );
    846   READ_UVLC( uiCode, "log2_min_transform_block_size_minus2" );   pcSPS->setQuadtreeTULog2MinSize( uiCode + 2 );
    847 
    848   READ_UVLC( uiCode, "log2_diff_max_min_transform_block_size" ); pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() );
     857  READ_UVLC( uiCode, "log2_min_luma_transform_block_size_minus2" );   pcSPS->setQuadtreeTULog2MinSize( uiCode + 2 );
     858
     859  READ_UVLC( uiCode, "log2_diff_max_min_luma_transform_block_size" ); pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() );
    849860  pcSPS->setMaxTrSize( 1<<(uiCode + pcSPS->getQuadtreeTULog2MinSize()) );
    850861
     
    913924  if (pcSPS->getLongTermRefsPresent())
    914925  {
    915     READ_UVLC( uiCode, "num_long_term_ref_pic_sps" );
     926    READ_UVLC( uiCode, "num_long_term_ref_pics_sps" );
    916927    pcSPS->setNumLongTermRefPicSPS(uiCode);
    917928    for (UInt k = 0; k < pcSPS->getNumLongTermRefPicSPS(); k++)
     
    944955#endif
    945956  {
     957#if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
     958    static const char *syntaxStrings[]={ "sps_range_extension_flag",
     959                                         "sps_multilayer_extension_flag",
     960                                         "sps_extension_6bits[0]",
     961                                         "sps_extension_6bits[1]",
     962                                         "sps_extension_6bits[2]",
     963                                         "sps_extension_6bits[3]",
     964                                         "sps_extension_6bits[4]",
     965                                         "sps_extension_6bits[5]" };
     966#endif
    946967    Bool sps_extension_flags[NUM_SPS_EXTENSION_FLAGS];
     968
    947969    for(Int i=0; i<NUM_SPS_EXTENSION_FLAGS; i++)
    948970    {
    949       READ_FLAG( uiCode, "sps_extension_flag[]" );
     971      READ_FLAG( uiCode, syntaxStrings[i] );
    950972      sps_extension_flags[i] = uiCode!=0;
    951973    }
     
    963985            READ_FLAG( uiCode, "transform_skip_rotation_enabled_flag");     pcSPS->setUseResidualRotation                    (uiCode != 0);
    964986            READ_FLAG( uiCode, "transform_skip_context_enabled_flag");      pcSPS->setUseSingleSignificanceMapContext        (uiCode != 0);
    965             READ_FLAG( uiCode, "residual_dpcm_implicit_enabled_flag");      pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_IMPLICIT, (uiCode != 0));
    966             READ_FLAG( uiCode, "residual_dpcm_explicit_enabled_flag");      pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_EXPLICIT, (uiCode != 0));
     987            READ_FLAG( uiCode, "implicit_rdpcm_enabled_flag");              pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_IMPLICIT, (uiCode != 0));
     988            READ_FLAG( uiCode, "explicit_rdpcm_enabled_flag");              pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_EXPLICIT, (uiCode != 0));
    967989            READ_FLAG( uiCode, "extended_precision_processing_flag");       pcSPS->setUseExtendedPrecision                   (uiCode != 0);
    968990            READ_FLAG( uiCode, "intra_smoothing_disabled_flag");            pcSPS->setDisableIntraReferenceSmoothing         (uiCode != 0);
    969             READ_FLAG( uiCode, "high_precision_prediction_weighting_flag"); pcSPS->setUseHighPrecisionPredictionWeighting    (uiCode != 0);
    970             READ_FLAG( uiCode, "golomb_rice_parameter_adaptation_flag");    pcSPS->setUseGolombRiceParameterAdaptation       (uiCode != 0);
     991            READ_FLAG( uiCode, "high_precision_offsets_enabled_flag");      pcSPS->setUseHighPrecisionPredictionWeighting    (uiCode != 0);
     992            READ_FLAG( uiCode, "persistent_rice_adaptation_enabled_flag");  pcSPS->setUseGolombRiceParameterAdaptation       (uiCode != 0);
    971993            READ_FLAG( uiCode, "cabac_bypass_alignment_enabled_flag");      pcSPS->setAlignCABACBeforeBypass                 (uiCode != 0);
    972994            break;
     
    10051027  assert( pcVPS->getBaseLayerInternalFlag() || pcVPS->getMaxLayers() > 1 );
    10061028#else
    1007   READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
     1029  READ_FLAG( uiCode,      "vps_base_layer_internal_flag" );       assert(uiCode == 1);
     1030  READ_FLAG( uiCode,      "vps_base_layer_available_flag" );      assert(uiCode == 1);
    10081031  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );
    10091032#endif
     
    10111034  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    10121035  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
    1013   READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     1036  READ_CODE( 16, uiCode,  "vps_reserved_0xffff_16bits" );         assert(uiCode == 0xffff);
    10141037  parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
    10151038  UInt subLayerOrderingInfoPresentFlag;
     
    10171040  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
    10181041  {
    1019     READ_UVLC( uiCode,  "vps_max_dec_pic_buffering_minus1[i]" );     pcVPS->setMaxDecPicBuffering( uiCode + 1, i );
    1020     READ_UVLC( uiCode,  "vps_num_reorder_pics[i]" );          pcVPS->setNumReorderPics( uiCode, i );
     1042    READ_UVLC( uiCode,  "vps_max_dec_pic_buffering_minus1[i]" );    pcVPS->setMaxDecPicBuffering( uiCode + 1, i );
     1043    READ_UVLC( uiCode,  "vps_max_num_reorder_pics[i]" );            pcVPS->setNumReorderPics( uiCode, i );
    10211044    READ_UVLC( uiCode,  "vps_max_latency_increase_plus1[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
    10221045
     
    10471070  assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 );
    10481071  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
    1049   READ_CODE( 6, uiCode, "vps_max_nuh_reserved_zero_layer_id" );   pcVPS->setMaxNuhReservedZeroLayerId( uiCode );
    1050   READ_UVLC(    uiCode, "vps_max_op_sets_minus1" );               pcVPS->setMaxOpSets( uiCode + 1 );
     1072  READ_CODE( 6, uiCode, "vps_max_layer_id" );                        pcVPS->setMaxNuhReservedZeroLayerId( uiCode );
     1073  READ_UVLC(    uiCode, "vps_num_layer_sets_minus1" );               pcVPS->setMaxOpSets( uiCode + 1 );
    10511074  for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ )
    10521075  {
     
    10831106    for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ )
    10841107    {
    1085       READ_UVLC( uiCode, "hrd_op_set_idx" );                       pcVPS->setHrdOpSetIdx( uiCode, i );
     1108      READ_UVLC( uiCode, "hrd_layer_set_idx[i]" );                  pcVPS->setHrdOpSetIdx( uiCode, i );
    10861109      if( i > 0 )
    10871110      {
     
    11711194  //!KS: need to add error handling code here, if SPS is not available
    11721195  assert(sps!=0);
     1196
     1197#if SVC_EXTENSION
    11731198  pcSlice->setSPS(sps);
    11741199  pcSlice->setPPS(pps);
    11751200
    1176 #if SVC_EXTENSION
    11771201  TComVPS* vps = parameterSetManager->getVPS(sps->getVPSId());
    11781202  pcSlice->setVPS(vps);
     
    12531277    for (Int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++)
    12541278    {
    1255       READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
     1279      READ_FLAG(uiCode, "slice_reserved_flag[]"); // ignored
    12561280    }
    12571281#endif //SVC_EXTENSION
     
    12661290      pcSlice->setPicOutputFlag( true );
    12671291    }
     1292
     1293    // if (separate_colour_plane_flag == 1)
     1294    //   read colour_plane_id
     1295    //   (separate_colour_plane_flag == 1) is not supported in this version of the standard.
    12681296
    12691297    if( pcSlice->getIdrPicFlag() )
     
    12841312#endif
    12851313    {
    1286       READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb");
     1314      READ_CODE(sps->getBitsForPOC(), uiCode, "slice_pic_order_cnt_lsb");
    12871315#if SVC_EXTENSION
    12881316      pcSlice->setPicOrderCntLsb( uiCode );
     
    14881516      if (sps->getTMVPFlagsPresent())
    14891517      {
    1490         READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" );
     1518        READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" );
    14911519        pcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false );
    14921520      }
     
    18021830      if (numValidComp>COMPONENT_Cb)
    18031831      {
    1804         READ_SVLC( iCode, "slice_qp_delta_cb" );
     1832        READ_SVLC( iCode, "slice_cb_qp_offset" );
    18051833        pcSlice->setSliceChromaQpDelta(COMPONENT_Cb, iCode );
    18061834        assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) >= -12 );
     
    18121840      if (numValidComp>COMPONENT_Cr)
    18131841      {
    1814         READ_SVLC( iCode, "slice_qp_delta_cr" );
     1842        READ_SVLC( iCode, "slice_cr_qp_offset" );
    18151843        pcSlice->setSliceChromaQpDelta(COMPONENT_Cr, iCode );
    18161844        assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) >= -12 );
     
    18231851    if (pps->getChromaQpAdjTableSize() > 0)
    18241852    {
    1825       READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
     1853      READ_FLAG(uiCode, "cu_chroma_qp_offset_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
    18261854    }
    18271855    else
     
    19041932  if(pps->getSliceHeaderExtensionPresentFlag())
    19051933  {
    1906     READ_UVLC( uiCode, "slice_header_extension_length"); sliceHeaderExtensionLength = uiCode;
     1934    READ_UVLC( uiCode, "slice_segment_header_extension_length"); sliceHeaderExtensionLength = uiCode;
    19071935  }
    19081936  else
     
    20122040  if(pps->getSliceHeaderExtensionPresentFlag())
    20132041  {
    2014     READ_UVLC(uiCode,"slice_header_extension_length");
     2042    READ_UVLC(uiCode,"slice_segment_header_extension_length");
    20152043    for(Int i=0; i<uiCode; i++)
    20162044    {
    20172045      UInt ignore;
    2018       READ_CODE(8,ignore,"slice_header_extension_data_byte");
     2046      READ_CODE(8,ignore,"slice_segment_header_extension_data_byte");
    20192047    }
    20202048  }
     
    20712099  if(profilePresentFlag)
    20722100  {
    2073     parseProfileTier(rpcPTL->getGeneralPTL());
     2101    parseProfileTier(rpcPTL->getGeneralPTL(), false);
    20742102  }
    20752103  READ_CODE( 8, uiCode, "general_level_idc" );    rpcPTL->getGeneralPTL()->setLevelIdc(Level::Name(uiCode));
     
    20942122    if( rpcPTL->getSubLayerProfilePresentFlag(i) )
    20952123    {
    2096       parseProfileTier(rpcPTL->getSubLayerPTL(i));
     2124      parseProfileTier(rpcPTL->getSubLayerPTL(i), true);
    20972125    }
    20982126    if(rpcPTL->getSubLayerLevelPresentFlag(i))
     
    21032131}
    21042132
    2105 Void TDecCavlc::parseProfileTier(ProfileTierLevel *ptl)
     2133#if ENC_DEC_TRACE || RExt__DECODER_DEBUG_BIT_STATISTICS
     2134Void TDecCavlc::parseProfileTier(ProfileTierLevel *ptl, const Bool bIsSubLayer)
     2135#define PTL_TRACE_TEXT(txt) bIsSubLayer?("sub_layer_" txt) : ("general_" txt)
     2136#else
     2137Void TDecCavlc::parseProfileTier(ProfileTierLevel *ptl, const Bool /*bIsSubLayer*/)
     2138#define PTL_TRACE_TEXT(txt) txt
     2139#endif
    21062140{
    21072141  UInt uiCode;
    2108   READ_CODE(2 , uiCode, "XXX_profile_space[]");  ptl->setProfileSpace(uiCode);
    2109   READ_FLAG(    uiCode, "XXX_tier_flag[]"    );  ptl->setTierFlag    (uiCode ? Level::HIGH : Level::MAIN);
    2110   READ_CODE(5 , uiCode, "XXX_profile_idc[]"  );  ptl->setProfileIdc  (Profile::Name(uiCode));
     2142  READ_CODE(2 , uiCode,   PTL_TRACE_TEXT("profile_space"                   )); ptl->setProfileSpace(uiCode);
     2143  READ_FLAG(    uiCode,   PTL_TRACE_TEXT("tier_flag"                       )); ptl->setTierFlag    (uiCode ? Level::HIGH : Level::MAIN);
     2144  READ_CODE(5 , uiCode,   PTL_TRACE_TEXT("profile_idc"                     )); ptl->setProfileIdc  (Profile::Name(uiCode));
    21112145  for(Int j = 0; j < 32; j++)
    21122146  {
    2113     READ_FLAG(  uiCode, "XXX_profile_compatibility_flag[][j]");   ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0);
    2114   }
    2115   READ_FLAG(uiCode, "general_progressive_source_flag");
    2116   ptl->setProgressiveSourceFlag(uiCode ? true : false);
    2117 
    2118   READ_FLAG(uiCode, "general_interlaced_source_flag");
    2119   ptl->setInterlacedSourceFlag(uiCode ? true : false);
    2120 
    2121   READ_FLAG(uiCode, "general_non_packed_constraint_flag");
    2122   ptl->setNonPackedConstraintFlag(uiCode ? true : false);
    2123 
    2124   READ_FLAG(uiCode, "general_frame_only_constraint_flag");
    2125   ptl->setFrameOnlyConstraintFlag(uiCode ? true : false);
    2126 
    2127   if (ptl->getProfileIdc() == Profile::MAINREXT || ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT )
     2147    READ_FLAG(  uiCode,   PTL_TRACE_TEXT("profile_compatibility_flag[][j]" )); ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0);
     2148  }
     2149  READ_FLAG(uiCode,       PTL_TRACE_TEXT("progressive_source_flag"         )); ptl->setProgressiveSourceFlag(uiCode ? true : false);
     2150
     2151  READ_FLAG(uiCode,       PTL_TRACE_TEXT("interlaced_source_flag"          )); ptl->setInterlacedSourceFlag(uiCode ? true : false);
     2152
     2153  READ_FLAG(uiCode,       PTL_TRACE_TEXT("non_packed_constraint_flag"      )); ptl->setNonPackedConstraintFlag(uiCode ? true : false);
     2154
     2155  READ_FLAG(uiCode,       PTL_TRACE_TEXT("frame_only_constraint_flag"      )); ptl->setFrameOnlyConstraintFlag(uiCode ? true : false);
     2156
     2157  if (ptl->getProfileIdc() == Profile::MAINREXT           || ptl->getProfileCompatibilityFlag(Profile::MAINREXT) ||
     2158      ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT || ptl->getProfileCompatibilityFlag(Profile::HIGHTHROUGHPUTREXT))
    21282159  {
    21292160    UInt maxBitDepth=16;
    2130     READ_FLAG(    uiCode, "general_max_12bit_constraint_flag" ); if (uiCode) maxBitDepth=12;
    2131     READ_FLAG(    uiCode, "general_max_10bit_constraint_flag" ); if (uiCode) maxBitDepth=10;
    2132     READ_FLAG(    uiCode, "general_max_8bit_constraint_flag"  ); if (uiCode) maxBitDepth=8;
     2161    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_12bit_constraint_flag"       )); if (uiCode) maxBitDepth=12;
     2162    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_10bit_constraint_flag"       )); if (uiCode) maxBitDepth=10;
     2163    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_8bit_constraint_flag"        )); if (uiCode) maxBitDepth=8;
    21332164    ptl->setBitDepthConstraint(maxBitDepth);
    21342165    ChromaFormat chromaFmtConstraint=CHROMA_444;
    2135     READ_FLAG(    uiCode, "general_max_422chroma_constraint_flag"  ); if (uiCode) chromaFmtConstraint=CHROMA_422;
    2136     READ_FLAG(    uiCode, "general_max_420chroma_constraint_flag"  ); if (uiCode) chromaFmtConstraint=CHROMA_420;
    2137     READ_FLAG(    uiCode, "general_max_monochrome_constraint_flag" ); if (uiCode) chromaFmtConstraint=CHROMA_400;
     2166    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_422chroma_constraint_flag"   )); if (uiCode) chromaFmtConstraint=CHROMA_422;
     2167    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_420chroma_constraint_flag"   )); if (uiCode) chromaFmtConstraint=CHROMA_420;
     2168    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_monochrome_constraint_flag"  )); if (uiCode) chromaFmtConstraint=CHROMA_400;
    21382169    ptl->setChromaFormatConstraint(chromaFmtConstraint);
    2139     READ_FLAG(    uiCode, "general_intra_constraint_flag");          ptl->setIntraConstraintFlag(uiCode != 0);
    2140     READ_FLAG(    uiCode, "general_one_picture_only_constraint_flag");
    2141     READ_FLAG(    uiCode, "general_lower_bit_rate_constraint_flag"); ptl->setLowerBitRateConstraintFlag(uiCode != 0);
     2170    READ_FLAG(    uiCode, PTL_TRACE_TEXT("intra_constraint_flag"           )); ptl->setIntraConstraintFlag(uiCode != 0);
     2171    READ_FLAG(    uiCode, PTL_TRACE_TEXT("one_picture_only_constraint_flag"));
     2172    READ_FLAG(    uiCode, PTL_TRACE_TEXT("lower_bit_rate_constraint_flag"  )); ptl->setLowerBitRateConstraintFlag(uiCode != 0);
    21422173#if SVC_EXTENSION
    21432174    READ_CODE(32, uiCode, "general_reserved_zero_34bits");  READ_CODE(2, uiCode, "general_reserved_zero_34bits");
     
    21642195    READ_CODE(32,  uiCode, "general_reserved_zero_43bits");  READ_CODE(11,  uiCode, "general_reserved_zero_43bits");
    21652196  }
    2166 
    2167   if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 ) ||
    2168       ptl->getProfileCompatibilityFlag(1) || ptl->getProfileCompatibilityFlag(2) ||
    2169       ptl->getProfileCompatibilityFlag(3) || ptl->getProfileCompatibilityFlag(4) ||
    2170       ptl->getProfileCompatibilityFlag(5)                                           )
    2171   {
    2172     READ_FLAG(uiCode, "general_inbld_flag");
    2173   }
    2174   else
    2175   {
    2176     READ_FLAG(uiCode, "general_reserved_zero_bit");
    2177   }
    21782197#else
    2179     READ_CODE(16, uiCode, "XXX_reserved_zero_35bits[0..15]");
    2180     READ_CODE(16, uiCode, "XXX_reserved_zero_35bits[16..31]");
    2181     READ_CODE(3,  uiCode, "XXX_reserved_zero_35bits[32..34]");
     2198    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_34bits[0..15]"     ));
     2199    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_34bits[16..31]"    ));
     2200    READ_CODE(2,  uiCode, PTL_TRACE_TEXT("reserved_zero_34bits[32..33]"    ));
    21822201  }
    21832202  else
     
    21872206    ptl->setIntraConstraintFlag(false);
    21882207    ptl->setLowerBitRateConstraintFlag(true);
    2189     READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[0..15]");
    2190     READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]");
    2191     READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]");
    2192   }
    2193 #endif
     2208    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[0..15]"     ));
     2209    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[16..31]"    ));
     2210    READ_CODE(11, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[32..42]"    ));
     2211  }
     2212#endif
     2213
     2214  if ((ptl->getProfileIdc() >= Profile::MAIN && ptl->getProfileIdc() <= Profile::HIGHTHROUGHPUTREXT) ||
     2215       ptl->getProfileCompatibilityFlag(Profile::MAIN) ||
     2216       ptl->getProfileCompatibilityFlag(Profile::MAIN10) ||
     2217       ptl->getProfileCompatibilityFlag(Profile::MAINSTILLPICTURE) ||
     2218       ptl->getProfileCompatibilityFlag(Profile::MAINREXT) ||
     2219       ptl->getProfileCompatibilityFlag(Profile::HIGHTHROUGHPUTREXT) )
     2220  {
     2221#if SVC_EXTENSION
     2222    READ_FLAG(    uiCode, PTL_TRACE_TEXT("inbld_flag"                      ));
     2223#else
     2224    READ_FLAG(    uiCode, PTL_TRACE_TEXT("inbld_flag"                      )); assert(uiCode == 0);
     2225#endif
     2226  }
     2227  else
     2228  {
     2229    READ_FLAG(    uiCode, PTL_TRACE_TEXT("reserved_zero_bit"               ));
     2230  }
     2231#undef PTL_TRACE_TEXT
    21942232}
    21952233
     
    23872425  Int iDeltaDenom;
    23882426  // decode delta_luma_log2_weight_denom :
    2389   READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" );     // ue(v): luma_log2_weight_denom
     2427  READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" );
    23902428  assert( uiLog2WeightDenomLuma <= 7 );
    23912429  if( bChroma )
    23922430  {
    2393     READ_SVLC( iDeltaDenom, "delta_chroma_log2_weight_denom" );     // se(v): delta_chroma_log2_weight_denom
     2431    READ_SVLC( iDeltaDenom, "delta_chroma_log2_weight_denom" );
    23942432    assert((iDeltaDenom + (Int)uiLog2WeightDenomLuma)>=0);
    23952433    assert((iDeltaDenom + (Int)uiLog2WeightDenomLuma)<=7);
     
    23972435  }
    23982436
    2399   for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ )
     2437  for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ ) // loop over l0 and l1 syntax elements
    24002438  {
    24012439    RefPicList  eRefPicList = ( iNumRef ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
     
    24112449
    24122450      UInt  uiCode;
    2413       READ_FLAG( uiCode, "luma_weight_lX_flag" );           // u(1): luma_weight_l0_flag
     2451      READ_FLAG( uiCode, iNumRef==0?"luma_weight_l0_flag[i]":"luma_weight_l1_flag[i]" );
    24142452      wp[COMPONENT_Y].bPresentFlag = ( uiCode == 1 );
    24152453      uiTotalSignalledWeightFlags += wp[COMPONENT_Y].bPresentFlag;
     
    24212459      {
    24222460        pcSlice->getWpScaling(eRefPicList, iRefIdx, wp);
    2423         READ_FLAG( uiCode, "chroma_weight_lX_flag" );      // u(1): chroma_weight_l0_flag
     2461        READ_FLAG( uiCode, iNumRef==0?"chroma_weight_l0_flag[i]":"chroma_weight_l1_flag[i]" );
    24242462        for(Int j=1; j<numValidComp; j++)
    24252463        {
     
    24352473      {
    24362474        Int iDeltaWeight;
    2437         READ_SVLC( iDeltaWeight, "delta_luma_weight_lX" );  // se(v): delta_luma_weight_l0[i]
     2475        READ_SVLC( iDeltaWeight, iNumRef==0?"delta_luma_weight_l0[i]":"delta_luma_weight_l1[i]" );
    24382476        assert( iDeltaWeight >= -128 );
    24392477        assert( iDeltaWeight <=  127 );
    24402478        wp[COMPONENT_Y].iWeight = (iDeltaWeight + (1<<wp[COMPONENT_Y].uiLog2WeightDenom));
    2441         READ_SVLC( wp[COMPONENT_Y].iOffset, "luma_offset_lX" );       // se(v): luma_offset_l0[i]
     2479        READ_SVLC( wp[COMPONENT_Y].iOffset, iNumRef==0?"luma_offset_l0[i]":"luma_offset_l1[i]" );
    24422480        Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<g_bitDepth[CHANNEL_TYPE_LUMA])/2 : 128;
    24432481        assert( wp[0].iOffset >= -range );
     
    24572495          {
    24582496            Int iDeltaWeight;
    2459             READ_SVLC( iDeltaWeight, "delta_chroma_weight_lX" );  // se(v): chroma_weight_l0[i][j]
     2497            READ_SVLC( iDeltaWeight, iNumRef==0?"delta_chroma_weight_l0[i]":"delta_chroma_weight_l1[i]" );
    24602498            assert( iDeltaWeight >= -128 );
    24612499            assert( iDeltaWeight <=  127 );
     
    24632501
    24642502            Int iDeltaChroma;
    2465             READ_SVLC( iDeltaChroma, "delta_chroma_offset_lX" );  // se(v): delta_chroma_offset_l0[i][j]
     2503            READ_SVLC( iDeltaChroma, iNumRef==0?"delta_chroma_offset_l0[i]":"delta_chroma_offset_l1[i]" );
    24662504            assert( iDeltaChroma >= -4*range);
    24672505            assert( iDeltaChroma <   4*range);
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r1235 r1257  
    8383  Void  parseSEI            ( SEIMessages& );
    8484  Void  parsePTL            ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 );
    85   Void  parseProfileTier    (ProfileTierLevel *ptl);
     85  Void  parseProfileTier    (ProfileTierLevel *ptl, const Bool bIsSubLayer);
    8686  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
    8787  Void  parseSliceHeader    ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager);
Note: See TracChangeset for help on using the changeset viewer.