Changeset 815 in SHVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 30 Jun 2014, 06:13:06 (11 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev merged: 715-751,753-814
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source merged: 715-726,728-744,746-751,753-802,804-814
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/NALread.cpp
r595 r815 114 114 if ( nalu.m_temporalId ) 115 115 { 116 #if !Q0108_TSA_STSA 116 117 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 117 118 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 124 125 && nalu.m_nalUnitType != NAL_UNIT_EOS 125 126 && nalu.m_nalUnitType != NAL_UNIT_EOB ); 127 #else 128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 129 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL 130 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP 131 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL 132 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP 133 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA 134 && nalu.m_nalUnitType != NAL_UNIT_VPS 135 && nalu.m_nalUnitType != NAL_UNIT_SPS 136 && nalu.m_nalUnitType != NAL_UNIT_EOS); 137 #endif 126 138 } 127 139 else 128 140 { 141 #if !Q0108_TSA_STSA 129 142 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 130 143 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 131 144 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R 132 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ); 145 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N 146 ); 147 #else 148 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 149 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 150 ); 151 #endif 133 152 } 134 153 } -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r713 r815 93 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 94 94 break; 95 #if P0050_KNEE_FUNCTION_SEI 96 case SEI::KNEE_FUNCTION_INFO: 97 fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n"); 98 break; 99 #endif 95 100 #if Q0074_SEI_COLOR_MAPPING 96 101 case SEI::COLOR_MAPPING_INFO: … … 129 134 case SEI::BSP_HRD: 130 135 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 136 break; 137 #endif 138 #if Q0078_ADD_LAYER_SETS 139 case SEI::OUTPUT_LAYER_SET_NESTING: 140 fprintf(g_hTrace, "=========== Output layer set nesting SEI message ===========\n"); 141 break; 142 case SEI::VPS_REWRITING: 143 fprintf(g_hTrace, "=========== VPS rewriting SEI message ===========\n"); 131 144 break; 132 145 #endif … … 285 298 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 286 299 break; 300 #if P0050_KNEE_FUNCTION_SEI 301 case SEI::KNEE_FUNCTION_INFO: 302 sei = new SEIKneeFunctionInfo; 303 xParseSEIKneeFunctionInfo((SEIKneeFunctionInfo&) *sei, payloadSize); 304 break; 305 #endif 287 306 #if Q0074_SEI_COLOR_MAPPING 288 307 case SEI::COLOR_MAPPING_INFO: … … 345 364 sei = new SEIBspHrd; 346 365 xParseSEIBspHrd((SEIBspHrd&) *sei, sps, *nestingSei); 366 break; 367 #endif 368 #if Q0078_ADD_LAYER_SETS 369 case SEI::OUTPUT_LAYER_SET_NESTING: 370 sei = new SEIOutputLayerSetNesting; 371 #if LAYERS_NOT_PRESENT_SEI 372 xParseSEIOutputLayerSetNesting((SEIOutputLayerSetNesting&)*sei, nalUnitType, vps, sps); 373 #else 374 xParseSEIOutputLayerSetNesting((SEIOutputLayerSetNesting&)*sei, nalUnitType, sps); 375 #endif 376 break; 377 case SEI::VPS_REWRITING: 378 sei = new SEIVPSRewriting; 379 xParseSEIVPSRewriting((SEIVPSRewriting&)*sei); 380 break; 381 #endif 382 #if Q0189_TMVP_CONSTRAINTS 383 case SEI::TMVP_CONSTRAINTS: 384 sei = new SEITMVPConstrains; 385 xParseSEITMVPConstraints((SEITMVPConstrains&) *sei, payloadSize); 386 break; 387 #endif 388 #if Q0247_FRAME_FIELD_INFO 389 case SEI::FRAME_FIELD_INFO: 390 sei = new SEIFrameFieldInfo; 391 xParseSEIFrameFieldInfo ((SEIFrameFieldInfo&) *sei, payloadSize); 347 392 break; 348 393 #endif … … 849 894 } 850 895 896 #if P0050_KNEE_FUNCTION_SEI 897 Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt /*payloadSize*/){ 898 Int i; 899 UInt val; 900 READ_UVLC( val, "knee_function_id" ); sei.m_kneeId = val; 901 READ_FLAG( val, "knee_function_cancel_flag" ); sei.m_kneeCancelFlag = val; 902 if ( !sei.m_kneeCancelFlag ) 903 { 904 READ_FLAG( val, "knee_function_persistence_flag" ); sei.m_kneePersistenceFlag = val; 905 READ_FLAG( val, "mapping_flag" ); sei.m_kneeMappingFlag = val; 906 READ_CODE( 32, val, "input_d_range" ); sei.m_kneeInputDrange = val; 907 READ_CODE( 32, val, "input_disp_luminance" ); sei.m_kneeInputDispLuminance = val; 908 READ_CODE( 32, val, "output_d_range" ); sei.m_kneeOutputDrange = val; 909 READ_CODE( 32, val, "output_disp_luminance" ); sei.m_kneeOutputDispLuminance = val; 910 READ_UVLC( val, "num_knee_points_minus1" ); sei.m_kneeNumKneePointsMinus1 = val; 911 assert( sei.m_kneeNumKneePointsMinus1 > 0 ); 912 sei.m_kneeInputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1); 913 sei.m_kneeOutputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1); 914 for(i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ ) 915 { 916 READ_CODE( 10, val, "input_knee_point" ); sei.m_kneeInputKneePoint[i] = val; 917 READ_CODE( 10, val, "output_knee_point" ); sei.m_kneeOutputKneePoint[i] = val; 918 } 919 } 920 } 921 #endif 922 851 923 #if Q0074_SEI_COLOR_MAPPING 852 924 Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/) … … 960 1032 } 961 1033 1034 #if Q0189_TMVP_CONSTRAINTS 1035 Void SEIReader::xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize) 1036 { 1037 UInt uiCode; 1038 READ_UVLC( uiCode, "prev_pics_not_used_flag" ); sei.prev_pics_not_used_flag = uiCode; 1039 READ_UVLC( uiCode, "no_intra_layer_col_pic_flag" ); sei.no_intra_layer_col_pic_flag = uiCode; 1040 xParseByteAlign(); 1041 } 1042 #endif 1043 1044 #if Q0247_FRAME_FIELD_INFO 1045 Void SEIReader::xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize) 1046 { 1047 UInt code; 1048 READ_CODE( 4, code, "ffinfo_pic_struct" ); sei.m_ffinfo_picStruct = code; 1049 READ_CODE( 2, code, "ffinfo_source_scan_type" ); sei.m_ffinfo_sourceScanType = code; 1050 READ_FLAG( code, "ffinfo_duplicate_flag" ); sei.m_ffinfo_duplicateFlag = ( code == 1 ? true : false ); 1051 xParseByteAlign(); 1052 } 1053 #endif 1054 962 1055 #if LAYERS_NOT_PRESENT_SEI 963 1056 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) … … 1209 1302 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 1210 1303 READ_UVLC( uiCode, "num_sei_bitstream_partitions_minus1[i]"); sei.m_seiNumBitstreamPartitionsMinus1[lsIdx] = uiCode; 1211 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1212 { 1213 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1304 #if HRD_BPB 1305 Int chkPart=0; 1306 #endif 1307 UInt i; 1308 for(i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1309 { 1310 #if HRD_BPB 1311 UInt nl=0; UInt j; 1312 for(j = 0; j < sei.m_vpsMaxLayers; j++) 1214 1313 { 1215 1314 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1216 1315 { 1316 nl++; 1317 } 1318 } 1319 for (j = 0; j < nl; j++) 1320 { 1321 #else 1322 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1323 { 1324 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1325 { 1326 #endif 1217 1327 READ_FLAG( uiCode, "sei_layer_in_bsp_flag[lsIdx][i][j]" ); sei.m_seiLayerInBspFlag[lsIdx][i][j] = uiCode; 1218 1328 } 1219 } 1220 } 1329 #if !HRD_BPB 1330 } 1331 #endif 1332 #if HRD_BPB 1333 chkPart+=sei.m_seiLayerInBspFlag[lsIdx][i][j]; 1334 #endif 1335 } 1336 #if HRD_BPB 1337 assert(chkPart<=1); 1338 #endif 1339 #if HRD_BPB 1340 if(sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]==0) 1341 { 1342 Int chkPartition1=0; Int chkPartition2=0; 1343 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1344 { 1345 if( sei.m_layerIdIncludedFlag[lsIdx][j] ) 1346 { 1347 chkPartition1+=sei.m_seiLayerInBspFlag[lsIdx][0][j]; 1348 chkPartition2++; 1349 } 1350 } 1351 assert(chkPartition1!=chkPartition2); 1352 } 1353 #endif 1354 1221 1355 READ_UVLC( uiCode, "sei_num_bsp_sched_combinations_minus1[i]"); sei.m_seiNumBspSchedCombinationsMinus1[lsIdx] = uiCode; 1222 for ( UInti = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++)1356 for (i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 1223 1357 { 1224 1358 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 1225 1359 { 1226 1360 READ_UVLC( uiCode, "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); sei.m_seiBspCombHrdIdx[lsIdx][i][j] = uiCode; 1361 #if HRD_BPB 1362 assert(uiCode <= sei.m_seiNumBspHrdParametersMinus1); 1363 #endif 1227 1364 READ_UVLC( uiCode, "sei_bsp_comb_sched_idx[lsIdx][i][j]"); sei.m_seiBspCombScheddx[lsIdx][i][j] = uiCode; 1365 #if HRD_BPB 1366 assert(uiCode <= sei.hrd->getCpbCntMinus1( sps->getMaxTLayers()-1 )); 1367 #endif 1368 1228 1369 } 1229 1370 } … … 1307 1448 #endif 1308 1449 1450 #if Q0078_ADD_LAYER_SETS 1451 1452 #if LAYERS_NOT_PRESENT_SEI 1453 Void SEIReader::xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 1454 #else 1455 Void SEIReader::xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComSPS *sps) 1456 #endif 1457 { 1458 UInt uiCode; 1459 SEIMessages seis; 1460 1461 READ_FLAG(uiCode, "ols_flag"); sei.m_olsFlag = uiCode; 1462 READ_UVLC(uiCode, "num_ols_indices_minus1"); sei.m_numOlsIndicesMinus1 = uiCode; 1463 1464 for (Int i = 0; i <= sei.m_numOlsIndicesMinus1; i++) 1465 { 1466 READ_UVLC(uiCode, "ols_idx[i]"); sei.m_olsIdx[i] = uiCode; 1467 } 1468 1469 // byte alignment 1470 while (m_pcBitstream->getNumBitsRead() % 8 != 0) 1471 { 1472 UInt code; 1473 READ_FLAG(code, "ols_nesting_zero_bit"); 1474 } 1475 1476 sei.m_callerOwnsSEIs = false; 1477 1478 // read nested SEI messages 1479 do { 1480 #if O0164_MULTI_LAYER_HRD 1481 #if LAYERS_NOT_PRESENT_SEI 1482 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 1483 #else 1484 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 1485 #endif 1486 #else 1487 #if LAYERS_NOT_PRESENT_SEI 1488 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 1489 #else 1490 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 1491 #endif 1492 #endif 1493 } while (m_pcBitstream->getNumBitsLeft() > 8); 1494 1495 } 1496 1497 Void SEIReader::xParseSEIVPSRewriting(SEIVPSRewriting &sei) 1498 { 1499 } 1500 1501 #endif 1502 1309 1503 #endif //SVC_EXTENSION 1310 1504 -
trunk/source/Lib/TLibDecoder/SEIread.h
r713 r815 90 90 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 91 91 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 92 #if P0050_KNEE_FUNCTION_SEI 93 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize); 94 #endif 92 95 #if Q0074_SEI_COLOR_MAPPING 93 96 Void xParseSEIColorMappingInfo (SEIColorMappingInfo& sei, UInt payloadSize); … … 116 119 Void xParseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1); 117 120 #endif 121 #if Q0078_ADD_LAYER_SETS 122 #if LAYERS_NOT_PRESENT_SEI 123 Void xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps); 124 #else 125 Void xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComSPS *sps); 126 #endif 127 Void xParseSEIVPSRewriting(SEIVPSRewriting &sei); 128 #endif 129 130 #if Q0189_TMVP_CONSTRAINTS 131 Void xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize); 132 #endif 133 #if Q0247_FRAME_FIELD_INFO 134 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize); 135 #endif 118 136 Void xParseByteAlign(); 119 137 }; -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r713 r815 339 339 340 340 READ_FLAG( uiCode, "pps_extension_flag"); 341 #if POC_RESET_INFO_INFERENCE 342 pcPPS->setExtensionFlag( uiCode ? true : false ); 343 344 if( pcPPS->getExtensionFlag() ) 345 #else 341 346 if (uiCode) 347 #endif 342 348 { 343 349 #if P0166_MODIFIED_PPS_EXTENSION … … 367 373 #endif 368 374 } 375 #if POC_RESET_INFO_INFERENCE 376 else // Extension type 0 absent 377 { 378 pcPPS->setPocResetInfoPresentFlag( false ); 379 } 380 #endif 369 381 if (ppsExtensionTypeFlag[7]) 370 382 { … … 379 391 #endif 380 392 } 393 #if POC_RESET_INFO_INFERENCE 394 if( !pcPPS->getExtensionFlag() ) 395 { 396 pcPPS->setPocResetInfoPresentFlag( false ); 397 } 398 #endif 381 399 } 382 400 … … 443 461 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 444 462 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); 445 #if TIMING_INFO_NONZERO_LAYERID_SPS463 #if SVC_EXTENSION 446 464 if( pcSPS->getLayerId() > 0 ) 447 465 { … … 585 603 #endif 586 604 605 #if !Q0177_SPS_TEMP_NESTING_FIX //This part is not needed anymore as it is already covered by implementation in TDecTop::xActivateParameterSets() 587 606 if ( pcSPS->getMaxTLayers() == 1 ) 588 607 { … … 596 615 #endif 597 616 } 617 #endif 618 598 619 #ifdef SPS_PTL_FIX 599 620 if ( pcSPS->getLayerId() == 0) … … 827 848 828 849 READ_FLAG( uiCode, "sps_extension_flag"); 829 if (uiCode) 830 { 831 #if SPS_EXTENSION 832 850 851 #if SVC_EXTENSION 852 pcSPS->setExtensionFlag( uiCode ? true : false ); 853 854 if( pcSPS->getExtensionFlag() ) 855 { 833 856 #if O0142_CONDITIONAL_SPS_EXTENSION 834 857 UInt spsExtensionTypeFlag[8]; … … 849 872 { 850 873 #endif 851 852 #endif853 874 while ( xMoreRbspData() ) 854 875 { 855 876 READ_FLAG( uiCode, "sps_extension_data_flag"); 856 877 } 857 #if SPS_EXTENSION 858 } 859 #endif 860 } 861 } 862 863 #if SPS_EXTENSION 878 } 879 } 880 #else 881 if (uiCode) 882 { 883 while ( xMoreRbspData() ) 884 { 885 READ_FLAG( uiCode, "sps_extension_data_flag"); 886 } 887 } 888 #endif 889 } 890 891 #if SVC_EXTENSION 864 892 Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS ) 865 893 { … … 899 927 READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 900 928 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 901 #if VPS_RENAME929 #if SVC_EXTENSION 902 930 #if O0137_MAX_LAYERID 903 931 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( min( 62u, uiCode) + 1 ); … … 941 969 } 942 970 943 #if VPS_RENAME971 #if SVC_EXTENSION 944 972 assert( pcVPS->getNumHrdParameters() < MAX_VPS_LAYER_SETS_PLUS1 ); 945 973 assert( pcVPS->getMaxLayerId() < MAX_VPS_LAYER_ID_PLUS1 ); 946 974 READ_CODE( 6, uiCode, "vps_max_layer_id" ); pcVPS->setMaxLayerId( uiCode ); 975 #if Q0078_ADD_LAYER_SETS 976 READ_UVLC(uiCode, "vps_num_layer_sets_minus1"); pcVPS->setVpsNumLayerSetsMinus1(uiCode); 977 pcVPS->setNumLayerSets(pcVPS->getVpsNumLayerSetsMinus1() + 1); 978 for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++) 979 #else 947 980 READ_UVLC( uiCode, "vps_num_layer_sets_minus1" ); pcVPS->setNumLayerSets( uiCode + 1 ); 948 981 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ ) 982 #endif 949 983 { 950 984 // Operation point set … … 995 1029 } 996 1030 997 #if VPS_EXTNS1031 #if SVC_EXTENSION 998 1032 READ_FLAG( uiCode, "vps_extension_flag" ); pcVPS->setVpsExtensionFlag( uiCode ? true : false ); 999 1033 … … 1040 1074 1041 1075 #if SVC_EXTENSION 1042 #if VPS_EXTNS1043 1076 Void TDecCavlc::parseVPSExtension(TComVPS *vps) 1044 1077 { … … 1081 1114 } 1082 1115 1116 // The value of dimBitOffset[ NumScalabilityTypes ] is set equal to 6. 1083 1117 if(vps->getSplittingFlag()) 1084 1118 { … … 1166 1200 } 1167 1201 #endif 1202 #if Q0078_ADD_LAYER_SETS 1203 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved here 1204 vps->setNumRefLayers(); 1205 1206 if (vps->getMaxLayers() > MAX_REF_LAYERS) 1207 { 1208 for (i = 1; i < vps->getMaxLayers(); i++) 1209 { 1210 assert(vps->getNumRefLayers(vps->getLayerIdInNuh(i)) <= MAX_REF_LAYERS); 1211 } 1212 } 1213 #endif 1214 vps->setPredictedLayerIds(); 1215 vps->setTreePartitionLayerIdList(); 1216 #endif 1168 1217 #if VPS_TSLAYERS 1169 1218 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); … … 1184 1233 } 1185 1234 #endif 1186 #if N0120_MAX_TID_REF_PRESENT_FLAG1187 1235 READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false); 1188 1236 if (vps->getMaxTidRefPresentFlag()) … … 1201 1249 #else 1202 1250 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1203 #if N0120_MAX_TID_REF_CFG1204 1251 assert( uiCode <= vps->getMaxTLayers()); 1205 #else1206 assert( uiCode <= vps->getMaxTLayers()+ 1 );1207 #endif1208 1252 #endif 1209 1253 } … … 1223 1267 } 1224 1268 } 1225 #else 1226 for(i = 0; i < vps->getMaxLayers() - 1; i++) 1227 { 1228 #if O0225_MAX_TID_FOR_REF_LAYERS 1229 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 1230 { 1231 if(vps->getDirectDependencyFlag(j, i)) 1232 { 1233 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i][j]" ); vps->setMaxTidIlRefPicsPlus1(i, j, uiCode); 1234 assert( uiCode <= vps->getMaxTLayers() ); 1235 } 1236 } 1237 #else 1238 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1239 assert( uiCode <= vps->getMaxTLayers() ); 1240 #endif 1241 } 1242 #endif 1243 #if ILP_SSH_SIG 1244 READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false); 1245 #endif 1269 READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false); 1246 1270 #if VPS_EXTN_PROFILE_INFO 1247 1271 // Profile-tier-level signalling … … 1276 1300 #endif 1277 1301 1302 #if Q0078_ADD_LAYER_SETS 1303 if (vps->getNumIndependentLayers() > 1) 1304 { 1305 READ_UVLC(uiCode, "num_add_layer_sets"); vps->setNumAddLayerSets(uiCode); 1306 for (i = 0; i < vps->getNumAddLayerSets(); i++) 1307 { 1308 for (j = 1; j < vps->getNumIndependentLayers(); j++) 1309 { 1310 int len = 1; 1311 while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1)) 1312 { 1313 len++; 1314 } 1315 READ_CODE(len, uiCode, "highest_layer_idx_plus1[i][j]"); vps->setHighestLayerIdxPlus1(i, j, uiCode); 1316 } 1317 } 1318 vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets()); 1319 vps->setLayerIdIncludedFlagsForAddLayerSets(); 1320 } 1321 #endif 1322 1278 1323 #if !VPS_EXTN_UEV_CODING 1279 1324 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false ); … … 1293 1338 if( vps->getNumLayerSets() > 1 ) 1294 1339 { 1295 READ_UVLC( uiCode, "num_add_o utput_layer_sets" ); vps->setNumAddOutputLayerSets( uiCode );1296 READ_CODE( 2, uiCode, "default_ target_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode );1340 READ_UVLC( uiCode, "num_add_olss" ); vps->setNumAddOutputLayerSets( uiCode ); 1341 READ_CODE( 2, uiCode, "default_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode ); 1297 1342 } 1298 1343 else … … 1304 1349 #endif 1305 1350 1306 // The value of num_add_o utput_layer_sets shall be in the range of 0 to 1023, inclusive.1351 // The value of num_add_olss shall be in the range of 0 to 1023, inclusive. 1307 1352 assert( vps->getNumAddOutputLayerSets() >= 0 && vps->getNumAddOutputLayerSets() < 1024 ); 1308 1353 … … 1328 1373 numBits++; 1329 1374 } 1330 READ_CODE( numBits, uiCode, " output_layer_set_idx_minus1"); vps->setOutputLayerSetIdx( i, uiCode + 1);1375 READ_CODE( numBits, uiCode, "layer_set_idx_for_ols_minus1"); vps->setOutputLayerSetIdx( i, uiCode + 1); 1331 1376 } 1332 1377 else … … 1334 1379 vps->setOutputLayerSetIdx( i, i ); 1335 1380 } 1381 #if Q0078_ADD_LAYER_SETS 1382 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1383 #else 1336 1384 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1385 #endif 1337 1386 { 1338 1387 Int lsIdx = vps->getOutputLayerSetIdx(i); … … 1634 1683 #endif 1635 1684 1636 #if N0147_IRAP_ALIGN_FLAG &&!IRAP_ALIGN_FLAG_IN_VPS_VUI1685 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI 1637 1686 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1638 1687 vps->setCrossLayerIrapAlignFlag(uiCode); … … 1678 1727 } 1679 1728 #endif 1680 #if O0092_0094_DEPENDENCY_CONSTRAINT 1681 for(i = 1; i < vps->getMaxLayers(); i++) 1682 { 1683 vps->setNumRefLayers(vps->getLayerIdInNuh(i)); // identify the number of direct and indirect reference layers of current layer and set recursiveRefLayersFlags 1684 } 1729 #if !Q0078_ADD_LAYER_SETS 1730 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved up 1731 vps->setNumRefLayers(); 1732 1685 1733 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1686 1734 { … … 1690 1738 } 1691 1739 } 1740 #endif 1692 1741 #endif 1693 1742 … … 1732 1781 #endif 1733 1782 { 1734 #if VPS_VUI1735 1783 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1736 1784 { … … 1738 1786 } 1739 1787 parseVPSVUI(vps); 1740 #endif1741 1788 } 1742 1789 else … … 1778 1825 } 1779 1826 1780 // When not present, the value of num_add_o utput_layer_sets is inferred to be equal to 0.1781 // NumOutputLayerSets = num_add_o utput_layer_sets + vps_num_layer_sets_minus1 + 11827 // When not present, the value of num_add_olss is inferred to be equal to 0. 1828 // NumOutputLayerSets = num_add_olss + NumLayerSets 1782 1829 vps->setNumOutputLayerSets( vps->getNumLayerSets() ); 1783 1830 1784 1831 // For i in the range of 0 to NumOutputLayerSets-1, inclusive, the variable LayerSetIdxForOutputLayerSet[ i ] is derived as specified in the following: 1785 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : output_layer_set_idx_minus1[ i ] + 11832 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : layer_set_idx_for_ols_minus1[ i ] + 1 1786 1833 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1787 1834 { … … 1834 1881 Void TDecCavlc::defaultVPSVUI( TComVPS* vps ) 1835 1882 { 1836 #if N0147_IRAP_ALIGN_FLAG1837 1883 // When not present, the value of all_layers_idr_aligned_flag is inferred to be equal to 0. 1838 1884 vps->setCrossLayerIrapAlignFlag( false ); 1839 #endif1840 1885 1841 1886 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 1849 1894 #endif 1850 1895 } 1851 #endif1852 1896 1853 1897 #if REPN_FORMAT_IN_VPS … … 1918 1962 UInt uiCode; 1919 1963 #if DPB_PARAMS_MAXTLAYERS 1964 #if BITRATE_PICRATE_SIGNALLING 1965 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumLayerSets()]; 1966 for(Int i = 0; i < vps->getNumLayerSets(); i++) 1967 #else 1920 1968 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1921 1969 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1970 #endif 1922 1971 { 1923 1972 UInt maxSLMinus1 = 0; … … 1927 1976 Int optLsIdx = i; 1928 1977 #endif 1978 #if BITRATE_PICRATE_SIGNALLING 1979 optLsIdx = i; 1980 #endif 1929 1981 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1930 1982 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); … … 1932 1984 } 1933 1985 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1986 #if BITRATE_PICRATE_SIGNALLING 1987 vps->setMaxSLayersInLayerSetMinus1(i,MaxSubLayersInLayerSetMinus1[ i ]); 1988 #endif 1934 1989 } 1935 1990 #endif … … 1945 2000 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1946 2001 #if DPB_PARAMS_MAXTLAYERS 2002 #if BITRATE_PICRATE_SIGNALLING 2003 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ vps->getOutputLayerSetIdx( i ) ]; j++) 2004 #else 1947 2005 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 2006 #endif 1948 2007 #else 1949 2008 for(Int j = 0; j <= vps->getMaxTLayers(); j++) … … 2009 2068 if( !vps->getSubLayerDpbInfoPresentFlag(i, j) ) // If sub-layer DPB information is NOT present 2010 2069 { 2070 #if RESOLUTION_BASED_DPB 2011 2071 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 2072 #else 2073 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 2074 #endif 2012 2075 { 2013 2076 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) ); 2014 2077 } 2015 2078 vps->setMaxVpsNumReorderPics( i, j, vps->getMaxVpsNumReorderPics( i, j - 1) ); 2079 #if RESOLUTION_BASED_DPB 2016 2080 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 2017 2081 { 2018 2082 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j - 1)); 2019 2083 } 2084 #endif 2020 2085 vps->setMaxVpsLatencyIncreasePlus1( i, j, vps->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 2021 2086 } … … 2024 2089 } 2025 2090 #endif 2026 #if VPS_VUI 2091 2027 2092 Void TDecCavlc::parseVPSVUI(TComVPS *vps) 2028 2093 { … … 2039 2104 vps->setCrossLayerIrapAlignFlag(uiCode); 2040 2105 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2041 if (uiCode)2042 { 2043 READ_FLAG( uiCode, "all_layers_idr_aligned_flag" );2044 vps->setCrossLayer IrapAlignFlag(uiCode);2106 if( uiCode ) 2107 { 2108 READ_FLAG( uiCode, "all_layers_idr_aligned_flag" ); 2109 vps->setCrossLayerAlignedIdrOnlyFlag(uiCode); 2045 2110 } 2046 2111 #endif … … 2053 2118 } 2054 2119 #endif 2055 #if VPS_VUI_BITRATE_PICRATE 2120 2056 2121 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); vps->setBitRatePresentVpsFlag( uiCode ? true : false ); 2057 2122 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); vps->setPicRatePresentVpsFlag( uiCode ? true : false ); 2058 2123 2059 2124 Bool parseFlag = vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag(); 2060 { 2061 for( i = 0; i < vps->getNumLayerSets(); i++ ) 2062 { 2063 for( j = 0; j < vps->getMaxTLayers(); j++ ) 2064 { 2065 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 2066 { 2067 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 2068 } 2069 else 2070 { 2071 vps->setBitRatePresentFlag( i, j, false ); 2072 } 2073 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 2074 { 2075 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 2076 } 2077 else 2078 { 2079 vps->setPicRatePresentFlag( i, j, false ); 2080 } 2081 if( parseFlag && vps->getBitRatePresentFlag(i, j) ) 2082 { 2083 READ_CODE( 16, uiCode, "avg_bit_rate[i][j]" ); vps->setAvgBitRate( i, j, uiCode ); 2084 READ_CODE( 16, uiCode, "max_bit_rate[i][j]" ); vps->setMaxBitRate( i, j, uiCode ); 2085 } 2086 else 2087 { 2088 vps->setAvgBitRate( i, j, 0 ); 2089 vps->setMaxBitRate( i, j, 0 ); 2090 } 2091 if( parseFlag && vps->getPicRatePresentFlag(i, j) ) 2092 { 2093 READ_CODE( 2 , uiCode, "constant_pic_rate_idc[i][j]" ); vps->setConstPicRateIdc( i, j, uiCode ); 2094 READ_CODE( 16, uiCode, "avg_pic_rate[i][j]" ); vps->setAvgPicRate( i, j, uiCode ); 2095 } 2096 else 2097 { 2098 vps->setConstPicRateIdc( i, j, 0 ); 2099 vps->setAvgPicRate ( i, j, 0 ); 2100 } 2101 } 2102 } 2103 } 2104 #endif 2125 2126 #if Q0078_ADD_LAYER_SETS 2127 for( i = 0; i <= vps->getVpsNumLayerSetsMinus1(); i++ ) 2128 #else 2129 for( i = 0; i < vps->getNumLayerSets(); i++ ) 2130 #endif 2131 { 2132 #if BITRATE_PICRATE_SIGNALLING 2133 for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ ) 2134 #else 2135 for( j = 0; j < vps->getMaxTLayers(); j++ ) 2136 #endif 2137 { 2138 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 2139 { 2140 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 2141 } 2142 else 2143 { 2144 vps->setBitRatePresentFlag( i, j, false ); 2145 } 2146 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 2147 { 2148 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 2149 } 2150 else 2151 { 2152 vps->setPicRatePresentFlag( i, j, false ); 2153 } 2154 if( parseFlag && vps->getBitRatePresentFlag(i, j) ) 2155 { 2156 READ_CODE( 16, uiCode, "avg_bit_rate[i][j]" ); vps->setAvgBitRate( i, j, uiCode ); 2157 READ_CODE( 16, uiCode, "max_bit_rate[i][j]" ); vps->setMaxBitRate( i, j, uiCode ); 2158 } 2159 else 2160 { 2161 vps->setAvgBitRate( i, j, 0 ); 2162 vps->setMaxBitRate( i, j, 0 ); 2163 } 2164 if( parseFlag && vps->getPicRatePresentFlag(i, j) ) 2165 { 2166 READ_CODE( 2 , uiCode, "constant_pic_rate_idc[i][j]" ); vps->setConstPicRateIdc( i, j, uiCode ); 2167 READ_CODE( 16, uiCode, "avg_pic_rate[i][j]" ); vps->setAvgPicRate( i, j, uiCode ); 2168 } 2169 else 2170 { 2171 vps->setConstPicRateIdc( i, j, 0 ); 2172 vps->setAvgPicRate ( i, j, 0 ); 2173 } 2174 } 2175 } 2105 2176 #if VPS_VUI_VIDEO_SIGNAL_MOVE 2106 2177 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 ); … … 2162 2233 } 2163 2234 #endif 2164 #if TILE_BOUNDARY_ALIGNED_FLAG 2235 2165 2236 for(i = 1; i < vps->getMaxLayers(); i++) 2166 2237 { … … 2177 2248 } 2178 2249 } 2179 #endif2180 2250 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 2181 2251 } … … 2290 2360 parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 2291 2361 } 2362 #if Q0078_ADD_LAYER_SETS 2363 for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++) 2364 #else 2292 2365 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 2366 #endif 2293 2367 { 2294 2368 READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode); 2369 #if HRD_BPB 2370 Int chkPart=0; 2371 #endif 2295 2372 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 2296 2373 { … … 2302 2379 } 2303 2380 } 2304 } 2381 #if HRD_BPB 2382 chkPart+=vps->getLayerInBspFlag(h, i, j); 2383 #endif 2384 } 2385 #if HRD_BPB 2386 assert(chkPart<=1); 2387 #endif 2388 #if HRD_BPB 2389 if(vps->getNumBitstreamPartitions(h)==1) 2390 { 2391 Int chkPartition1=0; Int chkPartition2=0; 2392 for( j = 0; j <= (vps->getMaxLayers()-1); j++ ) 2393 { 2394 if( vps->getLayerIdIncludedFlag(h, j) ) 2395 { 2396 chkPartition1+=vps->getLayerInBspFlag(h, 0, j); 2397 chkPartition2++; 2398 } 2399 } 2400 assert(chkPartition1!=chkPartition2); 2401 } 2402 #endif 2305 2403 if (vps->getNumBitstreamPartitions(h)) 2306 2404 { 2405 #if Q0182_MULTI_LAYER_HRD_UPDATE 2406 READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1[h]"); vps->setNumBspSchedCombinations(h, uiCode + 1); 2407 #else 2307 2408 READ_UVLC( uiCode, "num_bsp_sched_combinations[h]"); vps->setNumBspSchedCombinations(h, uiCode); 2409 #endif 2308 2410 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 2309 2411 { … … 2311 2413 { 2312 2414 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][j]"); vps->setBspCombHrdIdx(h, i, j, uiCode); 2415 #if HRD_BPB 2416 assert(uiCode <= vps->getVpsNumBspHrdParametersMinus1()); 2417 #endif 2418 2313 2419 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][j]"); vps->setBspCombSchedIdx(h, i, j, uiCode); 2420 #if HRD_BPB 2421 assert(uiCode <= vps->getBspHrdParamBufferCpbCntMinus1(uiCode,vps->getMaxTLayers()-1)); 2422 #endif 2314 2423 } 2315 2424 } … … 2334 2443 #endif 2335 2444 } 2336 #endif2337 2445 #endif //SVC_EXTENSION 2338 2446 … … 2412 2520 } 2413 2521 2522 #if Q0142_POC_LSB_NOT_PRESENT 2523 #if SHM_FIX7 2524 Int iPOClsb = 0; 2525 #endif 2526 #endif 2527 2414 2528 if(!rpcSlice->getDependentSliceSegmentFlag()) 2415 2529 { … … 2484 2598 } 2485 2599 #if N0065_LAYER_POC_ALIGNMENT 2600 #if !Q0142_POC_LSB_NOT_PRESENT 2486 2601 #if SHM_FIX7 2487 2602 Int iPOClsb = 0; 2488 2603 #endif 2604 #endif 2489 2605 #if O0062_POC_LSB_NOT_PRESENT_FLAG 2490 2606 if( ( rpcSlice->getLayerId() > 0 && !rpcSlice->getVPS()->getPocLsbNotPresentFlag( rpcSlice->getVPS()->getLayerIdInVps(rpcSlice->getLayerId())) ) || !rpcSlice->getIdrPicFlag()) … … 2497 2613 { 2498 2614 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 2615 #if POC_RESET_IDC_DECODER 2616 rpcSlice->setPicOrderCntLsb( uiCode ); 2617 #endif 2499 2618 #if SHM_FIX7 2500 2619 iPOClsb = uiCode; … … 2531 2650 #if SHM_FIX7 2532 2651 } 2652 #endif 2653 #if POC_RESET_IDC_DECODER 2654 else 2655 { 2656 rpcSlice->setPicOrderCntLsb( 0 ); 2657 } 2533 2658 #endif 2534 2659 if( !rpcSlice->getIdrPicFlag() ) … … 2645 2770 rps->setNumberOfPictures(offset); 2646 2771 } 2772 #if DPB_CONSTRAINTS 2773 if(rpcSlice->getVPS()->getVpsExtensionFlag()==1) 2774 { 2775 #if Q0078_ADD_LAYER_SETS 2776 for (Int ii = 1; ii < (rpcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++) // prevent assert error when num_add_layer_sets > 0 2777 #else 2778 for (Int ii=1; ii< rpcSlice->getVPS()->getNumOutputLayerSets(); ii++ ) 2779 #endif 2780 { 2781 Int layerSetIdxForOutputLayerSet = rpcSlice->getVPS()->getOutputLayerSetIdx( ii ); 2782 Int chkAssert=0; 2783 for(Int kk = 0; kk < rpcSlice->getVPS()->getNumLayersInIdList(layerSetIdxForOutputLayerSet); kk++) 2784 { 2785 if(rpcSlice->getLayerId()==rpcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk)) 2786 { 2787 chkAssert=1; 2788 } 2789 } 2790 if(chkAssert) 2791 { 2792 // There may be something wrong here (layer id assumed to be layer idx?) 2793 assert(rps->getNumberOfNegativePictures() <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii))); 2794 assert(rps->getNumberOfPositivePictures() <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)) - rps->getNumberOfNegativePictures()); 2795 assert((rps->getNumberOfPositivePictures() + rps->getNumberOfNegativePictures() + rps->getNumberOfLongtermPictures()) <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii))); 2796 } 2797 } 2798 2799 2800 } 2801 if(rpcSlice->getLayerId() == 0) 2802 { 2803 assert(rps->getNumberOfNegativePictures() <= rpcSlice->getSPS()->getMaxDecPicBuffering(rpcSlice->getSPS()->getMaxTLayers()-1) ); 2804 assert(rps->getNumberOfPositivePictures() <= rpcSlice->getSPS()->getMaxDecPicBuffering(rpcSlice->getSPS()->getMaxTLayers()-1) -rps->getNumberOfNegativePictures()); 2805 assert((rps->getNumberOfPositivePictures() + rps->getNumberOfNegativePictures() + rps->getNumberOfLongtermPictures()) <= rpcSlice->getSPS()->getMaxDecPicBuffering(rpcSlice->getSPS()->getMaxTLayers()-1)); 2806 } 2807 #endif 2647 2808 if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 2648 2809 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 2673 2834 #if SVC_EXTENSION 2674 2835 rpcSlice->setActiveNumILRRefIdx(0); 2675 #if ILP_SSH_SIG2676 #if ILP_SSH_SIG_FIX2677 2836 if((rpcSlice->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) ) 2678 #else2679 if((rpcSlice->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) )2680 #endif2681 #else2682 if((rpcSlice->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) )2683 #endif2684 2837 { 2685 2838 READ_FLAG(uiCode,"inter_layer_pred_enabled_flag"); … … 2720 2873 #endif 2721 2874 } 2722 #if ILP_NUM_REF_CHK 2875 2723 2876 if( rpcSlice->getActiveNumILRRefIdx() == rpcSlice->getNumILRRefIdx() ) 2724 2877 { … … 2730 2883 else 2731 2884 { 2732 #endif 2733 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ )2734 {2735 READ_CODE( numBits,uiCode,"inter_layer_pred_layer_idc[i]");2736 rpcSlice->setInterLayerPredLayerIdc(uiCode,i);2885 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 2886 { 2887 READ_CODE( numBits,uiCode,"inter_layer_pred_layer_idc[i]" ); 2888 rpcSlice->setInterLayerPredLayerIdc(uiCode,i); 2889 } 2737 2890 } 2738 #if ILP_NUM_REF_CHK2739 }2740 #endif2741 2891 } 2742 2892 else … … 2760 2910 } 2761 2911 } 2762 #if ILP_SSH_SIG2763 #if ILP_SSH_SIG_FIX2764 2912 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true && (rpcSlice->getLayerId() > 0 )) 2765 #else2766 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == false )2767 #endif2768 2913 { 2769 2914 rpcSlice->setInterLayerPredEnabledFlag(true); … … 2799 2944 #endif 2800 2945 } 2801 #endif2802 #endif2803 2946 #if P0312_VERT_PHASE_ADJ 2804 2947 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) … … 2811 2954 } 2812 2955 #endif 2956 #endif //SVC_EXTENSION 2813 2957 2814 2958 if(sps->getUseSAO()) … … 2992 3136 #if SVC_EXTENSION && REF_IDX_MFM 2993 3137 // set motion mapping flag 2994 rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() ) ? true : false );3138 rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() && !rpcSlice->isIntra() ) ? true : false ); 2995 3139 #endif 2996 3140 if ( rpcSlice->getSliceType() == B_SLICE ) … … 3132 3276 3133 3277 #if POC_RESET_IDC_SIGNALLING 3134 Int sliceHe derExtensionLength = 0;3278 Int sliceHeaderExtensionLength = 0; 3135 3279 if(pps->getSliceHeaderExtensionPresentFlag()) 3136 3280 { 3137 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHe derExtensionLength = uiCode;3281 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHeaderExtensionLength = uiCode; 3138 3282 } 3139 3283 else 3140 3284 { 3141 sliceHe derExtensionLength = 0;3285 sliceHeaderExtensionLength = 0; 3142 3286 } 3143 3287 UInt startBits = m_pcBitstream->getNumBitsRead(); // Start counter of # SH Extn bits 3144 if( sliceHe derExtensionLength > 0 )3288 if( sliceHeaderExtensionLength > 0 ) 3145 3289 { 3146 3290 if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() ) … … 3152 3296 rpcSlice->setPocResetIdc( 0 ); 3153 3297 } 3298 #if Q0142_POC_LSB_NOT_PRESENT 3299 if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && iPOClsb > 0 ) 3300 { 3301 assert( rpcSlice->getPocResetIdc() != 2 ); 3302 } 3303 #endif 3154 3304 if( rpcSlice->getPocResetIdc() > 0 ) 3155 3305 { … … 3166 3316 READ_FLAG( uiCode, "full_poc_reset_flag"); rpcSlice->setFullPocResetFlag((uiCode == 1) ? true : false); 3167 3317 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode,"poc_lsb_val"); rpcSlice->setPocLsbVal(uiCode); 3318 #if Q0142_POC_LSB_NOT_PRESENT 3319 if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() ) 3320 { 3321 assert( rpcSlice->getPocLsbVal() == 0 ); 3322 } 3323 #endif 3168 3324 } 3169 3325 … … 3179 3335 else 3180 3336 { 3337 #if POC_MSB_VAL_PRESENT_FLAG_SEM 3338 if( sliceHeaderExtensionLength == 0 ) 3339 { 3340 rpcSlice->setPocMsbValPresentFlag( false ); 3341 } 3342 else if( rpcSlice->getPocMsbValRequiredFlag() ) 3343 #else 3181 3344 if( rpcSlice->getPocMsbValRequiredFlag() ) 3345 #endif 3182 3346 { 3183 3347 rpcSlice->setPocMsbValPresentFlag( true ); … … 3189 3353 } 3190 3354 3355 #if !POC_RESET_IDC_DECODER 3191 3356 Int maxPocLsb = 1 << rpcSlice->getSPS()->getBitsForPOC(); 3357 #endif 3192 3358 if( rpcSlice->getPocMsbValPresentFlag() ) 3193 3359 { 3194 3360 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 3361 3362 #if !POC_RESET_IDC_DECODER 3195 3363 // Update POC of the slice based on this MSB val 3196 3364 Int pocLsb = rpcSlice->getPOC() % maxPocLsb; … … 3200 3368 { 3201 3369 rpcSlice->setPocMsbVal( rpcSlice->getPOC() / maxPocLsb ); 3370 #endif 3202 3371 } 3203 3372 … … 3212 3381 while( counter ) 3213 3382 { 3383 #if Q0146_SSH_EXT_DATA_BIT 3384 READ_FLAG( uiCode, "slice_segment_header_extension_data_bit" ); 3385 #else 3214 3386 READ_FLAG( uiCode, "slice_segment_header_extension_reserved_bit" ); assert( uiCode == 1 ); 3387 #endif 3215 3388 counter--; 3216 3389 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r713 r815 75 75 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 76 76 Void parseVPS ( TComVPS* pcVPS ); 77 #if SPS_EXTENSION 78 #if VPS_EXTNS 77 #if SVC_EXTENSION 79 78 Void parseVPSExtension ( TComVPS* pcVPS ); 80 79 Void defaultVPSExtension ( TComVPS* pcVPS ); 81 #endif 82 83 #if VPS_VUI 84 Void parseVPSVUI ( TComVPS* pcVPS ); 85 Void defaultVPSVUI ( TComVPS* pcVPS ); 86 #endif 80 Void parseVPSVUI ( TComVPS* pcVPS ); 81 Void defaultVPSVUI ( TComVPS* pcVPS ); 87 82 #if REPN_FORMAT_IN_VPS 88 83 Void parseRepFormat ( RepFormat *repFormat, RepFormat *repFormatPrev ); -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r713 r815 85 85 m_isNoOutputPriorPics = false; 86 86 #endif 87 #if Q0177_EOS_CHECKS 88 m_isLastNALWasEos = false; 89 #endif 87 90 #if NO_CLRAS_OUTPUT_FLAG 88 91 m_noClrasOutputFlag = false; … … 93 96 m_subDpbIdx = -1; 94 97 #endif 98 #if POC_RESET_IDC_DECODER 99 m_parseIdc = -1; 100 m_lastPocPeriodId = -1; 101 m_prevPicOrderCnt = 0; 102 #endif 95 103 #if Q0048_CGS_3D_ASYMLUT 96 104 m_pColorMappedPic = NULL; … … 104 112 TDecTop::~TDecTop() 105 113 { 114 #if Q0078_ADD_LAYER_SETS 115 for (Int psId = 0; psId < MAX_NUM_SPS; psId++) 116 { 117 TComSPS* sps = m_parameterSetManagerDecoder.getSPS(psId); 118 if (sps != NULL) 119 { 120 // Remove parameter set from other layers to prevent multiple deletes of the same object 121 for (Int lId = 0; lId < m_numLayer; lId++) 122 { 123 if (m_ppcTDecTop[lId] != this) 124 { 125 m_parameterSetManagerDecoder.removeSPS(psId); 126 } 127 } 128 } 129 } 130 for (Int psId = 0; psId < MAX_NUM_PPS; psId++) 131 { 132 TComPPS* pps = m_parameterSetManagerDecoder.getPPS(psId); 133 if (pps != NULL) 134 { 135 // Remove parameter set from other layers to prevent multiple deletes of the same object 136 for (Int lId = 0; lId < m_numLayer; lId++) 137 { 138 if (m_ppcTDecTop[lId] != this) 139 { 140 m_parameterSetManagerDecoder.removePPS(psId); 141 } 142 } 143 } 144 } 145 #endif 106 146 #if ENC_DEC_TRACE 107 147 fclose( g_hTrace ); … … 225 265 226 266 m_cIlpPic[j] = new TComPic; 267 227 268 #if AUXILIARY_PICTURES 228 269 #if REPN_FORMAT_IN_VPS 229 #if SVC_UPSAMPLING230 270 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 231 271 #else 232 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);233 #endif234 #else235 #if SVC_UPSAMPLING236 272 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 237 #else238 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);239 #endif240 273 #endif 241 274 #else 242 275 #if REPN_FORMAT_IN_VPS 243 #if SVC_UPSAMPLING244 276 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 245 277 #else 246 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);247 #endif248 #else249 #if SVC_UPSAMPLING250 278 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 251 #else252 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);253 #endif254 279 #endif 255 280 #endif … … 393 418 394 419 //only for scalable extension 395 #if SCALABILITY_MASK_E0104 396 assert( pcSlice->getVPS()->getScalabilityMask(2) == true ); 397 #else 398 assert( pcSlice->getVPS()->getScalabilityMask(1) == true ); 399 #endif 400 } 401 } 402 } 403 #endif 404 420 assert( pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true ); 421 } 422 } 423 } 424 405 425 #if AUXILIARY_PICTURES 406 426 #if REPN_FORMAT_IN_VPS 407 #if SVC_UPSAMPLING408 427 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 409 428 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 410 429 #else 411 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,412 conformanceWindow, defaultDisplayWindow, numReorderPics, true);413 #endif414 #else415 #if SVC_UPSAMPLING416 430 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 417 431 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 418 #else419 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,420 conformanceWindow, defaultDisplayWindow, numReorderPics, true);421 #endif422 432 #endif 423 433 #else 424 434 #if REPN_FORMAT_IN_VPS 425 #if SVC_UPSAMPLING426 435 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 427 436 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 428 437 #else 429 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,430 conformanceWindow, defaultDisplayWindow, numReorderPics, true);431 #endif432 #else433 #if SVC_UPSAMPLING434 438 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 435 439 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 436 #else 440 #endif 441 #endif 442 443 #else //SVC_EXTENSION 437 444 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 438 445 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 439 #endif 440 #endif 441 #endif 446 #endif //SVC_EXTENSION 447 442 448 m_cListPic.pushBack( rpcPic ); 443 449 … … 478 484 rpcPic->destroy(); 479 485 486 #if SVC_EXTENSION 480 487 #if AUXILIARY_PICTURES 481 488 #if REPN_FORMAT_IN_VPS 482 #if SVC_UPSAMPLING483 489 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 484 490 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 485 486 #else 487 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 488 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 489 #endif 490 #else 491 #if SVC_UPSAMPLING 491 #else 492 492 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 493 493 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 494 495 #else496 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,497 conformanceWindow, defaultDisplayWindow, numReorderPics, true);498 #endif499 494 #endif 500 495 #else 501 496 #if REPN_FORMAT_IN_VPS 502 #if SVC_UPSAMPLING503 497 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 504 498 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 505 499 506 500 #else 507 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,508 conformanceWindow, defaultDisplayWindow, numReorderPics, true);509 #endif510 #else511 #if SVC_UPSAMPLING512 501 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 513 502 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 514 515 #else 503 #endif 504 #endif 505 #else //SVC_EXTENSION 516 506 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 517 507 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 518 #endif 519 #endif 520 #endif 508 #endif //SVC_EXTENSION 521 509 } 522 510 … … 793 781 794 782 #if AUXILIARY_PICTURES 795 #if SVC_UPSAMPLING796 783 #if AVC_SYNTAX 797 784 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); … … 800 787 #endif 801 788 #else 802 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, true);803 #endif804 #else805 #if SVC_UPSAMPLING806 789 #if AVC_SYNTAX 807 790 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); 808 791 #else 809 792 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 810 #endif811 #else812 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);813 793 #endif 814 794 #endif … … 846 826 847 827 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 828 #if Q0177_SPS_TEMP_NESTING_FIX 829 sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? activeVPS->getTemporalNestingFlag() : true ); 830 #else 848 831 sps->setTemporalIdNestingFlag( activeVPS->getTemporalNestingFlag() ); 832 #endif 849 833 850 834 // 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, … … 854 838 // to avoid compiler warning "array subscript is above array bounds" 855 839 assert( i < MAX_TLAYER ); 856 840 #if LAYER_DECPICBUFF_PARAM && RESOLUTION_BASED_DPB 841 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 842 #else 857 843 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 844 #endif 858 845 } 859 846 } … … 1122 1109 } 1123 1110 #endif 1111 #if POC_RESET_IDC_DECODER 1112 if( m_parseIdc != -1 ) // Second pass for a POC resetting picture 1113 { 1114 m_parseIdc++; // Proceed to POC decoding and RPS derivation 1115 } 1116 1117 if( m_parseIdc == 2 ) 1118 { 1119 bNewPOC = false; 1120 } 1121 1122 if( (bNewPOC || m_layerId!=m_uiPrevLayerId) && (m_parseIdc == -1) ) // Will be true at the first pass 1123 { 1124 //if (bNewPOC || m_layerId!=m_uiPrevLayerId) 1125 // Check if new reset period has started - this is needed just so that the SHM decoder which calls slice header decoding twice 1126 // does not invoke the output twice 1127 //if( m_lastPocPeriodId[m_apcSlicePilot->getLayerId()] == m_apcSlicePilot->getPocResetPeriodId() ) 1128 // Update CurrAU marking 1129 if(( m_layerId < m_uiPrevLayerId) ||( ( m_layerId == m_uiPrevLayerId) && bNewPOC)) // Decoding a lower layer than or same layer as previous - mark all earlier pictures as not in current AU 1130 { 1131 markAllPicsAsNoCurrAu(); 1132 } 1133 1134 if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 ) 1135 { 1136 Int pocResetPeriodId = m_apcSlicePilot->getPocResetPeriodId(); 1137 if ( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 || 1138 ( m_apcSlicePilot->getPocResetIdc() == 3 && pocResetPeriodId != getLastPocPeriodId() ) ) 1139 { 1140 setLastPocPeriodId(pocResetPeriodId); 1141 m_parseIdc = 0; 1142 } 1143 } 1144 else 1145 { 1146 m_parseIdc = 3; // Proceed to decoding POC and RPS 1147 } 1148 } 1149 #endif 1124 1150 1125 1151 #if ALIGNED_BUMPING 1152 #if POC_RESET_IDC_DECODER 1153 //if( (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) ) 1154 if( m_parseIdc == 1 ) 1155 { 1156 // Invoke output of pictures if the current picture is a POC reset picture 1157 bNewPOC = true; 1158 /* Include reset of all POCs in the layer */ 1159 1160 // This operation would do the following: 1161 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 1162 // 2. Update the value of m_pocCRA. 1163 // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later 1164 // 4. update value of POCLastDisplay 1165 1166 //Do the reset stuff here 1167 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1168 Int pocLsbVal; 1169 if( m_apcSlicePilot->getPocResetIdc() == 3 ) 1170 { 1171 pocLsbVal = m_apcSlicePilot->getPocLsbVal() ; 1172 } 1173 else 1174 { 1175 pocLsbVal = (m_apcSlicePilot->getPOC() % maxPocLsb); 1176 } 1177 1178 Int pocMsbDelta = 0; 1179 if ( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1180 { 1181 pocMsbDelta = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; 1182 } 1183 else 1184 { 1185 //This MSB derivation can be made into one function. Item to do next. 1186 Int prevPoc = this->getPrevPicOrderCnt(); 1187 Int prevPocLsb = prevPoc & (maxPocLsb - 1); 1188 Int prevPocMsb = prevPoc - prevPocLsb; 1189 1190 pocMsbDelta = m_apcSlicePilot->getCurrMsb( pocLsbVal, prevPocLsb, prevPocMsb, maxPocLsb ); 1191 } 1192 1193 Int pocLsbDelta; 1194 if( m_apcSlicePilot->getPocResetIdc() == 2 || ( m_apcSlicePilot->getPocResetIdc() == 3 && m_apcSlicePilot->getFullPocResetFlag() )) 1195 { 1196 pocLsbDelta = pocLsbVal; 1197 } 1198 else 1199 { 1200 pocLsbDelta = 0; 1201 } 1202 1203 Int deltaPocVal = pocMsbDelta + pocLsbDelta; 1204 1205 //Reset all POC for DPB -> basically do it for each slice in the picutre 1206 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1207 1208 // Iterate through all picture in DPB 1209 while( iterPic != m_cListPic.end() ) 1210 { 1211 TComPic *dpbPic = *iterPic; 1212 // Check if the picture pointed to by iterPic is either used for reference or 1213 // needed for output, are in the same layer, and not the current picture. 1214 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1215 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 1216 && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() )) 1217 { 1218 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 1219 { 1220 1221 TComSlice *slice = dpbPic->getSlice(i); 1222 TComReferencePictureSet *rps = slice->getRPS(); 1223 slice->setPOC( slice->getPOC() - deltaPocVal ); 1224 1225 // Also adjust the POC value stored in the RPS of each such slice 1226 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 1227 { 1228 rps->setPOC( j, rps->getPOC(j) - deltaPocVal ); 1229 } 1230 // Also adjust the value of refPOC 1231 for(Int k = 0; k < 2; k++) // For List 0 and List 1 1232 { 1233 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1234 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 1235 { 1236 slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j); 1237 } 1238 } 1239 } 1240 } 1241 iterPic++; 1242 } 1243 // Update the value of pocCRA 1244 m_pocCRA -= deltaPocVal; 1245 1246 // Update value of POCLastDisplay 1247 iPOCLastDisplay -= deltaPocVal; 1248 } 1249 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1250 Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb(); 1251 1252 if( m_parseIdc == 1 || m_parseIdc == 2 ) // TODO This should be replaced by pocResettingFlag. 1253 { 1254 // Set poc for current slice 1255 if( m_apcSlicePilot->getPocResetIdc() == 1 ) 1256 { 1257 m_apcSlicePilot->setPOC( slicePicOrderCntLsb ); 1258 } 1259 else if( m_apcSlicePilot->getPocResetIdc() == 2 ) 1260 { 1261 m_apcSlicePilot->setPOC( 0 ); 1262 } 1263 else 1264 { 1265 Int picOrderCntMsb = m_apcSlicePilot->getCurrMsb( slicePicOrderCntLsb, m_apcSlicePilot->getFullPocResetFlag() ? 0 : m_apcSlicePilot->getPocLsbVal(), 0 , maxPocLsb ); 1266 m_apcSlicePilot->setPOC( picOrderCntMsb + slicePicOrderCntLsb ); 1267 } 1268 } 1269 else if (m_parseIdc == 3) 1270 { 1271 Int picOrderCntMsb = 0; 1272 if( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1273 { 1274 picOrderCntMsb = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; 1275 } 1276 else if( m_apcSlicePilot->getIdrPicFlag() ) 1277 { 1278 picOrderCntMsb = 0; 1279 } 1280 else 1281 { 1282 Int prevPicOrderCntLsb = this->getPrevPicOrderCnt() & ( maxPocLsb - 1); 1283 Int prevPicOrderCntMsb = this->getPrevPicOrderCnt() - prevPicOrderCntLsb; 1284 picOrderCntMsb = m_apcSlicePilot->getCurrMsb(slicePicOrderCntLsb, prevPicOrderCntLsb, prevPicOrderCntMsb, maxPocLsb ); 1285 } 1286 m_apcSlicePilot->setPOC( picOrderCntMsb + slicePicOrderCntLsb ); 1287 } 1288 1289 if( m_parseIdc == 1 || m_parseIdc == 3) 1290 { 1291 // Adjust prevPicOrderCnt 1292 if( !m_apcSlicePilot->getRaslPicFlag() 1293 && !m_apcSlicePilot->getRadlPicFlag() 1294 && (m_apcSlicePilot->getNalUnitType() % 2 == 1) 1295 && ( nalu.m_temporalId == 0 ) 1296 && !m_apcSlicePilot->getDiscardableFlag() ) 1297 { 1298 this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() ); 1299 } 1300 else if ( m_apcSlicePilot->getPocResetIdc() == 3 ) 1301 { 1302 this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1303 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1304 } 1305 #else 1126 1306 if (bNewPOC || m_layerId!=m_uiPrevLayerId) 1127 1307 { 1308 #endif 1128 1309 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1129 1310 } 1130 1311 #endif 1312 #if POC_RESET_IDC_DECODER 1313 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId || m_parseIdc == 1) && !m_bFirstSliceInSequence ) 1314 #else 1131 1315 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 1316 #endif 1132 1317 { 1133 1318 m_prevPOC = m_apcSlicePilot->getPOC(); … … 1136 1321 return true; 1137 1322 } 1138 #else 1139 //we should only get a different poc for a new picture (with CTU address==0) 1140 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1141 { 1142 printf ("Warning, the first slice of a picture might have been lost!\n"); 1143 } 1144 // exit when a new picture is found 1145 if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence ) 1146 { 1147 if (m_prevPOC >= m_pocRandomAccess) 1148 { 1149 m_prevPOC = m_apcSlicePilot->getPOC(); 1150 return true; 1151 } 1152 m_prevPOC = m_apcSlicePilot->getPOC(); 1153 } 1154 #endif 1323 1324 #if POC_RESET_IDC_DECODER 1325 m_parseIdc = -1; 1326 #endif 1327 1155 1328 // actual decoding starts here 1156 xActivateParameterSets(); 1157 #if !O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS && N0147_IRAP_ALIGN_FLAG 1158 //Note setting O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS to 0 may cause decoder to crash. 1159 //When cross_layer_irap_aligned_flag is equal to 0, num_extra_slice_header_bits >=1 1160 if(!m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 1161 { 1162 assert( m_apcSlicePilot->getPPS()->getNumExtraSliceHeaderBits() > 0); 1163 } 1164 //When cross_layer_irap_aligned_flag is equal to 1, the value of poc_reset_flag shall be equal to 0 1165 if( m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 1166 { 1167 assert( m_apcSlicePilot->getPocResetFlag() == 0); 1168 } 1169 #endif 1329 xActivateParameterSets(); 1330 1170 1331 #if REPN_FORMAT_IN_VPS 1171 1332 // Initialize ILRP if needed, only for the current layer … … 1177 1338 { 1178 1339 m_prevPOC = m_apcSlicePilot->getPOC(); 1179 #if SVC_EXTENSION1180 1340 curLayerId = m_layerId; 1181 1341 m_uiPrevLayerId = m_layerId; 1182 #endif1183 1342 } 1184 1343 m_bFirstSliceInSequence = false; … … 1249 1408 } 1250 1409 #endif 1251 #if ALIGN_TSA_STSA_PICS 1410 // Alignment of TSA and STSA pictures across AU 1411 #if !Q0108_TSA_STSA 1252 1412 if( m_apcSlicePilot->getLayerId() > 0 ) 1253 1413 { … … 1287 1447 } 1288 1448 #endif 1449 1450 #else //SVC_EXTENSION 1451 //we should only get a different poc for a new picture (with CTU address==0) 1452 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1453 { 1454 printf ("Warning, the first slice of a picture might have been lost!\n"); 1455 } 1456 // exit when a new picture is found 1457 if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence ) 1458 { 1459 if (m_prevPOC >= m_pocRandomAccess) 1460 { 1461 m_prevPOC = m_apcSlicePilot->getPOC(); 1462 return true; 1463 } 1464 m_prevPOC = m_apcSlicePilot->getPOC(); 1465 } 1466 1467 // actual decoding starts here 1468 xActivateParameterSets(); 1469 1470 if (m_apcSlicePilot->isNextSlice()) 1471 { 1472 m_prevPOC = m_apcSlicePilot->getPOC(); 1473 } 1474 m_bFirstSliceInSequence = false; 1475 #endif //SVC_EXTENSION 1289 1476 //detect lost reference picture and insert copy of earlier frame. 1290 1477 Int lostPoc; … … 1301 1488 pBLPic->getSlice(0)->setReferenced(true); 1302 1489 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 1303 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth();1304 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight();1305 1490 1306 1491 if( pFile->good() ) 1307 1492 { 1493 Bool is16bit = g_bitDepthYLayer[0] > 8 || g_bitDepthCLayer[0] > 8; 1494 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(); 1495 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(); 1496 1497 Int len = uiWidth * (is16bit ? 2 : 1); 1498 UChar *buf = new UChar[len]; 1499 1308 1500 UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2; 1501 if( is16bit ) 1502 { 1503 uiPos <<= 1; 1504 } 1309 1505 1310 1506 pFile->seekg((UInt)uiPos, ios::beg ); 1311 1507 1508 // read Y component 1312 1509 Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr(); 1313 1510 UInt uiStride = pBLPic->getPicYuvRec()->getStride(); 1314 1511 for( Int i = 0; i < uiHeight; i++ ) 1315 1512 { 1316 for( Int j = 0; j < uiWidth; j++ ) 1513 pFile->read(reinterpret_cast<Char*>(buf), len); 1514 1515 if( !is16bit ) 1317 1516 { 1318 pPel[j] = pFile->get(); 1517 for (Int x = 0; x < uiWidth; x++) 1518 { 1519 pPel[x] = buf[x]; 1520 } 1319 1521 } 1522 else 1523 { 1524 for (Int x = 0; x < uiWidth; x++) 1525 { 1526 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1527 } 1528 } 1529 1320 1530 pPel += uiStride; 1321 1531 } 1322 1532 1533 len >>= 1; 1534 uiWidth >>= 1; 1535 uiHeight >>= 1; 1536 1537 // read Cb component 1323 1538 pPel = pBLPic->getPicYuvRec()->getCbAddr(); 1324 1539 uiStride = pBLPic->getPicYuvRec()->getCStride(); 1325 for( Int i = 0; i < uiHeight/2; i++ ) 1326 { 1327 for( Int j = 0; j < uiWidth/2; j++ ) 1540 for( Int i = 0; i < uiHeight; i++ ) 1541 { 1542 pFile->read(reinterpret_cast<Char*>(buf), len); 1543 1544 if( !is16bit ) 1328 1545 { 1329 pPel[j] = pFile->get(); 1546 for( Int x = 0; x < uiWidth; x++ ) 1547 { 1548 pPel[x] = buf[x]; 1549 } 1330 1550 } 1551 else 1552 { 1553 for( Int x = 0; x < uiWidth; x++ ) 1554 { 1555 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1556 } 1557 } 1558 1331 1559 pPel += uiStride; 1332 1560 } 1333 1561 1562 // read Cr component 1334 1563 pPel = pBLPic->getPicYuvRec()->getCrAddr(); 1335 1564 uiStride = pBLPic->getPicYuvRec()->getCStride(); 1336 for( Int i = 0; i < uiHeight/2; i++ ) 1337 { 1338 for( Int j = 0; j < uiWidth/2; j++ ) 1565 for( Int i = 0; i < uiHeight; i++ ) 1566 { 1567 pFile->read(reinterpret_cast<Char*>(buf), len); 1568 1569 if( !is16bit ) 1339 1570 { 1340 pPel[j] = pFile->get(); 1571 for( Int x = 0; x < uiWidth; x++ ) 1572 { 1573 pPel[x] = buf[x]; 1574 } 1341 1575 } 1576 else 1577 { 1578 for( Int x = 0; x < uiWidth; x++ ) 1579 { 1580 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1581 } 1582 } 1583 1342 1584 pPel += uiStride; 1343 1585 } 1586 1587 delete[] buf; 1344 1588 } 1345 1589 } … … 1365 1609 // Get a new picture buffer 1366 1610 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 1611 1612 #if POC_RESET_IDC_DECODER 1613 pcPic->setCurrAuFlag( true ); 1614 #endif 1367 1615 1368 1616 Bool isField = false; … … 1543 1791 { 1544 1792 UInt refLayerIdc = i; 1793 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1545 1794 #if AVC_BASE 1546 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc )== 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() )1795 if( refLayerId == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() ) 1547 1796 { 1548 1797 TComPic* pic = *m_ppcTDecTop[0]->getListPic()->begin(); … … 1593 1842 1594 1843 #if O0098_SCALED_REF_LAYER_ID 1595 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));1844 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 1596 1845 #else 1597 1846 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); … … 1627 1876 } 1628 1877 #endif 1629 #if SVC_ UPSAMPLING1878 #if SVC_EXTENSION 1630 1879 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1631 { 1880 { 1881 // check for the sample prediction picture type 1882 if( m_ppcTDecTop[m_layerId]->getSamplePredEnabledFlag(refLayerId) ) 1883 { 1632 1884 #if O0215_PHASE_ALIGNMENT 1633 1885 #if O0194_JOINT_US_BITSHIFT 1634 1886 #if Q0048_CGS_3D_ASYMLUT 1635 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1636 #else 1637 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1887 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1888 #else 1889 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1638 1890 #endif 1639 1891 #else 1640 1892 #if Q0048_CGS_3D_ASYMLUT 1641 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );1642 #else 1643 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1893 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1894 #else 1895 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1644 1896 #endif 1645 1897 #endif … … 1647 1899 #if O0194_JOINT_US_BITSHIFT 1648 1900 #if Q0048_CGS_3D_ASYMLUT 1649 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );1650 #else 1651 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );1901 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1902 #else 1903 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1652 1904 #endif 1653 1905 #else 1654 1906 #if Q0048_CGS_3D_ASYMLUT 1655 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1656 #else 1657 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1658 #endif 1659 #endif 1660 #endif 1907 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1908 #else 1909 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1910 #endif 1911 #endif 1912 #endif 1913 } 1661 1914 } 1662 1915 else … … 1665 1918 } 1666 1919 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1667 #endif 1920 #endif //SVC_EXTENSION 1668 1921 } 1669 1922 } … … 1732 1985 if( pcSlice->getMFMEnabledFlag() ) 1733 1986 { 1734 Int refLayerId = pcSlice->getRefPic( pcSlice->getSliceType() == B_SLICE ? ( RefPicList )( 1 - pcSlice->getColFromL0Flag() ) : REF_PIC_LIST_0 , pcSlice->getColRefIdx() )->getLayerId(); 1987 TComPic* refPic = pcSlice->getRefPic( pcSlice->getSliceType() == B_SLICE ? ( RefPicList )( 1 - pcSlice->getColFromL0Flag() ) : REF_PIC_LIST_0 , pcSlice->getColRefIdx() ); 1988 1989 assert( refPic ); 1990 1991 Int refLayerId = refPic->getLayerId(); 1992 1735 1993 if( refLayerId != pcSlice->getLayerId() ) 1736 1994 { … … 1742 2000 #endif 1743 2001 1744 #if N0147_IRAP_ALIGN_FLAG1745 2002 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag() ) 1746 2003 { … … 1758 2015 } 1759 2016 } 1760 #endif 2017 2018 if( m_layerId > 0 && !pcSlice->isIntra() && pcSlice->getEnableTMVPFlag() ) 2019 { 2020 TComPic* refPic = pcSlice->getRefPic(RefPicList(1 - pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx()); 2021 2022 assert( refPic ); 2023 2024 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 2025 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 2026 if( refPic->isILR(pcSlice->getLayerId()) ) 2027 { 2028 assert( m_ppcTDecTop[m_layerId]->getMotionPredEnabledFlag(refPic->getLayerId()) ); 2029 } 2030 } 1761 2031 #endif //SVC_EXTENSION 1762 2032 … … 1856 2126 #endif 1857 2127 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 2128 #if Q0078_ADD_LAYER_SETS 2129 // Store SPS for all layers 2130 for (Int lId = 0; lId < m_numLayer; lId++) 2131 { 2132 if (m_ppcTDecTop[lId] != this) 2133 { 2134 m_ppcTDecTop[lId]->getParameterSetManager()->storePrefetchedSPS(sps); 2135 } 2136 } 2137 #endif 1858 2138 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1859 2139 if(m_numLayer>0) … … 1886 2166 ); 1887 2167 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 2168 #if Q0078_ADD_LAYER_SETS 2169 // Store PPS for all layers 2170 for (Int lId = 0; lId < m_numLayer; lId++) 2171 { 2172 if (m_ppcTDecTop[lId] != this) 2173 { 2174 m_ppcTDecTop[lId]->getParameterSetManager()->storePrefetchedPPS(pps); 2175 } 2176 } 2177 #endif 1888 2178 1889 2179 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 1906 2196 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1907 2197 { 1908 #if RANDOM_ACCESS_SEI_FIX1909 2198 if (m_prevSliceSkipped) // No need to decode SEI messages of a skipped access unit 1910 2199 { 1911 2200 return; 1912 2201 } 1913 #endif1914 2202 #if LAYERS_NOT_PRESENT_SEI 1915 2203 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); … … 1991 2279 { 1992 2280 case NAL_UNIT_VPS: 1993 #if VPS_NUH_LAYER_ID2281 #if SVC_EXTENSION 1994 2282 assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1995 2283 #endif 1996 2284 xDecodeVPS(); 2285 #if Q0177_EOS_CHECKS 2286 m_isLastNALWasEos = false; 2287 #endif 1997 2288 #if AVC_BASE 1998 2289 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) … … 2033 2324 case NAL_UNIT_PREFIX_SEI: 2034 2325 case NAL_UNIT_SUFFIX_SEI: 2326 #if Q0177_EOS_CHECKS 2327 if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI ) 2328 { 2329 assert( m_isLastNALWasEos == false ); 2330 } 2331 #endif 2035 2332 xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType ); 2036 2333 return false; … … 2052 2349 case NAL_UNIT_CODED_SLICE_RASL_N: 2053 2350 case NAL_UNIT_CODED_SLICE_RASL_R: 2351 #if Q0177_EOS_CHECKS 2352 if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N || 2353 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N || 2354 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N || 2355 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 2356 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ) 2357 { 2358 assert( m_isLastNALWasEos == false ); 2359 } 2360 else 2361 { 2362 m_isLastNALWasEos = false; 2363 } 2364 #endif 2054 2365 #if SVC_EXTENSION 2055 2366 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, curLayerId, bNewPOC); … … 2060 2371 2061 2372 case NAL_UNIT_EOS: 2373 #if Q0177_EOS_CHECKS 2374 assert( m_isLastNALWasEos == false ); 2375 //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything. 2376 if (nalu.m_layerId > 0) 2377 { 2378 printf( "\nThis bitstream has EOS with non-zero layer id.\n" ); 2379 return false; 2380 } 2381 m_isLastNALWasEos = true; 2382 #endif 2062 2383 m_associatedIRAPType = NAL_UNIT_INVALID; 2063 2384 m_pocCRA = 0; … … 2085 2406 2086 2407 case NAL_UNIT_FILLER_DATA: 2408 #if Q0177_EOS_CHECKS 2409 assert( m_isLastNALWasEos == false ); 2410 #endif 2087 2411 return false; 2088 2412 … … 2256 2580 } 2257 2581 } 2258 for ( Int i = 1, mIdx = 0, sIdx = 0; i < m_numLayer; i++ ) 2259 { 2582 for( Int i = 1; i < m_numLayer; i++ ) 2583 { 2584 Int mIdx = 0, sIdx = 0; 2260 2585 Int iNuhLId = vps->getLayerIdInNuh(i); 2261 2586 TDecTop *decTop = (TDecTop *)getLayerDec(iNuhLId); … … 2392 2717 } 2393 2718 #endif 2394 2719 #if POC_RESET_IDC_DECODER 2720 Void TDecTop::markAllPicsAsNoCurrAu() 2721 { 2722 for(Int i = 0; i < MAX_LAYERS; i++) 2723 { 2724 TComList<TComPic*>* listPic = this->getLayerDec(i)->getListPic(); 2725 TComList<TComPic*>::iterator iterPic = listPic->begin(); 2726 while ( iterPic != listPic->end() ) 2727 { 2728 TComPic *pcPic = *(iterPic); 2729 pcPic->setCurrAuFlag( false ); 2730 iterPic++; 2731 } 2732 } 2733 } 2734 #endif 2395 2735 #if Q0048_CGS_3D_ASYMLUT 2396 2736 Void TDecTop::initAsymLut(TComSlice *pcSlice) -
trunk/source/Lib/TLibDecoder/TDecTop.h
r713 r815 162 162 Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic 163 163 #endif 164 #if Q0177_EOS_CHECKS 165 Bool m_isLastNALWasEos; 166 #endif 164 167 165 168 #if SVC_EXTENSION … … 201 204 Bool m_firstPicInLayerDecodedFlag; 202 205 #endif 206 #if POC_RESET_IDC_DECODER 207 Int m_parseIdc; 208 Int m_lastPocPeriodId; 209 Int m_prevPicOrderCnt; 210 #endif 203 211 #if RESOLUTION_BASED_DPB 204 212 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to. … … 241 249 #if EARLY_REF_PIC_MARKING 242 250 Void earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdList); 251 #endif 252 #if POC_RESET_IDC_DECODER 253 Int getParseIdc() { return m_parseIdc;} 254 Void setParseIdc(Int x) { m_parseIdc = x;} 255 Void markAllPicsAsNoCurrAu(); 256 257 Int getLastPocPeriodId() { return m_lastPocPeriodId; } 258 Void setLastPocPeriodId(Int x) { m_lastPocPeriodId = x; } 259 260 Int getPrevPicOrderCnt() { return m_prevPicOrderCnt; } 261 Void setPrevPicOrderCnt(Int const x) { m_prevPicOrderCnt = x; } 243 262 #endif 244 263 UInt getLayerId () { return m_layerId; }
Note: See TracChangeset for help on using the changeset viewer.