Changeset 302 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibDecoder
- Timestamp:
- 28 Jun 2013, 00:40:00 (13 years ago)
- Location:
- branches/SHM-2.1-dev/source/Lib/TLibDecoder
- Files:
-
- 11 edited
-
SEIread.cpp (modified) (24 diffs)
-
SEIread.h (modified) (1 diff)
-
TDecBinCoder.h (modified) (2 diffs)
-
TDecBinCoderCABAC.cpp (modified) (2 diffs)
-
TDecBinCoderCABAC.h (modified) (2 diffs)
-
TDecCAVLC.cpp (modified) (31 diffs)
-
TDecCAVLC.h (modified) (1 diff)
-
TDecEntropy.cpp (modified) (1 diff)
-
TDecSbac.cpp (modified) (8 diffs)
-
TDecSlice.cpp (modified) (1 diff)
-
TDecTop.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/Lib/TLibDecoder/SEIread.cpp
r292 r302 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 95 #if M0043_LAYERS_PRESENT_SEI 98 96 case SEI::LAYERS_PRESENT: … … 100 98 break; 101 99 #endif 102 #if L0208_SOP_DESCRIPTION_SEI103 100 case SEI::SOP_DESCRIPTION: 104 101 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); 105 102 break; 106 #endif107 #if K0180_SCALABLE_NESTING_SEI108 103 case SEI::SCALABLE_NESTING: 109 104 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n"); 110 105 break; 111 #endif112 106 default: 113 107 fprintf( g_hTrace, "=========== Unknown SEI message ===========\n"); … … 251 245 xParseSEIGradualDecodingRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize); 252 246 break; 253 #if J0149_TONE_MAPPING_SEI254 247 case SEI::TONE_MAPPING_INFO: 255 248 sei = new SEIToneMappingInfo; 256 249 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 257 250 break; 258 #endif259 251 #if M0043_LAYERS_PRESENT_SEI 260 252 case SEI::LAYERS_PRESENT: … … 270 262 break; 271 263 #endif 272 #if L0208_SOP_DESCRIPTION_SEI273 264 case SEI::SOP_DESCRIPTION: 274 265 sei = new SEISOPDescription; 275 266 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize); 276 267 break; 277 #endif278 #if K0180_SCALABLE_NESTING_SEI279 268 case SEI::SCALABLE_NESTING: 280 269 sei = new SEIScalableNesting; … … 285 274 #endif 286 275 break; 287 #endif288 276 default: 289 277 for (UInt i = 0; i < payloadSize; i++) … … 299 287 switch (payloadType) 300 288 { 301 #if L0363_SEI_ALLOW_SUFFIX302 289 case SEI::USER_DATA_UNREGISTERED: 303 290 sei = new SEIuserDataUnregistered; 304 291 xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize); 305 292 break; 306 #endif307 293 case SEI::DECODED_PICTURE_HASH: 308 294 sei = new SEIDecodedPictureHash; … … 436 422 UInt val; 437 423 READ_CODE(4, val, "active_vps_id"); sei.activeVPSId = val; 438 #if L0047_APS_FLAGS439 424 READ_FLAG( val, "full_random_access_flag"); sei.m_fullRandomAccessFlag = val ? true : false; 440 425 READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false; 441 #endif442 426 READ_UVLC( val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 443 427 … … 472 456 sei.m_duSptCpbRemovalDelay = 0; 473 457 } 474 #if L0044_DU_DPB_OUTPUT_DELAY_HRD475 458 READ_FLAG( val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = val ? true : false; 476 459 if(sei.m_dpbOutputDuDelayPresentFlag) … … 479 462 sei.m_picSptDpbOutputDuDelay = val; 480 463 } 481 #endif482 464 xParseByteAlign(); 483 465 } … … 496 478 READ_FLAG( code, "rap_cpb_params_present_flag" ); sei.m_rapCpbParamsPresentFlag = code; 497 479 } 498 #if L0328_SPLICING499 480 //read splicing flag and cpb_removal_delay_delta 500 481 READ_FLAG( code, "concatenation_flag"); … … 502 483 READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" ); 503 484 sei.m_auCpbRemovalDelayDelta = code + 1; 504 #endif505 #if L0044_CPB_DPB_DELAY_OFFSET506 485 if( sei.m_rapCpbParamsPresentFlag ) 507 486 { … … 509 488 READ_CODE( pHRD->getDpbOutputDelayLengthMinus1() + 1, code, "dpb_delay_offset" ); sei.m_dpbDelayOffset = code; 510 489 } 511 #endif512 490 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 513 491 { … … 541 519 TComHRD *hrd = vui->getHrdParameters(); 542 520 543 #if !L0045_CONDITION_SIGNALLING544 // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added545 if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() )546 {547 return;548 }549 #endif550 551 521 if( vui->getFrameFieldInfoPresentFlag() ) 552 522 { 553 523 READ_CODE( 4, code, "pic_struct" ); sei.m_picStruct = code; 554 #if L0046_RENAME_PROG_SRC_IDC555 524 READ_CODE( 2, code, "source_scan_type" ); sei.m_sourceScanType = code; 556 #else557 READ_CODE( 2, code, "progressive_source_idc" ); sei.m_progressiveSourceIdc = code;558 #endif559 525 READ_FLAG( code, "duplicate_flag" ); sei.m_duplicateFlag = ( code == 1 ? true : false ); 560 526 } 561 527 562 #if L0045_CONDITION_SIGNALLING563 528 if( hrd->getCpbDpbDelaysPresentFlag()) 564 529 { 565 #endif566 530 READ_CODE( ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_minus1" ); 567 531 sei.m_auCpbRemovalDelay = code + 1; … … 569 533 sei.m_picDpbOutputDelay = code; 570 534 571 #if L0044_DU_DPB_OUTPUT_DELAY_HRD572 535 if(hrd->getSubPicCpbParamsPresentFlag()) 573 536 { … … 575 538 sei.m_picDpbOutputDuDelay = code; 576 539 } 577 #endif578 540 if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() ) 579 541 { … … 609 571 } 610 572 } 611 #if L0045_CONDITION_SIGNALLING 612 } 613 #endif 573 } 614 574 xParseByteAlign(); 615 575 } … … 632 592 { 633 593 READ_CODE( 7, val, "frame_packing_arrangement_type" ); sei.m_arrangementType = val; 634 #if L0444_FPA_TYPE635 594 assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) ); 636 #endif637 595 READ_FLAG( val, "quincunx_sampling_flag" ); sei.m_quincunxSamplingFlag = val; 638 596 … … 654 612 655 613 READ_CODE( 8, val, "frame_packing_arrangement_reserved_byte" ); sei.m_arrangementReservedByte = val; 656 #if L0045_PERSISTENCE_FLAGS657 614 READ_FLAG( val, "frame_packing_arrangement_persistence_flag" ); sei.m_arrangementPersistenceFlag = val ? true : false; 658 #else659 READ_UVLC( val, "frame_packing_arrangement_repetition_period" ); sei.m_arrangementRepetetionPeriod = val;660 #endif661 615 } 662 616 READ_FLAG( val, "upsampled_aspect_ratio" ); sei.m_upsampledAspectRatio = val; … … 674 628 READ_FLAG( val, "ver_flip" ); sei.verFlip = val; 675 629 READ_CODE( 16, val, "anticlockwise_rotation" ); sei.anticlockwiseRotation = val; 676 #if L0045_PERSISTENCE_FLAGS677 630 READ_FLAG( val, "display_orientation_persistence_flag" ); sei.persistenceFlag = val; 678 #else679 READ_UVLC( val, "display_orientation_repetition_period" ); sei.repetitionPeriod = val;680 #endif681 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS682 READ_FLAG( val, "display_orientation_extension_flag" ); sei.extensionFlag = val;683 assert( !sei.extensionFlag );684 #endif685 631 } 686 632 xParseByteAlign(); … … 702 648 } 703 649 704 #if J0149_TONE_MAPPING_SEI705 650 Void SEIReader::xParseSEIToneMappingInfo(SEIToneMappingInfo& sei, UInt /*payloadSize*/) 706 651 { … … 783 728 xParseByteAlign(); 784 729 } 785 #endif786 730 787 731 #if M0043_LAYERS_PRESENT_SEI … … 806 750 #endif 807 751 808 #if L0208_SOP_DESCRIPTION_SEI809 752 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize) 810 753 { … … 830 773 xParseByteAlign(); 831 774 } 832 #endif 833 834 835 #if K0180_SCALABLE_NESTING_SEI 775 836 776 #if M0043_LAYERS_PRESENT_SEI 837 777 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) … … 888 828 889 829 } 890 #endif891 830 892 831 Void SEIReader::xParseByteAlign() -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/SEIread.h
r292 r302 78 78 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize); 79 79 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 80 #if J0149_TONE_MAPPING_SEI81 80 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 82 #endif 81 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 83 82 #if M0043_LAYERS_PRESENT_SEI 84 83 Void xParseSEILayersPresent (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps); 85 #endif86 #if L0208_SOP_DESCRIPTION_SEI87 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize);88 #endif89 #if K0180_SCALABLE_NESTING_SEI90 #if M0043_LAYERS_PRESENT_SEI91 84 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps); 92 85 #else 93 86 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps); 94 #endif95 87 #endif 96 88 Void xParseByteAlign(); -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecBinCoder.h
r191 r302 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/SHM-2.1-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r191 r302 75 75 TDecBinCABAC::finish() 76 76 { 77 } 78 79 Void 80 TDecBinCABAC::flush() 81 { 82 while (m_pcTComBitstream->getNumBitsLeft() > 0 && m_pcTComBitstream->getNumBitsUntilByteAligned() != 0) 83 { 84 UInt uiBits; 85 m_pcTComBitstream->read ( 1, uiBits ); 86 } 87 start(); 77 UInt lastByte; 78 79 m_pcTComBitstream->peekPreviousByte( lastByte ); 80 // Check for proper stop/alignment pattern 81 assert( ((lastByte << (8 + m_bitsNeeded)) & 0xff) == 0x80 ); 88 82 } 89 83 … … 241 235 } 242 236 243 /** Reset BAC register values.244 * \returns Void245 */246 Void TDecBinCABAC::resetBac()247 {248 m_uiRange = 510;249 m_bitsNeeded = -8;250 m_uiValue = m_pcTComBitstream->read( 16 );251 }252 253 /** Decode PCM alignment zero bits.254 * \returns Void255 */256 Void TDecBinCABAC::decodePCMAlignBits()257 {258 Int iNum = m_pcTComBitstream->getNumBitsUntilByteAligned();259 260 UInt uiBit = 0;261 m_pcTComBitstream->read( iNum, uiBit );262 }263 264 237 /** Read a PCM code. 265 238 * \param uiLength code bit-depth -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.h
r191 r302 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/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r300 r302 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 { … … 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); … … 232 207 assert(uiCode <= 14); 233 208 pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 234 #else235 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 #endif238 209 239 210 READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); … … 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); … … 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()) … … 453 404 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 454 405 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); 455 #if L0043_MSS_IDC456 406 READ_UVLC( uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode); 457 407 assert(uiCode < 4096); 458 #else459 READ_CODE( 8, uiCode, "min_spatial_segmentation_idc"); pcVUI->setMinSpatialSegmentationIdc(uiCode);460 #endif461 408 READ_UVLC( uiCode, "max_bytes_per_pic_denom" ); pcVUI->setMaxBytesPerPicDenom(uiCode); 462 409 READ_UVLC( uiCode, "max_bits_per_mincu_denom" ); pcVUI->setMaxBitsPerMinCuDenom(uiCode); … … 471 418 if( commonInfPresentFlag ) 472 419 { 473 #if !L0043_TIMING_INFO474 READ_FLAG( uiCode, "timing_info_present_flag" ); hrd->setTimingInfoPresentFlag( uiCode == 1 ? true : false );475 if( hrd->getTimingInfoPresentFlag() )476 {477 READ_CODE( 32, uiCode, "num_units_in_tick" ); hrd->setNumUnitsInTick( uiCode );478 READ_CODE( 32, uiCode, "time_scale" ); hrd->setTimeScale( uiCode );479 }480 #endif481 420 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false ); 482 421 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false ); … … 489 428 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode ); 490 429 READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false ); 491 #if L0044_DU_DPB_OUTPUT_DELAY_HRD492 430 READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1" ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode ); 493 #endif494 431 } 495 432 READ_CODE( 4, uiCode, "bit_rate_scale" ); hrd->setBitRateScale( uiCode ); … … 516 453 hrd->setFixedPicRateWithinCvsFlag( i, true ); 517 454 } 518 #if L0372519 455 hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present 520 456 hrd->setCpbCntMinus1 ( i, 0 ); // Infered to be 0 when not present 521 #endif522 457 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 523 458 { 524 459 READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" ); hrd->setPicDurationInTcMinus1( i, uiCode ); 525 460 } 526 #if L0372527 461 else 528 462 { … … 533 467 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 534 468 } 535 #else536 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false );537 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode );538 #endif539 469 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 540 470 { … … 548 478 if( hrd->getSubPicCpbParamsPresentFlag() ) 549 479 { 550 #if L0363_DU_BIT_RATE 480 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 551 481 READ_UVLC( uiCode, "bit_rate_du_value_minus1" ); hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 552 #endif553 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );554 482 } 555 483 READ_FLAG( uiCode, "cbr_flag" ); hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false ); … … 577 505 #endif 578 506 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 507 assert(uiCode <= 6); 508 579 509 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 580 510 #if SPS_SUB_LAYER_INFO … … 598 528 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 599 529 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 530 assert(uiCode <= 15); 531 600 532 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 533 assert(uiCode <= 3); 601 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 602 535 assert (uiCode == 1); … … 619 552 620 553 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 554 assert(uiCode <= 6); 621 555 pcSPS->setBitDepthY( uiCode + 8 ); 622 556 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 623 557 624 558 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 559 assert(uiCode <= 6); 625 560 pcSPS->setBitDepthC( uiCode + 8 ); 626 561 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 627 562 628 563 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 564 assert(uiCode <= 12); 629 565 630 566 UInt subLayerOrderingInfoPresentFlag; 631 567 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 568 632 569 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 633 570 { 634 #if L0323_DPB635 571 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 636 572 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 637 #else638 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering");639 pcSPS->setMaxDecPicBuffering( uiCode, i);640 #endif641 573 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 642 574 pcSPS->setNumReorderPics(uiCode, i); 643 READ_UVLC ( uiCode, "sps_max_latency_increase ");575 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 644 576 pcSPS->setMaxLatencyIncrease( uiCode, i ); 645 577 … … 698 630 699 631 READ_UVLC( uiCode, "num_short_term_ref_pic_sets" ); 632 assert(uiCode <= 64); 700 633 pcSPS->createRPSList(uiCode); 701 634 … … 823 756 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 824 757 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 825 #if SIGNAL_BITRATE_PICRATE_IN_VPS826 parseBitratePicRateInfo( pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);827 #endif828 758 UInt subLayerOrderingInfoPresentFlag; 829 759 READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag"); 830 760 for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++) 831 761 { 832 #if L0323_DPB833 762 READ_UVLC( uiCode, "vps_max_dec_pic_buffering_minus1[i]" ); pcVPS->setMaxDecPicBuffering( uiCode + 1, i ); 834 #else835 READ_UVLC( uiCode, "vps_max_dec_pic_buffering[i]" ); pcVPS->setMaxDecPicBuffering( uiCode, i );836 #endif837 763 READ_UVLC( uiCode, "vps_num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i ); 838 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 ); 839 765 840 766 if (!subLayerOrderingInfoPresentFlag) … … 876 802 pcVPS->deriveLayerIdListVariables(); 877 803 #endif 878 #if L0043_TIMING_INFO879 804 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 880 805 READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 888 813 READ_UVLC( uiCode, "vps_num_ticks_poc_diff_one_minus1"); timingInfo->setNumTicksPocDiffOneMinus1 (uiCode); 889 814 } 890 #endif891 815 READ_UVLC( uiCode, "vps_num_hrd_parameters" ); pcVPS->setNumHrdParameters( uiCode ); 892 816 … … 904 828 parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 905 829 } 906 #if L0043_TIMING_INFO 907 } 908 #endif 830 } 909 831 READ_FLAG( uiCode, "vps_extension_flag" ); 910 832 if (uiCode) … … 1353 1275 uiCode = 0; 1354 1276 } 1355 memcpy(rps,sps->getRPSList()->getReferencePictureSet(uiCode),sizeof(TComReferencePictureSet));1277 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); 1356 1278 } 1357 1279 if(sps->getLongTermRefsPresent()) … … 1446 1368 rpcSlice->setRPS(rps); 1447 1369 } 1448 1449 1450 1370 if (rpcSlice->getSPS()->getTMVPFlagsPresent()) 1451 1371 { … … 1794 1714 for (UInt idx=0; idx<numEntryPointOffsets; idx++) 1795 1715 { 1796 #if L0116_ENTRY_POINT1797 1716 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset_minus1"); 1798 1717 entryPointOffset[ idx ] = uiCode + 1; 1799 #else1800 READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset");1801 entryPointOffset[ idx ] = uiCode;1802 #endif1803 1718 } 1804 1719 } … … 1822 1737 { 1823 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 1824 1749 Int curEntryPointOffset = 0; 1825 1750 Int prevEntryPointOffset = 0; … … 1889 1814 READ_CODE( 8, uiCode, "general_level_idc" ); rpcPTL->getGeneralPTL()->setLevelIdc(uiCode); 1890 1815 1891 #if L0363_BYTE_ALIGN1892 1816 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1893 1817 { … … 1907 1831 } 1908 1832 } 1909 #endif1910 1833 1911 1834 for(Int i = 0; i < maxNumSubLayersMinus1; i++) 1912 1835 { 1913 #if !L0363_BYTE_ALIGN1914 if(profilePresentFlag)1915 {1916 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);1917 }1918 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode);1919 #endif1920 1836 if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) ) 1921 1837 { … … 1939 1855 READ_FLAG( uiCode, "XXX_profile_compatibility_flag[][j]"); ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0); 1940 1856 } 1941 #if L0046_CONSTRAINT_FLAGS1942 1857 READ_FLAG(uiCode, "general_progressive_source_flag"); 1943 1858 ptl->setProgressiveSourceFlag(uiCode ? true : false); … … 1955 1870 READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]"); 1956 1871 READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]"); 1957 #elif L0363_MORE_BITS 1958 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[0..15]"); 1959 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[16..31]"); 1960 READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[32..47]"); 1961 #else 1962 READ_CODE(16, uiCode, "XXX_reserved_zero_16bits[]"); assert( uiCode == 0 ); 1963 #endif 1964 } 1965 #if SIGNAL_BITRATE_PICRATE_IN_VPS 1966 Void TDecCavlc::parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh) 1967 { 1968 UInt uiCode; 1969 for(Int i = tempLevelLow; i <= tempLevelHigh; i++) 1970 { 1971 READ_FLAG( uiCode, "bit_rate_info_present_flag[i]" ); info->setBitRateInfoPresentFlag(i, uiCode ? true : false); 1972 READ_FLAG( uiCode, "pic_rate_info_present_flag[i]" ); info->setPicRateInfoPresentFlag(i, uiCode ? true : false); 1973 if(info->getBitRateInfoPresentFlag(i)) 1974 { 1975 READ_CODE( 16, uiCode, "avg_bit_rate[i]" ); info->setAvgBitRate(i, uiCode); 1976 READ_CODE( 16, uiCode, "max_bit_rate[i]" ); info->setMaxBitRate(i, uiCode); 1977 } 1978 if(info->getPicRateInfoPresentFlag(i)) 1979 { 1980 READ_CODE( 2, uiCode, "constant_pic_rate_idc[i]" ); info->setConstantPicRateIdc(i, uiCode); 1981 READ_CODE( 16, uiCode, "avg_pic_rate[i]" ); info->setAvgPicRate(i, uiCode); 1982 } 1983 } 1984 } 1985 #endif 1872 } 1873 1986 1874 Void TDecCavlc::parseTerminatingBit( UInt& ruiBit ) 1987 1875 { -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r226 r302 88 88 Void parsePTL ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ); 89 89 Void parseProfileTier (ProfileTierLevel *ptl); 90 #if SIGNAL_BITRATE_PICRATE_IN_VPS91 Void parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh);92 #endif93 90 Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); 94 91 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager); -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
r191 r302 188 188 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 189 189 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 190 #if 0 //REF_IDX_FRAMEWORK // HM bug fix191 if(uiPartIdx)192 {193 for(UInt ui=0; ui<uiMergeIndex+1; ui++)194 {195 cMvFieldNeighbours[(ui<<1)].setMvField(TComMv(), NOT_VALID);196 cMvFieldNeighbours[(ui<<1)+1].setMvField(TComMv(), NOT_VALID);197 }198 }199 #endif200 190 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) 201 191 { -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r191 r302 158 158 UInt uiBit; 159 159 m_pcTDecBinIf->decodeBinTrm(uiBit); 160 assert(uiBit); // end_of_sub_stream_one_bit must be equal to 1 160 161 m_pcTDecBinIf->finish(); 161 162 m_pcBitstream->readOutTrailingBits(); … … 196 197 { 197 198 m_pcTDecBinIf->decodeBinTrm( ruiBit ); 199 if ( ruiBit ) 200 { 201 m_pcTDecBinIf->finish(); 202 } 198 203 } 199 204 … … 318 323 { 319 324 UInt uiSymbol; 320 Bool readPCMSampleFlag = false;321 325 322 326 m_pcTDecBinIf->decodeBinTrm(uiSymbol); … … 324 328 if (uiSymbol) 325 329 { 326 readPCMSampleFlag = true;327 m_pcTDecBinIf->decodePCMAlignBits();328 }329 330 if (readPCMSampleFlag == true)331 {332 330 Bool bIpcmFlag = true; 333 331 … … 395 393 } 396 394 397 m_pcTDecBinIf->resetBac();395 m_pcTDecBinIf->start(); 398 396 } 399 397 } … … 681 679 else 682 680 { 683 intraPredMode = 0;684 681 m_pcTDecBinIf->decodeBinsEP( symbol, 5 ); 685 682 intraPredMode = symbol; … … 917 914 else 918 915 { 919 iDQp=0;920 916 qp = pcCU->getRefQP(uiAbsPartIdx); 921 917 } … … 1102 1098 1103 1099 //===== decode significance flags ===== 1104 UInt uiScanPosLast = uiBlkPosLast;1100 UInt uiScanPosLast; 1105 1101 const UInt *scan = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ]; 1106 1102 for( uiScanPosLast = 0; uiScanPosLast < uiMaxNumCoeffM1; uiScanPosLast++ ) -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r191 r302 384 384 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder); 385 385 386 if ( uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU() 387 && pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() 388 && !uiIsLast ) 389 { 390 // Parse end_of_substream_one_bit for WPP case 391 UInt binVal; 392 pcSbacDecoder->parseTerminatingBit( binVal ); 393 assert( binVal ); 394 } 395 386 396 //Store probabilities of second LCU in line into buffer 387 397 if ( (uiCol == uiTileLCUX+1)&& (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) ) -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r297 r302 241 241 } 242 242 243 #if L0323_DPB 244 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 245 #else 246 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded 247 #endif 243 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 248 244 if (m_cListPic.size() < (UInt)m_iMaxRefPicNum) 249 245 { … … 476 472 m_apcSlicePilot->setPPS(pps); 477 473 m_apcSlicePilot->setSPS(sps); 478 479 474 pps->setSPS(sps); 480 475 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1); … … 991 986 //--------------- 992 987 pcSlice->setRefPOCList(); 993 #if !L0034_COMBINED_LIST_CLEANUP994 pcSlice->setNoBackPredFlag( false );995 if ( pcSlice->getSliceType() == B_SLICE )996 {997 if ( pcSlice->getNumRefIdx(RefPicList( 0 ) ) == pcSlice->getNumRefIdx(RefPicList( 1 ) ) )998 {999 pcSlice->setNoBackPredFlag( true );1000 for ( i=0; i < pcSlice->getNumRefIdx(RefPicList( 1 ) ); i++ )1001 {1002 if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) )1003 {1004 pcSlice->setNoBackPredFlag( false );1005 break;1006 }1007 }1008 }1009 }1010 #endif1011 988 } 1012 989
Note: See TracChangeset for help on using the changeset viewer.