Changeset 442 in SHVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 21 Oct 2013, 13:41:29 (11 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev merged: 350-351,357-360 /branches/SHM-3.1-dev (added) merged: 354-356,361-403,405-441 /trunk merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source merged: 357-360 /branches/SHM-3.1-dev/source (added) merged: 355-356,361-364,366-403,405,407-441 /trunk/source merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/SEIread.cpp
r313 r442 101 101 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); 102 102 break; 103 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 104 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 105 fprintf( g_hTrace, "=========== Inter Layer Constrained Tile Sets SEI message ===========\n"); 106 break; 107 #endif 103 108 case SEI::SCALABLE_NESTING: 104 109 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n"); … … 266 271 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize); 267 272 break; 273 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 274 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 275 sei = new SEIInterLayerConstrainedTileSets; 276 xParseSEIInterLayerConstrainedTileSets((SEIInterLayerConstrainedTileSets&) *sei, payloadSize); 277 break; 278 #endif 268 279 case SEI::SCALABLE_NESTING: 269 280 sei = new SEIScalableNesting; … … 349 360 350 361 /* restore primary bitstream for sei_message */ 362 getBitstream()->deleteFifo(); 351 363 delete getBitstream(); 352 364 setBitstream(bs); … … 774 786 } 775 787 788 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 789 Void SEIReader::xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize) 790 { 791 UInt uiCode; 792 793 READ_FLAG( uiCode, "il_all_tiles_exact_sample_value_match_flag" ); sei.m_ilAllTilesExactSampleValueMatchFlag = uiCode; 794 READ_FLAG( uiCode, "il_one_tile_per_tile_set_flag" ); sei.m_ilOneTilePerTileSetFlag = uiCode; 795 if( !sei.m_ilOneTilePerTileSetFlag ) 796 { 797 READ_UVLC( uiCode, "il_num_sets_in_message_minus1" ); sei.m_ilNumSetsInMessageMinus1 = uiCode; 798 if( sei.m_ilNumSetsInMessageMinus1 ) 799 { 800 READ_FLAG( uiCode, "skipped_tile_set_present_flag" ); sei.m_skippedTileSetPresentFlag = uiCode; 801 } 802 else 803 { 804 sei.m_skippedTileSetPresentFlag = false; 805 } 806 UInt numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - (sei.m_skippedTileSetPresentFlag ? 1 : 0) + 1; 807 for( UInt i = 0; i < numSignificantSets; i++ ) 808 { 809 READ_UVLC( uiCode, "ilcts_id" ); sei.m_ilctsId[i] = uiCode; 810 READ_UVLC( uiCode, "il_num_tile_rects_in_set_minus1" ) ;sei.m_ilNumTileRectsInSetMinus1[i] = uiCode; 811 for( UInt j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[i]; j++ ) 812 { 813 READ_UVLC( uiCode, "il_top_left_tile_index" ); sei.m_ilTopLeftTileIndex[i][j] = uiCode; 814 READ_UVLC( uiCode, "il_bottom_right_tile_index" ); sei.m_ilBottomRightTileIndex[i][j] = uiCode; 815 } 816 READ_CODE( 2, uiCode, "ilc_idc" ); sei.m_ilcIdc[i] = uiCode; 817 if( sei.m_ilAllTilesExactSampleValueMatchFlag ) 818 { 819 READ_FLAG( uiCode, "il_exact_sample_value_match_flag" ); sei.m_ilExactSampleValueMatchFlag[i] = uiCode; 820 } 821 } 822 } 823 else 824 { 825 READ_CODE( 2, uiCode, "all_tiles_ilc_idc" ); sei.m_allTilesIlcIdc = uiCode; 826 } 827 828 xParseByteAlign(); 829 } 830 #endif 831 776 832 #if M0043_LAYERS_PRESENT_SEI 777 833 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) -
trunk/source/Lib/TLibDecoder/SEIread.h
r313 r442 80 80 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 81 81 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 82 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 83 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize); 84 #endif 82 85 #if M0043_LAYERS_PRESENT_SEI 83 86 Void xParseSEILayersPresent (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps); -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r313 r442 52 52 if (length < 10) 53 53 { 54 fprintf( g_hTrace, "%-50s u(%d) : % d\n", pSymbolName, length, rValue );54 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 55 55 } 56 56 else 57 57 { 58 fprintf( g_hTrace, "%-50s u(%d) : % d\n", pSymbolName, length, rValue );58 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 59 59 } 60 60 fflush ( g_hTrace ); … … 65 65 xReadUvlc (rValue); 66 66 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 67 fprintf( g_hTrace, "%-50s ue(v) : % d\n", pSymbolName, rValue );67 fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue ); 68 68 fflush ( g_hTrace ); 69 69 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r345 r442 291 291 } 292 292 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 293 294 #if IL_SL_SIGNALLING_N0371 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 296 #endif 297 293 298 if(pcPPS->getScalingListPresentFlag ()) 294 299 { 300 #if IL_SL_SIGNALLING_N0371 301 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() ); 302 303 if( pcPPS->getLayerId() > 0 ) 304 { 305 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false ); 306 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() ); 307 308 if( pcPPS->getPredScalingListFlag() ) 309 { 310 READ_UVLC ( uiCode, "scaling_list_pps_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode ); 311 312 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 313 assert( /*pcPPS->getScalingListRefLayerId() >= 0 &&*/ pcPPS->getScalingListRefLayerId() <= 62 ); 314 315 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of pps_scaling_list_ref_layer_id shall be greater than 0 316 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() ) 317 { 318 assert( pcPPS->getScalingListRefLayerId() > 0 ); 319 } 320 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 322 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 323 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 324 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 326 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 327 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true ); 328 329 pcPPS->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() ); 330 parseScalingList( pcPPS->getScalingList() ); 331 } 332 else 333 { 334 parseScalingList( pcPPS->getScalingList() ); 335 } 336 } 337 else 338 { 339 parseScalingList( pcPPS->getScalingList() ); 340 } 341 #else 295 342 parseScalingList( pcPPS->getScalingList() ); 343 #endif 296 344 } 297 345 … … 377 425 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 378 426 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); 427 #if TIMING_INFO_NONZERO_LAYERID_SPS 428 if( pcSPS->getLayerId() > 0 ) 429 { 430 assert( timingInfo->getTimingInfoPresentFlag() == false ); 431 } 432 #endif 379 433 if(timingInfo->getTimingInfoPresentFlag()) 380 434 { … … 516 570 } 517 571 #endif 572 #if IL_SL_SIGNALLING_N0371 573 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) ); 574 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS ); 575 #endif 518 576 if ( pcSPS->getMaxTLayers() == 1 ) 519 577 { … … 525 583 #endif 526 584 } 527 585 #ifdef SPS_PTL_FIX 586 if ( pcSPS->getLayerId() == 0) 587 { 588 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 589 } 590 #else 528 591 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 592 #endif 593 529 594 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 530 595 assert(uiCode <= 15); 531 532 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 533 assert(uiCode <= 3); 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 535 assert (uiCode == 1); 536 if( uiCode == 3 ) 537 { 538 READ_FLAG( uiCode, "separate_colour_plane_flag"); assert(uiCode == 0); 539 } 540 541 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 542 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 596 597 #if REPN_FORMAT_IN_VPS 598 if( pcSPS->getLayerId() > 0 ) 599 { 600 READ_FLAG( uiCode, "update_rep_format_flag" ); 601 pcSPS->setUpdateRepFormatFlag( uiCode ? true : false ); 602 } 603 else 604 { 605 pcSPS->setUpdateRepFormatFlag( true ); 606 } 607 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 608 { 609 #endif 610 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 611 assert(uiCode <= 3); 612 // 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 613 assert (uiCode == 1); 614 if( uiCode == 3 ) 615 { 616 READ_FLAG( uiCode, "separate_colour_plane_flag"); assert(uiCode == 0); 617 } 618 619 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 620 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 621 #if REPN_FORMAT_IN_VPS 622 } 623 #endif 543 624 READ_FLAG( uiCode, "conformance_window_flag"); 544 625 if (uiCode != 0) 545 626 { 546 627 Window &conf = pcSPS->getConformanceWindow(); 628 #if REPN_FORMAT_IN_VPS 629 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode ); 630 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode ); 631 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode ); 632 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode ); 633 #else 547 634 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 548 635 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 549 636 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 550 637 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 551 } 552 553 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 554 assert(uiCode <= 6); 555 pcSPS->setBitDepthY( uiCode + 8 ); 556 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 557 558 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 559 assert(uiCode <= 6); 560 pcSPS->setBitDepthC( uiCode + 8 ); 561 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 562 638 #endif 639 } 640 #if REPN_FORMAT_IN_VPS 641 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 642 { 643 #endif 644 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 645 assert(uiCode <= 6); 646 pcSPS->setBitDepthY( uiCode + 8 ); 647 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 648 649 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 650 assert(uiCode <= 6); 651 pcSPS->setBitDepthC( uiCode + 8 ); 652 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 653 #if REPN_FORMAT_IN_VPS 654 } 655 #endif 563 656 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 564 657 assert(uiCode <= 12); … … 606 699 Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 607 700 pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth ); 608 609 701 READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); 702 610 703 if(pcSPS->getScalingListFlag()) 611 704 { … … 613 706 if(pcSPS->getScalingListPresentFlag ()) 614 707 { 708 709 #if IL_SL_SIGNALLING_N0371 710 pcSPS->getScalingList()->setLayerId( pcSPS->getLayerId() ); 711 712 if( pcSPS->getLayerId() > 0 ) 713 { 714 READ_FLAG( uiCode, "sps_pred_scaling_list_flag" ); pcSPS->setPredScalingListFlag ( uiCode ); 715 pcSPS->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() ); 716 717 if( pcSPS->getPredScalingListFlag() ) 718 { 719 READ_UVLC( uiCode, "scaling_list_sps_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode ); 720 721 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 722 assert( /*pcSPS->getScalingListRefLayerId() >= 0 &&*/ pcSPS->getScalingListRefLayerId() <= 62 ); 723 724 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 725 if( pcSPS->getVPS()->getAvcBaseLayerFlag() ) 726 { 727 assert( pcSPS->getScalingListRefLayerId() > 0 ); 728 } 729 730 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 731 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 732 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 733 734 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 735 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 736 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true ); 737 738 pcSPS->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() ); 739 parseScalingList( pcSPS->getScalingList() ); 740 } 741 else 742 { 743 parseScalingList( pcSPS->getScalingList() ); 744 } 745 } 746 else 747 { 748 parseScalingList( pcSPS->getScalingList() ); 749 } 750 #else 615 751 parseScalingList( pcSPS->getScalingList() ); 752 #endif 753 616 754 } 617 755 } … … 697 835 UInt uiCode; 698 836 // more syntax elements to be parsed here 837 838 #if VERT_MV_CONSTRAINT 839 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); 840 // Vertical MV component restriction is not used in SHVC CTC 841 assert( uiCode == 0 ); 842 #endif 699 843 #if SCALED_REF_LAYER_OFFSETS 700 #if SCALED_REF_LAYER_OFFSET_FLAG701 READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" );702 if( uiCode )703 #else704 844 if( pcSPS->getLayerId() > 0 ) 705 #endif706 845 { 707 846 Int iCode; … … 754 893 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 755 894 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 895 #if VPS_EXTN_OFFSET 896 READ_CODE( 16, uiCode, "vps_extension_offset" ); pcVPS->setExtensionOffset( uiCode ); 897 #else 756 898 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 899 #endif 757 900 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 758 901 UInt subLayerOrderingInfoPresentFlag; … … 833 976 { 834 977 #if VPS_EXTNS 978 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 979 { 980 READ_FLAG( uiCode, "vps_extension_alignment_bit_equal_to_one"); assert(uiCode == 1); 981 } 835 982 parseVPSExtension(pcVPS); 836 983 READ_FLAG( uiCode, "vps_entension2_flag" ); … … 927 1074 assert( uiCode <= vps->getMaxLayerId() ); 928 1075 } 1076 } 1077 #endif 1078 #if VIEW_ID_RELATED_SIGNALING 1079 // if ( pcVPS->getNumViews() > 1 ) 1080 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1081 { 1082 READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode ); 1083 } 1084 1085 for( i = 0; i < vps->getNumViews(); i++ ) 1086 { 1087 READ_CODE( vps->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); vps->setViewIdVal( i, uiCode ); 929 1088 } 930 1089 #endif … … 952 1111 #if JCTVC_M0203_INTERLAYER_PRED_IDC 953 1112 #if N0120_MAX_TID_REF_PRESENT_FLAG 954 READ_FLAG( uiCode, "max_tid_ il_ref_pics_plus1_present_flag"); vps->setMaxTidIlRefPicsPlus1PresentFlag(uiCode ? true : false);955 if (vps->getMaxTid IlRefPicsPlus1PresentFlag())1113 READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false); 1114 if (vps->getMaxTidRefPresentFlag()) 956 1115 { 957 1116 for(i = 0; i < vps->getMaxLayers() - 1; i++) 958 1117 { 959 READ_CODE( 3, uiCode, "max_sublayer_for_ilp_plus1[i]" ); vps->setMaxSublayerForIlpPlus1(i, uiCode); 960 assert( uiCode <= vps->getMaxTLayers() ); 1118 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1119 #if N0120_MAX_TID_REF_CFG 1120 assert( uiCode <= vps->getMaxTLayers()); 1121 #else 1122 assert( uiCode <= vps->getMaxTLayers()+ 1 ); 1123 #endif 961 1124 } 962 1125 } … … 965 1128 for(i = 0; i < vps->getMaxLayers() - 1; i++) 966 1129 { 967 vps->setMax SublayerForIlpPlus1(i, 7);1130 vps->setMaxTidIlRefPicsPlus1(i, 7); 968 1131 } 969 1132 } … … 971 1134 for(i = 0; i < vps->getMaxLayers() - 1; i++) 972 1135 { 973 READ_CODE( 3, uiCode, "max_ sublayer_for_ilp_plus1[i]" ); vps->setMaxSublayerForIlpPlus1(i, uiCode);1136 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 974 1137 assert( uiCode <= vps->getMaxTLayers() ); 975 1138 } … … 1090 1253 #endif 1091 1254 #endif 1255 #if REPN_FORMAT_IN_VPS 1256 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1257 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); 1258 1259 if( vps->getRepFormatIdxPresentFlag() ) 1260 { 1261 READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); 1262 vps->setVpsNumRepFormats( uiCode + 1 ); 1263 } 1264 else 1265 { 1266 // default assignment 1267 assert (vps->getMaxLayers() <= 16); // If max_layers_is more than 15, num_rep_formats has to be signaled 1268 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1269 } 1270 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1271 { 1272 // Read rep_format_structures 1273 parseRepFormat( vps->getVpsRepFormat(i) ); 1274 } 1275 1276 // Default assignment for layer 0 1277 vps->setVpsRepFormatIdx( 0, 0 ); 1278 if( vps->getRepFormatIdxPresentFlag() ) 1279 { 1280 for(i = 1; i < vps->getMaxLayers(); i++) 1281 { 1282 if( vps->getVpsNumRepFormats() > 1 ) 1283 { 1284 READ_CODE( 4, uiCode, "vps_rep_format_idx[i]" ); 1285 vps->setVpsRepFormatIdx( i, uiCode ); 1286 } 1287 else 1288 { 1289 // default assignment - only one rep_format() structure 1290 vps->setVpsRepFormatIdx( i, 0 ); 1291 } 1292 } 1293 } 1294 else 1295 { 1296 // default assignment - each layer assigned each rep_format() structure in the order signaled 1297 for(i = 1; i < vps->getMaxLayers(); i++) 1298 { 1299 vps->setVpsRepFormatIdx( i, i ); 1300 } 1301 } 1302 #endif 1092 1303 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1093 READ_FLAG(uiCode, "max_one_active_ref_layer_flag" ); 1094 vps->setMaxOneActiveRefLayerFlag(uiCode); 1095 #endif 1304 READ_FLAG(uiCode, "max_one_active_ref_layer_flag" ); 1305 vps->setMaxOneActiveRefLayerFlag(uiCode); 1306 #endif 1307 1308 #if N0147_IRAP_ALIGN_FLAG 1309 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1310 vps->setCrossLayerIrapAlignFlag(uiCode); 1311 #endif 1096 1312 1097 1313 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG … … 1128 1344 } 1129 1345 } 1130 #endif 1346 1347 #endif 1348 1349 #if IL_SL_SIGNALLING_N0371 1350 for(i = 1; i < vps->getMaxLayers(); i++) 1351 { 1352 for(j = 0; j < i; j++) 1353 { 1354 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1355 } 1356 } 1357 #endif 1358 1131 1359 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1132 1360 READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false); 1133 1361 #endif 1134 } 1135 #endif 1136 1362 1363 READ_FLAG( uiCode, "vps_vui_present_flag" ); 1364 if (uiCode) 1365 { 1366 #if VPS_VUI 1367 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1368 { 1369 READ_FLAG( uiCode, "vps_vui_alignment_bit_equal_to_one"); assert(uiCode == 1); 1370 } 1371 parseVPSVUI(vps); 1372 #endif 1373 } 1374 } 1375 #endif 1376 #if REPN_FORMAT_IN_VPS 1377 Void TDecCavlc::parseRepFormat ( RepFormat *repFormat ) 1378 { 1379 UInt uiCode; 1380 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1381 1382 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1383 { 1384 READ_FLAG( uiCode, "separate_colour_plane_flag"); repFormat->setSeparateColourPlaneVpsFlag(uiCode ? true : false); 1385 } 1386 1387 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1388 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1389 1390 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1391 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1392 1393 } 1394 #endif 1395 #if VPS_VUI 1396 Void TDecCavlc::parseVPSVUI(TComVPS *vps) 1397 { 1398 UInt i,j; 1399 UInt uiCode; 1400 #if VPS_VUI_BITRATE_PICRATE 1401 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); vps->setBitRatePresentVpsFlag( uiCode ? true : false ); 1402 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); vps->setPicRatePresentVpsFlag( uiCode ? true : false ); 1403 1404 Bool parseFlag = vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag(); 1405 { 1406 for( i = 0; i < vps->getNumLayerSets(); i++ ) 1407 { 1408 for( j = 0; j < vps->getMaxTLayers(); j++ ) 1409 { 1410 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 1411 { 1412 READ_FLAG( uiCode, "bit_rate_present_vps_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 1413 } 1414 else 1415 { 1416 vps->setBitRatePresentFlag( i, j, false ); 1417 } 1418 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 1419 { 1420 READ_FLAG( uiCode, "pic_rate_present_vps_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 1421 } 1422 else 1423 { 1424 vps->setPicRatePresentFlag( i, j, false ); 1425 } 1426 if( parseFlag && vps->getBitRatePresentFlag(i, j) ) 1427 { 1428 READ_CODE( 16, uiCode, "avg_bit_rate[i][j]" ); vps->setAvgBitRate( i, j, uiCode ); 1429 READ_CODE( 16, uiCode, "max_bit_rate[i][j]" ); vps->setMaxBitRate( i, j, uiCode ); 1430 } 1431 else 1432 { 1433 vps->setAvgBitRate( i, j, 0 ); 1434 vps->setMaxBitRate( i, j, 0 ); 1435 } 1436 if( parseFlag && vps->getPicRatePresentFlag(i, j) ) 1437 { 1438 READ_CODE( 2 , uiCode, "constant_pic_rate_idc[i][j]" ); vps->setConstPicRateIdc( i, j, uiCode ); 1439 READ_CODE( 16, uiCode, "avg_pic_rate[i][j]" ); vps->setAvgPicRate( i, j, uiCode ); 1440 } 1441 else 1442 { 1443 vps->setConstPicRateIdc( i, j, 0 ); 1444 vps->setAvgPicRate ( i, j, 0 ); 1445 } 1446 } 1447 } 1448 } 1449 #endif 1450 #if TILE_BOUNDARY_ALIGNED_FLAG 1451 for(i = 1; i < vps->getMaxLayers(); i++) 1452 { 1453 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1454 { 1455 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1456 } 1457 } 1458 #endif 1459 #if N0160_VUI_EXT_ILP_REF 1460 READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 1461 if( vps->getNumIlpRestrictedRefLayers()) 1462 { 1463 for(i = 1; i < vps->getMaxLayers(); i++) 1464 { 1465 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1466 { 1467 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1468 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1469 { 1470 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 1471 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1472 { 1473 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 1474 } 1475 } 1476 } 1477 } 1478 } 1479 #endif 1480 } 1481 #endif 1137 1482 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) 1138 1483 { … … 1169 1514 rpcSlice->setDependentSliceSegmentFlag(false); 1170 1515 } 1516 #if REPN_FORMAT_IN_VPS 1517 Int numCTUs = ((rpcSlice->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((rpcSlice->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 1518 #else 1171 1519 Int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 1520 #endif 1172 1521 Int maxParts = (1<<(sps->getMaxCUDepth()<<1)); 1173 1522 UInt sliceSegmentAddress = 0; … … 1203 1552 if(!rpcSlice->getDependentSliceSegmentFlag()) 1204 1553 { 1205 1554 #if POC_RESET_FLAG 1555 Int iBits = 0; 1556 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1557 { 1558 READ_FLAG(uiCode, "poc_reset_flag"); rpcSlice->setPocResetFlag( uiCode ? true : false ); 1559 iBits++; 1560 } 1561 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1562 { 1563 READ_FLAG(uiCode, "discardable_flag"); // ignored 1564 iBits++; 1565 } 1566 for (; iBits < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++) 1567 { 1568 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1569 } 1570 #else 1206 1571 #if SH_DISCARDABLE_FLAG 1207 1572 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) … … 1218 1583 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1219 1584 } 1585 #endif 1220 1586 #endif 1221 1587 … … 1244 1610 rpcSlice->setRPS(rps); 1245 1611 } 1612 #if N0065_LAYER_POC_ALIGNMENT 1613 if( rpcSlice->getLayerId() > 0 || !rpcSlice->getIdrPicFlag() ) 1614 #else 1246 1615 else 1616 #endif 1247 1617 { 1248 1618 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1249 1619 Int iPOClsb = uiCode; 1250 Int iPrevPOC = rpcSlice->getPrev POC();1620 Int iPrevPOC = rpcSlice->getPrevTid0POC(); 1251 1621 Int iMaxPOClsb = 1<< sps->getBitsForPOC(); 1252 Int iPrevPOClsb = iPrevPOC %iMaxPOClsb;1622 Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1); 1253 1623 Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb; 1254 1624 Int iPOCmsb; … … 1274 1644 rpcSlice->setPOC (iPOCmsb+iPOClsb); 1275 1645 1646 #if N0065_LAYER_POC_ALIGNMENT 1647 if( !rpcSlice->getIdrPicFlag() ) 1648 { 1649 #endif 1276 1650 TComReferencePictureSet* rps; 1277 1651 rps = rpcSlice->getLocalRPS(); … … 1372 1746 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1373 1747 rps->setCheckLTMSBPresent(j,false); 1748 1749 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 1750 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) 1751 { 1752 deltaPocMSBCycleLT = 0; 1753 } 1374 1754 } 1375 1755 prevDeltaMSB = deltaPocMSBCycleLT; … … 1399 1779 rpcSlice->setEnableTMVPFlag(false); 1400 1780 } 1401 } 1402 1403 #if REF_IDX_FRAMEWORK 1781 #if N0065_LAYER_POC_ALIGNMENT 1782 } 1783 #endif 1784 } 1785 1786 #if SVC_EXTENSION 1404 1787 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1405 1788 rpcSlice->setActiveNumILRRefIdx(0); … … 1624 2007 if ( rpcSlice->getEnableTMVPFlag() ) 1625 2008 { 1626 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING2009 #if M0457_COL_PICTURE_SIGNALING 1627 2010 #if REMOVE_COL_PICTURE_SIGNALING 1628 2011 rpcSlice->setMFMEnabledFlag( rpcSlice->getNumMotionPredRefLayers() > 0 ? true : false ); … … 1667 2050 rpcSlice->setColRefIdx(0); 1668 2051 } 1669 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING2052 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 1670 2053 } 1671 2054 #endif … … 1685 2068 rpcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode); 1686 2069 2070 #if REPN_FORMAT_IN_VPS 2071 assert( rpcSlice->getSliceQp() >= -rpcSlice->getQpBDOffsetY() ); 2072 #else 1687 2073 assert( rpcSlice->getSliceQp() >= -sps->getQpBDOffsetY() ); 2074 #endif 1688 2075 assert( rpcSlice->getSliceQp() <= 51 ); 1689 2076 … … 2016 2403 xReadSvlc( iDQp ); 2017 2404 2405 #if REPN_FORMAT_IN_VPS 2406 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffsetY(); 2407 #else 2018 2408 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 2409 #endif 2019 2410 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2020 2411 … … 2186 2577 UInt code, sizeId, listId; 2187 2578 Bool scalingListPredModeFlag; 2579 2188 2580 //for each size 2189 2581 for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2191 2583 for(listId = 0; listId < g_scalingListNum[sizeId]; listId++) 2192 2584 { 2585 #if IL_SL_SIGNALLING_N0371 2586 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2587 { 2588 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2589 scalingListPredModeFlag = (code) ? true : false; 2590 if(!scalingListPredModeFlag) //Copy Mode 2591 { 2592 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 2593 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); 2594 if( sizeId > SCALING_LIST_8x8 ) 2595 { 2596 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); 2597 } 2598 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 2599 2600 } 2601 else //DPCM Mode 2602 { 2603 xDecodeScalingList(scalingList, sizeId, listId); 2604 } 2605 } 2606 else 2607 { 2608 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2609 scalingListPredModeFlag = (code) ? true : false; 2610 if(!scalingListPredModeFlag) //Copy Mode 2611 { 2612 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 2613 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); 2614 if( sizeId > SCALING_LIST_8x8 ) 2615 { 2616 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); 2617 } 2618 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 2619 2620 } 2621 else //DPCM Mode 2622 { 2623 xDecodeScalingList(scalingList, sizeId, listId); 2624 } 2625 } 2626 #else 2193 2627 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2194 2628 scalingListPredModeFlag = (code) ? true : false; … … 2208 2642 xDecodeScalingList(scalingList, sizeId, listId); 2209 2643 } 2644 #endif 2210 2645 } 2211 2646 } … … 2229 2664 if( sizeId > SCALING_LIST_8x8 ) 2230 2665 { 2666 #if IL_SL_SIGNALLING_N0371 2667 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2668 { 2669 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2670 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]); 2671 } 2672 else 2673 { 2674 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2675 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2676 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2677 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2678 } 2679 #else 2231 2680 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2232 2681 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2233 2682 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2683 #endif 2234 2684 } 2235 2685 2236 2686 for(i = 0; i < coefNum; i++) 2237 2687 { 2688 #if IL_SL_SIGNALLING_N0371 2689 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2690 { 2691 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]]; 2692 dst[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i]; 2693 } 2694 else 2695 { 2696 READ_SVLC( data, "scaling_list_delta_coef"); 2697 nextCoef = (nextCoef + data + 256 ) % 256; 2698 dst[scan[i]] = nextCoef; 2699 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]]; 2700 } 2701 #else 2238 2702 READ_SVLC( data, "scaling_list_delta_coef"); 2239 2703 nextCoef = (nextCoef + data + 256 ) % 256; 2240 2704 dst[scan[i]] = nextCoef; 2705 #endif 2241 2706 } 2242 2707 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r345 r442 75 75 Void parseVPSExtension ( TComVPS* pcVPS ); 76 76 #endif 77 78 #if VPS_VUI 79 Void parseVPSVUI ( TComVPS* pcVPS ); 80 #endif 81 #if REPN_FORMAT_IN_VPS 82 Void parseRepFormat ( RepFormat *repFormat ); 83 #endif 77 84 #if SPS_SUB_LAYER_INFO 78 85 Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r345 r442 177 177 TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); 178 178 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 179 #if REPN_FORMAT_IN_VPS 180 UInt uiWidth = pcSlice->getPicWidthInLumaSamples(); 181 UInt uiHeight = pcSlice->getPicHeightInLumaSamples(); 182 #else 179 183 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 180 184 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 185 #endif 181 186 UInt uiGranularityWidth = g_uiMaxCUWidth; 182 187 UInt uiPosX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; … … 230 235 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 231 236 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 237 #if REPN_FORMAT_IN_VPS 238 if((!bStartInCU) && ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) ) 239 #else 232 240 if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 241 #endif 233 242 { 234 243 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 256 265 if ( bSubInSlice ) 257 266 { 267 #if REPN_FORMAT_IN_VPS 268 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) ) 269 #else 258 270 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 271 #endif 259 272 { 260 273 xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); … … 385 398 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 386 399 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 400 #if REPN_FORMAT_IN_VPS 401 if(bStartInCU||( uiRPelX >= pcSlice->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getPicHeightInLumaSamples() ) ) 402 #else 387 403 if(bStartInCU||( uiRPelX >= pcSlice->getSPS()->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 404 #endif 388 405 { 389 406 bBoundary = true; … … 401 418 402 419 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getSliceSegmentCurEndCUAddr()); 420 #if REPN_FORMAT_IN_VPS 421 if(binSlice&&( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) ) 422 #else 403 423 if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 424 #endif 404 425 { 405 426 xDecompressCU(pcCU, uiIdx, uiNextDepth ); … … 494 515 495 516 //===== inverse transform ===== 517 #if REPN_FORMAT_IN_VPS 518 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 519 #else 496 520 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 521 #endif 497 522 498 523 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; … … 733 758 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 734 759 760 #if REPN_FORMAT_IN_VPS 761 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getQpBDOffsetY(), 0 ); 762 #else 735 763 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 764 #endif 736 765 737 766 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r313 r442 247 247 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 248 248 { 249 #if REF_IDX_FRAMEWORK && VPS_EXTN_DIRECT_REF_LAYERS 249 #if SVC_EXTENSION 250 #if VPS_EXTN_DIRECT_REF_LAYERS 250 251 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR( m_layerId ) ) 251 252 { 252 printf( "%d(%d) 253 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 253 254 } 254 255 else 255 #endif 256 { 257 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 258 } 259 #endif 260 if( pcSlice->getEnableTMVPFlag() && iRefList == 1 - pcSlice->getColFromL0Flag() && iRefIndex == pcSlice->getColRefIdx() ) 261 { 262 printf( "c" ); 263 } 264 265 printf( " " ); 266 #else 256 267 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 268 #endif 257 269 } 258 270 printf ("] "); -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r345 r442 860 860 { 861 861 UInt uiSign; 862 #if REPN_FORMAT_IN_VPS 863 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffsetY(); 864 #else 862 865 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 866 #endif 863 867 m_pcTDecBinIf->decodeBinEP(uiSign); 864 868 iDQp = uiDQp; -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r313 r442 65 65 TDecEntropy* m_pcEntropyDecoder; 66 66 TDecCu* m_pcCuDecoder; 67 UInt m_uiCurrSliceIdx;68 67 69 68 TDecSbac* m_pcBufferSbacDecoders; ///< line to store temporary contexts, one per column of tiles. -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r345 r442 57 57 g_nSymbolCounter = 0; 58 58 #endif 59 m_associatedIRAPType = NAL_UNIT_INVALID; 59 60 m_pocCRA = 0; 60 m_prevRAPisBLA = false;61 61 m_pocRandomAccess = MAX_INT; 62 62 #if !SVC_EXTENSION … … 72 72 m_pBLReconFile = NULL; 73 73 #endif 74 #endif75 #if REF_IDX_FRAMEWORK76 74 memset(m_cIlpPic, 0, sizeof(m_cIlpPic)); 77 75 #endif … … 79 77 m_pBLSyntaxFile = NULL; 80 78 #endif 81 79 m_prevSliceSkipped = false; 80 m_skippedPOC = 0; 82 81 } 83 82 … … 108 107 109 108 m_cSliceDecoder.destroy(); 110 #if REF_IDX_FRAMEWORK109 #if SVC_EXTENSION 111 110 for(Int i=0; i<MAX_NUM_REF; i++) 112 111 { … … 137 136 } 138 137 139 #if REF_IDX_FRAMEWORK 138 #if SVC_EXTENSION 139 #if !REPN_FORMAT_IN_VPS 140 140 Void TDecTop::xInitILRP(TComSPS *pcSPS) 141 { 141 #else 142 Void TDecTop::xInitILRP(TComSlice *slice) 143 #endif 144 { 145 #if REPN_FORMAT_IN_VPS 146 TComSPS* pcSPS = slice->getSPS(); 147 Int bitDepthY = slice->getBitDepthY(); 148 Int bitDepthC = slice->getBitDepthC(); 149 Int picWidth = slice->getPicWidthInLumaSamples(); 150 Int picHeight = slice->getPicHeightInLumaSamples(); 151 #endif 142 152 if(m_layerId>0) 143 153 { 154 #if REPN_FORMAT_IN_VPS 155 g_bitDepthY = bitDepthY; 156 g_bitDepthC = bitDepthC; 157 #else 144 158 g_bitDepthY = pcSPS->getBitDepthY(); 145 159 g_bitDepthC = pcSPS->getBitDepthC(); 160 #endif 146 161 g_uiMaxCUWidth = pcSPS->getMaxCUWidth(); 147 162 g_uiMaxCUHeight = pcSPS->getMaxCUHeight(); … … 164 179 165 180 m_cIlpPic[j] = new TComPic; 181 #if REPN_FORMAT_IN_VPS 182 #if SVC_UPSAMPLING 183 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 184 #else 185 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 186 #endif 187 #else 166 188 #if SVC_UPSAMPLING 167 189 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 168 190 #else 169 191 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 192 #endif 170 193 #endif 171 194 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) … … 177 200 } 178 201 } 202 203 179 204 180 205 Void TDecTop::setILRPic(TComPic *pcPic) … … 191 216 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false); 192 217 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 218 for (Int j=0; j<m_cIlpPic[refLayerIdc]->getPicSym()->getNumberOfCUsInFrame(); j++) // set reference CU layerId 219 { 220 m_cIlpPic[refLayerIdc]->getPicSym()->getCU(j)->setLayerId(m_cIlpPic[refLayerIdc]->getLayerId()); 221 } 193 222 } 194 223 } … … 266 295 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 267 296 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 297 #if REPN_FORMAT_IN_VPS 298 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) 299 #else 268 300 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() || !zeroOffsets ) 301 #endif 269 302 { 270 303 rpcPic->setSpatialEnhLayerFlag( i, true ); 271 304 272 305 //only for scalable extension 306 #if SCALABILITY_MASK_E0104 307 assert( pcSlice->getVPS()->getScalabilityMask(2) == true ); 308 #else 273 309 assert( pcSlice->getVPS()->getScalabilityMask(1) == true ); 310 #endif 274 311 } 275 312 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 313 #if SCALABILITY_MASK_E0104 314 if(pcSlice->getVPS()->getScalabilityMask(2)) 315 #else 276 316 if(pcSlice->getVPS()->getScalabilityMask(1)) 317 #endif 277 318 { 278 319 pcSlice->setPic(rpcPic); … … 283 324 #endif 284 325 326 #if REPN_FORMAT_IN_VPS 327 #if SVC_UPSAMPLING 328 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 329 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 330 #else 331 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 332 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 333 #endif 334 #else 285 335 #if SVC_UPSAMPLING 286 336 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 290 340 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 291 341 #endif 342 #endif 343 292 344 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 293 345 m_cListPic.pushBack( rpcPic ); … … 329 381 rpcPic->destroy(); 330 382 383 #if REPN_FORMAT_IN_VPS 384 #if SVC_UPSAMPLING 385 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 386 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 387 388 #else 389 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 390 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 391 #endif 392 #else 331 393 #if SVC_UPSAMPLING 332 394 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 336 398 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 337 399 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 400 #endif 338 401 #endif 339 402 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); … … 366 429 } 367 430 431 #if EARLY_REF_PIC_MARKING 432 Void TDecTop::earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdSet) 433 { 434 UInt currTid = m_pcPic->getTLayer(); 435 UInt highestTid = (maxTemporalLayer >= 0) ? maxTemporalLayer : (m_pcPic->getSlice(0)->getSPS()->getMaxTLayers() - 1); 436 UInt latestDecLayerId = m_layerId; 437 UInt numTargetDecLayers = 0; 438 Int targetDecLayerIdList[MAX_LAYERS]; 439 UInt latestDecIdx = 0; 440 TComSlice* pcSlice = m_pcPic->getSlice(0); 441 442 if ( currTid != highestTid ) // Marking process is only applicaple for highest decoded TLayer 443 { 444 return; 445 } 446 447 // currPic must be marked as "used for reference" and must be a sub-layer non-reference picture 448 if ( !((pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 449 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 450 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 451 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N || 452 pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || 453 pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N10 || 454 pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N12 || 455 pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N14) && pcSlice->isReferenced())) 456 { 457 return; 458 } 459 460 if ( targetDecLayerIdSet.size() == 0 ) // Cannot mark if we don't know the number of scalable layers 461 { 462 return; 463 } 464 465 for (std::vector<Int>::iterator it = targetDecLayerIdSet.begin(); it != targetDecLayerIdSet.end(); it++) 466 { 467 if ( latestDecLayerId == (*it) ) 468 { 469 latestDecIdx = numTargetDecLayers; 470 } 471 targetDecLayerIdList[numTargetDecLayers++] = (*it); 472 } 473 474 Int remainingInterLayerReferencesFlag = 0; 475 if ( currTid <= pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(latestDecLayerId) - 1 ) 476 { 477 for ( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 478 { 479 for ( Int k = 0; k < m_ppcTDecTop[targetDecLayerIdList[j]]->getNumDirectRefLayers(); k++ ) 480 { 481 if ( latestDecIdx == m_ppcTDecTop[targetDecLayerIdList[j]]->getRefLayerId(k) ) 482 { 483 remainingInterLayerReferencesFlag = 1; 484 } 485 } 486 } 487 } 488 489 if ( remainingInterLayerReferencesFlag == 0 ) 490 { 491 pcSlice->setReferenced(false); 492 } 493 } 494 #endif 495 368 496 Void TDecTop::xCreateLostPicture(Int iLostPoc) 369 497 { … … 478 606 m_apcSlicePilot->setSPS(sps); 479 607 pps->setSPS(sps); 608 #if REPN_FORMAT_IN_VPS 480 609 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1); 610 #else 611 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1); 612 #endif 481 613 pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) ); 482 614 615 #if REPN_FORMAT_IN_VPS 616 g_bitDepthY = m_apcSlicePilot->getBitDepthY(); 617 g_bitDepthC = m_apcSlicePilot->getBitDepthC(); 618 #else 483 619 g_bitDepthY = sps->getBitDepthY(); 484 620 g_bitDepthC = sps->getBitDepthC(); 621 #endif 485 622 g_uiMaxCUWidth = sps->getMaxCUWidth(); 486 623 g_uiMaxCUHeight = sps->getMaxCUHeight(); … … 499 636 500 637 m_cSAO.destroy(); 638 #if REPN_FORMAT_IN_VPS 639 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 640 #else 501 641 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 642 #endif 502 643 m_cLoopFilter.create( sps->getMaxCUDepth() ); 503 644 } 504 645 505 646 #if SVC_EXTENSION 647 #if POC_RESET_FLAG 648 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 649 #else 506 650 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 651 #endif 507 652 #else 508 653 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 538 683 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 539 684 685 #if SVC_EXTENSION 540 686 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 541 687 setRefLayerParams(m_apcSlicePilot->getVPS()); 542 688 #endif 543 #if REF_IDX_FRAMEWORK &&M0457_COL_PICTURE_SIGNALING689 #if M0457_COL_PICTURE_SIGNALING 544 690 m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers); 545 691 #endif 546 547 #if SVC_EXTENSION548 692 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 549 693 m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() ); … … 554 698 #endif 555 699 700 // set POC for dependent slices in skipped pictures 701 if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped) 702 { 703 m_apcSlicePilot->setPOC(m_skippedPOC); 704 } 705 706 m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA); 707 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 708 556 709 // Skip pictures due to random access 557 710 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 558 711 { 712 m_prevSliceSkipped = true; 713 m_skippedPOC = m_apcSlicePilot->getPOC(); 559 714 return false; 560 715 } … … 562 717 if (isSkipPictureForBLA(iPOCLastDisplay)) 563 718 { 719 m_prevSliceSkipped = true; 720 m_skippedPOC = m_apcSlicePilot->getPOC(); 564 721 return false; 565 722 } 723 724 // clear previous slice skipped flag 725 m_prevSliceSkipped = false; 566 726 567 727 // exit when a new picture is found … … 594 754 // actual decoding starts here 595 755 xActivateParameterSets(); 596 756 #if 0 // N0147_IRAP_ALIGN_FLAG Disabled for now! 757 //When cross_layer_irap_aligned_flag is equal to 0, num_extra_slice_header_bits >=1 758 if(!m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 759 { 760 assert( m_apcSlicePilot->getPPS()->getNumExtraSliceHeaderBits() > 0); 761 } 762 //When cross_layer_irap_aligned_flag is equal to 1, the value of poc_reset_flag shall be equal to 0 763 if( m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 764 { 765 assert( m_apcSlicePilot->getPocResetFlag() == 0); 766 } 767 #endif 768 769 #if REPN_FORMAT_IN_VPS 770 // Initialize ILRP if needed, only for the current layer 771 // ILRP intialization should go along with activation of parameters sets, 772 // although activation of parameter sets itself need not be done for each and every slice!!! 773 xInitILRP(m_apcSlicePilot); 774 #endif 597 775 if (m_apcSlicePilot->isNextSlice()) 598 776 { … … 604 782 } 605 783 m_bFirstSliceInSequence = false; 784 #if POC_RESET_FLAG 785 // This operation would do the following: 786 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 787 // 2. Update the value of m_pocCRA. 788 // 3. Reset the POC values at the decoder for the current picture to be zero. 789 // 4. update value of POCLastDisplay 790 if( m_apcSlicePilot->getPocResetFlag() ) 791 { 792 if( m_apcSlicePilot->getSliceIdx() == 0 ) 793 { 794 Int pocAdjustValue = m_apcSlicePilot->getPOC(); 795 796 // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre 797 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 798 799 // Iterate through all picture in DPB 800 while( iterPic != m_cListPic.end() ) 801 { 802 TComPic *dpbPic = *iterPic; 803 // Check if the picture pointed to by iterPic is either used for reference or 804 // needed for output, are in the same layer, and not the current picture. 805 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 806 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 807 && ( dpbPic->getReconMark() ) 808 ) 809 { 810 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 811 { 812 813 TComSlice *slice = dpbPic->getSlice(i); 814 TComReferencePictureSet *rps = slice->getRPS(); 815 slice->setPOC( slice->getPOC() - pocAdjustValue ); 816 817 // Also adjust the POC value stored in the RPS of each such slice 818 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 819 { 820 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue ); 821 } 822 // Also adjust the value of refPOC 823 for(Int k = 0; k < 2; k++) // For List 0 and List 1 824 { 825 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 826 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 827 { 828 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j); 829 } 830 } 831 } 832 } 833 iterPic++; 834 } 835 // Update the value of pocCRA 836 m_pocCRA -= pocAdjustValue; 837 // Update value of POCLastDisplay 838 iPOCLastDisplay -= pocAdjustValue; 839 } 840 // Reset current poc for current slice and RPS 841 m_apcSlicePilot->setPOC( 0 ); 842 } 843 #endif 844 #if ALIGN_TSA_STSA_PICS 845 if( m_apcSlicePilot->getLayerId() > 0 ) 846 { 847 // Check for TSA alignment 848 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 849 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R 850 ) 851 { 852 for(Int dependentLayerIdx = 0; dependentLayerIdx < m_apcSlicePilot->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 853 { 854 TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic(); 855 TComPic* refpicLayer = m_apcSlicePilot->getRefPic(*cListPic, m_apcSlicePilot->getPOC() ); 856 if( refpicLayer ) 857 { 858 assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 859 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R ); // TSA pictures should be aligned among depenedent layers 860 } 861 } 862 } 863 // Check for STSA alignment 864 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 865 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R 866 ) 867 { 868 for(Int dependentLayerIdx = 0; dependentLayerIdx < m_apcSlicePilot->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 869 { 870 TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic(); 871 TComPic* refpicLayer = m_apcSlicePilot->getRefPic(*cListPic, m_apcSlicePilot->getPOC() ); // STSA pictures should be aligned among dependent layers 872 if( refpicLayer ) 873 874 { 875 assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N || 876 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ); 877 } 878 } 879 } 880 } 881 #endif 606 882 //detect lost reference picture and insert copy of earlier frame. 607 883 Int lostPoc; … … 617 893 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 618 894 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 619 #if ILP_DECODED_PICTURE620 895 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(); 621 896 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(); 622 #else623 const Window &conf = pBLPic->getConformanceWindow();624 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset();625 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset();626 #endif627 897 628 898 if( pFile->good() ) … … 674 944 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 675 945 946 Bool isField = false; 947 Bool isTff = false; 948 949 if(!m_SEIs.empty()) 950 { 951 // Check if any new Picture Timing SEI has arrived 952 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 953 if (pictureTimingSEIs.size()>0) 954 { 955 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 956 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2); 957 isTff = (pictureTiming->m_picStruct == 1); 958 } 959 } 960 961 //Set Field/Frame coding mode 962 m_pcPic->setField(isField); 963 m_pcPic->setTopField(isTff); 964 676 965 // transfer any SEI messages that have been received to the picture 677 966 pcPic->setSEIs(m_SEIs); … … 813 1102 if (bNextSlice) 814 1103 { 815 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_ prevRAPisBLA, m_cListPic );1104 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic ); 816 1105 // Set reference list 817 #if REF_IDX_FRAMEWORK1106 #if SVC_EXTENSION 818 1107 if (m_layerId == 0) 819 1108 #endif … … 867 1156 #endif 868 1157 869 #if SIMPLIFIED_MV_POS_SCALING870 1158 #if SCALED_REF_LAYER_OFFSETS 871 1159 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); … … 891 1179 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 892 1180 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 893 #endif894 1181 895 1182 #if SVC_UPSAMPLING … … 911 1198 } 912 1199 913 #if REF_IDX_FRAMEWORK914 1200 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 915 1201 { … … 927 1213 #endif 928 1214 } 929 #endif930 1215 pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic); 931 1216 } … … 940 1225 #endif //SVC_EXTENSION 941 1226 1227 #if N0147_IRAP_ALIGN_FLAG 1228 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 1229 { 1230 for(Int dependentLayerIdx = 0; dependentLayerIdx < pcSlice->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 1231 { 1232 TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic(); 1233 TComPic* refpicLayer = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 1234 if(refpicLayer && pcSlice->isIRAP()) 1235 { 1236 assert(pcSlice->getNalUnitType() == refpicLayer->getSlice(0)->getNalUnitType()); 1237 } 1238 } 1239 } 1240 #endif 1241 942 1242 // For generalized B 943 1243 // note: maybe not existed case (always L0 is copied to L1 if L1 is empty) … … 986 1286 if(pcSlice->getSPS()->getScalingListFlag()) 987 1287 { 1288 #if IL_SL_SIGNALLING_N0371 1289 pcSlice->getSPS()->getScalingList()->setLayerId( m_layerId ); 1290 #endif 1291 988 1292 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1293 989 1294 if(pcSlice->getPPS()->getScalingListPresentFlag()) 990 1295 { 1296 #if IL_SL_SIGNALLING_N0371 1297 pcSlice->getPPS()->getScalingList()->setLayerId( m_layerId ); 1298 #endif 1299 991 1300 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 992 1301 } 993 pcSlice->getScalingList()->setUseTransformSkip(pcSlice->getPPS()->getUseTransformSkip());994 1302 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 995 1303 { 1304 #if IL_SL_SIGNALLING_N0371 1305 pcSlice->setDefaultScalingList( m_layerId ); 1306 #else 996 1307 pcSlice->setDefaultScalingList(); 1308 #endif 997 1309 } 998 1310 m_cTrQuant.setScalingListDec(pcSlice->getScalingList()); … … 1001 1313 else 1002 1314 { 1315 #if IL_SL_SIGNALLING_N0371 1316 m_cTrQuant.setFlatScalingList( m_layerId ); 1317 #else 1003 1318 m_cTrQuant.setFlatScalingList(); 1319 #endif 1004 1320 m_cTrQuant.setUseScalingList(false); 1005 1321 } … … 1032 1348 sps->setLayerId(m_layerId); 1033 1349 #endif 1350 1034 1351 #if SPS_SUB_LAYER_INFO 1035 1352 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder[0] ); … … 1042 1359 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1043 1360 #endif 1044 #if REF_IDX_FRAMEWORK 1361 #if SVC_EXTENSION 1362 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1045 1363 if(m_numLayer>0) 1046 1364 { … … 1048 1366 } 1049 1367 #endif 1368 #endif 1050 1369 } 1051 1370 … … 1053 1372 { 1054 1373 TComPPS* pps = new TComPPS(); 1374 1375 #if IL_SL_SIGNALLING_N0371 1376 pps->setLayerId(m_layerId); 1377 #endif 1378 1055 1379 m_cEntropyDecoder.decodePPS( pps ); 1056 1380 #if SVC_EXTENSION … … 1079 1403 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1080 1404 { 1405 #if RANDOM_ACCESS_SEI_FIX 1406 if (m_prevSliceSkipped) // No need to decode SEI messages of a skipped access unit 1407 { 1408 return; 1409 } 1410 #endif 1081 1411 #if M0043_LAYERS_PRESENT_SEI 1082 1412 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() ); … … 1148 1478 { 1149 1479 case NAL_UNIT_VPS: 1480 #if VPS_NUH_LAYER_ID 1481 assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1482 #endif 1150 1483 xDecodeVPS(); 1151 1484 #if AVC_BASE … … 1247 1580 Bool TDecTop::isSkipPictureForBLA(Int& iPOCLastDisplay) 1248 1581 { 1249 if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1582 if ((m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_N_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_RADL) && 1583 m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N)) 1250 1584 { 1251 1585 iPOCLastDisplay++; -
trunk/source/Lib/TLibDecoder/TDecTop.h
r345 r442 67 67 Int m_iMaxRefPicNum; 68 68 69 NalUnitType m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture 69 70 Int m_pocCRA; ///< POC number of the latest CRA picture 70 Bool m_prevRAPisBLA; ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture71 71 Int m_pocRandomAccess; ///< POC number of the random access point (the first IDR or CRA picture) 72 72 … … 79 79 80 80 TComSlice* m_apcSlicePilot; 81 81 82 82 SEIMessages m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices 83 83 … … 107 107 Bool m_bFirstSliceInSequence; 108 108 #endif 109 Bool m_prevSliceSkipped; 110 Int m_skippedPOC; 109 111 110 112 #if SVC_EXTENSION … … 118 120 fstream* m_pBLReconFile; 119 121 Int m_iBLSourceWidth; 120 Int m_iBLSourceHeight; 122 Int m_iBLSourceHeight; 121 123 #endif 122 124 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS … … 130 132 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 131 133 #endif 134 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 132 135 #endif 133 136 #if AVC_SYNTAX || SYNTAX_OUTPUT 134 137 fstream* m_pBLSyntaxFile; 135 #endif136 #if REF_IDX_FRAMEWORK137 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture138 138 #endif 139 139 … … 157 157 158 158 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 159 160 #if SVC_EXTENSION 159 #if SVC_EXTENSION 160 #if EARLY_REF_PIC_MARKING 161 Void earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdList); 162 #endif 161 163 UInt getLayerId () { return m_layerId; } 162 164 Void setLayerId (UInt layer) { m_layerId = layer; } … … 206 208 Int getBLHeight() { return m_iBLSourceHeight; } 207 209 #endif 210 #if REPN_FORMAT_IN_VPS 211 Void xInitILRP(TComSlice *slice); 212 #else 213 Void xInitILRP(TComSPS *pcSPS); 214 #endif 215 Void setILRPic(TComPic *pcPic); 208 216 #endif 209 217 #if AVC_SYNTAX || SYNTAX_OUTPUT … … 211 219 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 212 220 #endif 213 #if REF_IDX_FRAMEWORK214 Void xInitILRP(TComSPS *pcSPS);215 Void setILRPic(TComPic *pcPic);216 #endif217 221 218 222 protected: … … 222 226 Void xActivateParameterSets(); 223 227 #if SVC_EXTENSION 228 #if POC_RESET_FLAG 229 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 230 #else 224 231 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 232 #endif 225 233 #else 226 234 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
Note: See TracChangeset for help on using the changeset viewer.