Ignore:
Timestamp:
13 Jul 2013, 15:51:26 (12 years ago)
Author:
tech
Message:

Update to HM 11.0.

Location:
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/SEIread.cpp

    r446 r537  
    9090    fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n");
    9191    break;
    92 #if J0149_TONE_MAPPING_SEI
    9392  case SEI::TONE_MAPPING_INFO:
    9493    fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");
    9594    break;
    96 #endif
    97 #if L0208_SOP_DESCRIPTION_SEI
    9895  case SEI::SOP_DESCRIPTION:
    9996    fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n");
    10097    break;
    101 #endif
    102 #if K0180_SCALABLE_NESTING_SEI
    10398  case SEI::SCALABLE_NESTING:
    10499    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
    105100    break;
    106 #endif
    107101  default:
    108102    fprintf( g_hTrace, "=========== Unknown SEI message ===========\n");
     
    234228      xParseSEIGradualDecodingRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize);
    235229      break;
    236 #if J0149_TONE_MAPPING_SEI
    237230    case SEI::TONE_MAPPING_INFO:
    238231      sei = new SEIToneMappingInfo;
    239232      xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);
    240233      break;
    241 #endif
    242 #if L0208_SOP_DESCRIPTION_SEI
    243234    case SEI::SOP_DESCRIPTION:
    244235      sei = new SEISOPDescription;
    245236      xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize);
    246237      break;
    247 #endif
    248 #if K0180_SCALABLE_NESTING_SEI
    249238    case SEI::SCALABLE_NESTING:
    250239      sei = new SEIScalableNesting;
    251240      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);
    252241      break;
    253 #endif
    254242    default:
    255243      for (UInt i = 0; i < payloadSize; i++)
     
    265253    switch (payloadType)
    266254    {
    267 #if L0363_SEI_ALLOW_SUFFIX
    268255      case SEI::USER_DATA_UNREGISTERED:
    269256        sei = new SEIuserDataUnregistered;
    270257        xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize);
    271258        break;
    272 #endif
    273259      case SEI::DECODED_PICTURE_HASH:
    274260        sei = new SEIDecodedPictureHash;
     
    402388  UInt val;
    403389  READ_CODE(4, val, "active_vps_id");      sei.activeVPSId = val;
    404 #if L0047_APS_FLAGS
    405390  READ_FLAG( val, "full_random_access_flag");  sei.m_fullRandomAccessFlag = val ? true : false;
    406391  READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;
    407 #endif
    408392  READ_UVLC(   val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
    409393
     
    438422    sei.m_duSptCpbRemovalDelay = 0;
    439423  }
    440 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    441424  READ_FLAG( val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = val ? true : false;
    442425  if(sei.m_dpbOutputDuDelayPresentFlag)
     
    445428    sei.m_picSptDpbOutputDuDelay = val;
    446429  }
    447 #endif
    448430  xParseByteAlign();
    449431}
     
    462444    READ_FLAG( code, "rap_cpb_params_present_flag" );                   sei.m_rapCpbParamsPresentFlag = code;
    463445  }
    464 #if L0328_SPLICING
    465446  //read splicing flag and cpb_removal_delay_delta
    466447  READ_FLAG( code, "concatenation_flag");
     
    468449  READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" );
    469450  sei.m_auCpbRemovalDelayDelta = code + 1;
    470 #endif
    471 #if L0044_CPB_DPB_DELAY_OFFSET
    472451  if( sei.m_rapCpbParamsPresentFlag )
    473452  {
     
    475454    READ_CODE( pHRD->getDpbOutputDelayLengthMinus1()  + 1, code, "dpb_delay_offset" );      sei.m_dpbDelayOffset = code;
    476455  }
    477 #endif
    478456  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    479457  {
     
    507485  TComHRD *hrd = vui->getHrdParameters();
    508486
    509 #if !L0045_CONDITION_SIGNALLING
    510   // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added
    511   if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() )
    512   {
    513     return;
    514   }
    515 #endif
    516 
    517487  if( vui->getFrameFieldInfoPresentFlag() )
    518488  {
    519489    READ_CODE( 4, code, "pic_struct" );             sei.m_picStruct            = code;
    520 #if L0046_RENAME_PROG_SRC_IDC
    521490    READ_CODE( 2, code, "source_scan_type" );       sei.m_sourceScanType = code;
    522 #else
    523     READ_CODE( 2, code, "progressive_source_idc" ); sei.m_progressiveSourceIdc = code;
    524 #endif
    525491    READ_FLAG(    code, "duplicate_flag" );         sei.m_duplicateFlag        = ( code == 1 ? true : false );
    526492  }
    527493
    528 #if L0045_CONDITION_SIGNALLING
    529494  if( hrd->getCpbDpbDelaysPresentFlag())
    530495  {
    531 #endif
    532496    READ_CODE( ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_minus1" );
    533497    sei.m_auCpbRemovalDelay = code + 1;
     
    535499    sei.m_picDpbOutputDelay = code;
    536500
    537 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    538501    if(hrd->getSubPicCpbParamsPresentFlag())
    539502    {
     
    541504      sei.m_picDpbOutputDuDelay = code;
    542505    }
    543 #endif
    544506    if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() )
    545507    {
     
    575537      }
    576538    }
    577 #if L0045_CONDITION_SIGNALLING
    578   }
    579 #endif
     539  }
    580540  xParseByteAlign();
    581541}
     
    598558  {
    599559    READ_CODE( 7, val, "frame_packing_arrangement_type" );          sei.m_arrangementType = val;
    600 #if L0444_FPA_TYPE
    601560    assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) );
    602 #endif
    603561    READ_FLAG( val, "quincunx_sampling_flag" );                     sei.m_quincunxSamplingFlag = val;
    604562
     
    620578
    621579    READ_CODE( 8, val, "frame_packing_arrangement_reserved_byte" );   sei.m_arrangementReservedByte = val;
    622 #if L0045_PERSISTENCE_FLAGS
    623580    READ_FLAG( val,  "frame_packing_arrangement_persistence_flag" );  sei.m_arrangementPersistenceFlag = val ? true : false;
    624 #else
    625     READ_UVLC( val, "frame_packing_arrangement_repetition_period" );  sei.m_arrangementRepetetionPeriod = val;
    626 #endif
    627581  }
    628582  READ_FLAG( val, "upsampled_aspect_ratio" );                       sei.m_upsampledAspectRatio = val;
     
    640594    READ_FLAG( val,     "ver_flip" );                              sei.verFlip               = val;
    641595    READ_CODE( 16, val, "anticlockwise_rotation" );                sei.anticlockwiseRotation = val;
    642 #if L0045_PERSISTENCE_FLAGS
    643596    READ_FLAG( val,     "display_orientation_persistence_flag" );  sei.persistenceFlag       = val;
    644 #else
    645     READ_UVLC( val,     "display_orientation_repetition_period" ); sei.repetitionPeriod      = val;
    646 #endif
    647 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS
    648     READ_FLAG( val,     "display_orientation_extension_flag" );    sei.extensionFlag         = val;
    649     assert( !sei.extensionFlag );
    650 #endif
    651597  }
    652598  xParseByteAlign();
     
    668614}
    669615
    670 #if J0149_TONE_MAPPING_SEI
    671616Void SEIReader::xParseSEIToneMappingInfo(SEIToneMappingInfo& sei, UInt /*payloadSize*/)
    672617{
     
    749694  xParseByteAlign();
    750695}
    751 #endif
    752 
    753 #if L0208_SOP_DESCRIPTION_SEI
     696
    754697Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize)
    755698{
     
    775718  xParseByteAlign();
    776719}
    777 #endif
    778 
    779 #if K0180_SCALABLE_NESTING_SEI
     720
    780721Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps)
    781722{
     
    824765
    825766}
    826 #endif
    827767
    828768Void SEIReader::xParseByteAlign()
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/SEIread.h

    r446 r537  
    7070  Void xParseSEITemporalLevel0Index   (SEITemporalLevel0Index &sei, UInt payloadSize);
    7171  Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize);
    72 #if J0149_TONE_MAPPING_SEI
    7372  Void xParseSEIToneMappingInfo       (SEIToneMappingInfo& sei, UInt payloadSize);
    74 #endif
    75 #if L0208_SOP_DESCRIPTION_SEI
    7673  Void xParseSEISOPDescription        (SEISOPDescription &sei, UInt payloadSize);
    77 #endif
    78 #if K0180_SCALABLE_NESTING_SEI
    7974  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);
    80 #endif
    8175  Void xParseByteAlign();
    8276};
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoder.h

    r324 r537  
    5454  virtual Void  start             ()                                          = 0;
    5555  virtual Void  finish            ()                                          = 0;
    56   virtual Void  flush            ()                                           = 0;
    5756
    5857  virtual Void  decodeBin         ( UInt& ruiBin, ContextModel& rcCtxModel )  = 0;
     
    6160  virtual Void  decodeBinTrm      ( UInt& ruiBin                           )  = 0;
    6261 
    63   virtual Void  resetBac          ()                                          = 0;
    64   virtual Void  decodePCMAlignBits()                                          = 0;
    6562  virtual Void  xReadPCMCode      ( UInt uiLength, UInt& ruiCode)              = 0;
    6663
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

    r521 r537  
    7676TDecBinCABAC::finish()
    7777{
    78 }
    79 
    80 Void
    81 TDecBinCABAC::flush()
    82 {
    83   while (m_pcTComBitstream->getNumBitsLeft() > 0 && m_pcTComBitstream->getNumBitsUntilByteAligned() != 0)
    84   {
    85     UInt uiBits;
    86     m_pcTComBitstream->read ( 1, uiBits );
    87   }
    88   start();
     78  UInt lastByte;
     79
     80  m_pcTComBitstream->peekPreviousByte( lastByte );
     81  // Check for proper stop/alignment pattern
     82  assert( ((lastByte << (8 + m_bitsNeeded)) & 0xff) == 0x80 );
    8983}
    9084
     
    242236}
    243237
    244 /** Reset BAC register values.
    245  * \returns Void
    246  */
    247 Void TDecBinCABAC::resetBac()
    248 {
    249   m_uiRange    = 510;
    250   m_bitsNeeded = -8;
    251   m_uiValue    = m_pcTComBitstream->read( 16 );
    252 }
    253 
    254 /** Decode PCM alignment zero bits.
    255  * \returns Void
    256  */
    257 Void TDecBinCABAC::decodePCMAlignBits()
    258 {
    259   Int iNum = m_pcTComBitstream->getNumBitsUntilByteAligned();
    260  
    261   UInt uiBit = 0;
    262   m_pcTComBitstream->read( iNum, uiBit );
    263 #if H_MV_ENC_DEC_TRAC         
    264   DTRACE_CU("Number of pcm_alignment_zero_bit", iNum)
    265 #endif
    266 }
    267 
    268238/** Read a PCM code.
    269239 * \param uiLength code bit-depth
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoderCABAC.h

    r324 r537  
    5656  Void  start             ();
    5757  Void  finish            ();
    58   Void  flush             ();
    5958 
    6059  Void  decodeBin         ( UInt& ruiBin, ContextModel& rcCtxModel );
     
    6362  Void  decodeBinTrm      ( UInt& ruiBin                           );
    6463 
    65   Void  resetBac          ();
    66   Void  decodePCMAlignBits();
    6764  Void  xReadPCMCode      ( UInt uiLength, UInt& ruiCode );
    6865 
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r536 r537  
    224224  Int   iCode;
    225225
    226   READ_UVLC( uiCode, "pps_pic_parameter_set_id");                     pcPPS->setPPSId (uiCode);
    227   READ_UVLC( uiCode, "pps_seq_parameter_set_id");                     pcPPS->setSPSId (uiCode);
     226  READ_UVLC( uiCode, "pps_pic_parameter_set_id");
     227  assert(uiCode <= 63);
     228  pcPPS->setPPSId (uiCode);
     229 
     230  READ_UVLC( uiCode, "pps_seq_parameter_set_id");
     231  assert(uiCode <= 15);
     232  pcPPS->setSPSId (uiCode);
     233 
    228234  READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag"    );    pcPPS->setDependentSliceSegmentsEnabledFlag   ( uiCode == 1 );
    229 #if L0255_MOVE_PPS_FLAGS
    230235  READ_FLAG( uiCode, "output_flag_present_flag" );                    pcPPS->setOutputFlagPresentFlag( uiCode==1 );
    231236
    232237  READ_CODE(3, uiCode, "num_extra_slice_header_bits");                pcPPS->setNumExtraSliceHeaderBits(uiCode);
    233 #endif
    234238  READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode );
    235239
    236240  READ_FLAG( uiCode,   "cabac_init_present_flag" );            pcPPS->setCabacInitPresentFlag( uiCode ? true : false );
    237241
    238 #if L0323_LIMIT_DEFAULT_LIST_SIZE
    239242  READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1");
    240243  assert(uiCode <= 14);
     
    244247  assert(uiCode <= 14);
    245248  pcPPS->setNumRefIdxL1DefaultActive(uiCode+1);
    246 #else
    247   READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1");       pcPPS->setNumRefIdxL0DefaultActive(uiCode+1);
    248   READ_UVLC(uiCode, "num_ref_idx_l1_default_active_minus1");       pcPPS->setNumRefIdxL1DefaultActive(uiCode+1);
    249 #endif
    250249 
    251250  READ_SVLC(iCode, "init_qp_minus26" );                            pcPPS->setPicInitQPMinus26(iCode);
     
    282281  pcPPS->setWPBiPred( uiCode==1 );
    283282
    284 #if !L0255_MOVE_PPS_FLAGS
    285   READ_FLAG( uiCode, "output_flag_present_flag" );
    286   pcPPS->setOutputFlagPresentFlag( uiCode==1 );
    287 #endif
    288283  READ_FLAG( uiCode, "transquant_bypass_enable_flag");
    289284  pcPPS->setTransquantBypassEnableFlag(uiCode ? true : false);
     
    347342  pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode);
    348343
    349 #if !L0255_MOVE_PPS_FLAGS
    350   READ_CODE(3, uiCode, "num_extra_slice_header_bits");
    351   pcPPS->setNumExtraSliceHeaderBits(uiCode);
    352 #endif
    353344  READ_FLAG( uiCode, "slice_segment_header_extension_present_flag");
    354345  pcPPS->setSliceHeaderExtensionPresentFlag(uiCode);
     
    424415    READ_UVLC(   uiCode, "def_disp_win_bottom_offset" );              defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
    425416  }
    426 #if L0043_TIMING_INFO
    427417  TimingInfo *timingInfo = pcVUI->getTimingInfo();
    428418  READ_FLAG(       uiCode, "vui_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
     
    436426      READ_UVLC(   uiCode, "vui_num_ticks_poc_diff_one_minus1");    timingInfo->setNumTicksPocDiffOneMinus1   (uiCode);
    437427    }
    438 #endif 
    439428  READ_FLAG(     uiCode, "hrd_parameters_present_flag");              pcVUI->setHrdParametersPresentFlag(uiCode);
    440429  if( pcVUI->getHrdParametersPresentFlag() )
     
    442431    parseHrdParameters( pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
    443432  }
    444 #if L0043_TIMING_INFO
    445   }
    446 #endif
    447 #if !L0043_TIMING_INFO
    448   READ_FLAG( uiCode, "poc_proportional_to_timing_flag" ); pcVUI->setPocProportionalToTimingFlag(uiCode ? true : false);
    449   if( pcVUI->getPocProportionalToTimingFlag() && pcVUI->getHrdParameters()->getTimingInfoPresentFlag() )
    450   {
    451     READ_UVLC( uiCode, "num_ticks_poc_diff_one_minus1" ); pcVUI->setNumTicksPocDiffOneMinus1(uiCode);
    452   }
    453 #endif
     433  }
    454434  READ_FLAG(     uiCode, "bitstream_restriction_flag");               pcVUI->setBitstreamRestrictionFlag(uiCode);
    455435  if (pcVUI->getBitstreamRestrictionFlag())
     
    464444    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    465445    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
    466 #if L0043_MSS_IDC
    467446    READ_UVLC( uiCode, "min_spatial_segmentation_idc");            pcVUI->setMinSpatialSegmentationIdc(uiCode);
    468447    assert(uiCode < 4096);
    469 #else
    470     READ_CODE( 8, uiCode, "min_spatial_segmentation_idc");            pcVUI->setMinSpatialSegmentationIdc(uiCode);
    471 #endif
    472448    READ_UVLC(   uiCode, "max_bytes_per_pic_denom" );                 pcVUI->setMaxBytesPerPicDenom(uiCode);
    473449    READ_UVLC(   uiCode, "max_bits_per_mincu_denom" );                pcVUI->setMaxBitsPerMinCuDenom(uiCode);
     
    482458  if( commonInfPresentFlag )
    483459  {
    484 #if !L0043_TIMING_INFO
    485     READ_FLAG( uiCode, "timing_info_present_flag" );                  hrd->setTimingInfoPresentFlag( uiCode == 1 ? true : false );
    486     if( hrd->getTimingInfoPresentFlag() )
    487     {
    488       READ_CODE( 32, uiCode, "num_units_in_tick" );                   hrd->setNumUnitsInTick( uiCode );
    489       READ_CODE( 32, uiCode, "time_scale" );                          hrd->setTimeScale( uiCode );
    490     }
    491 #endif
    492460    READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" );           hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false );
    493461    READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" );           hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false );
     
    500468        READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode );
    501469        READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false );
    502 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    503470        READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1"  ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode );
    504 #endif
    505471      }
    506472      READ_CODE( 4, uiCode, "bit_rate_scale" );                       hrd->setBitRateScale( uiCode );
     
    527493      hrd->setFixedPicRateWithinCvsFlag( i, true );
    528494    }
    529 #if L0372
    530495    hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present
    531496    hrd->setCpbCntMinus1   ( i, 0 ); // Infered to be 0 when not present
    532 #endif
    533497    if( hrd->getFixedPicRateWithinCvsFlag( i ) )
    534498    {
    535499      READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" );             hrd->setPicDurationInTcMinus1( i, uiCode );
    536500    }
    537 #if L0372
    538501    else
    539502    {     
     
    544507      READ_UVLC( uiCode, "cpb_cnt_minus1" );                          hrd->setCpbCntMinus1( i, uiCode );     
    545508    }
    546 #else
    547     READ_FLAG( uiCode, "low_delay_hrd_flag" );                      hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false  );
    548     READ_UVLC( uiCode, "cpb_cnt_minus1" );                          hrd->setCpbCntMinus1( i, uiCode );
    549 #endif
    550509    for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    551510    {
     
    559518          if( hrd->getSubPicCpbParamsPresentFlag() )
    560519          {
    561 #if L0363_DU_BIT_RATE
     520            READ_UVLC( uiCode, "cpb_size_du_value_minus1" );       hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );
    562521            READ_UVLC( uiCode, "bit_rate_du_value_minus1" );       hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode );
    563 #endif
    564             READ_UVLC( uiCode, "cpb_size_du_value_minus1" );       hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );
    565522          }
    566523          READ_FLAG( uiCode, "cbr_flag" );                          hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false  );
     
    588545#endif
    589546  READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
     547  assert(uiCode <= 6);
     548 
    590549  READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
    591550  if ( pcSPS->getMaxTLayers() == 1 )
     
    594553    assert( uiCode == 1 );
    595554  }
     555 
    596556  parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
    597557#if H_MV
     
    599559#endif
    600560  READ_UVLC(     uiCode, "sps_seq_parameter_set_id" );           pcSPS->setSPSId( uiCode );
     561  assert(uiCode <= 15);
     562 
    601563  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     564  assert(uiCode <= 3);
    602565  // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
    603566  assert (uiCode == 1);
     
    620583
    621584  READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
     585  assert(uiCode <= 6);
    622586  pcSPS->setBitDepthY( uiCode + 8 );
    623587  pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
    624588
    625589  READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
     590  assert(uiCode <= 6);
    626591  pcSPS->setBitDepthC( uiCode + 8 );
    627592  pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
    628593
    629594  READ_UVLC( uiCode,    "log2_max_pic_order_cnt_lsb_minus4" );   pcSPS->setBitsForPOC( 4 + uiCode );
     595  assert(uiCode <= 12);
    630596
    631597  UInt subLayerOrderingInfoPresentFlag;
    632598  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
     599 
    633600  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    634601  {
    635 #if L0323_DPB
    636602#if H_MV
    637603    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
     
    640606#endif
    641607    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    642 #else
    643     READ_UVLC ( uiCode, "sps_max_dec_pic_buffering");
    644     pcSPS->setMaxDecPicBuffering( uiCode, i);
    645 #endif
    646608#if H_MV
    647609    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
     
    711673
    712674  READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );
     675  assert(uiCode <= 64);
    713676  pcSPS->createRPSList(uiCode);
    714677
     
    838801#endif
    839802  parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
    840 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    841   parseBitratePicRateInfo( pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);
    842 #endif
    843803  UInt subLayerOrderingInfoPresentFlag;
    844804  READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag");
    845805  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
    846806  {
    847 #if L0323_DPB
    848807    READ_UVLC( uiCode,  "vps_max_dec_pic_buffering_minus1[i]" );     pcVPS->setMaxDecPicBuffering( uiCode + 1, i );
    849 #else
    850     READ_UVLC( uiCode,  "vps_max_dec_pic_buffering[i]" );     pcVPS->setMaxDecPicBuffering( uiCode, i );
    851 #endif
    852808    READ_UVLC( uiCode,  "vps_num_reorder_pics[i]" );          pcVPS->setNumReorderPics( uiCode, i );
    853     READ_UVLC( uiCode,  "vps_max_latency_increase[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
     809    READ_UVLC( uiCode,  "vps_max_latency_increase_plus1[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
    854810
    855811    if (!subLayerOrderingInfoPresentFlag)
     
    887843    }
    888844  }
    889 #if L0043_TIMING_INFO
    890845  TimingInfo *timingInfo = pcVPS->getTimingInfo();
    891846  READ_FLAG(       uiCode, "vps_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
     
    899854      READ_UVLC(   uiCode, "vps_num_ticks_poc_diff_one_minus1");    timingInfo->setNumTicksPocDiffOneMinus1   (uiCode);
    900855    }
    901 #endif
    902856    READ_UVLC( uiCode, "vps_num_hrd_parameters" );                  pcVPS->setNumHrdParameters( uiCode );
    903857
     
    915869      parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
    916870    }
    917 #if L0043_TIMING_INFO
    918   }
    919 #endif
     871  }
    920872  READ_FLAG( uiCode,  "vps_extension_flag" );
    921873  if (uiCode)
     
    13111263          uiCode = 0;
    13121264        }
    1313         memcpy(rps,sps->getRPSList()->getReferencePictureSet(uiCode),sizeof(TComReferencePictureSet));
     1265        *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode));
    13141266      }
    13151267      if(sps->getLongTermRefsPresent())
     
    17361688    for (UInt idx=0; idx<numEntryPointOffsets; idx++)
    17371689    {
    1738 #if L0116_ENTRY_POINT
    17391690      READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset_minus1");
    17401691      entryPointOffset[ idx ] = uiCode + 1;
    1741 #else
    1742       READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset");
    1743       entryPointOffset[ idx ] = uiCode;
    1744 #endif
    17451692    }
    17461693  }
     
    17911738  {
    17921739    Int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation();
     1740   
     1741    // Adjust endOfSliceHeaderLocation to account for emulation prevention bytes in the slice segment header
     1742    for ( UInt curByteIdx  = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ )
     1743    {
     1744      if ( m_pcBitstream->getEmulationPreventionByteLocation( curByteIdx ) < endOfSliceHeaderLocation )
     1745      {
     1746        endOfSliceHeaderLocation++;
     1747      }
     1748    }
     1749
    17931750    Int  curEntryPointOffset     = 0;
    17941751    Int  prevEntryPointOffset    = 0;
     
    18581815  READ_CODE( 8, uiCode, "general_level_idc" );    rpcPTL->getGeneralPTL()->setLevelIdc(uiCode);
    18591816
    1860 #if L0363_BYTE_ALIGN
    18611817  for (Int i = 0; i < maxNumSubLayersMinus1; i++)
    18621818  {
     
    18821838    }
    18831839  }
    1884 #endif
    18851840 
    18861841  for(Int i = 0; i < maxNumSubLayersMinus1; i++)
    18871842  {
    1888 #if !L0363_BYTE_ALIGN
    1889     if(profilePresentFlag)
    1890     {
    1891       READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);
    1892     }
    1893     READ_FLAG( uiCode, "sub_layer_level_present_flag[i]"   ); rpcPTL->setSubLayerLevelPresentFlag  (i, uiCode);
    1894 #endif
    18951843    if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )
    18961844    {
     
    19141862    READ_FLAG(  uiCode, "XXX_profile_compatibility_flag[][j]");   ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0);
    19151863  }
    1916 #if L0046_CONSTRAINT_FLAGS
    19171864  READ_FLAG(uiCode, "general_progressive_source_flag");
    19181865  ptl->setProgressiveSourceFlag(uiCode ? true : false);
     
    19301877  READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]");
    19311878  READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]");
    1932 #elif L0363_MORE_BITS
    1933   READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[0..15]");
    1934   READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[16..31]");
    1935   READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[32..47]");
    1936 #else
    1937   READ_CODE(16, uiCode, "XXX_reserved_zero_16bits[]");  assert( uiCode == 0 );
    1938 #endif
    1939 }
    1940 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    1941 Void TDecCavlc::parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh)
    1942 {
    1943   UInt uiCode;
    1944   for(Int i = tempLevelLow; i <= tempLevelHigh; i++)
    1945   {
    1946     READ_FLAG( uiCode, "bit_rate_info_present_flag[i]" ); info->setBitRateInfoPresentFlag(i, uiCode ? true : false);
    1947     READ_FLAG( uiCode, "pic_rate_info_present_flag[i]" ); info->setPicRateInfoPresentFlag(i, uiCode ? true : false);
    1948     if(info->getBitRateInfoPresentFlag(i))
    1949     {
    1950       READ_CODE( 16, uiCode, "avg_bit_rate[i]" ); info->setAvgBitRate(i, uiCode);
    1951       READ_CODE( 16, uiCode, "max_bit_rate[i]" ); info->setMaxBitRate(i, uiCode);
    1952     }
    1953     if(info->getPicRateInfoPresentFlag(i))
    1954     {
    1955       READ_CODE(  2, uiCode,  "constant_pic_rate_idc[i]" ); info->setConstantPicRateIdc(i, uiCode);
    1956       READ_CODE( 16, uiCode,  "avg_pic_rate[i]"          ); info->setAvgPicRate(i, uiCode);
    1957     }
    1958   }
    1959 }
    1960 #endif 
     1879}
     1880
    19611881Void TDecCavlc::parseTerminatingBit( UInt& ruiBit )
    19621882{
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.h

    r504 r537  
    8686  Void  parsePTL            ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 );
    8787  Void  parseProfileTier    (ProfileTierLevel *ptl);
    88 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    89   Void  parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh);
    90 #endif
    9188  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
    9289  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager);
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp

    r531 r537  
    166166  m_cTransformSkipSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_TRANSFORMSKIP_FLAG );
    167167  m_CUTransquantBypassFlagSCModel.initBuffer( sliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
    168 
    169168#if H_3D_DIM
    170169  m_cDepthIntraModeSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE );
     
    184183#endif
    185184#endif
    186 
    187185  m_uiLastDQpNonZero  = 0;
    188186 
     
    200198  UInt uiBit;
    201199  m_pcTDecBinIf->decodeBinTrm(uiBit);
     200  assert(uiBit); // end_of_sub_stream_one_bit must be equal to 1
    202201  m_pcTDecBinIf->finish(); 
    203202  m_pcBitstream->readOutTrailingBits();
     
    259258{
    260259  m_pcTDecBinIf->decodeBinTrm( ruiBit );
     260  if ( ruiBit )
     261  {
     262    m_pcTDecBinIf->finish();
     263  }
    261264}
    262265
     
    613616{
    614617  UInt uiSymbol;
    615   Bool readPCMSampleFlag = false;
    616618
    617619    m_pcTDecBinIf->decodeBinTrm(uiSymbol);
     
    622624    if (uiSymbol)
    623625    {
    624       readPCMSampleFlag = true;
    625       m_pcTDecBinIf->decodePCMAlignBits();
    626     }
    627 
    628   if (readPCMSampleFlag == true)
    629   {
    630626    Bool bIpcmFlag = true;
    631627
     
    693689    }
    694690
    695       m_pcTDecBinIf->resetBac();
     691    m_pcTDecBinIf->start();
    696692  }
    697693}
     
    1003999    else
    10041000    {
    1005       intraPredMode = 0;
    10061001      m_pcTDecBinIf->decodeBinsEP( symbol, 5 );
    10071002      intraPredMode = symbol;
     
    14441439  else
    14451440  {
    1446     iDQp=0;
    14471441    qp = pcCU->getRefQP(uiAbsPartIdx);
    14481442  }
     
    16341628
    16351629  //===== decode significance flags =====
    1636   UInt uiScanPosLast = uiBlkPosLast;
     1630  UInt uiScanPosLast;
    16371631  const UInt *scan   = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ];
    16381632  for( uiScanPosLast = 0; uiScanPosLast < uiMaxNumCoeffM1; uiScanPosLast++ )
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSlice.cpp

    r521 r537  
    372372    pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
    373373
     374    if ( uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU()
     375        && pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()
     376        && !uiIsLast )
     377    {
     378      // Parse end_of_substream_one_bit for WPP case
     379      UInt binVal;
     380      pcSbacDecoder->parseTerminatingBit( binVal );
     381      assert( binVal );
     382    }
     383
    374384    //Store probabilities of second LCU in line into buffer
    375385    if ( (uiCol == uiTileLCUX+1)&& (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) )
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecTop.cpp

    r534 r537  
    441441  }
    442442
    443 #if L0323_DPB
    444   m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    445 #else
    446   m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded
    447 #endif
     443  m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    448444  if (m_cListPic.size() < (UInt)m_iMaxRefPicNum)
    449445  {
     
    964960    //---------------
    965961    pcSlice->setRefPOCList();
    966 #if !L0034_COMBINED_LIST_CLEANUP
    967     pcSlice->setNoBackPredFlag( false );
    968     if ( pcSlice->getSliceType() == B_SLICE )
    969     {
    970       if ( pcSlice->getNumRefIdx(RefPicList( 0 ) ) == pcSlice->getNumRefIdx(RefPicList( 1 ) ) )
    971       {
    972         pcSlice->setNoBackPredFlag( true );
    973         for ( i=0; i < pcSlice->getNumRefIdx(RefPicList( 1 ) ); i++ )
    974         {
    975           if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) )
    976           {
    977             pcSlice->setNoBackPredFlag( false );
    978             break;
    979           }
    980         }
    981       }
    982     }
    983 #endif
    984962#if  H_3D_TMVP
    985963    if(pcSlice->getLayerId())
Note: See TracChangeset for help on using the changeset viewer.