Changeset 537 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder
- Timestamp:
- 13 Jul 2013, 15:51:26 (12 years ago)
- 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 90 90 fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n"); 91 91 break; 92 #if J0149_TONE_MAPPING_SEI93 92 case SEI::TONE_MAPPING_INFO: 94 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 95 94 break; 96 #endif97 #if L0208_SOP_DESCRIPTION_SEI98 95 case SEI::SOP_DESCRIPTION: 99 96 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); 100 97 break; 101 #endif102 #if K0180_SCALABLE_NESTING_SEI103 98 case SEI::SCALABLE_NESTING: 104 99 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n"); 105 100 break; 106 #endif107 101 default: 108 102 fprintf( g_hTrace, "=========== Unknown SEI message ===========\n"); … … 234 228 xParseSEIGradualDecodingRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize); 235 229 break; 236 #if J0149_TONE_MAPPING_SEI237 230 case SEI::TONE_MAPPING_INFO: 238 231 sei = new SEIToneMappingInfo; 239 232 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 240 233 break; 241 #endif242 #if L0208_SOP_DESCRIPTION_SEI243 234 case SEI::SOP_DESCRIPTION: 244 235 sei = new SEISOPDescription; 245 236 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize); 246 237 break; 247 #endif248 #if K0180_SCALABLE_NESTING_SEI249 238 case SEI::SCALABLE_NESTING: 250 239 sei = new SEIScalableNesting; 251 240 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps); 252 241 break; 253 #endif254 242 default: 255 243 for (UInt i = 0; i < payloadSize; i++) … … 265 253 switch (payloadType) 266 254 { 267 #if L0363_SEI_ALLOW_SUFFIX268 255 case SEI::USER_DATA_UNREGISTERED: 269 256 sei = new SEIuserDataUnregistered; 270 257 xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize); 271 258 break; 272 #endif273 259 case SEI::DECODED_PICTURE_HASH: 274 260 sei = new SEIDecodedPictureHash; … … 402 388 UInt val; 403 389 READ_CODE(4, val, "active_vps_id"); sei.activeVPSId = val; 404 #if L0047_APS_FLAGS405 390 READ_FLAG( val, "full_random_access_flag"); sei.m_fullRandomAccessFlag = val ? true : false; 406 391 READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false; 407 #endif408 392 READ_UVLC( val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 409 393 … … 438 422 sei.m_duSptCpbRemovalDelay = 0; 439 423 } 440 #if L0044_DU_DPB_OUTPUT_DELAY_HRD441 424 READ_FLAG( val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = val ? true : false; 442 425 if(sei.m_dpbOutputDuDelayPresentFlag) … … 445 428 sei.m_picSptDpbOutputDuDelay = val; 446 429 } 447 #endif448 430 xParseByteAlign(); 449 431 } … … 462 444 READ_FLAG( code, "rap_cpb_params_present_flag" ); sei.m_rapCpbParamsPresentFlag = code; 463 445 } 464 #if L0328_SPLICING465 446 //read splicing flag and cpb_removal_delay_delta 466 447 READ_FLAG( code, "concatenation_flag"); … … 468 449 READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" ); 469 450 sei.m_auCpbRemovalDelayDelta = code + 1; 470 #endif471 #if L0044_CPB_DPB_DELAY_OFFSET472 451 if( sei.m_rapCpbParamsPresentFlag ) 473 452 { … … 475 454 READ_CODE( pHRD->getDpbOutputDelayLengthMinus1() + 1, code, "dpb_delay_offset" ); sei.m_dpbDelayOffset = code; 476 455 } 477 #endif478 456 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 479 457 { … … 507 485 TComHRD *hrd = vui->getHrdParameters(); 508 486 509 #if !L0045_CONDITION_SIGNALLING510 // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added511 if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() )512 {513 return;514 }515 #endif516 517 487 if( vui->getFrameFieldInfoPresentFlag() ) 518 488 { 519 489 READ_CODE( 4, code, "pic_struct" ); sei.m_picStruct = code; 520 #if L0046_RENAME_PROG_SRC_IDC521 490 READ_CODE( 2, code, "source_scan_type" ); sei.m_sourceScanType = code; 522 #else523 READ_CODE( 2, code, "progressive_source_idc" ); sei.m_progressiveSourceIdc = code;524 #endif525 491 READ_FLAG( code, "duplicate_flag" ); sei.m_duplicateFlag = ( code == 1 ? true : false ); 526 492 } 527 493 528 #if L0045_CONDITION_SIGNALLING529 494 if( hrd->getCpbDpbDelaysPresentFlag()) 530 495 { 531 #endif532 496 READ_CODE( ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_minus1" ); 533 497 sei.m_auCpbRemovalDelay = code + 1; … … 535 499 sei.m_picDpbOutputDelay = code; 536 500 537 #if L0044_DU_DPB_OUTPUT_DELAY_HRD538 501 if(hrd->getSubPicCpbParamsPresentFlag()) 539 502 { … … 541 504 sei.m_picDpbOutputDuDelay = code; 542 505 } 543 #endif544 506 if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() ) 545 507 { … … 575 537 } 576 538 } 577 #if L0045_CONDITION_SIGNALLING 578 } 579 #endif 539 } 580 540 xParseByteAlign(); 581 541 } … … 598 558 { 599 559 READ_CODE( 7, val, "frame_packing_arrangement_type" ); sei.m_arrangementType = val; 600 #if L0444_FPA_TYPE601 560 assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) ); 602 #endif603 561 READ_FLAG( val, "quincunx_sampling_flag" ); sei.m_quincunxSamplingFlag = val; 604 562 … … 620 578 621 579 READ_CODE( 8, val, "frame_packing_arrangement_reserved_byte" ); sei.m_arrangementReservedByte = val; 622 #if L0045_PERSISTENCE_FLAGS623 580 READ_FLAG( val, "frame_packing_arrangement_persistence_flag" ); sei.m_arrangementPersistenceFlag = val ? true : false; 624 #else625 READ_UVLC( val, "frame_packing_arrangement_repetition_period" ); sei.m_arrangementRepetetionPeriod = val;626 #endif627 581 } 628 582 READ_FLAG( val, "upsampled_aspect_ratio" ); sei.m_upsampledAspectRatio = val; … … 640 594 READ_FLAG( val, "ver_flip" ); sei.verFlip = val; 641 595 READ_CODE( 16, val, "anticlockwise_rotation" ); sei.anticlockwiseRotation = val; 642 #if L0045_PERSISTENCE_FLAGS643 596 READ_FLAG( val, "display_orientation_persistence_flag" ); sei.persistenceFlag = val; 644 #else645 READ_UVLC( val, "display_orientation_repetition_period" ); sei.repetitionPeriod = val;646 #endif647 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS648 READ_FLAG( val, "display_orientation_extension_flag" ); sei.extensionFlag = val;649 assert( !sei.extensionFlag );650 #endif651 597 } 652 598 xParseByteAlign(); … … 668 614 } 669 615 670 #if J0149_TONE_MAPPING_SEI671 616 Void SEIReader::xParseSEIToneMappingInfo(SEIToneMappingInfo& sei, UInt /*payloadSize*/) 672 617 { … … 749 694 xParseByteAlign(); 750 695 } 751 #endif 752 753 #if L0208_SOP_DESCRIPTION_SEI 696 754 697 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize) 755 698 { … … 775 718 xParseByteAlign(); 776 719 } 777 #endif 778 779 #if K0180_SCALABLE_NESTING_SEI 720 780 721 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps) 781 722 { … … 824 765 825 766 } 826 #endif827 767 828 768 Void SEIReader::xParseByteAlign() -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/SEIread.h
r446 r537 70 70 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize); 71 71 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 72 #if J0149_TONE_MAPPING_SEI73 72 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 74 #endif75 #if L0208_SOP_DESCRIPTION_SEI76 73 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 77 #endif78 #if K0180_SCALABLE_NESTING_SEI79 74 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps); 80 #endif81 75 Void xParseByteAlign(); 82 76 }; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoder.h
r324 r537 54 54 virtual Void start () = 0; 55 55 virtual Void finish () = 0; 56 virtual Void flush () = 0;57 56 58 57 virtual Void decodeBin ( UInt& ruiBin, ContextModel& rcCtxModel ) = 0; … … 61 60 virtual Void decodeBinTrm ( UInt& ruiBin ) = 0; 62 61 63 virtual Void resetBac () = 0;64 virtual Void decodePCMAlignBits() = 0;65 62 virtual Void xReadPCMCode ( UInt uiLength, UInt& ruiCode) = 0; 66 63 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r521 r537 76 76 TDecBinCABAC::finish() 77 77 { 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 ); 89 83 } 90 84 … … 242 236 } 243 237 244 /** Reset BAC register values.245 * \returns Void246 */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 Void256 */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_TRAC264 DTRACE_CU("Number of pcm_alignment_zero_bit", iNum)265 #endif266 }267 268 238 /** Read a PCM code. 269 239 * \param uiLength code bit-depth -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoderCABAC.h
r324 r537 56 56 Void start (); 57 57 Void finish (); 58 Void flush ();59 58 60 59 Void decodeBin ( UInt& ruiBin, ContextModel& rcCtxModel ); … … 63 62 Void decodeBinTrm ( UInt& ruiBin ); 64 63 65 Void resetBac ();66 Void decodePCMAlignBits();67 64 Void xReadPCMCode ( UInt uiLength, UInt& ruiCode ); 68 65 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp
r536 r537 224 224 Int iCode; 225 225 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 228 234 READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag" ); pcPPS->setDependentSliceSegmentsEnabledFlag ( uiCode == 1 ); 229 #if L0255_MOVE_PPS_FLAGS230 235 READ_FLAG( uiCode, "output_flag_present_flag" ); pcPPS->setOutputFlagPresentFlag( uiCode==1 ); 231 236 232 237 READ_CODE(3, uiCode, "num_extra_slice_header_bits"); pcPPS->setNumExtraSliceHeaderBits(uiCode); 233 #endif234 238 READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode ); 235 239 236 240 READ_FLAG( uiCode, "cabac_init_present_flag" ); pcPPS->setCabacInitPresentFlag( uiCode ? true : false ); 237 241 238 #if L0323_LIMIT_DEFAULT_LIST_SIZE239 242 READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1"); 240 243 assert(uiCode <= 14); … … 244 247 assert(uiCode <= 14); 245 248 pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 246 #else247 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 #endif250 249 251 250 READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); … … 282 281 pcPPS->setWPBiPred( uiCode==1 ); 283 282 284 #if !L0255_MOVE_PPS_FLAGS285 READ_FLAG( uiCode, "output_flag_present_flag" );286 pcPPS->setOutputFlagPresentFlag( uiCode==1 );287 #endif288 283 READ_FLAG( uiCode, "transquant_bypass_enable_flag"); 289 284 pcPPS->setTransquantBypassEnableFlag(uiCode ? true : false); … … 347 342 pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode); 348 343 349 #if !L0255_MOVE_PPS_FLAGS350 READ_CODE(3, uiCode, "num_extra_slice_header_bits");351 pcPPS->setNumExtraSliceHeaderBits(uiCode);352 #endif353 344 READ_FLAG( uiCode, "slice_segment_header_extension_present_flag"); 354 345 pcPPS->setSliceHeaderExtensionPresentFlag(uiCode); … … 424 415 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 425 416 } 426 #if L0043_TIMING_INFO427 417 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 428 418 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 436 426 READ_UVLC( uiCode, "vui_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 437 427 } 438 #endif439 428 READ_FLAG( uiCode, "hrd_parameters_present_flag"); pcVUI->setHrdParametersPresentFlag(uiCode); 440 429 if( pcVUI->getHrdParametersPresentFlag() ) … … 442 431 parseHrdParameters( pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 ); 443 432 } 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 } 454 434 READ_FLAG( uiCode, "bitstream_restriction_flag"); pcVUI->setBitstreamRestrictionFlag(uiCode); 455 435 if (pcVUI->getBitstreamRestrictionFlag()) … … 464 444 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 465 445 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); 466 #if L0043_MSS_IDC467 446 READ_UVLC( uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode); 468 447 assert(uiCode < 4096); 469 #else470 READ_CODE( 8, uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode);471 #endif472 448 READ_UVLC( uiCode, "max_bytes_per_pic_denom" ); pcVUI->setMaxBytesPerPicDenom(uiCode); 473 449 READ_UVLC( uiCode, "max_bits_per_mincu_denom" ); pcVUI->setMaxBitsPerMinCuDenom(uiCode); … … 482 458 if( commonInfPresentFlag ) 483 459 { 484 #if !L0043_TIMING_INFO485 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 #endif492 460 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false ); 493 461 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false ); … … 500 468 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode ); 501 469 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_HRD503 470 READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1" ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode ); 504 #endif505 471 } 506 472 READ_CODE( 4, uiCode, "bit_rate_scale" ); hrd->setBitRateScale( uiCode ); … … 527 493 hrd->setFixedPicRateWithinCvsFlag( i, true ); 528 494 } 529 #if L0372530 495 hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present 531 496 hrd->setCpbCntMinus1 ( i, 0 ); // Infered to be 0 when not present 532 #endif533 497 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 534 498 { 535 499 READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" ); hrd->setPicDurationInTcMinus1( i, uiCode ); 536 500 } 537 #if L0372538 501 else 539 502 { … … 544 507 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 545 508 } 546 #else547 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 #endif550 509 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 551 510 { … … 559 518 if( hrd->getSubPicCpbParamsPresentFlag() ) 560 519 { 561 #if L0363_DU_BIT_RATE 520 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 562 521 READ_UVLC( uiCode, "bit_rate_du_value_minus1" ); hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 563 #endif564 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );565 522 } 566 523 READ_FLAG( uiCode, "cbr_flag" ); hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false ); … … 588 545 #endif 589 546 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 547 assert(uiCode <= 6); 548 590 549 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 591 550 if ( pcSPS->getMaxTLayers() == 1 ) … … 594 553 assert( uiCode == 1 ); 595 554 } 555 596 556 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 597 557 #if H_MV … … 599 559 #endif 600 560 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 561 assert(uiCode <= 15); 562 601 563 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 564 assert(uiCode <= 3); 602 565 // 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 603 566 assert (uiCode == 1); … … 620 583 621 584 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 585 assert(uiCode <= 6); 622 586 pcSPS->setBitDepthY( uiCode + 8 ); 623 587 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 624 588 625 589 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 590 assert(uiCode <= 6); 626 591 pcSPS->setBitDepthC( uiCode + 8 ); 627 592 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 628 593 629 594 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 595 assert(uiCode <= 12); 630 596 631 597 UInt subLayerOrderingInfoPresentFlag; 632 598 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 599 633 600 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 634 601 { 635 #if L0323_DPB636 602 #if H_MV 637 603 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]"); … … 640 606 #endif 641 607 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 642 #else643 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering");644 pcSPS->setMaxDecPicBuffering( uiCode, i);645 #endif646 608 #if H_MV 647 609 READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" ); … … 711 673 712 674 READ_UVLC( uiCode, "num_short_term_ref_pic_sets" ); 675 assert(uiCode <= 64); 713 676 pcSPS->createRPSList(uiCode); 714 677 … … 838 801 #endif 839 802 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 840 #if SIGNAL_BITRATE_PICRATE_IN_VPS841 parseBitratePicRateInfo( pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);842 #endif843 803 UInt subLayerOrderingInfoPresentFlag; 844 804 READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag"); 845 805 for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++) 846 806 { 847 #if L0323_DPB848 807 READ_UVLC( uiCode, "vps_max_dec_pic_buffering_minus1[i]" ); pcVPS->setMaxDecPicBuffering( uiCode + 1, i ); 849 #else850 READ_UVLC( uiCode, "vps_max_dec_pic_buffering[i]" ); pcVPS->setMaxDecPicBuffering( uiCode, i );851 #endif852 808 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 ); 854 810 855 811 if (!subLayerOrderingInfoPresentFlag) … … 887 843 } 888 844 } 889 #if L0043_TIMING_INFO890 845 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 891 846 READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 899 854 READ_UVLC( uiCode, "vps_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 900 855 } 901 #endif902 856 READ_UVLC( uiCode, "vps_num_hrd_parameters" ); pcVPS->setNumHrdParameters( uiCode ); 903 857 … … 915 869 parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 916 870 } 917 #if L0043_TIMING_INFO 918 } 919 #endif 871 } 920 872 READ_FLAG( uiCode, "vps_extension_flag" ); 921 873 if (uiCode) … … 1311 1263 uiCode = 0; 1312 1264 } 1313 memcpy(rps,sps->getRPSList()->getReferencePictureSet(uiCode),sizeof(TComReferencePictureSet));1265 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); 1314 1266 } 1315 1267 if(sps->getLongTermRefsPresent()) … … 1736 1688 for (UInt idx=0; idx<numEntryPointOffsets; idx++) 1737 1689 { 1738 #if L0116_ENTRY_POINT1739 1690 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset_minus1"); 1740 1691 entryPointOffset[ idx ] = uiCode + 1; 1741 #else1742 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset");1743 entryPointOffset[ idx ] = uiCode;1744 #endif1745 1692 } 1746 1693 } … … 1791 1738 { 1792 1739 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 1793 1750 Int curEntryPointOffset = 0; 1794 1751 Int prevEntryPointOffset = 0; … … 1858 1815 READ_CODE( 8, uiCode, "general_level_idc" ); rpcPTL->getGeneralPTL()->setLevelIdc(uiCode); 1859 1816 1860 #if L0363_BYTE_ALIGN1861 1817 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1862 1818 { … … 1882 1838 } 1883 1839 } 1884 #endif1885 1840 1886 1841 for(Int i = 0; i < maxNumSubLayersMinus1; i++) 1887 1842 { 1888 #if !L0363_BYTE_ALIGN1889 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 #endif1895 1843 if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) ) 1896 1844 { … … 1914 1862 READ_FLAG( uiCode, "XXX_profile_compatibility_flag[][j]"); ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0); 1915 1863 } 1916 #if L0046_CONSTRAINT_FLAGS1917 1864 READ_FLAG(uiCode, "general_progressive_source_flag"); 1918 1865 ptl->setProgressiveSourceFlag(uiCode ? true : false); … … 1930 1877 READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]"); 1931 1878 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 1961 1881 Void TDecCavlc::parseTerminatingBit( UInt& ruiBit ) 1962 1882 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.h
r504 r537 86 86 Void parsePTL ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ); 87 87 Void parseProfileTier (ProfileTierLevel *ptl); 88 #if SIGNAL_BITRATE_PICRATE_IN_VPS89 Void parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh);90 #endif91 88 Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); 92 89 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp
r531 r537 166 166 m_cTransformSkipSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANSFORMSKIP_FLAG ); 167 167 m_CUTransquantBypassFlagSCModel.initBuffer( sliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG ); 168 169 168 #if H_3D_DIM 170 169 m_cDepthIntraModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE ); … … 184 183 #endif 185 184 #endif 186 187 185 m_uiLastDQpNonZero = 0; 188 186 … … 200 198 UInt uiBit; 201 199 m_pcTDecBinIf->decodeBinTrm(uiBit); 200 assert(uiBit); // end_of_sub_stream_one_bit must be equal to 1 202 201 m_pcTDecBinIf->finish(); 203 202 m_pcBitstream->readOutTrailingBits(); … … 259 258 { 260 259 m_pcTDecBinIf->decodeBinTrm( ruiBit ); 260 if ( ruiBit ) 261 { 262 m_pcTDecBinIf->finish(); 263 } 261 264 } 262 265 … … 613 616 { 614 617 UInt uiSymbol; 615 Bool readPCMSampleFlag = false;616 618 617 619 m_pcTDecBinIf->decodeBinTrm(uiSymbol); … … 622 624 if (uiSymbol) 623 625 { 624 readPCMSampleFlag = true;625 m_pcTDecBinIf->decodePCMAlignBits();626 }627 628 if (readPCMSampleFlag == true)629 {630 626 Bool bIpcmFlag = true; 631 627 … … 693 689 } 694 690 695 m_pcTDecBinIf->resetBac();691 m_pcTDecBinIf->start(); 696 692 } 697 693 } … … 1003 999 else 1004 1000 { 1005 intraPredMode = 0;1006 1001 m_pcTDecBinIf->decodeBinsEP( symbol, 5 ); 1007 1002 intraPredMode = symbol; … … 1444 1439 else 1445 1440 { 1446 iDQp=0;1447 1441 qp = pcCU->getRefQP(uiAbsPartIdx); 1448 1442 } … … 1634 1628 1635 1629 //===== decode significance flags ===== 1636 UInt uiScanPosLast = uiBlkPosLast;1630 UInt uiScanPosLast; 1637 1631 const UInt *scan = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ]; 1638 1632 for( uiScanPosLast = 0; uiScanPosLast < uiMaxNumCoeffM1; uiScanPosLast++ ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSlice.cpp
r521 r537 372 372 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder); 373 373 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 374 384 //Store probabilities of second LCU in line into buffer 375 385 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 441 441 } 442 442 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 448 444 if (m_cListPic.size() < (UInt)m_iMaxRefPicNum) 449 445 { … … 964 960 //--------------- 965 961 pcSlice->setRefPOCList(); 966 #if !L0034_COMBINED_LIST_CLEANUP967 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 #endif984 962 #if H_3D_TMVP 985 963 if(pcSlice->getLayerId())
Note: See TracChangeset for help on using the changeset viewer.