Changeset 310 in SHVCSoftware for trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-2.1-dev (added) merged: 193-196,202,204,210-212,214-216,224,226-228,233-251,258,282-309
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r191 r310 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 93 93 } 94 94 95 if (interRPSPred) 95 if (interRPSPred) 96 96 { 97 97 UInt bit; … … 114 114 for(Int j=0 ; j <= rpsRef->getNumberOfPictures(); j++) 115 115 { 116 READ_CODE(1, bit, "used_by_curr_pic_flag" ); //first bit is "1" if Idc is 1 116 READ_CODE(1, bit, "used_by_curr_pic_flag" ); //first bit is "1" if Idc is 1 117 117 Int refIdc = bit; 118 if (refIdc == 0) 118 if (refIdc == 0) 119 119 { 120 120 READ_CODE(1, bit, "use_delta_flag" ); //second bit is "1" if Idc is 2, "0" otherwise. … … 131 131 k0++; 132 132 } 133 else 133 else 134 134 { 135 135 k1++; 136 136 } 137 137 k++; 138 } 139 rps->setRefIdc(j,refIdc); 140 } 141 rps->setNumRefIdc(rpsRef->getNumberOfPictures()+1); 138 } 139 rps->setRefIdc(j,refIdc); 140 } 141 rps->setNumRefIdc(rpsRef->getNumberOfPictures()+1); 142 142 rps->setNumberOfPictures(k); 143 143 rps->setNumberOfNegativePictures(k0); … … 175 175 } 176 176 177 /** copy SAO parameter178 * \param dst179 * \param src180 */181 inline Void copySaoOneLcuParam(SaoLcuParam* dst, SaoLcuParam* src)182 {183 Int i;184 dst->partIdx = src->partIdx;185 dst->typeIdx = src->typeIdx;186 if (dst->typeIdx != -1)187 {188 dst->subTypeIdx = src->subTypeIdx ;189 dst->length = src->length;190 for (i=0;i<dst->length;i++)191 {192 dst->offset[i] = src->offset[i];193 }194 }195 else196 {197 dst->length = 0;198 for (i=0;i<SAO_BO_LEN;i++)199 {200 dst->offset[i] = 0;201 }202 }203 }204 205 177 Void TDecCavlc::parsePPS(TComPPS* pcPPS) 206 178 { 207 #if ENC_DEC_TRACE 179 #if ENC_DEC_TRACE 208 180 xTracePPSHeader (pcPPS); 209 181 #endif … … 212 184 Int iCode; 213 185 214 READ_UVLC( uiCode, "pps_pic_parameter_set_id"); pcPPS->setPPSId (uiCode); 215 READ_UVLC( uiCode, "pps_seq_parameter_set_id"); pcPPS->setSPSId (uiCode); 186 READ_UVLC( uiCode, "pps_pic_parameter_set_id"); 187 assert(uiCode <= 63); 188 pcPPS->setPPSId (uiCode); 189 190 READ_UVLC( uiCode, "pps_seq_parameter_set_id"); 191 assert(uiCode <= 15); 192 pcPPS->setSPSId (uiCode); 193 216 194 READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag" ); pcPPS->setDependentSliceSegmentsEnabledFlag ( uiCode == 1 ); 217 #if L0255_MOVE_PPS_FLAGS218 195 READ_FLAG( uiCode, "output_flag_present_flag" ); pcPPS->setOutputFlagPresentFlag( uiCode==1 ); 219 196 220 197 READ_CODE(3, uiCode, "num_extra_slice_header_bits"); pcPPS->setNumExtraSliceHeaderBits(uiCode); 221 #endif222 198 READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode ); 223 199 224 200 READ_FLAG( uiCode, "cabac_init_present_flag" ); pcPPS->setCabacInitPresentFlag( uiCode ? true : false ); 225 201 226 #if L0323_LIMIT_DEFAULT_LIST_SIZE227 202 READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1"); 228 203 assert(uiCode <= 14); 229 204 pcPPS->setNumRefIdxL0DefaultActive(uiCode+1); 230 205 231 206 READ_UVLC(uiCode, "num_ref_idx_l1_default_active_minus1"); 232 207 assert(uiCode <= 14); 233 208 pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 234 #else 235 READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1"); pcPPS->setNumRefIdxL0DefaultActive(uiCode+1); 236 READ_UVLC(uiCode, "num_ref_idx_l1_default_active_minus1"); pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 237 #endif 238 209 239 210 READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); 240 211 READ_FLAG( uiCode, "constrained_intra_pred_flag" ); pcPPS->setConstrainedIntraPred( uiCode ? true : false ); 241 READ_FLAG( uiCode, "transform_skip_enabled_flag" ); 242 pcPPS->setUseTransformSkip ( uiCode ? true : false ); 212 READ_FLAG( uiCode, "transform_skip_enabled_flag" ); 213 pcPPS->setUseTransformSkip ( uiCode ? true : false ); 243 214 244 215 READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false ); … … 270 241 pcPPS->setWPBiPred( uiCode==1 ); 271 242 272 #if !L0255_MOVE_PPS_FLAGS273 READ_FLAG( uiCode, "output_flag_present_flag" );274 pcPPS->setOutputFlagPresentFlag( uiCode==1 );275 #endif276 243 READ_FLAG( uiCode, "transquant_bypass_enable_flag"); 277 244 pcPPS->setTransquantBypassEnableFlag(uiCode ? true : false); 278 245 READ_FLAG( uiCode, "tiles_enabled_flag" ); pcPPS->setTilesEnabledFlag ( uiCode == 1 ); 279 246 READ_FLAG( uiCode, "entropy_coding_sync_enabled_flag" ); pcPPS->setEntropyCodingSyncEnabledFlag( uiCode == 1 ); 280 247 281 248 if( pcPPS->getTilesEnabledFlag() ) 282 249 { 283 READ_UVLC ( uiCode, "num_tile_columns_minus1" ); pcPPS->setNumColumnsMinus1( uiCode ); 284 READ_UVLC ( uiCode, "num_tile_rows_minus1" ); pcPPS->setNumRowsMinus1( uiCode ); 250 READ_UVLC ( uiCode, "num_tile_columns_minus1" ); pcPPS->setNumColumnsMinus1( uiCode ); 251 READ_UVLC ( uiCode, "num_tile_rows_minus1" ); pcPPS->setNumRowsMinus1( uiCode ); 285 252 READ_FLAG ( uiCode, "uniform_spacing_flag" ); pcPPS->setUniformSpacingFlag( uiCode ); 286 253 … … 289 256 UInt* columnWidth = (UInt*)malloc(pcPPS->getNumColumnsMinus1()*sizeof(UInt)); 290 257 for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++) 291 { 292 READ_UVLC( uiCode, "column_width_minus1" ); 258 { 259 READ_UVLC( uiCode, "column_width_minus1" ); 293 260 columnWidth[i] = uiCode+1; 294 261 } … … 303 270 } 304 271 pcPPS->setRowHeight(rowHeight); 305 free(rowHeight); 272 free(rowHeight); 306 273 } 307 274 … … 335 302 pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode); 336 303 337 #if !L0255_MOVE_PPS_FLAGS338 READ_CODE(3, uiCode, "num_extra_slice_header_bits");339 pcPPS->setNumExtraSliceHeaderBits(uiCode);340 #endif341 304 READ_FLAG( uiCode, "slice_segment_header_extension_present_flag"); 342 305 pcPPS->setSliceHeaderExtensionPresentFlag(uiCode); … … 400 363 401 364 READ_FLAG( uiCode, "field_seq_flag"); pcVUI->setFieldSeqFlag(uiCode); 402 assert(pcVUI->getFieldSeqFlag() == false); // not supported yet403 365 404 366 READ_FLAG(uiCode, "frame_field_info_present_flag"); pcVUI->setFrameFieldInfoPresentFlag(uiCode); … … 413 375 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 414 376 } 415 #if L0043_TIMING_INFO416 377 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 417 378 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 425 386 READ_UVLC( uiCode, "vui_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 426 387 } 427 #endif428 388 READ_FLAG( uiCode, "hrd_parameters_present_flag"); pcVUI->setHrdParametersPresentFlag(uiCode); 429 389 if( pcVUI->getHrdParametersPresentFlag() ) … … 431 391 parseHrdParameters( pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 ); 432 392 } 433 #if L0043_TIMING_INFO 434 } 435 #endif 436 #if !L0043_TIMING_INFO 437 READ_FLAG( uiCode, "poc_proportional_to_timing_flag" ); pcVUI->setPocProportionalToTimingFlag(uiCode ? true : false); 438 if( pcVUI->getPocProportionalToTimingFlag() && pcVUI->getHrdParameters()->getTimingInfoPresentFlag() ) 439 { 440 READ_UVLC( uiCode, "num_ticks_poc_diff_one_minus1" ); pcVUI->setNumTicksPocDiffOneMinus1(uiCode); 441 } 442 #endif 393 } 443 394 READ_FLAG( uiCode, "bitstream_restriction_flag"); pcVUI->setBitstreamRestrictionFlag(uiCode); 444 395 if (pcVUI->getBitstreamRestrictionFlag()) 445 396 { 446 397 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 398 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG 399 if ( pcSPS->getLayerId() > 0 ) 400 { 401 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 ); 402 } 403 #endif 447 404 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 448 405 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); 449 #if L0043_MSS_IDC450 406 READ_UVLC( uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode); 451 407 assert(uiCode < 4096); 452 #else453 READ_CODE( 8, uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode);454 #endif455 408 READ_UVLC( uiCode, "max_bytes_per_pic_denom" ); pcVUI->setMaxBytesPerPicDenom(uiCode); 456 409 READ_UVLC( uiCode, "max_bits_per_mincu_denom" ); pcVUI->setMaxBitsPerMinCuDenom(uiCode); … … 465 418 if( commonInfPresentFlag ) 466 419 { 467 #if !L0043_TIMING_INFO468 READ_FLAG( uiCode, "timing_info_present_flag" ); hrd->setTimingInfoPresentFlag( uiCode == 1 ? true : false );469 if( hrd->getTimingInfoPresentFlag() )470 {471 READ_CODE( 32, uiCode, "num_units_in_tick" ); hrd->setNumUnitsInTick( uiCode );472 READ_CODE( 32, uiCode, "time_scale" ); hrd->setTimeScale( uiCode );473 }474 #endif475 420 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false ); 476 421 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false ); … … 483 428 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode ); 484 429 READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false ); 485 #if L0044_DU_DPB_OUTPUT_DELAY_HRD486 430 READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1" ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode ); 487 #endif488 431 } 489 432 READ_CODE( 4, uiCode, "bit_rate_scale" ); hrd->setBitRateScale( uiCode ); … … 510 453 hrd->setFixedPicRateWithinCvsFlag( i, true ); 511 454 } 512 #if L0372513 455 hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present 514 456 hrd->setCpbCntMinus1 ( i, 0 ); // Infered to be 0 when not present 515 #endif516 457 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 517 458 { 518 459 READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" ); hrd->setPicDurationInTcMinus1( i, uiCode ); 519 460 } 520 #if L0372521 461 else 522 { 462 { 523 463 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false ); 524 464 } 525 465 if (!hrd->getLowDelayHrdFlag( i )) 526 466 { 527 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 528 } 529 #else 530 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false ); 531 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 532 #endif 467 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 468 } 533 469 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 534 470 { … … 542 478 if( hrd->getSubPicCpbParamsPresentFlag() ) 543 479 { 544 #if L0363_DU_BIT_RATE 480 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 545 481 READ_UVLC( uiCode, "bit_rate_du_value_minus1" ); hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 546 #endif547 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );548 482 } 549 483 READ_FLAG( uiCode, "cbr_flag" ); hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false ); … … 554 488 } 555 489 490 #if SPS_SUB_LAYER_INFO 491 Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager) 492 #else 556 493 Void TDecCavlc::parseSPS(TComSPS* pcSPS) 557 { 558 #if ENC_DEC_TRACE 494 #endif 495 { 496 #if ENC_DEC_TRACE 559 497 xTraceSPSHeader (pcSPS); 560 498 #endif … … 562 500 UInt uiCode; 563 501 READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); 564 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 565 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 502 #if SPS_SUB_LAYER_INFO 503 if(pcSPS->getLayerId() == 0) 504 { 505 #endif 506 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 507 assert(uiCode <= 6); 508 509 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 510 #if SPS_SUB_LAYER_INFO 511 } 512 else 513 { 514 pcSPS->setMaxTLayers ( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getMaxTLayers() ); 515 pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() ); 516 } 517 #endif 566 518 if ( pcSPS->getMaxTLayers() == 1 ) 567 519 { 568 520 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 521 #if SPS_SUB_LAYER_INFO 522 assert( pcSPS->getTemporalIdNestingFlag() == true ); 523 #else 569 524 assert( uiCode == 1 ); 570 } 571 525 #endif 526 } 527 572 528 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 573 529 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 530 assert(uiCode <= 15); 531 574 532 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 533 assert(uiCode <= 3); 575 534 // 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 576 535 assert (uiCode == 1); … … 593 552 594 553 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 554 assert(uiCode <= 6); 595 555 pcSPS->setBitDepthY( uiCode + 8 ); 596 556 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 597 557 598 558 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 559 assert(uiCode <= 6); 599 560 pcSPS->setBitDepthC( uiCode + 8 ); 600 561 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 601 562 602 563 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 564 assert(uiCode <= 12); 603 565 604 566 UInt subLayerOrderingInfoPresentFlag; 605 567 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 568 606 569 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 607 570 { 608 #if L0323_DPB609 571 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 610 572 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 611 #else612 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering");613 pcSPS->setMaxDecPicBuffering( uiCode, i);614 #endif615 573 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 616 574 pcSPS->setNumReorderPics(uiCode, i); 617 READ_UVLC ( uiCode, "sps_max_latency_increase ");575 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 618 576 pcSPS->setMaxLatencyIncrease( uiCode, i ); 619 577 … … 636 594 pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode); 637 595 Int maxCUDepthDelta = uiCode; 638 pcSPS->setMaxCUWidth ( 1<<(log2MinCUSize + maxCUDepthDelta) ); 596 pcSPS->setMaxCUWidth ( 1<<(log2MinCUSize + maxCUDepthDelta) ); 639 597 pcSPS->setMaxCUHeight ( 1<<(log2MinCUSize + maxCUDepthDelta) ); 640 598 READ_UVLC( uiCode, "log2_min_transform_block_size_minus2" ); pcSPS->setQuadtreeTULog2MinSize( uiCode + 2 ); … … 647 605 648 606 Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 649 pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth ); 607 pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth ); 650 608 651 609 READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); … … 672 630 673 631 READ_UVLC( uiCode, "num_short_term_ref_pic_sets" ); 632 assert(uiCode <= 64); 674 633 pcSPS->createRPSList(uiCode); 675 634 … … 683 642 } 684 643 READ_FLAG( uiCode, "long_term_ref_pics_present_flag" ); pcSPS->setLongTermRefsPresent(uiCode); 685 if (pcSPS->getLongTermRefsPresent()) 644 if (pcSPS->getLongTermRefsPresent()) 686 645 { 687 646 READ_UVLC( uiCode, "num_long_term_ref_pic_sps" ); … … 697 656 READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" ); pcSPS->setTMVPFlagsPresent(uiCode); 698 657 #if REF_IDX_MFM 658 #if !M0457_COL_PICTURE_SIGNALING 699 659 if(pcSPS->getLayerId() > 0) 700 660 { … … 703 663 } 704 664 #endif 665 #endif 705 666 READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" ); pcSPS->setUseStrongIntraSmoothing(uiCode); 706 667 … … 711 672 parseVUI(pcSPS->getVuiParameters(), pcSPS); 712 673 } 713 714 #if SCALED_REF_LAYER_OFFSETS715 if( pcSPS->getLayerId() > 0 )716 {717 Int iCode;718 Window& scaledWindow = pcSPS->getScaledRefLayerWindow();719 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1);720 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1);721 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1);722 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1);723 }724 #endif725 674 726 675 READ_FLAG( uiCode, "sps_extension_flag"); 727 676 if (uiCode) 728 677 { 729 while ( xMoreRbspData() ) 730 { 731 READ_FLAG( uiCode, "sps_extension_data_flag"); 732 } 733 } 734 } 678 #if SPS_EXTENSION 679 parseSPSExtension( pcSPS ); 680 READ_FLAG( uiCode, "sps_extension2_flag"); 681 if(uiCode) 682 { 683 #endif 684 while ( xMoreRbspData() ) 685 { 686 READ_FLAG( uiCode, "sps_extension_data_flag"); 687 } 688 #if SPS_EXTENSION 689 } 690 #endif 691 } 692 } 693 694 #if SPS_EXTENSION 695 Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS ) 696 { 697 UInt uiCode; 698 // more syntax elements to be parsed here 699 #if SCALED_REF_LAYER_OFFSETS 700 #if SCALED_REF_LAYER_OFFSET_FLAG 701 READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" ); 702 if( uiCode ) 703 #else 704 if( pcSPS->getLayerId() > 0 ) 705 #endif 706 { 707 Int iCode; 708 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode); 709 for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++) 710 { 711 Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i); 712 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 713 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); 714 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 715 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 716 } 717 } 718 #endif 719 #if M0463_VUI_EXT_ILP_REF 720 //// sps_extension_vui_parameters( ) 721 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() ) 722 { 723 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 724 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 725 { 726 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 727 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 728 { 729 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 730 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 731 { 732 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 733 } 734 } 735 } 736 } 737 //// sps_extension_vui_parameters( ) END 738 #endif 739 } 740 #endif 735 741 736 742 Void TDecCavlc::parseVPS(TComVPS* pcVPS) 737 743 { 738 744 UInt uiCode; 739 745 740 746 READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 741 747 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); … … 750 756 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 751 757 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 752 #if SIGNAL_BITRATE_PICRATE_IN_VPS753 parseBitratePicRateInfo( pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);754 #endif755 758 UInt subLayerOrderingInfoPresentFlag; 756 759 READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag"); 757 760 for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++) 758 761 { 759 #if L0323_DPB760 762 READ_UVLC( uiCode, "vps_max_dec_pic_buffering_minus1[i]" ); pcVPS->setMaxDecPicBuffering( uiCode + 1, i ); 761 #else762 READ_UVLC( uiCode, "vps_max_dec_pic_buffering[i]" ); pcVPS->setMaxDecPicBuffering( uiCode, i );763 #endif764 763 READ_UVLC( uiCode, "vps_num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i ); 765 READ_UVLC( uiCode, "vps_max_latency_increase [i]" ); pcVPS->setMaxLatencyIncrease( uiCode, i );764 READ_UVLC( uiCode, "vps_max_latency_increase_plus1[i]" ); pcVPS->setMaxLatencyIncrease( uiCode, i ); 766 765 767 766 if (!subLayerOrderingInfoPresentFlag) … … 803 802 pcVPS->deriveLayerIdListVariables(); 804 803 #endif 805 #if L0043_TIMING_INFO806 804 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 807 805 READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 815 813 READ_UVLC( uiCode, "vps_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 816 814 } 817 #endif818 815 READ_UVLC( uiCode, "vps_num_hrd_parameters" ); pcVPS->setNumHrdParameters( uiCode ); 819 816 … … 831 828 parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 832 829 } 833 #if L0043_TIMING_INFO 834 } 835 #endif 830 } 836 831 READ_FLAG( uiCode, "vps_extension_flag" ); 837 832 if (uiCode) … … 854 849 #endif 855 850 } 856 851 857 852 return; 858 853 } … … 860 855 #if VPS_EXTNS 861 856 Void TDecCavlc::parseVPSExtension(TComVPS *vps) 862 { 857 { 863 858 UInt uiCode; 864 859 // ... More syntax elements to be parsed here … … 873 868 READ_FLAG( uiCode, "scalability_mask[i]" ); vps->setScalabilityMask(i, uiCode ? true : false); 874 869 numScalabilityTypes += uiCode; 875 if( i != 1 )876 {877 // Multiview and reserved masks are not used in this version of software878 assert( uiCode == 0 );879 }880 870 } 881 871 vps->setNumScalabilityTypes(numScalabilityTypes); 882 872 873 #if VPS_SPLIT_FLAG 874 for(j = 0; j < numScalabilityTypes - vps->getSplittingFlag(); j++) 875 #else 883 876 for(j = 0; j < numScalabilityTypes; j++) 877 #endif 884 878 { 885 879 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1); 886 880 } 881 #if VPS_SPLIT_FLAG 882 if(vps->getSplittingFlag()) 883 { 884 UInt numBits = 0; 885 for(j = 0; j < numScalabilityTypes - 1; j++) 886 { 887 numBits += vps->getDimensionIdLen(j); 888 } 889 assert( numBits < 6 ); 890 vps->setDimensionIdLen(numScalabilityTypes-1, 6 - numBits); 891 numBits = 6; 892 } 893 #else 887 894 if(vps->getSplittingFlag()) 888 895 { … … 894 901 assert( numBits <= 6 ); 895 902 } 903 #endif 896 904 897 905 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false); … … 911 919 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 912 920 921 #if VPS_SPLIT_FLAG 922 if(!vps->getSplittingFlag()) 923 #endif 913 924 for(j = 0; j < numScalabilityTypes; j++) 914 925 { … … 939 950 #endif 940 951 #endif 941 952 #if JCTVC_M0203_INTERLAYER_PRED_IDC 953 for(i = 0; i < vps->getMaxLayers() - 1; i++) 954 { 955 READ_CODE( 3, uiCode, "max_sublayer_for_ilp_plus1[i]" ); vps->setMaxSublayerForIlpPlus1(i, uiCode); 956 assert( uiCode <= vps->getMaxTLayers() ); 957 } 958 #endif 942 959 #if VPS_EXTN_PROFILE_INFO 943 960 // Profile-tier-level signalling … … 961 978 #endif 962 979 assert( vps->getProfileLayerSetRef(idx) < idx ); 963 // Copy profile information as indicated 980 // Copy profile information as indicated 964 981 vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) ); 965 } 982 } 966 983 parsePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 ); 967 984 } … … 1048 1065 } 1049 1066 } 1050 } 1067 } 1051 1068 #endif 1052 1069 #endif 1053 1070 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1054 1071 READ_FLAG(uiCode, "max_one_active_ref_layer_flag" ); 1055 vps->setMaxOneActiveRefLayerFlag(uiCode); 1056 #endif 1072 vps->setMaxOneActiveRefLayerFlag(uiCode); 1073 #endif 1057 1074 1058 1075 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG … … 1077 1094 #endif 1078 1095 #endif 1096 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1097 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2); 1098 for(i = 1; i < vps->getMaxLayers(); i++) 1099 { 1100 for(j = 0; j < i; j++) 1101 { 1102 if (vps->getDirectDependencyFlag(i, j)) 1103 { 1104 READ_CODE( vps->getDirectDepTypeLen(), uiCode, "direct_dependency_type[i][j]" ); vps->setDirectDependencyType(i, j, uiCode); 1105 } 1106 } 1107 } 1108 #endif 1109 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1110 READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false); 1111 #endif 1079 1112 } 1080 1113 #endif … … 1094 1127 READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" ); 1095 1128 if( rpcSlice->getRapPicFlag()) 1096 { 1129 { 1097 1130 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 1098 1131 } … … 1145 1178 rpcSlice->setSliceCurEndCUAddr(numCTUs*maxParts); 1146 1179 } 1147 1180 1148 1181 if(!rpcSlice->getDependentSliceSegmentFlag()) 1149 1182 { 1183 1184 #if SH_DISCARDABLE_FLAG 1185 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1186 { 1187 READ_FLAG(uiCode, "discardable_flag"); // ignored 1188 } 1189 for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1190 { 1191 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1192 } 1193 #else 1150 1194 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1151 1195 { 1152 1196 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1153 1197 } 1198 #endif 1154 1199 1155 1200 READ_UVLC ( uiCode, "slice_type" ); rpcSlice->setSliceType((SliceType)uiCode); … … 1179 1224 else 1180 1225 { 1181 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1226 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1182 1227 Int iPOClsb = uiCode; 1183 1228 Int iPrevPOC = rpcSlice->getPrevPOC(); … … 1190 1235 iPOCmsb = iPrevPOCmsb + iMaxPOClsb; 1191 1236 } 1192 else if( (iPOClsb > iPrevPOClsb ) && ( (iPOClsb - iPrevPOClsb ) > ( iMaxPOClsb / 2 ) ) ) 1237 else if( (iPOClsb > iPrevPOClsb ) && ( (iPOClsb - iPrevPOClsb ) > ( iMaxPOClsb / 2 ) ) ) 1193 1238 { 1194 1239 iPOCmsb = iPrevPOCmsb - iMaxPOClsb; … … 1230 1275 uiCode = 0; 1231 1276 } 1232 memcpy(rps,sps->getRPSList()->getReferencePictureSet(uiCode),sizeof(TComReferencePictureSet));1277 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); 1233 1278 } 1234 1279 if(sps->getLongTermRefsPresent()) … … 1276 1321 READ_FLAG(uiCode,"delta_poc_msb_present_flag"); 1277 1322 Bool mSBPresentFlag = uiCode ? true : false; 1278 if(mSBPresentFlag) 1323 if(mSBPresentFlag) 1279 1324 { 1280 1325 READ_UVLC( uiCode, "delta_poc_msb_cycle_lt[i]" ); … … 1291 1336 else 1292 1337 { 1293 deltaPocMSBCycleLT = uiCode + prevDeltaMSB; 1338 deltaPocMSBCycleLT = uiCode + prevDeltaMSB; 1294 1339 } 1295 1340 1296 Int pocLTCurr = rpcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 1341 Int pocLTCurr = rpcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 1297 1342 - iPOClsb + pocLsbLt; 1298 rps->setPOC (j, pocLTCurr); 1343 rps->setPOC (j, pocLTCurr); 1299 1344 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLTCurr); 1300 rps->setCheckLTMSBPresent(j,true); 1345 rps->setCheckLTMSBPresent(j,true); 1301 1346 } 1302 1347 else … … 1304 1349 rps->setPOC (j, pocLsbLt); 1305 1350 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1306 rps->setCheckLTMSBPresent(j,false); 1351 rps->setCheckLTMSBPresent(j,false); 1307 1352 } 1308 1353 prevDeltaMSB = deltaPocMSBCycleLT; 1309 1354 } 1310 1355 offset += rps->getNumberOfLongtermPictures(); 1311 rps->setNumberOfPictures(offset); 1312 } 1356 rps->setNumberOfPictures(offset); 1357 } 1313 1358 if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1314 1359 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 1323 1368 rpcSlice->setRPS(rps); 1324 1369 } 1325 1326 1327 1370 if (rpcSlice->getSPS()->getTMVPFlagsPresent()) 1328 1371 { 1329 1372 READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" ); 1330 rpcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false ); 1373 rpcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false ); 1331 1374 } 1332 1375 else … … 1337 1380 1338 1381 #if REF_IDX_FRAMEWORK 1339 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1382 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1340 1383 rpcSlice->setActiveNumILRRefIdx(0); 1341 if((sps->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) ) 1342 { 1384 if((sps->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) ) 1385 { 1343 1386 READ_FLAG(uiCode,"inter_layer_pred_enabled_flag"); 1344 1387 rpcSlice->setInterLayerPredEnabledFlag(uiCode); 1345 1388 if( rpcSlice->getInterLayerPredEnabledFlag()) 1346 1389 { 1347 if(rpcSlice->getNumILRRefIdx() > 1) 1390 if(rpcSlice->getNumILRRefIdx() > 1) 1348 1391 { 1349 1392 Int numBits = 1; … … 1352 1395 numBits++; 1353 1396 } 1354 if( !rpcSlice->getVPS()->getMaxOneActiveRefLayerFlag()) 1397 if( !rpcSlice->getVPS()->getMaxOneActiveRefLayerFlag()) 1355 1398 { 1356 1399 READ_CODE( numBits, uiCode,"num_inter_layer_ref_pics_minus1" ); 1357 rpcSlice->setActiveNumILRRefIdx(uiCode + 1); 1400 rpcSlice->setActiveNumILRRefIdx(uiCode + 1); 1358 1401 } 1359 1402 else 1360 1403 { 1361 rpcSlice->setActiveNumILRRefIdx(1); 1404 rpcSlice->setActiveNumILRRefIdx(1); 1362 1405 } 1363 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 1406 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 1364 1407 { 1365 READ_CODE( numBits,uiCode,"inter_layer_pred_layer_idc[i]" ); 1366 rpcSlice->setInterLayerPredLayerIdc(uiCode,i); 1408 READ_CODE( numBits,uiCode,"inter_layer_pred_layer_idc[i]" ); 1409 rpcSlice->setInterLayerPredLayerIdc(uiCode,i); 1367 1410 } 1368 1411 } 1369 1412 else 1370 1413 { 1371 rpcSlice->setActiveNumILRRefIdx(1); 1372 rpcSlice->setInterLayerPredLayerIdc(0,0); 1373 } 1374 } 1375 } 1414 rpcSlice->setActiveNumILRRefIdx(1); 1415 rpcSlice->setInterLayerPredLayerIdc(0,0); 1416 } 1417 } 1418 } 1419 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 1420 rpcSlice->setInterLayerSamplePredOnlyFlag( false ); 1421 if( rpcSlice->getNumSamplePredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 ) 1422 { 1423 READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); 1424 rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode > 0 ); 1425 } 1426 #endif 1376 1427 #else 1377 1428 if( rpcSlice->getLayerId() > 0 ) … … 1443 1494 Int length = 1; 1444 1495 numRpsCurrTempList0 --; 1445 while ( numRpsCurrTempList0 >>= 1) 1496 while ( numRpsCurrTempList0 >>= 1) 1446 1497 { 1447 1498 length ++; … … 1485 1536 Int length = 1; 1486 1537 numRpsCurrTempList1 --; 1487 while ( numRpsCurrTempList1 >>= 1) 1538 while ( numRpsCurrTempList1 >>= 1) 1488 1539 { 1489 1540 length ++; … … 1503 1554 } 1504 1555 } 1505 } 1556 } 1506 1557 else 1507 1558 { … … 1522 1573 if ( rpcSlice->getEnableTMVPFlag() ) 1523 1574 { 1575 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING 1576 rpcSlice->setMFMEnabledFlag( false ); 1577 rpcSlice->setColRefLayerIdx( 0 ); 1578 rpcSlice->setAltColIndicationFlag( false ); 1579 if ( sps->getLayerId() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 && rpcSlice->getNumMotionPredRefLayers() > 0 ) 1580 { 1581 READ_FLAG( uiCode, "alt_collocated_indication_flag" ); 1582 rpcSlice->setAltColIndicationFlag( uiCode == 1 ? true : false ); 1583 rpcSlice->setMFMEnabledFlag( uiCode == 1 ? true : false ); 1584 if ( rpcSlice->getNumMotionPredRefLayers() > 1 ) 1585 { 1586 READ_UVLC( uiCode, "collocated_ref_layer_idx" ); 1587 rpcSlice->setColRefLayerIdx( uiCode ); 1588 } 1589 } 1590 else 1591 { 1592 #endif 1524 1593 if ( rpcSlice->getSliceType() == B_SLICE ) 1525 1594 { … … 1543 1612 rpcSlice->setColRefIdx(0); 1544 1613 } 1614 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING 1615 } 1616 #endif 1545 1617 } 1546 1618 if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) ) … … 1585 1657 } 1586 1658 else 1587 { 1659 { 1588 1660 rpcSlice->setDeblockingFilterOverrideFlag(0); 1589 1661 } … … 1609 1681 } 1610 1682 else 1611 { 1683 { 1612 1684 rpcSlice->setDeblockingFilterDisable ( false ); 1613 1685 rpcSlice->setDeblockingFilterBetaOffsetDiv2( 0 ); … … 1629 1701 1630 1702 } 1631 1703 1632 1704 UInt *entryPointOffset = NULL; 1633 1705 UInt numEntryPointOffsets, offsetLenMinus1; … … 1642 1714 for (UInt idx=0; idx<numEntryPointOffsets; idx++) 1643 1715 { 1644 #if L0116_ENTRY_POINT1645 1716 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset_minus1"); 1646 1717 entryPointOffset[ idx ] = uiCode + 1; 1647 #else1648 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset");1649 entryPointOffset[ idx ] = uiCode;1650 #endif1651 1718 } 1652 1719 } … … 1670 1737 { 1671 1738 Int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation(); 1739 1740 // Adjust endOfSliceHeaderLocation to account for emulation prevention bytes in the slice segment header 1741 for ( UInt curByteIdx = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ ) 1742 { 1743 if ( m_pcBitstream->getEmulationPreventionByteLocation( curByteIdx ) < endOfSliceHeaderLocation ) 1744 { 1745 endOfSliceHeaderLocation++; 1746 } 1747 } 1748 1672 1749 Int curEntryPointOffset = 0; 1673 1750 Int prevEntryPointOffset = 0; … … 1679 1756 for ( UInt curByteIdx = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ ) 1680 1757 { 1681 if ( m_pcBitstream->getEmulationPreventionByteLocation( curByteIdx ) >= ( prevEntryPointOffset + endOfSliceHeaderLocation ) && 1758 if ( m_pcBitstream->getEmulationPreventionByteLocation( curByteIdx ) >= ( prevEntryPointOffset + endOfSliceHeaderLocation ) && 1682 1759 m_pcBitstream->getEmulationPreventionByteLocation( curByteIdx ) < ( curEntryPointOffset + endOfSliceHeaderLocation ) ) 1683 1760 { … … 1727 1804 return; 1728 1805 } 1729 1806 1730 1807 Void TDecCavlc::parsePTL( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ) 1731 1808 { … … 1737 1814 READ_CODE( 8, uiCode, "general_level_idc" ); rpcPTL->getGeneralPTL()->setLevelIdc(uiCode); 1738 1815 1739 #if L0363_BYTE_ALIGN1740 1816 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1741 1817 { … … 1746 1822 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode); 1747 1823 } 1748 1824 1749 1825 if (maxNumSubLayersMinus1 > 0) 1750 1826 { … … 1755 1831 } 1756 1832 } 1757 #endif 1758 1833 1759 1834 for(Int i = 0; i < maxNumSubLayersMinus1; i++) 1760 1835 { 1761 #if !L0363_BYTE_ALIGN1762 if(profilePresentFlag)1763 {1764 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);1765 }1766 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode);1767 #endif1768 1836 if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) ) 1769 1837 { … … 1787 1855 READ_FLAG( uiCode, "XXX_profile_compatibility_flag[][j]"); ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0); 1788 1856 } 1789 #if L0046_CONSTRAINT_FLAGS1790 1857 READ_FLAG(uiCode, "general_progressive_source_flag"); 1791 1858 ptl->setProgressiveSourceFlag(uiCode ? true : false); … … 1793 1860 READ_FLAG(uiCode, "general_interlaced_source_flag"); 1794 1861 ptl->setInterlacedSourceFlag(uiCode ? true : false); 1795 1862 1796 1863 READ_FLAG(uiCode, "general_non_packed_constraint_flag"); 1797 1864 ptl->setNonPackedConstraintFlag(uiCode ? true : false); 1798 1865 1799 1866 READ_FLAG(uiCode, "general_frame_only_constraint_flag"); 1800 1867 ptl->setFrameOnlyConstraintFlag(uiCode ? true : false); 1801 1868 1802 1869 READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[0..15]"); 1803 1870 READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]"); 1804 1871 READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]"); 1805 #elif L0363_MORE_BITS 1806 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[0..15]"); 1807 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[16..31]"); 1808 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[32..47]"); 1809 #else 1810 READ_CODE(16, uiCode, "XXX_reserved_zero_16bits[]"); assert( uiCode == 0 ); 1811 #endif 1812 } 1813 #if SIGNAL_BITRATE_PICRATE_IN_VPS 1814 Void TDecCavlc::parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh) 1815 { 1816 UInt uiCode; 1817 for(Int i = tempLevelLow; i <= tempLevelHigh; i++) 1818 { 1819 READ_FLAG( uiCode, "bit_rate_info_present_flag[i]" ); info->setBitRateInfoPresentFlag(i, uiCode ? true : false); 1820 READ_FLAG( uiCode, "pic_rate_info_present_flag[i]" ); info->setPicRateInfoPresentFlag(i, uiCode ? true : false); 1821 if(info->getBitRateInfoPresentFlag(i)) 1822 { 1823 READ_CODE( 16, uiCode, "avg_bit_rate[i]" ); info->setAvgBitRate(i, uiCode); 1824 READ_CODE( 16, uiCode, "max_bit_rate[i]" ); info->setMaxBitRate(i, uiCode); 1825 } 1826 if(info->getPicRateInfoPresentFlag(i)) 1827 { 1828 READ_CODE( 2, uiCode, "constant_pic_rate_idc[i]" ); info->setConstantPicRateIdc(i, uiCode); 1829 READ_CODE( 16, uiCode, "avg_pic_rate[i]" ); info->setAvgPicRate(i, uiCode); 1830 } 1831 } 1832 } 1833 #endif 1872 } 1873 1834 1874 Void TDecCavlc::parseTerminatingBit( UInt& ruiBit ) 1835 1875 { … … 1876 1916 } 1877 1917 1878 /** Parse I_PCM information. 1918 /** Parse I_PCM information. 1879 1919 * \param pcCU pointer to CU 1880 1920 * \param uiAbsPartIdx CU index … … 1882 1922 * \returns Void 1883 1923 * 1884 * If I_PCM flag indicates that the CU is I_PCM, parse its PCM alignment bits and codes. 1924 * If I_PCM flag indicates that the CU is I_PCM, parse its PCM alignment bits and codes. 1885 1925 */ 1886 1926 Void TDecCavlc::parseIPCMInfo( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) … … 1890 1930 1891 1931 Void TDecCavlc::parseIntraDirLumaAng ( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 1892 { 1932 { 1893 1933 assert(0); 1894 1934 } … … 1981 2021 UInt uiLog2WeightDenomLuma, uiLog2WeightDenomChroma; 1982 2022 UInt uiTotalSignalledWeightFlags = 0; 1983 2023 1984 2024 Int iDeltaDenom; 1985 2025 // decode delta_luma_log2_weight_denom : 1986 2026 READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" ); // ue(v): luma_log2_weight_denom 1987 2027 assert( uiLog2WeightDenomLuma <= 7 ); 1988 if( bChroma ) 2028 if( bChroma ) 1989 2029 { 1990 2030 READ_SVLC( iDeltaDenom, "delta_chroma_log2_weight_denom" ); // se(v): delta_chroma_log2_weight_denom … … 1994 2034 } 1995 2035 1996 for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ ) 2036 for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ ) 1997 2037 { 1998 2038 RefPicList eRefPicList = ( iNumRef ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 1999 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2039 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2000 2040 { 2001 2041 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); … … 2010 2050 uiTotalSignalledWeightFlags += wp[0].bPresentFlag; 2011 2051 } 2012 if ( bChroma ) 2052 if ( bChroma ) 2013 2053 { 2014 2054 UInt uiCode; 2015 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2055 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2016 2056 { 2017 2057 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); … … 2022 2062 } 2023 2063 } 2024 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2064 for ( Int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) 2025 2065 { 2026 2066 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); 2027 if ( wp[0].bPresentFlag ) 2067 if ( wp[0].bPresentFlag ) 2028 2068 { 2029 2069 Int iDeltaWeight; … … 2036 2076 assert( wp[0].iOffset <= 127 ); 2037 2077 } 2038 else 2078 else 2039 2079 { 2040 2080 wp[0].iWeight = (1 << wp[0].uiLog2WeightDenom); 2041 2081 wp[0].iOffset = 0; 2042 2082 } 2043 if ( bChroma ) 2044 { 2045 if ( wp[1].bPresentFlag ) 2046 { 2047 for ( Int j=1 ; j<3 ; j++ ) 2083 if ( bChroma ) 2084 { 2085 if ( wp[1].bPresentFlag ) 2086 { 2087 for ( Int j=1 ; j<3 ; j++ ) 2048 2088 { 2049 2089 Int iDeltaWeight; … … 2061 2101 } 2062 2102 } 2063 else 2064 { 2065 for ( Int j=1 ; j<3 ; j++ ) 2103 else 2104 { 2105 for ( Int j=1 ; j<3 ; j++ ) 2066 2106 { 2067 2107 wp[j].iWeight = (1 << wp[j].uiLog2WeightDenom); … … 2072 2112 } 2073 2113 2074 for ( Int iRefIdx=pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 2114 for ( Int iRefIdx=pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 2075 2115 { 2076 2116 pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); … … 2148 2188 2149 2189 Bool TDecCavlc::xMoreRbspData() 2150 { 2190 { 2151 2191 Int bitsLeft = m_pcBitstream->getNumBitsLeft(); 2152 2192
Note: See TracChangeset for help on using the changeset viewer.