Changeset 644 in SHVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 25 Mar 2014, 21:51:30 (11 years ago)
- Location:
- trunk
- Files:
-
- 13 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/TLibDecoder/SEIread.cpp
r595 r644 111 111 #endif 112 112 #if SUB_BITSTREAM_PROPERTY_SEI 113 case SEI::SUB_BITSTREAM_PROPERTY: 114 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 115 break; 113 case SEI::SUB_BITSTREAM_PROPERTY: 114 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 115 break; 116 #endif 117 #if O0164_MULTI_LAYER_HRD 118 case SEI::BSP_NESTING: 119 fprintf( g_hTrace, "=========== Bitstream parition nesting SEI message ===========\n"); 120 break; 121 case SEI::BSP_INITIAL_ARRIVAL_TIME: 122 fprintf( g_hTrace, "=========== Bitstream parition initial arrival time SEI message ===========\n"); 123 break; 124 case SEI::BSP_HRD: 125 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 126 break; 116 127 #endif 117 128 #endif //SVC_EXTENSION … … 152 163 } 153 164 165 #if O0164_MULTI_LAYER_HRD 166 #if LAYERS_NOT_PRESENT_SEI 167 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei) 168 #else 169 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting *nestingSei) 170 #endif 171 #else 154 172 #if LAYERS_NOT_PRESENT_SEI 155 173 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 156 174 #else 157 175 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps) 176 #endif 158 177 #endif 159 178 { … … 272 291 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps); 273 292 #endif 293 break; 274 294 #if SVC_EXTENSION 275 295 #if LAYERS_NOT_PRESENT_SEI … … 296 316 sei = new SEISubBitstreamProperty; 297 317 xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei); 318 break; 319 #endif 320 #if O0164_MULTI_LAYER_HRD 321 case SEI::BSP_NESTING: 322 sei = new SEIBspNesting; 323 #if LAYERS_NOT_PRESENT_SEI 324 xParseSEIBspNesting((SEIBspNesting&) *sei, nalUnitType, vps, sps, *nestingSei); 325 #else 326 xParseSEIBspNesting((SEIBspNesting&) *sei, nalUnitType, sps, *nestingSei); 327 #endif 328 break; 329 case SEI::BSP_INITIAL_ARRIVAL_TIME: 330 sei = new SEIBspInitialArrivalTime; 331 xParseSEIBspInitialArrivalTime((SEIBspInitialArrivalTime&) *sei, vps, sps, *nestingSei, *bspNestingSei); 332 break; 333 case SEI::BSP_HRD: 334 sei = new SEIBspHrd; 335 xParseSEIBspHrd((SEIBspHrd&) *sei, sps, *nestingSei); 298 336 break; 299 337 #endif … … 380 418 } 381 419 420 #if P0138_USE_ALT_CPB_PARAMS_FLAG 421 /** 422 * Check if SEI message contains payload extension 423 */ 424 Bool SEIReader::xPayloadExtensionPresent() 425 { 426 Int payloadBitsRemaining = getBitstream()->getNumBitsLeft(); 427 Bool payloadExtensionPresent = false; 428 429 if (payloadBitsRemaining > 8) 430 { 431 payloadExtensionPresent = true; 432 } 433 else 434 { 435 Int finalBits = getBitstream()->peekBits(payloadBitsRemaining); 436 while (payloadBitsRemaining && (finalBits & 1) == 0) 437 { 438 payloadBitsRemaining--; 439 finalBits >>= 1; 440 } 441 payloadBitsRemaining--; 442 if (payloadBitsRemaining > 0) 443 { 444 payloadExtensionPresent = true; 445 } 446 } 447 448 return payloadExtensionPresent; 449 } 450 #endif 451 382 452 /** 383 453 * parse bitstream bs and unpack a user_data_unregistered SEI message … … 536 606 } 537 607 } 608 609 #if P0138_USE_ALT_CPB_PARAMS_FLAG 610 sei.m_useAltCpbParamsFlag = false; 611 sei.m_useAltCpbParamsFlagPresent = false; 612 if (xPayloadExtensionPresent()) 613 { 614 READ_FLAG (code, "use_alt_cpb_params_flag"); 615 sei.m_useAltCpbParamsFlag = code; 616 sei.m_useAltCpbParamsFlagPresent = true; 617 } 618 #endif 619 538 620 xParseByteAlign(); 539 621 } … … 826 908 // read nested SEI messages 827 909 do { 910 #if O0164_MULTI_LAYER_HRD 911 #if LAYERS_NOT_PRESENT_SEI 912 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, &sei); 913 #else 914 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, &sei); 915 #endif 916 #else 828 917 #if LAYERS_NOT_PRESENT_SEI 829 918 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 830 919 #else 831 920 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 921 #endif 832 922 #endif 833 923 } while (m_pcBitstream->getNumBitsLeft() > 8); … … 930 1020 } 931 1021 #endif 1022 1023 #if O0164_MULTI_LAYER_HRD 1024 #if LAYERS_NOT_PRESENT_SEI 1025 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei) 1026 #else 1027 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei) 1028 #endif 1029 { 1030 UInt uiCode; 1031 READ_UVLC( uiCode, "bsp_idx" ); sei.m_bspIdx = uiCode; 1032 1033 // byte alignment 1034 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1035 { 1036 UInt code; 1037 READ_FLAG( code, "bsp_nesting_zero_bit" ); 1038 } 1039 1040 sei.m_callerOwnsSEIs = false; 1041 1042 // read nested SEI messages 1043 do { 1044 #if LAYERS_NOT_PRESENT_SEI 1045 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, &nestingSei, &sei); 1046 #else 1047 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, &nestingSei); 1048 #endif 1049 } while (m_pcBitstream->getNumBitsLeft() > 8); 1050 } 1051 1052 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei) 1053 { 1054 assert(vps->getVpsVuiPresentFlag()); 1055 1056 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]); 1057 UInt len; 1058 UInt hrdIdx; 1059 UInt uiCode; 1060 1061 if (schedCombCnt > 0) 1062 { 1063 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx); 1064 } 1065 else 1066 { 1067 hrdIdx = 0; 1068 } 1069 1070 TComHRD *hrd = vps->getBspHrd(hrdIdx); 1071 1072 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag()) 1073 { 1074 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1; 1075 } 1076 else 1077 { 1078 len = 23 + 1; 1079 } 1080 1081 if (hrd->getNalHrdParametersPresentFlag()) 1082 { 1083 for(UInt i = 0; i < schedCombCnt; i++) 1084 { 1085 READ_CODE( len, uiCode, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = uiCode; 1086 } 1087 } 1088 else 1089 { 1090 for(UInt i = 0; i < schedCombCnt; i++) 1091 { 1092 READ_CODE( len, uiCode, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = uiCode; 1093 } 1094 } 1095 } 1096 1097 Void SEIReader::xParseSEIBspHrd(SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei) 1098 { 1099 UInt uiCode; 1100 READ_UVLC( uiCode, "sei_num_bsp_hrd_parameters_minus1" ); sei.m_seiNumBspHrdParametersMinus1 = uiCode; 1101 for (UInt i = 0; i <= sei.m_seiNumBspHrdParametersMinus1; i++) 1102 { 1103 if (i > 0) 1104 { 1105 READ_FLAG( uiCode, "sei_bsp_cprms_present_flag" ); sei.m_seiBspCprmsPresentFlag[i] = uiCode; 1106 } 1107 xParseHrdParameters(sei.hrd, i==0 ? 1 : sei.m_seiBspCprmsPresentFlag[i], nestingSei.m_nestingMaxTemporalIdPlus1[0]-1); 1108 } 1109 for (UInt h = 0; h <= nestingSei.m_nestingNumOpsMinus1; h++) 1110 { 1111 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 1112 READ_UVLC( uiCode, "num_sei_bitstream_partitions_minus1[i]"); sei.m_seiNumBitstreamPartitionsMinus1[lsIdx] = uiCode; 1113 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1114 { 1115 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1116 { 1117 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1118 { 1119 READ_FLAG( uiCode, "sei_layer_in_bsp_flag[lsIdx][i][j]" ); sei.m_seiLayerInBspFlag[lsIdx][i][j] = uiCode; 1120 } 1121 } 1122 } 1123 READ_UVLC( uiCode, "sei_num_bsp_sched_combinations_minus1[i]"); sei.m_seiNumBspSchedCombinationsMinus1[lsIdx] = uiCode; 1124 for (UInt i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 1125 { 1126 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 1127 { 1128 READ_UVLC( uiCode, "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); sei.m_seiBspCombHrdIdx[lsIdx][i][j] = uiCode; 1129 READ_UVLC( uiCode, "sei_bsp_comb_sched_idx[lsIdx][i][j]"); sei.m_seiBspCombScheddx[lsIdx][i][j] = uiCode; 1130 } 1131 } 1132 } 1133 } 1134 1135 Void SEIReader::xParseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1) 1136 { 1137 UInt uiCode; 1138 if( commonInfPresentFlag ) 1139 { 1140 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false ); 1141 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false ); 1142 if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() ) 1143 { 1144 READ_FLAG( uiCode, "sub_pic_cpb_params_present_flag" ); hrd->setSubPicCpbParamsPresentFlag( uiCode == 1 ? true : false ); 1145 if( hrd->getSubPicCpbParamsPresentFlag() ) 1146 { 1147 READ_CODE( 8, uiCode, "tick_divisor_minus2" ); hrd->setTickDivisorMinus2( uiCode ); 1148 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode ); 1149 READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false ); 1150 READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1" ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode ); 1151 } 1152 READ_CODE( 4, uiCode, "bit_rate_scale" ); hrd->setBitRateScale( uiCode ); 1153 READ_CODE( 4, uiCode, "cpb_size_scale" ); hrd->setCpbSizeScale( uiCode ); 1154 if( hrd->getSubPicCpbParamsPresentFlag() ) 1155 { 1156 READ_CODE( 4, uiCode, "cpb_size_du_scale" ); hrd->setDuCpbSizeScale( uiCode ); 1157 } 1158 READ_CODE( 5, uiCode, "initial_cpb_removal_delay_length_minus1" ); hrd->setInitialCpbRemovalDelayLengthMinus1( uiCode ); 1159 READ_CODE( 5, uiCode, "au_cpb_removal_delay_length_minus1" ); hrd->setCpbRemovalDelayLengthMinus1( uiCode ); 1160 READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" ); hrd->setDpbOutputDelayLengthMinus1( uiCode ); 1161 } 1162 } 1163 Int i, j, nalOrVcl; 1164 for( i = 0; i <= maxNumSubLayersMinus1; i ++ ) 1165 { 1166 READ_FLAG( uiCode, "fixed_pic_rate_general_flag" ); hrd->setFixedPicRateFlag( i, uiCode == 1 ? true : false ); 1167 if( !hrd->getFixedPicRateFlag( i ) ) 1168 { 1169 READ_FLAG( uiCode, "fixed_pic_rate_within_cvs_flag" ); hrd->setFixedPicRateWithinCvsFlag( i, uiCode == 1 ? true : false ); 1170 } 1171 else 1172 { 1173 hrd->setFixedPicRateWithinCvsFlag( i, true ); 1174 } 1175 hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present 1176 hrd->setCpbCntMinus1 ( i, 0 ); // Infered to be 0 when not present 1177 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 1178 { 1179 READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" ); hrd->setPicDurationInTcMinus1( i, uiCode ); 1180 } 1181 else 1182 { 1183 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false ); 1184 } 1185 if (!hrd->getLowDelayHrdFlag( i )) 1186 { 1187 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 1188 } 1189 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 1190 { 1191 if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) || 1192 ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) ) 1193 { 1194 for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ ) 1195 { 1196 READ_UVLC( uiCode, "bit_rate_value_minus1" ); hrd->setBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 1197 READ_UVLC( uiCode, "cpb_size_value_minus1" ); hrd->setCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 1198 if( hrd->getSubPicCpbParamsPresentFlag() ) 1199 { 1200 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 1201 READ_UVLC( uiCode, "bit_rate_du_value_minus1" ); hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 1202 } 1203 READ_FLAG( uiCode, "cbr_flag" ); hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false ); 1204 } 1205 } 1206 } 1207 } 1208 } 1209 #endif 1210 932 1211 #endif //SVC_EXTENSION 933 1212 -
trunk/source/Lib/TLibDecoder/SEIread.h
r595 r644 62 62 #endif 63 63 protected: 64 #if O0164_MULTI_LAYER_HRD 65 #if LAYERS_NOT_PRESENT_SEI 66 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL); 67 #else 68 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting *nestingSei=NULL); 69 #endif 70 #else 64 71 #if LAYERS_NOT_PRESENT_SEI 65 72 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps); 66 73 #else 67 74 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps); 75 #endif 76 #endif 77 #if P0138_USE_ALT_CPB_PARAMS_FLAG 78 Bool xPayloadExtensionPresent (); 68 79 #endif 69 80 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize); … … 92 103 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps); 93 104 #endif 105 #if O0164_MULTI_LAYER_HRD 106 #if LAYERS_NOT_PRESENT_SEI 107 Void xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei); 108 #else 109 Void xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei); 110 #endif 111 Void xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei); 112 Void xParseSEIBspHrd(SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei); 113 Void xParseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1); 114 #endif 94 115 Void xParseByteAlign(); 95 116 }; -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r595 r644 334 334 if (uiCode) 335 335 { 336 #if P0166_MODIFIED_PPS_EXTENSION 337 UInt ppsExtensionTypeFlag[8]; 338 for (UInt i = 0; i < 8; i++) 339 { 340 READ_FLAG( ppsExtensionTypeFlag[i], "pps_extension_type_flag" ); 341 } 342 #if !POC_RESET_IDC 343 if (ppsExtensionTypeFlag[1]) 344 { 345 #else 346 if( ppsExtensionTypeFlag[0] ) 347 { 348 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 349 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 350 #endif 351 } 352 if (ppsExtensionTypeFlag[7]) 353 { 354 #endif 355 336 356 while ( xMoreRbspData() ) 337 357 { 338 358 READ_FLAG( uiCode, "pps_extension_data_flag"); 339 359 } 360 #if P0166_MODIFIED_PPS_EXTENSION 361 } 362 #endif 340 363 } 341 364 } … … 514 537 } 515 538 516 #if SVC_EXTENSION 539 #if SVC_EXTENSION && !SPS_DPB_PARAMS 517 540 Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager) 518 541 #else … … 536 559 #if SVC_EXTENSION 537 560 } 561 #if !SPS_DPB_PARAMS 538 562 else 539 563 { … … 542 566 } 543 567 #endif 568 #endif 569 544 570 if ( pcSPS->getMaxTLayers() == 1 ) 545 571 { 546 572 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 547 573 #if SVC_EXTENSION 574 #if !SPS_DPB_PARAMS 548 575 assert( pcSPS->getTemporalIdNestingFlag() == true ); 576 #endif 549 577 #else 550 578 assert( uiCode == 1 ); … … 644 672 assert(uiCode <= 12); 645 673 646 UInt subLayerOrderingInfoPresentFlag; 647 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 648 649 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 650 { 651 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 652 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 653 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 654 pcSPS->setNumReorderPics(uiCode, i); 655 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 656 pcSPS->setMaxLatencyIncrease( uiCode, i ); 657 658 if (!subLayerOrderingInfoPresentFlag) 659 { 660 for (i++; i <= pcSPS->getMaxTLayers()-1; i++) 661 { 662 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 663 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 664 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 665 } 666 break; 667 } 668 } 669 674 #if SPS_DPB_PARAMS 675 if( pcSPS->getLayerId() == 0 ) 676 { 677 #endif 678 UInt subLayerOrderingInfoPresentFlag; 679 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 680 681 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 682 { 683 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 684 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 685 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 686 pcSPS->setNumReorderPics(uiCode, i); 687 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 688 pcSPS->setMaxLatencyIncrease( uiCode, i ); 689 690 if (!subLayerOrderingInfoPresentFlag) 691 { 692 for (i++; i <= pcSPS->getMaxTLayers()-1; i++) 693 { 694 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 695 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 696 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 697 } 698 break; 699 } 700 } 701 #if SPS_DPB_PARAMS 702 } 703 #endif 670 704 READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" ); 671 705 Int log2MinCUSize = uiCode + 3; … … 824 858 Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i); 825 859 #if O0098_SCALED_REF_LAYER_ID 826 READ_CODE( 6, uiCode, "scaled_ref_layer_ left_id" );pcSPS->setScaledRefLayerId( i, uiCode );860 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 827 861 #endif 828 862 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); … … 830 864 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 831 865 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 866 #if P0312_VERT_PHASE_ADJ 867 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcSPS->setVertPhasePositionEnableFlag( pcSPS->getScaledRefLayerId(i), uiCode); 868 #endif 832 869 } 833 870 } … … 850 887 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 851 888 #endif 852 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 889 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode <= 6); 853 890 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 854 891 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); … … 970 1007 UInt uiCode; 971 1008 // ... More syntax elements to be parsed here 1009 #if P0300_ALT_OUTPUT_LAYER_FLAG 1010 Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1]; 1011 Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1]; 1012 #endif 972 1013 #if VPS_EXTN_MASK_AND_DIM_INFO 973 1014 UInt numScalabilityTypes = 0, i = 0, j = 0; … … 1091 1132 if (vps->getMaxTSLayersPresentFlag()) 1092 1133 { 1093 for(i = 0; i < vps->getMaxLayers() - 1; i++)1134 for(i = 0; i < vps->getMaxLayers(); i++) 1094 1135 { 1095 1136 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); … … 1098 1139 else 1099 1140 { 1100 for( i = 0; i < vps->getMaxLayers() - 1; i++)1141 for( i = 0; i < vps->getMaxLayers(); i++) 1101 1142 { 1102 1143 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); … … 1238 1279 { 1239 1280 Int lsIdx = vps->getOutputLayerSetIdx(i); 1281 #if NUM_OL_FLAGS 1282 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++) 1283 #else 1240 1284 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++) 1285 #endif 1241 1286 { 1242 1287 READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode); … … 1269 1314 } 1270 1315 READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" ); vps->setProfileLevelTierIdx(i, uiCode); 1316 #if P0300_ALT_OUTPUT_LAYER_FLAG 1317 NumOutputLayersInOutputLayerSet[i] = 0; 1318 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 1319 for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++) 1320 { 1321 NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j); 1322 if (vps->getOutputLayerFlag(i, j)) 1323 { 1324 OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j); 1325 } 1326 } 1327 if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0) 1328 { 1329 READ_FLAG(uiCode, "alt_output_layer_flag[i]"); 1330 vps->setAltOuputLayerFlag(i, uiCode ? true : false); 1331 } 1332 #endif 1271 1333 } 1272 1334 #else … … 1292 1354 READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1"); vps->setOutputLayerSetIdx( i, uiCode + 1); 1293 1355 Int lsIdx = vps->getOutputLayerSetIdx(i); 1356 #if NUM_OL_FLAGS 1357 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++) 1358 #else 1294 1359 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++) 1360 #endif 1295 1361 { 1296 1362 READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode); … … 1354 1420 #endif 1355 1421 1422 #if !P0300_ALT_OUTPUT_LAYER_FLAG 1356 1423 #if O0153_ALT_OUTPUT_LAYER_FLAG 1357 1424 if( vps->getMaxLayers() > 1 ) … … 1360 1427 vps->setAltOuputLayerFlag( uiCode ? true : false ); 1361 1428 } 1429 #endif 1362 1430 #endif 1363 1431 … … 1510 1578 #if P0307_VPS_NON_VUI_EXTENSION 1511 1579 READ_UVLC( uiCode, "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode); 1580 #if P0307_VPS_NON_VUI_EXT_UPDATE 1581 Int nonVuiExtByte = uiCode; 1582 for (i = 1; i <= nonVuiExtByte; i++) 1583 { 1584 READ_CODE( 8, uiCode, "vps_non_vui_extension_data_byte" ); //just parse and discard for now. 1585 } 1586 #else 1512 1587 if ( vps->getVpsNonVuiExtLength() > 0 ) 1513 1588 { 1514 1589 printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n"); 1515 1590 } 1591 #endif 1516 1592 #endif 1517 1593 … … 1596 1672 { 1597 1673 UInt uiCode; 1674 #if DPB_PARAMS_MAXTLAYERS 1675 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1676 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1677 { 1678 UInt maxSLMinus1 = 0; 1679 #if CHANGE_NUMSUBDPB_IDX 1680 Int optLsIdx = vps->getOutputLayerSetIdx( i ); 1681 #else 1682 Int optLsIdx = i; 1683 #endif 1684 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1685 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); 1686 maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId))); 1687 } 1688 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1689 } 1690 #endif 1691 1598 1692 #if !RESOLUTION_BASED_DPB 1599 1693 vps->deriveNumberOfSubDpbs(); … … 1605 1699 #endif 1606 1700 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1607 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1701 #if DPB_PARAMS_MAXTLAYERS 1702 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1703 #else 1704 for(Int j = 0; j <= vps->getMaxTLayers(); j++) 1705 #endif 1608 1706 { 1609 1707 if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) ) … … 1652 1750 } 1653 1751 } 1752 for(Int j = vps->getMaxTLayers(); j < MAX_TLAYER; j++) 1753 { 1754 vps->setSubLayerDpbInfoPresentFlag( i, j, false ); 1755 } 1756 } 1757 1758 // Infer values when not signalled 1759 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1760 { 1761 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1762 for(Int j = 0; j < MAX_TLAYER; j++) 1763 { 1764 if( !vps->getSubLayerDpbInfoPresentFlag(i, j) ) // If sub-layer DPB information is NOT present 1765 { 1766 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1767 { 1768 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) ); 1769 } 1770 vps->setMaxVpsNumReorderPics( i, j, vps->getMaxVpsNumReorderPics( i, j - 1) ); 1771 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 1772 { 1773 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j - 1)); 1774 } 1775 vps->setMaxVpsLatencyIncreasePlus1( i, j, vps->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1776 } 1777 } 1654 1778 } 1655 1779 } … … 1669 1793 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1670 1794 vps->setCrossLayerIrapAlignFlag(uiCode); 1795 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1796 if (uiCode) 1797 { 1798 READ_FLAG(uiCode, "only_idr_for_IRAP_across_layers" ); 1799 vps->setCrossLayerIrapAlignFlag(uiCode); 1800 } 1801 #endif 1671 1802 #endif 1672 1803 #if O0223_PICTURE_TYPES_ALIGN_FLAG … … 1825 1956 #endif 1826 1957 #endif 1827 1958 #if P0312_VERT_PHASE_ADJ 1959 READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode); 1960 #endif 1828 1961 #if N0160_VUI_EXT_ILP_REF 1829 1962 READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); vps->setIlpRestrictedRefLayersFlag( uiCode == 1 ); … … 1892 2025 #endif 1893 2026 #endif 2027 2028 #if O0164_MULTI_LAYER_HRD 2029 READ_FLAG(uiCode, "vps_vui_bsp_hrd_present_flag" ); vps->setVpsVuiBspHrdPresentFlag(uiCode); 2030 if (vps->getVpsVuiBspHrdPresentFlag()) 2031 { 2032 READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vps->setVpsNumBspHrdParametersMinus1(uiCode); 2033 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 2034 for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) 2035 { 2036 if( i > 0 ) 2037 { 2038 READ_FLAG( uiCode, "bsp_cprms_present_flag[i]" ); vps->setBspCprmsPresentFlag(i, uiCode); 2039 } 2040 parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 2041 } 2042 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 2043 { 2044 READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode); 2045 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 2046 { 2047 for( j = 0; j <= (vps->getMaxLayers()-1); j++ ) 2048 { 2049 if( vps->getLayerIdIncludedFlag(h, j) ) 2050 { 2051 READ_FLAG( uiCode, "layer_in_bsp_flag[h][i][j]" ); vps->setLayerInBspFlag(h, i, j, uiCode); 2052 } 2053 } 2054 } 2055 if (vps->getNumBitstreamPartitions(h)) 2056 { 2057 READ_UVLC( uiCode, "num_bsp_sched_combinations[h]"); vps->setNumBspSchedCombinations(h, uiCode); 2058 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 2059 { 2060 for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ ) 2061 { 2062 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][j]"); vps->setBspCombHrdIdx(h, i, j, uiCode); 2063 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][j]"); vps->setBspCombSchedIdx(h, i, j, uiCode); 2064 } 2065 } 2066 } 2067 } 2068 } 2069 #endif 2070 2071 #if P0182_VPS_VUI_PS_FLAG 2072 for(i = 1; i < vps->getMaxLayers(); i++) 2073 { 2074 if (vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0) 2075 { 2076 READ_FLAG( uiCode, "base_layer_parameter_set_compatibility_flag" ); 2077 vps->setBaseLayerPSCompatibilityFlag( i, uiCode ); 2078 } 2079 else 2080 { 2081 vps->setBaseLayerPSCompatibilityFlag( i, 0 ); 2082 } 2083 } 2084 #endif 1894 2085 } 1895 2086 #endif … … 1911 2102 if( rpcSlice->getRapPicFlag()) 1912 2103 { 2104 #if !NO_OUTPUT_OF_PRIOR_PICS 1913 2105 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 2106 #else 2107 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); rpcSlice->setNoOutputOfPriorPicsFlag( uiCode ? true : false ); 2108 #endif 1914 2109 } 1915 2110 READ_UVLC ( uiCode, "slice_pic_parameter_set_id" ); rpcSlice->setPPSId(uiCode); … … 2229 2424 #if ILP_SSH_SIG 2230 2425 #if ILP_SSH_SIG_FIX 2231 if(( sps->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) )2232 #else 2233 if(( sps->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) )2234 #endif 2235 #else 2236 if(( sps->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) )2426 if((rpcSlice->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) ) 2427 #else 2428 if((rpcSlice->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) ) 2429 #endif 2430 #else 2431 if((rpcSlice->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) ) 2237 2432 #endif 2238 2433 { … … 2256 2451 { 2257 2452 #if P0079_DERIVE_NUMACTIVE_REF_PICS 2258 Int numRefLayerPics = 0; 2259 Int i = 0; 2260 Int refLayerPicIdc [MAX_VPS_LAYER_ID_PLUS1]; 2261 for(i = 0, numRefLayerPics = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2453 for( Int i = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2262 2454 { 2263 2455 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2264 2456 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2265 2457 { 2266 refLayerPicIdc[ numRefLayerPics++ ] = i; 2458 rpcSlice->setActiveNumILRRefIdx(1); 2459 break; 2267 2460 } 2268 2461 } 2269 if (numRefLayerPics)2270 rpcSlice->setActiveNumILRRefIdx(1);2271 2462 #else 2272 2463 rpcSlice->setActiveNumILRRefIdx(1); … … 2344 2535 #endif 2345 2536 #endif 2537 #if P0312_VERT_PHASE_ADJ 2538 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 2539 { 2540 UInt refLayerIdc = rpcSlice->getInterLayerPredLayerIdc(i); 2541 if( rpcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 2542 { 2543 READ_FLAG( uiCode, "vert_phase_position_flag" ); rpcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc ); 2544 } 2545 } 2546 #endif 2346 2547 2347 2548 if(sps->getUseSAO()) … … 2661 2862 } 2662 2863 2864 #if POC_RESET_IDC_SIGNALLING 2865 Int sliceHederExtensionLength = 0; 2866 if(pps->getSliceHeaderExtensionPresentFlag()) 2867 { 2868 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHederExtensionLength = uiCode; 2869 } 2870 else 2871 { 2872 sliceHederExtensionLength = 0; 2873 } 2874 UInt startBits = m_pcBitstream->getNumBitsRead(); // Start counter of # SH Extn bits 2875 if( sliceHederExtensionLength > 0 ) 2876 { 2877 if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() ) 2878 { 2879 READ_CODE( 2, uiCode, "poc_reset_idc"); rpcSlice->setPocResetIdc(uiCode); 2880 } 2881 else 2882 { 2883 rpcSlice->setPocResetIdc( 0 ); 2884 } 2885 if( rpcSlice->getPocResetIdc() > 0 ) 2886 { 2887 READ_CODE(6, uiCode, "poc_reset_period_id"); rpcSlice->setPocResetPeriodId(uiCode); 2888 } 2889 else 2890 { 2891 2892 rpcSlice->setPocResetPeriodId( 0 ); 2893 } 2894 2895 if (rpcSlice->getPocResetIdc() == 3) 2896 { 2897 READ_FLAG( uiCode, "full_poc_reset_flag"); rpcSlice->setFullPocResetFlag((uiCode == 1) ? true : false); 2898 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode,"poc_lsb_val"); rpcSlice->setPocLsbVal(uiCode); 2899 } 2900 2901 // Derive the value of PocMsbValRequiredFlag 2902 rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag() 2903 /* || related to vps_poc_lsb_aligned_flag */ 2904 ); 2905 2906 if( !rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ ) 2907 { 2908 READ_FLAG( uiCode, "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag( uiCode ? true : false ); 2909 } 2910 else 2911 { 2912 if( rpcSlice->getPocMsbValRequiredFlag() ) 2913 { 2914 rpcSlice->setPocMsbValPresentFlag( true ); 2915 } 2916 else 2917 { 2918 rpcSlice->setPocMsbValPresentFlag( false ); 2919 } 2920 } 2921 2922 Int maxPocLsb = 1 << rpcSlice->getSPS()->getBitsForPOC(); 2923 if( rpcSlice->getPocMsbValPresentFlag() ) 2924 { 2925 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 2926 // Update POC of the slice based on this MSB val 2927 Int pocLsb = rpcSlice->getPOC() % maxPocLsb; 2928 rpcSlice->setPOC((rpcSlice->getPocMsbVal() * maxPocLsb) + pocLsb); 2929 } 2930 else 2931 { 2932 rpcSlice->setPocMsbVal( rpcSlice->getPOC() / maxPocLsb ); 2933 } 2934 2935 // Read remaining bits in the slice header extension. 2936 UInt endBits = m_pcBitstream->getNumBitsRead(); 2937 Int counter = (endBits - startBits) % 8; 2938 if( counter ) 2939 { 2940 counter = 8 - counter; 2941 } 2942 2943 while( counter ) 2944 { 2945 READ_FLAG( uiCode, "slice_segment_header_extension_reserved_bit" ); assert( uiCode == 1 ); 2946 counter--; 2947 } 2948 } 2949 #else 2663 2950 if(pps->getSliceHeaderExtensionPresentFlag()) 2664 2951 { … … 2670 2957 } 2671 2958 } 2959 #endif 2672 2960 m_pcBitstream->readByteAlignment(); 2673 2961 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r595 r644 86 86 Void parseVpsDpbSizeTable( TComVPS *vps ); 87 87 #endif 88 #if SPS_DPB_PARAMS 89 Void parseSPS ( TComSPS* pcSPS ); // it should be removed after macro clean up 90 #else 88 91 Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ); 92 #endif 89 93 Void parseSPSExtension ( TComSPS* pcSPS ); 90 94 #else //SVC_EXTENSION -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r595 r644 66 66 67 67 virtual Void parseVPS ( TComVPS* pcVPS ) = 0; 68 #if SVC_EXTENSION 68 #if SVC_EXTENSION && !SPS_DPB_PARAMS 69 69 virtual Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) = 0; 70 70 #else … … 133 133 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 134 134 Void decodeVPS ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 135 #if SVC_EXTENSION 135 #if SVC_EXTENSION && !SPS_DPB_PARAMS 136 136 Void decodeSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, parameterSetManager); } 137 137 #else -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r595 r644 1394 1394 1395 1395 Void TDecSbac::parseSAOBlkParam (SAOBlkParam& saoBlkParam 1396 #if SVC_EXTENSION 1397 , UInt* saoMaxOffsetQVal 1398 #endif 1396 1399 , Bool* sliceEnabled 1397 1400 , Bool leftMergeAvail … … 1468 1471 for(Int i=0; i< 4; i++) 1469 1472 { 1473 #if SVC_EXTENSION 1474 parseSaoMaxUvlc(uiSymbol, saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1475 #else 1470 1476 parseSaoMaxUvlc(uiSymbol, g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1477 #endif 1471 1478 offset[i] = (Int)uiSymbol; 1472 1479 } -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r595 r644 76 76 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 77 77 Void parseVPS ( TComVPS* /*pcVPS*/ ) {} 78 #if SVC_EXTENSION 78 #if SVC_EXTENSION && !SPS_DPB_PARAMS 79 79 Void parseSPS ( TComSPS* /*pcSPS*/, ParameterSetManagerDecoder * /*parameterSetManager*/ ) {} 80 80 #else … … 90 90 Void parseSaoTypeIdx ( UInt& ruiVal ); 91 91 Void parseSaoUflc ( UInt uiLength, UInt& ruiVal ); 92 93 #if SVC_EXTENSION 94 Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail ); 95 #else 92 96 Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail); 97 #endif 93 98 Void parseSaoSign(UInt& val); 94 99 private: -
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r595 r644 105 105 106 106 #if SVC_EXTENSION 107 Void TDecSlice::init(TDec Top** ppcDecTop,TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)107 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder, UInt* saoMaxOffsetQVal) 108 108 { 109 109 m_pcEntropyDecoder = pcEntropyDecoder; 110 110 m_pcCuDecoder = pcCuDecoder; 111 m_ ppcTDecTop = ppcDecTop;111 m_saoMaxOffsetQVal = saoMaxOffsetQVal; 112 112 } 113 113 #else … … 347 347 aboveMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-uiWidthInLCUs); 348 348 } 349 349 #if SVC_EXTENSION 350 pcSbacDecoder->parseSAOBlkParam( saoblkParam, m_saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail); 351 #else 350 352 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); 353 #endif 351 354 } 352 355 else -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r595 r644 72 72 std::vector<TDecSbac*> CTXMem; 73 73 #if SVC_EXTENSION 74 TDecTop** m_ppcTDecTop;74 UInt* m_saoMaxOffsetQVal; 75 75 #endif 76 76 … … 80 80 81 81 #if SVC_EXTENSION 82 Void init ( TDec Top** ppcDecTop, TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder);82 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder, UInt* saoMaxOffsetQVal ); 83 83 #else 84 84 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder ); … … 91 91 Void setCtxMem( TDecSbac* sb, Int b ) { CTXMem[b] = sb; } 92 92 Int getCtxMemSize( ) { return (Int)CTXMem.size(); } 93 #if SVC_EXTENSION94 TDecTop* getLayerDec ( UInt LayerId ) { return m_ppcTDecTop[LayerId]; }95 #endif96 93 }; 97 94 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r595 r644 138 138 #if SVC_EXTENSION 139 139 m_cGopDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 140 m_cSliceDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cCuDecoder);140 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder, m_cSAO.getSaoMaxOffsetQVal() ); 141 141 #else 142 142 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); … … 349 349 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 350 350 #if REPN_FORMAT_IN_VPS 351 #if O0194_DIFFERENT_BITDEPTH_EL_BL 352 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, i); 353 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 354 355 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths ) 356 #else 351 357 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) 358 #endif 352 359 #else 353 360 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() || !zeroOffsets ) … … 726 733 #endif 727 734 735 #if P0312_VERT_PHASE_ADJ 736 if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 ) 737 { 738 for(Int i = 0; i < activeSPS->getNumScaledRefLayerOffsets(); i++) 739 { 740 UInt scaledRefLayerId = activeSPS->getScaledRefLayerId(i); 741 if( activeSPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) ) 742 { 743 printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId ); 744 break; 745 } 746 } 747 } 748 #endif 749 750 #if SPS_DPB_PARAMS 751 if( m_layerId > 0 ) 752 { 753 // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1. 754 sps->setMaxTLayers( activeVPS->getMaxTLayers() ); 755 756 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 757 sps->setTemporalIdNestingFlag( activeVPS->getTemporalNestingFlag() ); 758 759 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, 760 // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS. 761 for(UInt i=0; i < sps->getMaxTLayers(); i++) 762 { 763 // to avoid compiler warning "array subscript is above array bounds" 764 assert( i < MAX_TLAYER ); 765 766 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 767 } 768 } 769 #endif 770 728 771 if( pps->getDependentSliceSegmentsEnabledFlag() ) 729 772 { … … 800 843 TComPic*& pcPic = m_pcPic; 801 844 #if SVC_EXTENSION 845 #if !NO_OUTPUT_OF_PRIOR_PICS 802 846 #if NO_CLRAS_OUTPUT_FLAG 803 847 Bool bFirstSliceInSeq; 848 #endif 804 849 #endif 805 850 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); … … 855 900 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 856 901 902 #if NO_OUTPUT_OF_PRIOR_PICS 903 // Infer the value of NoOutputOfPriorPicsFlag 904 if( m_apcSlicePilot->getRapPicFlag() ) 905 { 906 if ( m_apcSlicePilot->getBlaPicFlag() || m_apcSlicePilot->getIdrPicFlag() || 907 (m_apcSlicePilot->getCraPicFlag() && m_bFirstSliceInSequence) || 908 (m_apcSlicePilot->getCraPicFlag() && m_apcSlicePilot->getHandleCraAsBlaFlag())) 909 { 910 m_apcSlicePilot->setNoRaslOutputFlag( true ); 911 } 912 else 913 { 914 m_apcSlicePilot->setNoRaslOutputFlag( false ); 915 } 916 } 917 #endif 918 857 919 // Skip pictures due to random access 858 920 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 876 938 #if SVC_EXTENSION 877 939 bNewPOC = (m_apcSlicePilot->getPOC()!= m_prevPOC); 940 941 #if NO_OUTPUT_OF_PRIOR_PICS 942 #if NO_CLRAS_OUTPUT_FLAG 943 if (m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() ) 944 { 945 if (m_bFirstSliceInSequence) 946 { 947 setNoClrasOutputFlag(true); 948 } 949 else if ( m_apcSlicePilot->getBlaPicFlag() ) 950 { 951 setNoClrasOutputFlag(true); 952 } 953 #if O0149_CROSS_LAYER_BLA_FLAG 954 else if (m_apcSlicePilot->getIdrPicFlag() && m_apcSlicePilot->getCrossLayerBLAFlag()) 955 { 956 setNoClrasOutputFlag(true); 957 } 958 #endif 959 else 960 { 961 setNoClrasOutputFlag(false); 962 } 963 } 964 else 965 { 966 setNoClrasOutputFlag(false); 967 } 968 969 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 970 #endif 971 972 // Derive the value of NoOutputOfPriorPicsFlag 973 if( bNewPOC || m_layerId!=m_uiPrevLayerId ) // i.e. new coded picture 974 { 975 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getNoRaslOutputFlag() ) 976 { 977 this->setNoOutputOfPriorPicsFlags( true ); 978 } 979 else if( m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag() ) 980 { 981 this->setNoOutputOfPriorPicsFlags( m_apcSlicePilot->getNoOutputOfPriorPicsFlag() ); 982 } 983 else 984 { 985 if( this->m_ppcTDecTop[0]->getNoClrasOutputFlag() ) 986 { 987 this->setNoOutputOfPriorPicsFlags( true ); 988 } 989 } 990 } 991 #endif 992 993 #if ALIGNED_BUMPING 994 if (bNewPOC || m_layerId!=m_uiPrevLayerId) 995 { 996 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 997 } 998 #endif 878 999 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 879 1000 { … … 929 1050 #endif 930 1051 } 1052 #if !NO_OUTPUT_OF_PRIOR_PICS 931 1053 #if NO_CLRAS_OUTPUT_FLAG 932 1054 bFirstSliceInSeq = m_bFirstSliceInSequence; 1055 #endif 933 1056 #endif 934 1057 m_bFirstSliceInSequence = false; … … 1093 1216 #endif 1094 1217 1218 #if !NO_OUTPUT_OF_PRIOR_PICS 1095 1219 #if NO_CLRAS_OUTPUT_FLAG 1096 1220 if (m_layerId == 0 && … … 1137 1261 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 1138 1262 #endif 1139 1263 #else 1264 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1265 { 1266 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++) 1267 { 1268 m_ppcTDecTop[i]->setLayerInitializedFlag(false); 1269 m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false); 1270 } 1271 } 1272 #endif 1140 1273 // Buffer initialize for prediction. 1141 1274 m_cPrediction.initTempBuff(); 1275 #if !ALIGNED_BUMPING 1142 1276 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1277 #else 1278 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1279 #endif 1143 1280 // Get a new picture buffer 1144 1281 xGetNewPicBuffer (m_apcSlicePilot, pcPic); … … 1600 1737 #if SVC_EXTENSION 1601 1738 sps->setLayerId(m_layerId); 1739 #if SPS_DPB_PARAMS 1740 m_cEntropyDecoder.decodeSPS( sps ); // it should be removed after macro clean up 1741 #else 1602 1742 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder ); 1743 #endif 1603 1744 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1604 1745 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation -
trunk/source/Lib/TLibDecoder/TDecTop.h
r595 r644 239 239 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 240 240 #endif 241 241 #if NO_OUTPUT_OF_PRIOR_PICS 242 #if NO_CLRAS_OUTPUT_FLAG 243 Bool getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 244 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 245 #endif 246 #endif 242 247 protected: 243 248 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); … … 266 271 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 267 272 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 273 #if !NO_OUTPUT_OF_PRIOR_PICS 268 274 Int getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 269 275 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 270 276 #endif 277 #endif 271 278 };// END CLASS DEFINITION TDecTop 272 279
Note: See TracChangeset for help on using the changeset viewer.