Changeset 644 in SHVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 25 Mar 2014, 21:51:30 (11 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-5.1-dev (added) merged: 599-600,602-643
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-5.0-dev/source merged: 601 /branches/SHM-5.1-dev/source (added) merged: 600,602-643
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r595 r644 105 105 #endif 106 106 #if SUB_BITSTREAM_PROPERTY_SEI 107 case SEI::SUB_BITSTREAM_PROPERTY: 108 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 109 break; 107 case SEI::SUB_BITSTREAM_PROPERTY: 108 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 109 break; 110 #endif 111 #if O0164_MULTI_LAYER_HRD 112 case SEI::BSP_NESTING: 113 fprintf( g_hTrace, "=========== Bitstream partition nesting SEI message ===========\n"); 114 break; 115 case SEI::BSP_INITIAL_ARRIVAL_TIME: 116 fprintf( g_hTrace, "=========== Bitstream parition initial arrival time SEI message ===========\n"); 117 break; 118 case SEI::BSP_HRD: 119 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 120 break; 110 121 #endif 111 122 #endif //SVC_EXTENSION … … 117 128 #endif 118 129 130 #if O0164_MULTI_LAYER_HRD 131 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei) 132 #else 119 133 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps) 134 #endif 120 135 { 121 136 switch (sei.payloadType()) … … 161 176 break; 162 177 case SEI::SCALABLE_NESTING: 178 #if O0164_MULTI_LAYER_HRD 179 xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), vps, sps); 180 #else 163 181 xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps); 182 #endif 164 183 break; 165 184 #if SVC_EXTENSION … … 179 198 break; 180 199 #endif 200 #if O0164_MULTI_LAYER_HRD 201 case SEI::BSP_NESTING: 202 xWriteSEIBspNesting(bs, *static_cast<const SEIBspNesting*>(&sei), vps, sps, nestingSei); 203 break; 204 case SEI::BSP_INITIAL_ARRIVAL_TIME: 205 xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei), vps, sps, nestingSei, bspNestingSei); 206 break; 207 case SEI::BSP_HRD: 208 xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei); 209 break; 210 #endif 181 211 #endif //SVC_EXTENSION 182 212 default: … … 189 219 * in bitstream bs. 190 220 */ 221 #if O0164_MULTI_LAYER_HRD 222 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei) 223 #else 191 224 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps) 225 #endif 192 226 { 193 227 /* calculate how large the payload data is */ … … 202 236 g_HLSTraceEnable = false; 203 237 #endif 238 #if O0164_MULTI_LAYER_HRD 239 xWriteSEIpayloadData(bs_count, sei, vps, sps, *nestingSei, *bspNestingSei); 240 #else 204 241 xWriteSEIpayloadData(bs_count, sei, sps); 242 #endif 205 243 #if ENC_DEC_TRACE 206 244 g_HLSTraceEnable = traceEnable; … … 237 275 #endif 238 276 277 #if O0164_MULTI_LAYER_HRD 278 xWriteSEIpayloadData(bs, sei, vps, sps, *nestingSei, *bspNestingSei); 279 #else 239 280 xWriteSEIpayloadData(bs, sei, sps); 281 #endif 240 282 } 241 283 … … 367 409 } 368 410 } 411 #if P0138_USE_ALT_CPB_PARAMS_FLAG 412 if (sei.m_useAltCpbParamsFlagPresent) 413 { 414 WRITE_FLAG( sei.m_useAltCpbParamsFlag, "use_alt_cpb_params_flag"); 415 } 416 #endif 369 417 xWriteByteAlign(); 370 418 } … … 571 619 } 572 620 621 #if O0164_MULTI_LAYER_HRD 622 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps) 623 #else 573 624 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps) 625 #endif 574 626 { 575 627 WRITE_FLAG( sei.m_bitStreamSubsetFlag, "bitstream_subset_flag" ); … … 581 633 for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++) 582 634 { 583 WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );584 635 WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3, "nesting_max_temporal_id" ); 585 636 WRITE_UVLC( sei.m_nestingOpIdx[i], "nesting_op_idx" ); … … 609 660 for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++) 610 661 { 662 #if O0164_MULTI_LAYER_HRD 663 writeSEImessage(bs, *(*it), vps, sps, &sei); 664 #else 611 665 writeSEImessage(bs, *(*it), sps); 666 #endif 612 667 } 613 668 } … … 693 748 } 694 749 #endif 750 751 #if O0164_MULTI_LAYER_HRD 752 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei) 753 { 754 WRITE_UVLC( sei.m_bspIdx, "bsp_idx" ); 755 756 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 757 { 758 WRITE_FLAG( 0, "bsp_nesting_zero_bit" ); 759 } 760 761 // write nested SEI messages 762 for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++) 763 { 764 writeSEImessage(bs, *(*it), vps, sps, &nestingSei, &sei); 765 } 766 } 767 768 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei) 769 { 770 assert(vps->getVpsVuiPresentFlag()); 771 772 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]); 773 UInt len; 774 UInt hrdIdx; 775 776 if (schedCombCnt > 0) 777 { 778 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx); 779 } 780 else 781 { 782 hrdIdx = 0; 783 } 784 785 TComHRD *hrd = vps->getBspHrd(hrdIdx); 786 787 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag()) 788 { 789 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1; 790 } 791 else 792 { 793 len = 23 + 1; 794 } 795 796 if (hrd->getNalHrdParametersPresentFlag()) 797 { 798 for(UInt i = 0; i < schedCombCnt; i++) 799 { 800 WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" ); 801 } 802 } 803 else 804 { 805 for(UInt i = 0; i < schedCombCnt; i++) 806 { 807 WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" ); 808 } 809 } 810 } 811 812 Void SEIWriter::xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei) 813 { 814 WRITE_UVLC( sei.m_seiNumBspHrdParametersMinus1, "sei_num_bsp_hrd_parameters_minus1" ); 815 for (UInt i = 0; i <= sei.m_seiNumBspHrdParametersMinus1; i++) 816 { 817 if (i > 0) 818 { 819 WRITE_FLAG( sei.m_seiBspCprmsPresentFlag[i], "sei_bsp_cprms_present_flag" ); 820 } 821 xCodeHrdParameters(sei.hrd, i==0 ? 1 : sei.m_seiBspCprmsPresentFlag[i], nestingSei.m_nestingMaxTemporalIdPlus1[0]-1); 822 } 823 for (UInt h = 0; h <= nestingSei.m_nestingNumOpsMinus1; h++) 824 { 825 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 826 WRITE_UVLC( sei.m_seiNumBitstreamPartitionsMinus1[lsIdx], "num_sei_bitstream_partitions_minus1[i]"); 827 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 828 { 829 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 830 { 831 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 832 { 833 WRITE_FLAG( sei.m_seiLayerInBspFlag[lsIdx][i][j], "sei_layer_in_bsp_flag[lsIdx][i][j]" ); 834 } 835 } 836 } 837 WRITE_UVLC( sei.m_seiNumBspSchedCombinationsMinus1[lsIdx], "sei_num_bsp_sched_combinations_minus1[i]"); 838 for (UInt i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 839 { 840 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 841 { 842 WRITE_UVLC( sei.m_seiBspCombHrdIdx[lsIdx][i][j], "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); 843 WRITE_UVLC( sei.m_seiBspCombScheddx[lsIdx][i][j], "sei_bsp_comb_sched_idx[lsIdx][i][j]"); 844 } 845 } 846 } 847 } 848 849 Void SEIWriter::xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ) 850 { 851 if( commonInfPresentFlag ) 852 { 853 WRITE_FLAG( hrd->getNalHrdParametersPresentFlag() ? 1 : 0 , "nal_hrd_parameters_present_flag" ); 854 WRITE_FLAG( hrd->getVclHrdParametersPresentFlag() ? 1 : 0 , "vcl_hrd_parameters_present_flag" ); 855 if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() ) 856 { 857 WRITE_FLAG( hrd->getSubPicCpbParamsPresentFlag() ? 1 : 0, "sub_pic_cpb_params_present_flag" ); 858 if( hrd->getSubPicCpbParamsPresentFlag() ) 859 { 860 WRITE_CODE( hrd->getTickDivisorMinus2(), 8, "tick_divisor_minus2" ); 861 WRITE_CODE( hrd->getDuCpbRemovalDelayLengthMinus1(), 5, "du_cpb_removal_delay_length_minus1" ); 862 WRITE_FLAG( hrd->getSubPicCpbParamsInPicTimingSEIFlag() ? 1 : 0, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); 863 WRITE_CODE( hrd->getDpbOutputDelayDuLengthMinus1(), 5, "dpb_output_delay_du_length_minus1" ); 864 } 865 WRITE_CODE( hrd->getBitRateScale(), 4, "bit_rate_scale" ); 866 WRITE_CODE( hrd->getCpbSizeScale(), 4, "cpb_size_scale" ); 867 if( hrd->getSubPicCpbParamsPresentFlag() ) 868 { 869 WRITE_CODE( hrd->getDuCpbSizeScale(), 4, "du_cpb_size_scale" ); 870 } 871 WRITE_CODE( hrd->getInitialCpbRemovalDelayLengthMinus1(), 5, "initial_cpb_removal_delay_length_minus1" ); 872 WRITE_CODE( hrd->getCpbRemovalDelayLengthMinus1(), 5, "au_cpb_removal_delay_length_minus1" ); 873 WRITE_CODE( hrd->getDpbOutputDelayLengthMinus1(), 5, "dpb_output_delay_length_minus1" ); 874 } 875 } 876 Int i, j, nalOrVcl; 877 for( i = 0; i <= maxNumSubLayersMinus1; i ++ ) 878 { 879 WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0, "fixed_pic_rate_general_flag"); 880 if( !hrd->getFixedPicRateFlag( i ) ) 881 { 882 WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag"); 883 } 884 else 885 { 886 hrd->setFixedPicRateWithinCvsFlag( i, true ); 887 } 888 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 889 { 890 WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ), "elemental_duration_in_tc_minus1"); 891 } 892 else 893 { 894 WRITE_FLAG( hrd->getLowDelayHrdFlag( i ) ? 1 : 0, "low_delay_hrd_flag"); 895 } 896 if (!hrd->getLowDelayHrdFlag( i )) 897 { 898 WRITE_UVLC( hrd->getCpbCntMinus1( i ), "cpb_cnt_minus1"); 899 } 900 901 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 902 { 903 if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) || 904 ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) ) 905 { 906 for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ ) 907 { 908 WRITE_UVLC( hrd->getBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_value_minus1"); 909 WRITE_UVLC( hrd->getCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_value_minus1"); 910 if( hrd->getSubPicCpbParamsPresentFlag() ) 911 { 912 WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 913 WRITE_UVLC( hrd->getDuBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_du_value_minus1"); 914 } 915 WRITE_FLAG( hrd->getCbrFlag( i, j, nalOrVcl ) ? 1 : 0, "cbr_flag"); 916 } 917 } 918 } 919 } 920 } 921 922 #endif 923 695 924 #endif //SVC_EXTENSION 696 925 -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r595 r644 47 47 virtual ~SEIWriter() {}; 48 48 49 #if O0164_MULTI_LAYER_HRD 50 void writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL); 51 #else 49 52 void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps); 53 #endif 50 54 51 55 protected: 56 #if O0164_MULTI_LAYER_HRD 57 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei); 58 #else 52 59 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps); 60 #endif 53 61 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); 54 62 Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei); … … 65 73 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 66 74 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 75 #if O0164_MULTI_LAYER_HRD 76 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps); 77 #else 67 78 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps); 79 #endif 68 80 Void xWriteByteAlign(); 69 81 #if SVC_EXTENSION … … 77 89 Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei); 78 90 #endif 91 #if O0164_MULTI_LAYER_HRD 92 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei); 93 Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei); 94 Void xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei); 95 Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 96 #endif 79 97 #endif //SVC_EXTENSION 80 98 }; -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r595 r644 251 251 WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2"); 252 252 WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag"); 253 #if P0166_MODIFIED_PPS_EXTENSION 254 WRITE_FLAG( 1, "pps_extension_flag" ); 255 if( 1 ) //pps_extension_flag 256 { 257 #if !POC_RESET_IDC 258 UInt ppsExtensionTypeFlag[8] = { 0, 1, 0, 0, 0, 0, 0, 0 }; 259 #else 260 UInt ppsExtensionTypeFlag[8] = { 1, 0, 0, 0, 0, 0, 0, 0 }; 261 #endif 262 for (UInt i = 0; i < 8; i++) 263 { 264 WRITE_FLAG( ppsExtensionTypeFlag[i], "pps_extension_type_flag" ); 265 } 266 #if POC_RESET_IDC 267 if( ppsExtensionTypeFlag[0] ) 268 { 269 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag() ? 1 : 0, "poc_reset_info_present_flag" ); 270 #endif 271 } 272 } 273 #else 253 274 WRITE_FLAG( 0, "pps_extension_flag" ); 275 #endif 254 276 } 255 277 … … 496 518 WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); 497 519 520 #if SPS_DPB_PARAMS 521 if( pcSPS->getLayerId() == 0 ) 522 { 523 #endif 498 524 const Bool subLayerOrderingInfoPresentFlag = 1; 499 525 WRITE_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); … … 508 534 } 509 535 } 536 #if SPS_DPB_PARAMS 537 } 538 #endif 510 539 assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() ); 511 540 … … 632 661 WRITE_SVLC( scaledWindow.getWindowRightOffset() >> 1, "scaled_ref_layer_right_offset" ); 633 662 WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" ); 663 #if P0312_VERT_PHASE_ADJ 664 WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_position_enable_flag" ); 665 #endif 634 666 } 635 667 } … … 776 808 { 777 809 // ... More syntax elements to be written here 810 #if P0300_ALT_OUTPUT_LAYER_FLAG 811 Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1]; 812 Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1]; 813 #endif 778 814 #if VPS_EXTN_MASK_AND_DIM_INFO 779 815 UInt i = 0, j = 0; … … 887 923 if (vps->getMaxTSLayersPresentFlag()) 888 924 { 889 for( i = 0; i < vps->getMaxLayers() - 1; i++)925 for( i = 0; i < vps->getMaxLayers(); i++) 890 926 { 891 927 WRITE_CODE(vps->getMaxTSLayersMinus1(i), 3, "sub_layers_vps_max_minus1[i]" ); … … 993 1029 #endif 994 1030 Int lsIdx = vps->getOutputLayerSetIdx(i); 1031 #if NUM_OL_FLAGS 1032 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++) 1033 #else 995 1034 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++) 1035 #endif 996 1036 { 997 1037 WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]"); … … 1004 1044 } 1005 1045 WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" ); 1006 } 1007 1046 #if P0300_ALT_OUTPUT_LAYER_FLAG 1047 NumOutputLayersInOutputLayerSet[i] = 0; 1048 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 1049 for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++) 1050 { 1051 NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j); 1052 if (vps->getOutputLayerFlag(i, j)) 1053 { 1054 OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j); 1055 } 1056 } 1057 if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0) 1058 { 1059 WRITE_FLAG(vps->getAltOuputLayerFlag(i), "alt_output_layer_flag[i]"); 1060 } 1061 #endif 1062 } 1063 1064 #if !P0300_ALT_OUTPUT_LAYER_FLAG 1008 1065 #if O0153_ALT_OUTPUT_LAYER_FLAG 1009 1066 if( vps->getMaxLayers() > 1 ) … … 1011 1068 WRITE_FLAG( vps->getAltOuputLayerFlag(), "alt_output_layer_flag" ); 1012 1069 } 1070 #endif 1013 1071 #endif 1014 1072 … … 1124 1182 #if P0307_VPS_NON_VUI_EXTENSION 1125 1183 WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" ); 1184 #if P0307_VPS_NON_VUI_EXT_UPDATE 1185 for (i = 1; i <= vps->getVpsNonVuiExtLength(); i++) 1186 { 1187 WRITE_CODE(1, 8, "vps_non_vui_extension_data_byte"); 1188 } 1189 #else 1126 1190 if ( vps->getVpsNonVuiExtLength() > 0 ) 1127 1191 { 1128 1192 printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n"); 1129 1193 } 1194 #endif 1130 1195 #endif 1131 1196 … … 1217 1282 Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps) 1218 1283 { 1284 #if DPB_PARAMS_MAXTLAYERS 1285 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1286 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1287 { 1288 UInt maxSLMinus1 = 0; 1289 #if CHANGE_NUMSUBDPB_IDX 1290 Int optLsIdx = vps->getOutputLayerSetIdx( i ); 1291 #else 1292 Int optLsIdx = i; 1293 #endif 1294 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1295 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); 1296 maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId))); 1297 } 1298 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1299 } 1300 #endif 1301 1219 1302 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1220 1303 { … … 1222 1305 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1223 1306 #endif 1224 WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 1307 WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 1308 #if DPB_PARAMS_MAXTLAYERS 1309 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1310 #else 1225 1311 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1312 #endif 1226 1313 { 1227 1314 if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) ) … … 1266 1353 #if IRAP_ALIGN_FLAG_IN_VPS_VUI 1267 1354 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1355 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1356 if(vps->getCrossLayerIrapAlignFlag()) 1357 { 1358 WRITE_FLAG(vps->getCrossLayerAlignedIdrOnlyFlag(), "only_idr_for_IRAP_across_layers"); 1359 } 1360 #endif 1268 1361 #endif 1269 1362 #if O0223_PICTURE_TYPES_ALIGN_FLAG … … 1375 1468 WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" ); 1376 1469 #endif 1470 #endif 1471 #if P0312_VERT_PHASE_ADJ 1472 WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" ); 1377 1473 #endif 1378 1474 #if N0160_VUI_EXT_ILP_REF … … 1424 1520 #endif 1425 1521 #endif 1522 #if O0164_MULTI_LAYER_HRD 1523 WRITE_FLAG(vps->getVpsVuiBspHrdPresentFlag(), "vps_vui_bsp_hrd_present_flag" ); 1524 if (vps->getVpsVuiBspHrdPresentFlag()) 1525 { 1526 WRITE_UVLC( vps->getVpsNumBspHrdParametersMinus1(), "vps_num_bsp_hrd_parameters_minus1" ); 1527 for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) 1528 { 1529 if( i > 0 ) 1530 { 1531 WRITE_FLAG( vps->getBspCprmsPresentFlag(i), "bsp_cprms_present_flag[i]" ); 1532 } 1533 codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 1534 } 1535 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 1536 { 1537 WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]"); 1538 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 1539 { 1540 for( j = 0; j <= (vps->getMaxLayers()-1); j++ ) 1541 { 1542 if (vps->getLayerIdIncludedFlag(h, j)) 1543 { 1544 WRITE_FLAG( vps->getLayerInBspFlag(h, i, j), "layer_in_bsp_flag[h][i][j]" ); 1545 } 1546 } 1547 } 1548 if (vps->getNumBitstreamPartitions(h)) 1549 { 1550 WRITE_UVLC( vps->getNumBspSchedCombinations(h), "num_bsp_sched_combinations[h]"); 1551 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 1552 { 1553 for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ ) 1554 { 1555 WRITE_UVLC( vps->getBspCombHrdIdx(h, i, j), "bsp_comb_hrd_idx[h][i][j]"); 1556 WRITE_UVLC( vps->getBspCombSchedIdx(h, i, j), "bsp_comb_sched_idx[h][i][j]"); 1557 } 1558 } 1559 } 1560 } 1561 } 1562 #endif 1563 #if P0182_VPS_VUI_PS_FLAG 1564 for(i = 1; i < vps->getMaxLayers(); i++) 1565 { 1566 if(vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0) 1567 { 1568 if ((vps->getSPSId(i) == 0) && (vps->getPPSId(i) == 0)) 1569 { 1570 vps->setBaseLayerPSCompatibilityFlag(i, 1); 1571 WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" ); 1572 } 1573 else 1574 { 1575 vps->setBaseLayerPSCompatibilityFlag(i, 0); 1576 } 1577 } 1578 } 1579 #endif 1426 1580 } 1427 1581 #endif … … 1458 1612 if ( pcSlice->getRapPicFlag() ) 1459 1613 { 1614 #if NO_OUTPUT_OF_PRIOR_PICS 1615 WRITE_FLAG( pcSlice->getNoOutputOfPriorPicsFlag(), "no_output_of_prior_pics_flag" ); 1616 #else 1460 1617 WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); 1618 #endif 1461 1619 } 1462 1620 WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" ); … … 1690 1848 #if ILP_SSH_SIG 1691 1849 #if ILP_SSH_SIG_FIX 1692 if((pcSlice->get SPS()->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )1693 #else 1694 if((pcSlice->get SPS()->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) )1695 #endif 1696 #else 1697 if((pcSlice->get SPS()->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) )1850 if((pcSlice->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1851 #else 1852 if((pcSlice->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) ) 1853 #endif 1854 #else 1855 if((pcSlice->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) ) 1698 1856 #endif 1699 1857 { … … 1726 1884 } 1727 1885 } 1886 #if P0312_VERT_PHASE_ADJ 1887 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1888 { 1889 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1890 if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 1891 { 1892 WRITE_FLAG( pcSlice->getVertPhasePositionFlag(refLayerIdc), "vert_phase_position_flag" ); 1893 } 1894 } 1895 #endif 1728 1896 #endif //SVC_EXTENSION 1729 1897 … … 1886 2054 } 1887 2055 } 2056 2057 #if !POC_RESET_IDC_SIGNALLING // Wrong place to put slice header extension 1888 2058 if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag()) 1889 2059 { 1890 2060 WRITE_UVLC(0,"slice_header_extension_length"); 1891 2061 } 2062 #endif 1892 2063 } 1893 2064 … … 2025 2196 } 2026 2197 2198 #if POC_RESET_IDC_SIGNALLING 2199 Void TEncCavlc::codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow ) 2200 { 2201 Int tmpBitsBeforeWriting = getNumberOfWrittenBits(); 2202 if(slice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2203 { 2204 // Derive the value of PocMsbValRequiredFlag 2205 slice->setPocMsbValRequiredFlag( slice->getCraPicFlag() || slice->getBlaPicFlag() 2206 /* || related to vps_poc_lsb_aligned_flag */ 2207 ); 2208 2209 // Determine value of SH extension length. 2210 Int shExtnLengthInBit = 0; 2211 if (slice->getPPS()->getPocResetInfoPresentFlag()) 2212 { 2213 shExtnLengthInBit += 2; 2214 } 2215 if (slice->getPocResetIdc() > 0) 2216 { 2217 shExtnLengthInBit += 6; 2218 } 2219 if (slice->getPocResetIdc() == 3) 2220 { 2221 shExtnLengthInBit += (slice->getSPS()->getBitsForPOC() + 1); 2222 } 2223 2224 2225 if( !slice->getPocMsbValRequiredFlag() /* && vps_poc_lsb_aligned_flag */ ) 2226 { 2227 shExtnLengthInBit++; 2228 } 2229 else 2230 { 2231 if( slice->getPocMsbValRequiredFlag() ) 2232 { 2233 slice->setPocMsbValPresentFlag( true ); 2234 } 2235 else 2236 { 2237 slice->setPocMsbValPresentFlag( false ); 2238 } 2239 } 2240 2241 if( slice->getPocMsbValPresentFlag() ) 2242 { 2243 UInt lengthVal = 1; 2244 UInt tempVal = slice->getPocMsbVal() + 1; 2245 assert ( tempVal ); 2246 while( 1 != tempVal ) 2247 { 2248 tempVal >>= 1; 2249 lengthVal += 2; 2250 } 2251 shExtnLengthInBit += lengthVal; 2252 } 2253 Int shExtnAdditionalBits = 0; 2254 if(shExtnLengthInBit % 8 != 0) 2255 { 2256 shExtnAdditionalBits = 8 - (shExtnLengthInBit % 8); 2257 } 2258 Int shExtnLength = (shExtnLengthInBit + shExtnAdditionalBits) / 8; 2259 WRITE_UVLC( shExtnLength, "slice_header_extension_length" ); 2260 2261 if(slice->getPPS()->getPocResetInfoPresentFlag()) 2262 { 2263 WRITE_CODE( slice->getPocResetIdc(), 2, "poc_reset_idc"); 2264 } 2265 if(slice->getPocResetIdc() > 0) 2266 { 2267 WRITE_CODE( slice->getPocResetPeriodId(), 6, "poc_reset_period_id"); 2268 } 2269 if(slice->getPocResetIdc() == 3) 2270 { 2271 WRITE_FLAG( slice->getFullPocResetFlag() ? 1 : 0, "full_poc_reset_flag"); 2272 WRITE_CODE( slice->getPocLsbVal(), slice->getSPS()->getBitsForPOC(), "poc_lsb_val"); 2273 } 2274 2275 if( !slice->getPocMsbValRequiredFlag() /* && vps_poc_lsb_aligned_flag */ ) 2276 { 2277 WRITE_FLAG( slice->getPocMsbValPresentFlag(), "poc_msb_val_present_flag" ); 2278 } 2279 if( slice->getPocMsbValPresentFlag() ) 2280 { 2281 WRITE_UVLC( slice->getPocMsbVal(), "poc_msb_val" ); 2282 } 2283 for (Int i = 0; i < shExtnAdditionalBits; i++) 2284 { 2285 WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit"); 2286 } 2287 } 2288 shBitsWrittenTillNow += ( getNumberOfWrittenBits() - tmpBitsBeforeWriting ); 2289 2290 // Slice header byte_alignment() included in xAttachSliceDataToNalUnit 2291 } 2292 #endif 2293 2027 2294 Void TEncCavlc::codeTerminatingBit ( UInt uilsLast ) 2028 2295 { -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r595 r644 96 96 Void codeHrdParameters ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 97 97 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 98 #if POC_RESET_IDC_SIGNALLING 99 Void codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow ); 100 #endif 98 101 Void codeTerminatingBit ( UInt uilsLast ); 99 102 Void codeSliceFinish (); 100 103 101 104 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 105 #if SVC_EXTENSION 106 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 107 #else 102 108 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 109 #endif 103 110 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 104 111 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r595 r644 386 386 387 387 Window &getConformanceWindow() { return m_conformanceWindow; } 388 #if P0312_VERT_PHASE_ADJ 389 Void setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false); } 390 #else 388 391 Void setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); } 392 #endif 389 393 390 394 Void setFramesToBeEncoded ( Int i ) { m_framesToBeEncoded = i; } -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r595 r644 60 60 } 61 61 62 #if POC_RESET_IDC_SIGNALLING 63 Void TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) 64 { 65 m_pcEntropyCoderIf->codeSliceHeaderExtn( pSlice, shBitsWrittenTillNow ); 66 } 67 #endif 68 62 69 Void TEncEntropy::encodeTerminatingBit ( UInt uiIsLast ) 63 70 { -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r595 r644 74 74 75 75 virtual Void codeTilesWPPEntryPoint ( TComSlice* pSlice ) = 0; 76 #if POC_RESET_IDC_SIGNALLING 77 virtual Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ) = 0; 78 #endif 76 79 virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; 77 80 virtual Void codeSliceFinish () = 0; … … 105 108 virtual Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 106 109 virtual Void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType ) = 0; 110 #if SVC_EXTENSION 111 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 112 #else 107 113 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 114 #endif 108 115 virtual Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0; 109 116 … … 138 145 Void encodeSliceHeader ( TComSlice* pcSlice ); 139 146 Void encodeTilesWPPEntryPoint( TComSlice* pSlice ); 147 #if POC_RESET_IDC_SIGNALLING 148 Void encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ); 149 #endif 140 150 Void encodeTerminatingBit ( UInt uiIsLast ); 141 151 Void encodeSliceFinish (); … … 184 194 185 195 Void estimateBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); 196 #if SVC_EXTENSION 197 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 198 #else 186 199 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 200 #endif 187 201 static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ); 188 202 -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r595 r644 303 303 //nalu = NALUnit(NAL_UNIT_SEI); 304 304 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 305 #if O0164_MULTI_LAYER_HRD 306 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 307 #else 305 308 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 309 #endif 306 310 writeRBSPTrailingBits(nalu.m_Bitstream); 307 311 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 316 320 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 317 321 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 322 #if O0164_MULTI_LAYER_HRD 323 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 324 #else 318 325 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 326 #endif 319 327 writeRBSPTrailingBits(nalu.m_Bitstream); 320 328 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 327 335 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 328 336 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 337 #if O0164_MULTI_LAYER_HRD 338 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 339 #else 329 340 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 341 #endif 330 342 writeRBSPTrailingBits(nalu.m_Bitstream); 331 343 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 338 350 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 339 351 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 352 #if O0164_MULTI_LAYER_HRD 353 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 354 #else 340 355 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 356 #endif 341 357 writeRBSPTrailingBits(nalu.m_Bitstream); 342 358 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 350 366 SEILayersNotPresent *sei = xCreateSEILayersNotPresent (); 351 367 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 368 #if O0164_MULTI_LAYER_HRD 369 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 370 #else 352 371 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 372 #endif 353 373 writeRBSPTrailingBits(nalu.m_Bitstream); 354 374 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 364 384 nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, m_pcCfg->getNumLayer()-1); // For highest layer 365 385 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 386 #if O0164_MULTI_LAYER_HRD 387 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 388 #else 366 389 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 390 #endif 367 391 writeRBSPTrailingBits(nalu.m_Bitstream); 368 392 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 797 821 Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 798 822 #endif*/ 823 #if P0312_VERT_PHASE_ADJ 824 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom 825 if( scalEL.getVertPhasePositionEnableFlag() ) 826 { 827 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc ); 828 } 829 #endif 799 830 #if O0215_PHASE_ALIGNMENT 800 831 #if O0194_JOINT_US_BITSHIFT … … 928 959 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP()); 929 960 } 961 #if ALIGNED_BUMPING 962 pcSlice->checkLeadingPictureRestrictions(rcListPic); 963 #endif 930 964 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 931 965 … … 1716 1750 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS()); 1717 1751 1752 #if O0164_MULTI_LAYER_HRD 1753 if (pcSlice->getLayerId() == 0 && m_pcEncTop->getVPS()->getVpsVuiBspHrdPresentFlag()) 1754 { 1755 nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, 1); 1756 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 1757 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1758 SEIScalableNesting *scalableBspNestingSei = xCreateBspNestingSEI(pcSlice); 1759 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *scalableBspNestingSei, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1760 writeRBSPTrailingBits(nalu.m_Bitstream); 1761 1762 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); 1763 UInt offsetPosition = m_activeParameterSetSEIPresentInAU 1764 + m_bufferingPeriodSEIPresentInAU 1765 + m_pictureTimingSEIPresentInAU 1766 + m_nestedPictureTimingSEIPresentInAU; // Insert SEI after APS, BP and PT SEI 1767 AccessUnit::iterator it; 1768 for(j = 0, it = accessUnit.begin(); j < seiPositionInAu + offsetPosition; j++) 1769 { 1770 it++; 1771 } 1772 accessUnit.insert(it, new NALUnitEBSP(nalu)); 1773 } 1774 #endif 1775 1718 1776 m_bSeqFirst = false; 1719 1777 } … … 1750 1808 SOPDescriptionSEI.m_numPicsInSopMinus1 = i - 1; 1751 1809 1810 #if O0164_MULTI_LAYER_HRD 1811 m_seiWriter.writeSEImessage( nalu.m_Bitstream, SOPDescriptionSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1812 #else 1752 1813 m_seiWriter.writeSEImessage( nalu.m_Bitstream, SOPDescriptionSEI, pcSlice->getSPS()); 1814 #endif 1753 1815 writeRBSPTrailingBits(nalu.m_Bitstream); 1754 1816 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 1834 1896 sei_buffering_period.m_dpbDelayOffset = 0; 1835 1897 1898 #if O0164_MULTI_LAYER_HRD 1899 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1900 #else 1836 1901 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, pcSlice->getSPS()); 1902 #endif 1837 1903 writeRBSPTrailingBits(nalu.m_Bitstream); 1838 1904 { … … 1855 1921 scalableNestingSEI.m_nestedSEIs.clear(); 1856 1922 scalableNestingSEI.m_nestedSEIs.push_back(&sei_buffering_period); 1923 #if O0164_MULTI_LAYER_HRD 1924 m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1925 #else 1857 1926 m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, pcSlice->getSPS()); 1927 #endif 1858 1928 writeRBSPTrailingBits(naluTmp.m_Bitstream); 1859 1929 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 1884 1954 seiGradualDecodingRefreshInfo.m_gdrForegroundFlag = true; // Indicating all "foreground" 1885 1955 1956 #if O0164_MULTI_LAYER_HRD 1957 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiGradualDecodingRefreshInfo, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 1958 #else 1886 1959 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiGradualDecodingRefreshInfo, pcSlice->getSPS() ); 1960 #endif 1887 1961 writeRBSPTrailingBits(nalu.m_Bitstream); 1888 1962 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 1902 1976 sei_recovery_point.m_brokenLinkFlag = false; 1903 1977 1978 #if O0164_MULTI_LAYER_HRD 1979 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 1980 #else 1904 1981 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, pcSlice->getSPS() ); 1982 #endif 1905 1983 writeRBSPTrailingBits(nalu.m_Bitstream); 1906 1984 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 2128 2206 m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder, pcSlice ); 2129 2207 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2208 #if !POC_RESET_IDC_SIGNALLING 2130 2209 m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice ); 2210 #else 2211 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 2212 m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice ); 2213 actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting ); 2214 m_pcEntropyCoder->encodeSliceHeaderExtn( pcSlice, actualHeadBits ); 2215 #endif 2131 2216 2132 2217 // Substreams... … … 2269 2354 /* write the SEI messages */ 2270 2355 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2356 #if O0164_MULTI_LAYER_HRD 2357 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recon_picture_digest, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2358 #else 2271 2359 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recon_picture_digest, pcSlice->getSPS()); 2360 #endif 2272 2361 writeRBSPTrailingBits(nalu.m_Bitstream); 2273 2362 … … 2293 2382 /* write the SEI messages */ 2294 2383 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2384 #if O0164_MULTI_LAYER_HRD 2385 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_temporal_level0_index, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2386 #else 2295 2387 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_temporal_level0_index, pcSlice->getSPS()); 2388 #endif 2296 2389 writeRBSPTrailingBits(nalu.m_Bitstream); 2297 2390 … … 2443 2536 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2444 2537 pictureTimingSEI.m_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0; 2538 #if O0164_MULTI_LAYER_HRD 2539 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2540 #else 2445 2541 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS()); 2542 #endif 2446 2543 writeRBSPTrailingBits(nalu.m_Bitstream); 2447 2544 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 2462 2559 scalableNestingSEI.m_nestedSEIs.clear(); 2463 2560 scalableNestingSEI.m_nestedSEIs.push_back(&pictureTimingSEI); 2561 #if O0164_MULTI_LAYER_HRD 2562 m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2563 #else 2464 2564 m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, pcSlice->getSPS()); 2565 #endif 2465 2566 writeRBSPTrailingBits(nalu.m_Bitstream); 2466 2567 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 2494 2595 { 2495 2596 // Insert before the first slice. 2597 #if O0164_MULTI_LAYER_HRD 2598 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2599 #else 2496 2600 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, pcSlice->getSPS()); 2601 #endif 2497 2602 writeRBSPTrailingBits(nalu.m_Bitstream); 2498 2603 … … 2516 2621 { 2517 2622 // Insert before the first slice. 2623 #if O0164_MULTI_LAYER_HRD 2624 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2625 #else 2518 2626 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, pcSlice->getSPS()); 2627 #endif 2519 2628 writeRBSPTrailingBits(nalu.m_Bitstream); 2520 2629 … … 3652 3761 } 3653 3762 #endif 3763 3764 #if O0164_MULTI_LAYER_HRD 3765 SEIScalableNesting* TEncGOP::xCreateBspNestingSEI(TComSlice *pcSlice) 3766 { 3767 SEIScalableNesting *seiScalableNesting = new SEIScalableNesting(); 3768 SEIBspInitialArrivalTime *seiBspInitialArrivalTime = new SEIBspInitialArrivalTime(); 3769 SEIBspNesting *seiBspNesting = new SEIBspNesting(); 3770 SEIBufferingPeriod *seiBufferingPeriod = new SEIBufferingPeriod(); 3771 3772 // Scalable nesting SEI 3773 3774 seiScalableNesting->m_bitStreamSubsetFlag = 1; // If the nested SEI messages are picture buffereing SEI mesages, picure timing SEI messages or sub-picture timing SEI messages, bitstream_subset_flag shall be equal to 1 3775 seiScalableNesting->m_nestingOpFlag = 1; 3776 seiScalableNesting->m_defaultOpFlag = 0; 3777 seiScalableNesting->m_nestingNumOpsMinus1 = 0; //nesting_num_ops_minus1 3778 seiScalableNesting->m_nestingOpIdx[0] = 1; 3779 seiScalableNesting->m_allLayersFlag = 0; 3780 seiScalableNesting->m_nestingNoOpMaxTemporalIdPlus1 = 6 + 1; //nesting_no_op_max_temporal_id_plus1 3781 seiScalableNesting->m_nestingNumLayersMinus1 = 1 - 1; //nesting_num_layers_minus1 3782 seiScalableNesting->m_nestingLayerId[0] = 0; 3783 seiScalableNesting->m_callerOwnsSEIs = true; 3784 3785 // Bitstream partition nesting SEI 3786 3787 seiBspNesting->m_bspIdx = 0; 3788 seiBspNesting->m_callerOwnsSEIs = true; 3789 3790 // Buffering period SEI 3791 3792 UInt uiInitialCpbRemovalDelay = (90000/2); // 0.5 sec 3793 seiBufferingPeriod->m_initialCpbRemovalDelay [0][0] = uiInitialCpbRemovalDelay; 3794 seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][0] = uiInitialCpbRemovalDelay; 3795 seiBufferingPeriod->m_initialCpbRemovalDelay [0][1] = uiInitialCpbRemovalDelay; 3796 seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][1] = uiInitialCpbRemovalDelay; 3797 3798 Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale(); 3799 3800 UInt uiTmp = (UInt)( dTmp * 90000.0 ); 3801 uiInitialCpbRemovalDelay -= uiTmp; 3802 uiInitialCpbRemovalDelay -= uiTmp / ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2 ); 3803 seiBufferingPeriod->m_initialAltCpbRemovalDelay [0][0] = uiInitialCpbRemovalDelay; 3804 seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][0] = uiInitialCpbRemovalDelay; 3805 seiBufferingPeriod->m_initialAltCpbRemovalDelay [0][1] = uiInitialCpbRemovalDelay; 3806 seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][1] = uiInitialCpbRemovalDelay; 3807 3808 seiBufferingPeriod->m_rapCpbParamsPresentFlag = 0; 3809 //for the concatenation, it can be set to one during splicing. 3810 seiBufferingPeriod->m_concatenationFlag = 0; 3811 //since the temporal layer HRD is not ready, we assumed it is fixed 3812 seiBufferingPeriod->m_auCpbRemovalDelayDelta = 1; 3813 seiBufferingPeriod->m_cpbDelayOffset = 0; 3814 seiBufferingPeriod->m_dpbDelayOffset = 0; 3815 3816 // Intial arrival time SEI message 3817 3818 seiBspInitialArrivalTime->m_nalInitialArrivalDelay[0] = 0; 3819 seiBspInitialArrivalTime->m_vclInitialArrivalDelay[0] = 0; 3820 3821 3822 seiBspNesting->m_nestedSEIs.push_back(seiBufferingPeriod); 3823 seiBspNesting->m_nestedSEIs.push_back(seiBspInitialArrivalTime); 3824 seiScalableNesting->m_nestedSEIs.push_back(seiBspNesting); // BSP nesting SEI is contained in scalable nesting SEI 3825 3826 return seiScalableNesting; 3827 } 3828 #endif 3829 3654 3830 #endif //SVC_EXTENSION 3655 3831 -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r595 r644 211 211 SEIInterLayerConstrainedTileSets* xCreateSEIInterLayerConstrainedTileSets(); 212 212 #endif 213 #if O0164_MULTI_LAYER_HRD 214 SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice); 215 #endif 213 216 #endif //SVC_EXTENSION 214 217 };// END CLASS DEFINITION TEncGOP -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r595 r644 463 463 Int bitDepth = (compIdx== SAO_Y) ? g_bitDepthY : g_bitDepthC; 464 464 Int shift = 2 * DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 465 #if SVC_EXTENSION 466 Int offsetTh = getSaoMaxOffsetQVal()[compIdx]; //inclusive 467 #else 465 468 Int offsetTh = g_saoMaxOffsetQVal[compIdx]; //inclusive 469 #endif 466 470 467 471 ::memset(quantOffsets, 0, sizeof(Int)*MAX_NUM_SAO_CLASSES); … … 582 586 modeParam[SAO_Y ].modeIdc = SAO_MODE_OFF; 583 587 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 588 #if SVC_EXTENSION 589 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true); 590 #else 584 591 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true); 592 #endif 585 593 m_pcRDGoOnSbacCoder->store(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]); 586 594 … … 590 598 modeParam[compIdx].modeIdc = SAO_MODE_OFF; 591 599 m_pcRDGoOnSbacCoder->resetBits(); 600 #if SVC_EXTENSION 601 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 602 #else 592 603 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx]); 604 #endif 593 605 modeDist[compIdx] = 0; 594 606 minCost= m_lambda[compIdx]*((Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits()); … … 613 625 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]); 614 626 m_pcRDGoOnSbacCoder->resetBits(); 627 #if SVC_EXTENSION 628 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 629 #else 615 630 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]); 631 #endif 616 632 rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 617 633 cost = (Double)dist[compIdx] + m_lambda[compIdx]*((Double)rate); … … 638 654 modeDist [component] = 0; 639 655 656 #if SVC_EXTENSION 657 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component], getSaoMaxOffsetQVal()); 658 #else 640 659 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component]); 660 #endif 641 661 642 662 const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); … … 672 692 dist[compIdx]= getDistortion(ctu, compIdx, typeIdc, testOffset[compIdx].typeAuxInfo, invQuantOffset, blkStats[ctu][compIdx][typeIdc]); 673 693 694 #if SVC_EXTENSION 695 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 696 #else 674 697 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]); 698 #endif 675 699 676 700 const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); … … 699 723 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 700 724 m_pcRDGoOnSbacCoder->resetBits(); 725 #if SVC_EXTENSION 726 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 727 #else 701 728 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 729 #endif 702 730 modeNormCost += (Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 703 731 … … 742 770 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 743 771 m_pcRDGoOnSbacCoder->resetBits(); 772 #if SVC_EXTENSION 773 m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 774 #else 744 775 m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 776 #endif 745 777 Int rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 746 778 -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r595 r644 266 266 } 267 267 268 #if POC_RESET_IDC_SIGNALLING 269 Void TEncSbac::codeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) 270 { 271 assert (0); 272 return; 273 } 274 #endif 268 275 Void TEncSbac::codeTerminatingBit( UInt uilsLast ) 269 276 { … … 1592 1599 } 1593 1600 1601 #if SVC_EXTENSION 1602 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal) 1603 #else 1594 1604 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled) 1605 #endif 1595 1606 { 1596 1607 UInt uiSymbol; … … 1639 1650 for(Int i=0; i< 4; i++) 1640 1651 { 1652 #if SVC_EXTENSION 1653 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1654 #else 1641 1655 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1656 #endif 1642 1657 } 1643 1658 … … 1669 1684 1670 1685 Void TEncSbac::codeSAOBlkParam(SAOBlkParam& saoBlkParam 1686 #if SVC_EXTENSION 1687 , UInt* saoMaxOffsetQVal 1688 #endif 1671 1689 , Bool* sliceEnabled 1672 1690 , Bool leftMergeAvail … … 1700 1718 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 1701 1719 { 1720 #if SVC_EXTENSION 1721 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx], saoMaxOffsetQVal); 1722 #else 1702 1723 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx]); 1724 #endif 1703 1725 } 1704 1726 } -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r595 r644 95 95 Void codeSliceHeader ( TComSlice* pcSlice ); 96 96 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 97 #if POC_RESET_IDC_SIGNALLING 98 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ); 99 #endif 97 100 Void codeTerminatingBit ( UInt uilsLast ); 98 101 Void codeSliceFinish (); … … 104 107 Void codeScalingList ( TComScalingList* /*scalingList*/ ){ assert (0); return;}; 105 108 109 #if SVC_EXTENSION 110 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal); 111 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam 112 , UInt* saoMaxOffsetQVal 113 , Bool* sliceEnabled 114 , Bool leftMergeAvail 115 , Bool aboveMergeAvail 116 , Bool onlyEstMergeInfo = false 117 ); 118 #else 106 119 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled); 107 120 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam … … 111 124 , Bool onlyEstMergeInfo = false 112 125 ); 126 #endif 113 127 114 128 private: -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r595 r644 1356 1356 } 1357 1357 1358 #if SVC_EXTENSION 1359 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerId()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail); 1360 #else 1358 1361 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam,sliceEnabled, leftMergeAvail, aboveMergeAvail); 1362 #endif 1359 1363 } 1360 1364 } -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r595 r644 791 791 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 792 792 #endif 793 #if O0194_DIFFERENT_BITDEPTH_EL_BL 794 UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i); 795 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 796 797 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths ) 798 #else 793 799 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 800 #endif 794 801 { 795 802 pcEPic->setSpatialEnhLayerFlag( i, true ); … … 846 853 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 847 854 #endif 855 #if O0194_DIFFERENT_BITDEPTH_EL_BL 856 UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i); 857 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 858 859 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths ) 860 #else 848 861 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 862 #endif 849 863 { 850 864 rpcPic->setSpatialEnhLayerFlag( i, true ); … … 902 916 #endif 903 917 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 918 #if P0312_VERT_PHASE_ADJ 919 m_cSPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() ); 920 #endif 904 921 } 905 922 #endif //SVC_EXTENSION -
trunk/source/Lib/TLibEncoder/TEncTop.h
r595 r644 139 139 #endif 140 140 Window m_scaledRefLayerWindow[MAX_LAYERS]; 141 #if P0312_VERT_PHASE_ADJ 142 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 143 #endif 141 144 #if POC_RESET_FLAG 142 145 Int m_pocAdjustmentValue; … … 213 216 /// encode several number of pictures until end-of-sequence 214 217 #if SVC_EXTENSION 215 Void setLayerEnc(TEncTop** p) {m_ppcTEncTop = p;}216 TEncTop** getLayerEnc() {return m_ppcTEncTop;}217 Int getPOCLast () { return m_iPOCLast;}218 Int getNumPicRcvd () { return m_iNumPicRcvd;}219 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num;}220 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x;}221 UInt getNumScaledRefLayerOffsets(){ return m_numScaledRefLayerOffsets; }218 Void setLayerEnc(TEncTop** p) { m_ppcTEncTop = p; } 219 TEncTop** getLayerEnc() { return m_ppcTEncTop; } 220 Int getPOCLast () { return m_iPOCLast; } 221 Int getNumPicRcvd () { return m_iNumPicRcvd; } 222 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num; } 223 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 224 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 222 225 #if O0098_SCALED_REF_LAYER_ID 223 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 224 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 225 Window& getScaledRefLayerWindowForLayer(Int layerId); 226 #endif 227 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 226 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 227 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 228 Window& getScaledRefLayerWindowForLayer(Int layerId); 229 #endif 230 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 231 #if P0312_VERT_PHASE_ADJ 232 Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; } 233 UInt getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; } 234 #endif 235 228 236 TComPic** getIlpList() { return m_cIlpPic; } 229 237 #if REF_IDX_MFM 230 Void setMFMEnabledFlag (Bool flag) { m_bMFMEnabledFlag = flag;}231 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag;}238 Void setMFMEnabledFlag (Bool flag) { m_bMFMEnabledFlag = flag; } 239 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 232 240 #endif 233 241 #if O0194_WEIGHTED_PREDICTION_CGS … … 247 255 #endif 248 256 #if POC_RESET_FLAG 249 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;}250 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; }257 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 258 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; } 251 259 #endif 252 260 #if NO_CLRAS_OUTPUT_FLAG
Note: See TracChangeset for help on using the changeset viewer.