Changeset 894 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 26 Sep 2014, 03:22:40 (11 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 4 edited
-
SEIread.cpp (modified) (10 diffs)
-
SEIread.h (modified) (1 diff)
-
TDecCAVLC.cpp (modified) (5 diffs)
-
TDecCAVLC.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r884 r894 251 251 { 252 252 sei = new SEIDecodingUnitInfo; 253 #if VPS_VUI_BSP_HRD_PARAMS 254 xParseSEIDecodingUnitInfo((SEIDecodingUnitInfo&) *sei, payloadSize, sps, nestingSei, bspNestingSei, vps); 255 #else 253 256 xParseSEIDecodingUnitInfo((SEIDecodingUnitInfo&) *sei, payloadSize, sps); 257 #endif 254 258 } 255 259 break; … … 262 266 { 263 267 sei = new SEIBufferingPeriod; 268 #if VPS_VUI_BSP_HRD_PARAMS 269 xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps, nestingSei, bspNestingSei, vps); 270 #else 264 271 xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps); 272 #endif 265 273 } 266 274 break; … … 273 281 { 274 282 sei = new SEIPictureTiming; 283 #if VPS_VUI_BSP_HRD_PARAMS 284 xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps, nestingSei, bspNestingSei, vps); 285 #else 275 286 xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps); 287 #endif 276 288 } 277 289 break; … … 600 612 } 601 613 614 #if VPS_VUI_BSP_HRD_PARAMS 615 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps) 616 #else 602 617 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, TComSPS *sps) 618 #endif 603 619 { 604 620 UInt val; … … 606 622 sei.m_decodingUnitIdx = val; 607 623 624 #if VPS_VUI_BSP_HRD_PARAMS 625 TComHRD *hrd; 626 if( bspNestingSei ) // If DU info SEI contained inside a BSP nesting SEI message 627 { 628 assert( nestingSei ); 629 Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx; 630 Int seiOlsIdx = bspNestingSei->m_seiOlsIdx; 631 Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1; 632 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 633 std::vector<Int> hrdIdx(maxValues, 0); 634 std::vector<TComHRD *> hrdVec; 635 std::vector<Int> syntaxElemLen(maxValues, 0); 636 for(Int i = 0; i < maxValues; i++) 637 { 638 hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx); 639 hrdVec.push_back(vps->getBspHrd(hrdIdx[i])); 640 641 syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1; 642 if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) ) 643 { 644 assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23 645 } 646 if( i > 0 ) 647 { 648 assert( hrdVec[i]->getSubPicCpbParamsPresentFlag() == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() ); 649 assert( hrdVec[i]->getSubPicCpbParamsInPicTimingSEIFlag() == hrdVec[i-1]->getSubPicCpbParamsInPicTimingSEIFlag() ); 650 assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1() == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() ); 651 // To be done: Check CpbDpbDelaysPresentFlag 652 } 653 } 654 hrd = hrdVec[0]; 655 } 656 else 657 { 658 TComVUI *vui = sps->getVuiParameters(); 659 hrd = vui->getHrdParameters(); 660 } 661 #else 608 662 TComVUI *vui = sps->getVuiParameters(); 609 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) 610 { 611 READ_CODE( ( vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay"); 663 TComHrd *hrd = vui->getHrdParameters(); 664 #endif 665 if(hrd->getSubPicCpbParamsInPicTimingSEIFlag()) 666 { 667 READ_CODE( ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay"); 612 668 sei.m_duSptCpbRemovalDelay = val; 613 669 } … … 619 675 if(sei.m_dpbOutputDuDelayPresentFlag) 620 676 { 621 READ_CODE( vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay");677 READ_CODE(hrd->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay"); 622 678 sei.m_picSptDpbOutputDuDelay = val; 623 679 } … … 625 681 } 626 682 683 #if VPS_VUI_BSP_HRD_PARAMS 684 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps) 685 #else 627 686 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, TComSPS *sps) 687 #endif 628 688 { 629 689 Int i, nalOrVcl; 630 690 UInt code; 631 691 692 #if VPS_VUI_BSP_HRD_PARAMS 693 TComHRD *pHRD; 694 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 695 { 696 assert( nestingSei ); 697 Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx; 698 Int seiOlsIdx = bspNestingSei->m_seiOlsIdx; 699 Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1; 700 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 701 std::vector<Int> hrdIdx(maxValues, 0); 702 std::vector<TComHRD *> hrdVec; 703 std::vector<Int> syntaxElemLen(maxValues, 0); 704 for(i = 0; i < maxValues; i++) 705 { 706 hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx); 707 hrdVec.push_back(vps->getBspHrd(hrdIdx[i])); 708 709 syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1; 710 if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) ) 711 { 712 assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23 713 } 714 if( i > 0 ) 715 { 716 assert( hrdVec[i]->getCpbRemovalDelayLengthMinus1() == hrdVec[i-1]->getCpbRemovalDelayLengthMinus1() ); 717 assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1() == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() ); 718 assert( hrdVec[i]->getSubPicCpbParamsPresentFlag() == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() ); 719 } 720 } 721 pHRD = hrdVec[i]; 722 } 723 else 724 { 725 TComVUI *vui = sps->getVuiParameters(); 726 pHRD = vui->getHrdParameters(); 727 } 728 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 729 #else 632 730 TComVUI *pVUI = sps->getVuiParameters(); 633 731 TComHRD *pHRD = pVUI->getHrdParameters(); 732 #endif 634 733 635 734 READ_UVLC( code, "bp_seq_parameter_set_id" ); sei.m_bpSeqParameterSetId = code; … … 683 782 xParseByteAlign(); 684 783 } 784 #if VPS_VUI_BSP_HRD_PARAMS 785 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps) 786 #else 685 787 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, TComSPS *sps) 788 #endif 686 789 { 687 790 Int i; 688 791 UInt code; 689 792 793 #if VPS_VUI_BSP_HRD_PARAMS 794 TComHRD *hrd; 795 TComVUI *vui = sps->getVuiParameters(); 796 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 797 { 798 assert( nestingSei ); 799 Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx; 800 Int seiOlsIdx = bspNestingSei->m_seiOlsIdx; 801 Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1; 802 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 803 std::vector<Int> hrdIdx(maxValues, 0); 804 std::vector<TComHRD *> hrdVec; 805 std::vector<Int> syntaxElemLen(maxValues, 0); 806 for(i = 0; i < maxValues; i++) 807 { 808 hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx); 809 hrdVec.push_back(vps->getBspHrd(hrdIdx[i])); 810 811 syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1; 812 if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) ) 813 { 814 assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23 815 } 816 if( i > 0 ) 817 { 818 assert( hrdVec[i]->getSubPicCpbParamsPresentFlag() == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() ); 819 assert( hrdVec[i]->getSubPicCpbParamsInPicTimingSEIFlag() == hrdVec[i-1]->getSubPicCpbParamsInPicTimingSEIFlag() ); 820 assert( hrdVec[i]->getCpbRemovalDelayLengthMinus1() == hrdVec[i-1]->getCpbRemovalDelayLengthMinus1() ); 821 assert( hrdVec[i]->getDpbOutputDelayLengthMinus1() == hrdVec[i-1]->getDpbOutputDelayLengthMinus1() ); 822 assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1() == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() ); 823 assert( hrdVec[i]->getDuCpbRemovalDelayLengthMinus1() == hrdVec[i-1]->getDuCpbRemovalDelayLengthMinus1() ); 824 // To be done: Check CpbDpbDelaysPresentFlag 825 } 826 } 827 hrd = hrdVec[0]; 828 } 829 else 830 { 831 hrd = vui->getHrdParameters(); 832 } 833 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 834 #else 690 835 TComVUI *vui = sps->getVuiParameters(); 691 836 TComHRD *hrd = vui->getHrdParameters(); 837 #endif 692 838 693 839 if( vui->getFrameFieldInfoPresentFlag() ) … … 1264 1410 assert(vps->getVpsVuiPresentFlag()); 1265 1411 1412 #if VPS_VUI_BSP_HRD_PARAMS 1413 UInt uiCode; 1414 Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx; 1415 Int seiOlsIdx = bspNestingSei.m_seiOlsIdx; 1416 Int maxTemporalId = nestingSei.m_nestingMaxTemporalIdPlus1[0]; 1417 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 1418 std::vector<Int> hrdIdx(0, maxValues); 1419 std::vector<TComHRD *> hrdVec; 1420 std::vector<Int> syntaxElemLen; 1421 for(Int i = 0; i < maxValues; i++) 1422 { 1423 hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei.m_bspIdx); 1424 hrdVec[i] = vps->getBspHrd(hrdIdx[i]); 1425 1426 syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1; 1427 if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) ) 1428 { 1429 assert( syntaxElemLen[i] == 24 ); // Default value of init_cpb_removal_delay_length_minus1 is 23 1430 } 1431 if( i > 0 ) 1432 { 1433 assert( hrdVec[i]->getNalHrdParametersPresentFlag() == hrdVec[i-1]->getNalHrdParametersPresentFlag() ); 1434 assert( hrdVec[i]->getVclHrdParametersPresentFlag() == hrdVec[i-1]->getVclHrdParametersPresentFlag() ); 1435 } 1436 } 1437 if (hrdVec[0]->getNalHrdParametersPresentFlag()) 1438 { 1439 for(UInt i = 0; i < maxValues; i++) 1440 { 1441 READ_CODE( syntaxElemLen[i], uiCode, "nal_initial_arrival_delay[i]" ); sei.m_nalInitialArrivalDelay[i] = uiCode; 1442 } 1443 } 1444 if( hrdVec[0]->getVclHrdParametersPresentFlag() ) 1445 { 1446 for(UInt i = 0; i < maxValues; i++) 1447 { 1448 READ_CODE( syntaxElemLen[i], uiCode, "vcl_initial_arrival_delay[i]" ); sei.m_vclInitialArrivalDelay[i] = uiCode; 1449 } 1450 } 1451 #else 1266 1452 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]); 1267 1453 UInt len; … … 1307 1493 } 1308 1494 } 1495 #endif 1309 1496 } 1310 1497 -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
r856 r894 80 80 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize); 81 81 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize); 82 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize); 83 #if VPS_VUI_BSP_HRD_PARAMS 84 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps); 85 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps); 86 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps); 87 #else 82 88 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps); 83 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize);84 89 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps); 85 90 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps); 91 #endif 86 92 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize); 87 93 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r893 r894 578 578 READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" ); hrd->setDpbOutputDelayLengthMinus1( uiCode ); 579 579 } 580 #if VPS_VUI_BSP_HRD_PARAMS 581 else 582 { 583 hrd->setInitialCpbRemovalDelayLengthMinus1( 23 ); 584 // Add inferred values for other syntax elements here. 585 } 586 #endif 580 587 } 581 588 Int i, j, nalOrVcl; … … 2625 2632 if (vps->getVpsVuiBspHrdPresentFlag()) 2626 2633 { 2634 #if VPS_VUI_BSP_HRD_PARAMS 2635 parseVpsVuiBspHrdParams(vps); 2636 #else 2627 2637 #if R0227_VUI_BSP_HRD_FLAG 2628 2638 assert (vps->getTimingInfo()->getTimingInfoPresentFlag() == 1); … … 2703 2713 } 2704 2714 } 2705 } 2706 #endif 2707 2715 #endif 2716 } 2717 #endif 2708 2718 #if P0182_VPS_VUI_PS_FLAG 2709 2719 for(i = 1; i < vps->getMaxLayers(); i++) … … 2721 2731 #endif 2722 2732 } 2733 2723 2734 #endif //SVC_EXTENSION 2724 2735 … … 4487 4498 } 4488 4499 #endif 4500 #if VPS_VUI_BSP_HRD_PARAMS 4501 Void TDecCavlc::parseVpsVuiBspHrdParams( TComVPS *vps ) 4502 { 4503 UInt uiCode; 4504 assert (vps->getTimingInfo()->getTimingInfoPresentFlag() == 1); 4505 READ_UVLC( uiCode, "vps_num_add_hrd_params" ); vps->setVpsNumAddHrdParams(uiCode); 4506 vps->createBspHrdParamBuffer(vps->getVpsNumAddHrdParams()); // Also allocates m_cprmsAddPresentFlag and m_numSubLayerHrdMinus 4507 4508 for( Int i = vps->getNumHrdParameters(), j = 0; i < vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams(); i++, j++ ) // j = i - vps->getNumHrdParameters() 4509 { 4510 if( i > 0 ) 4511 { 4512 READ_FLAG( uiCode, "cprms_add_present_flag[i]" ); vps->setCprmsAddPresentFlag(j, uiCode ? true : false); 4513 } 4514 else 4515 { 4516 // i == 0 4517 if( vps->getNumHrdParameters() == 0 ) 4518 { 4519 vps->setCprmsAddPresentFlag(0, true); 4520 } 4521 } 4522 READ_UVLC( uiCode, "num_sub_layer_hrd_minus1[i]" ); vps->setNumSubLayerHrdMinus1(j, uiCode ); 4523 assert( uiCode <= vps->getMaxTLayers() - 1 ); 4524 4525 parseHrdParameters( vps->getBspHrd(j), vps->getCprmsAddPresentFlag(j), vps->getNumSubLayerHrdMinus1(j) ); 4526 if( i > 0 && !vps->getCprmsAddPresentFlag(i) ) 4527 { 4528 // Copy common information parameters 4529 if( i == vps->getNumHrdParameters() ) 4530 { 4531 vps->getBspHrd(j)->copyCommonInformation( vps->getHrdParameters( vps->getNumHrdParameters() - 1 ) ); 4532 } 4533 else 4534 { 4535 vps->getBspHrd(j)->copyCommonInformation( vps->getBspHrd( j - 1 ) ); 4536 } 4537 } 4538 } 4539 for (Int h = 1; h < vps->getNumOutputLayerSets(); h++) 4540 { 4541 Int lsIdx = vps->getOutputLayerSetIdx( h ); 4542 READ_UVLC( uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode); 4543 for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ ) 4544 { 4545 READ_UVLC( uiCode, "num_partitions_in_scheme_minus1[h][j]" ); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode); 4546 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ ) 4547 { 4548 for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ ) 4549 { 4550 READ_FLAG( uiCode, "layer_included_in_partition_flag[h][j][k][r]" ); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false); 4551 } 4552 } 4553 } 4554 for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ ) 4555 { 4556 for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ ) 4557 { 4558 READ_UVLC( uiCode, "num_bsp_schedules_minus1[h][i][t]"); vps->setNumBspSchedulesMinus1(h, i, t, uiCode); 4559 for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ ) 4560 { 4561 for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ ) 4562 { 4563 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 4564 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 4565 } 4566 } 4567 } 4568 } 4569 4570 // To be done: Check each layer included in not more than one BSP in every partitioning scheme, 4571 // and other related checks associated with layers in bitstream partitions. 4572 4573 } 4574 } 4575 #endif 4489 4576 #endif 4490 4577 //! \} -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r826 r894 86 86 Void parseVpsDpbSizeTable( TComVPS *vps ); 87 87 #endif 88 #if VPS_VUI_BSP_HRD_PARAMS 89 Void parseVpsVuiBspHrdParams( TComVPS *vps ); 90 #endif 88 91 #if SPS_DPB_PARAMS 89 92 Void parseSPS ( TComSPS* pcSPS ); // it should be removed after macro clean up
Note: See TracChangeset for help on using the changeset viewer.