Changeset 898 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 6 Oct 2014, 12:50:55 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r895 r898 295 295 } 296 296 } 297 297 #if !R0042_PROFILE_INDICATION 298 298 #if SCALINGLIST_INFERRING 299 299 if( pcPPS->getLayerId() > 0 ) … … 315 315 { 316 316 #endif 317 #endif 317 318 318 319 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); … … 322 323 parseScalingList( pcPPS->getScalingList() ); 323 324 } 324 325 #if !R0042_PROFILE_INDICATION 325 326 #if SCALINGLIST_INFERRING 326 327 } 328 #endif 327 329 #endif 328 330 … … 336 338 pcPPS->setSliceHeaderExtensionPresentFlag(uiCode); 337 339 340 #if !R0042_PROFILE_INDICATION 338 341 READ_FLAG( uiCode, "pps_extension_flag"); 342 #else 343 READ_FLAG( uiCode, "pps_extension_present_flag"); 344 #endif 345 346 #if !R0042_PROFILE_INDICATION 339 347 #if POC_RESET_INFO_INFERENCE 340 348 pcPPS->setExtensionFlag( uiCode ? true : false ); … … 451 459 } 452 460 #endif 461 #else 462 pcPPS->setExtensionFlag( uiCode ? true : false ); 463 if( pcPPS->getExtensionFlag() ) 464 { 465 READ_FLAG( uiCode, "pps_range_extension_flag" ); 466 assert(uiCode == 0); 467 READ_FLAG( uiCode, "pps_multilayer_extension_flag" ); 468 assert(uiCode == 1); 469 READ_CODE(6, uiCode, "pps_extension_6bits"); 470 assert(uiCode == 0); 471 472 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 473 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 474 475 #if SCALINGLIST_INFERRING 476 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); 477 pcPPS->setInferScalingListFlag( uiCode ); 478 479 if( pcPPS->getInferScalingListFlag() ) 480 { 481 READ_UVLC( uiCode, "pps_scaling_list_ref_layer_id" ); 482 pcPPS->setScalingListRefLayerId( uiCode ); 483 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 484 assert( pcPPS->getScalingListRefLayerId() <= 62 ); 485 pcPPS->setScalingListPresentFlag( false ); 486 } 487 #endif 488 489 #if REF_REGION_OFFSET 490 READ_UVLC( uiCode, "num_ref_loc_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode); 491 for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++) 492 { 493 READ_CODE( 6, uiCode, "ref_loc_offset_layer_id" ); pcPPS->setScaledRefLayerId( i, uiCode ); 494 READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" ); pcPPS->setScaledRefLayerOffsetPresentFlag( i, uiCode ); 495 if (uiCode) 496 { 497 Window& scaledWindow = pcPPS->getScaledRefLayerWindow(i); 498 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 499 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); 500 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 501 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 502 #if P0312_VERT_PHASE_ADJ 503 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode); 504 #endif 505 } 506 READ_FLAG( uiCode, "ref_region_offset_present_flag" ); pcPPS->setRefRegionOffsetPresentFlag( i, uiCode ); 507 if (uiCode) 508 { 509 Window& refWindow = pcPPS->getRefLayerWindow(i); 510 READ_SVLC( iCode, "ref_region_left_offset" ); refWindow.setWindowLeftOffset (iCode << 1); 511 READ_SVLC( iCode, "ref_region_top_offset" ); refWindow.setWindowTopOffset (iCode << 1); 512 READ_SVLC( iCode, "ref_region_right_offset" ); refWindow.setWindowRightOffset (iCode << 1); 513 READ_SVLC( iCode, "ref_region_bottom_offset" ); refWindow.setWindowBottomOffset(iCode << 1); 514 } 515 #if R0209_GENERIC_PHASE 516 READ_FLAG( uiCode, "resample_phase_set_present_flag" ); pcPPS->setResamplePhaseSetPresentFlag( i, uiCode ); 517 if (uiCode) 518 { 519 READ_UVLC( uiCode, "phase_hor_luma" ); pcPPS->setPhaseHorLuma ( i, uiCode ); 520 READ_UVLC( uiCode, "phase_ver_luma" ); pcPPS->setPhaseVerLuma ( i, uiCode ); 521 READ_UVLC( uiCode, "phase_hor_chroma_plus8" ); pcPPS->setPhaseHorChroma (i, uiCode - 8); 522 READ_UVLC( uiCode, "phase_ver_chroma_plus8" ); pcPPS->setPhaseVerChroma (i, uiCode - 8); 523 } 524 #endif 525 } 526 #else 527 #if MOVE_SCALED_OFFSET_TO_PPS 528 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode); 529 for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++) 530 { 531 Window& scaledWindow = pcPPS->getScaledRefLayerWindow(i); 532 #if O0098_SCALED_REF_LAYER_ID 533 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcPPS->setScaledRefLayerId( i, uiCode ); 534 #endif 535 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 536 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); 537 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 538 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 539 #if P0312_VERT_PHASE_ADJ 540 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode); 541 #endif 542 } 543 #endif 544 #endif 545 #if Q0048_CGS_3D_ASYMLUT 546 READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); 547 pcPPS->setCGSFlag( uiCode ); 548 if( pcPPS->getCGSFlag() ) 549 { 550 xParse3DAsymLUT( pc3DAsymLUT ); 551 pcPPS->setCGSOutputBitDepthY( pc3DAsymLUT->getOutputBitDepthY() ); 552 pcPPS->setCGSOutputBitDepthC( pc3DAsymLUT->getOutputBitDepthC() ); 553 } 554 #endif 555 } 556 #endif 557 453 558 } 454 559 … … 643 748 #endif 644 749 750 #if R0042_PROFILE_INDICATION 751 UInt uiTmp; 752 bool bMultiLayerExtSpsFlag; 753 #endif 645 754 UInt uiCode; 646 755 READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); … … 651 760 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 652 761 assert(uiCode <= 6); 653 762 #if SVC_EXTENSION 763 } 764 #if R0042_PROFILE_INDICATION 765 else 766 { 767 READ_CODE( 3, uiCode, "sps_ext_or_max_sub_layers_minus1" ); uiTmp = uiCode; 768 } 769 #endif 770 #if !SPS_DPB_PARAMS 771 if(pcSPS->getLayerId() != 0) 772 { 773 pcSPS->setMaxTLayers ( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getMaxTLayers() ); 774 } 775 #endif 776 #endif 777 778 #if SVC_EXTENSION 779 #if R0042_PROFILE_INDICATION 780 bMultiLayerExtSpsFlag = ( pcSPS->getLayerId() != 0 && uiTmp == 7 ); 781 #endif 782 #endif 783 784 #if SVC_EXTENSION 785 #if !R0042_PROFILE_INDICATION 786 if(pcSPS->getLayerId() == 0) 787 #else 788 if(!bMultiLayerExtSpsFlag) 789 #endif 790 { 791 #endif 654 792 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 655 793 #if SVC_EXTENSION … … 658 796 else 659 797 { 660 pcSPS->setMaxTLayers ( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getMaxTLayers() );661 798 pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() ); 662 799 } … … 679 816 680 817 #ifdef SPS_PTL_FIX 818 #if !R0042_PROFILE_INDICATION 681 819 if ( pcSPS->getLayerId() == 0) 820 #else 821 if(!bMultiLayerExtSpsFlag) 822 #endif 682 823 { 683 824 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); … … 691 832 692 833 #if REPN_FORMAT_IN_VPS 834 #if !R0042_PROFILE_INDICATION 693 835 if( pcSPS->getLayerId() > 0 ) 836 #else 837 if( bMultiLayerExtSpsFlag) 838 #endif 694 839 { 695 840 READ_FLAG( uiCode, "update_rep_format_flag" ); 696 841 pcSPS->setUpdateRepFormatFlag( uiCode ? true : false ); 842 #if R0042_PROFILE_INDICATION 843 if( bMultiLayerExtSpsFlag && uiCode) 844 { 845 READ_CODE(8, uiCode, "sps_rep_format_idx"); 846 pcSPS->setUpdateRepFormatIndex(uiCode); 847 } 848 #endif 697 849 } 698 850 else … … 704 856 #endif 705 857 } 858 859 #if R0042_PROFILE_INDICATION 860 if( !bMultiLayerExtSpsFlag ) 861 { 862 #else 706 863 #if O0096_REP_FORMAT_INDEX 707 864 if( pcSPS->getLayerId() == 0 ) 708 865 #else 709 866 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 867 #endif 710 868 #endif 711 869 { … … 729 887 } 730 888 #if O0096_REP_FORMAT_INDEX 889 #if !R0042_PROFILE_INDICATION 731 890 else if ( pcSPS->getUpdateRepFormatFlag() ) 732 891 { … … 736 895 #endif 737 896 #endif 897 #endif 738 898 739 899 #if R0156_CONF_WINDOW_IN_REP_FORMAT 740 900 #if REPN_FORMAT_IN_VPS 901 #if !R0042_PROFILE_INDICATION 741 902 #if O0096_REP_FORMAT_INDEX 742 903 if( pcSPS->getLayerId() == 0 ) 743 904 #else 744 905 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 906 #endif 745 907 #endif 746 908 { … … 770 932 771 933 #if REPN_FORMAT_IN_VPS 934 #if !R0042_PROFILE_INDICATION 772 935 #if O0096_REP_FORMAT_INDEX 773 936 if( pcSPS->getLayerId() == 0 ) 774 937 #else 775 938 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 939 #endif 776 940 #endif 777 941 { … … 789 953 } 790 954 #endif 955 #if R0042_PROFILE_INDICATION 956 } 957 #endif 958 791 959 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 792 960 assert(uiCode <= 12); 793 961 794 962 #if SPS_DPB_PARAMS 963 #if !R0042_PROFILE_INDICATION 795 964 if( pcSPS->getLayerId() == 0 ) 796 965 { 966 #else 967 if( !bMultiLayerExtSpsFlag ) 968 { 969 #endif 797 970 #endif 798 971 UInt subLayerOrderingInfoPresentFlag; … … 851 1024 { 852 1025 #if SCALINGLIST_INFERRING 1026 #if !R0042_PROFILE_INDICATION 853 1027 if( pcSPS->getLayerId() > 0 ) 1028 #else 1029 if( bMultiLayerExtSpsFlag ) 1030 #endif 854 1031 { 855 1032 READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setInferScalingListFlag( uiCode ); … … 932 1109 if( pcSPS->getExtensionFlag() ) 933 1110 { 1111 #if !R0042_PROFILE_INDICATION 934 1112 #if O0142_CONDITIONAL_SPS_EXTENSION 935 1113 UInt spsExtensionTypeFlag[8]; … … 955 1133 } 956 1134 } 957 } 1135 } 1136 #else 1137 READ_FLAG( uiCode, "sps_range_extension_flag" ); 1138 assert(uiCode == 0); 1139 READ_FLAG( uiCode, "sps_multilayer_extension_flag" ); 1140 assert(uiCode == 1); 1141 READ_CODE(6, uiCode, "sps_extension_6bits"); 1142 assert(uiCode == 0); 1143 parseSPSExtension( pcSPS ); 1144 } 1145 #endif 958 1146 #else 959 1147 if (uiCode)
Note: See TracChangeset for help on using the changeset viewer.