Changeset 540 in SHVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 9 Jan 2014, 05:04:17 (11 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-4.1-dev (added) merged: 501-539 /trunk merged: 499
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-4.1-dev/source (added) merged: 502-522,524-533,535,537-539
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/NALread.cpp
r313 r540 126 126 else 127 127 { 128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_T LA_R128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 129 129 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 130 130 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r494 r540 290 290 } 291 291 } 292 293 #if SCALINGLIST_INFERRING 294 if( pcPPS->getLayerId() > 0 ) 295 { 296 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); 297 pcPPS->setInferScalingListFlag( uiCode ); 298 } 299 300 if( pcPPS->getInferScalingListFlag() ) 301 { 302 READ_UVLC( uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode ); 303 304 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 305 assert( pcPPS->getScalingListRefLayerId() <= 62 ); 306 307 pcPPS->setScalingListPresentFlag( false ); 308 } 309 else 310 { 311 #endif 312 292 313 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 293 314 294 #if IL_SL_SIGNALLING_N0371295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS );296 #endif297 298 315 if(pcPPS->getScalingListPresentFlag ()) 299 316 { 300 #if IL_SL_SIGNALLING_N0371301 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() );302 303 if( pcPPS->getLayerId() > 0 )304 {305 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false );306 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() );307 308 if( pcPPS->getPredScalingListFlag() )309 {310 READ_UVLC ( uiCode, "scaling_list_pps_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode );311 312 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive313 assert( /*pcPPS->getScalingListRefLayerId() >= 0 &&*/ pcPPS->getScalingListRefLayerId() <= 62 );314 315 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of pps_scaling_list_ref_layer_id shall be greater than 0316 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() )317 {318 assert( pcPPS->getScalingListRefLayerId() > 0 );319 }320 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and322 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id323 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );324 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,326 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB327 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true );328 329 pcPPS->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() );330 parseScalingList( pcPPS->getScalingList() );331 }332 else333 {334 parseScalingList( pcPPS->getScalingList() );335 }336 }337 else338 {339 parseScalingList( pcPPS->getScalingList() );340 }341 #else342 317 parseScalingList( pcPPS->getScalingList() ); 343 #endif 344 } 318 } 319 320 #if SCALINGLIST_INFERRING 321 } 322 #endif 345 323 346 324 READ_FLAG( uiCode, "lists_modification_present_flag"); … … 563 541 pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() ); 564 542 } 565 #if IL_SL_SIGNALLING_N0371566 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) );567 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );568 #endif569 543 #endif 570 544 if ( pcSPS->getMaxTLayers() == 1 ) … … 599 573 pcSPS->setUpdateRepFormatFlag( true ); 600 574 } 575 #if O0096_REP_FORMAT_INDEX 576 if( pcSPS->getLayerId() == 0 ) 577 #else 601 578 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 579 #endif 602 580 { 603 581 #endif … … 619 597 #if REPN_FORMAT_IN_VPS 620 598 } 599 #if O0096_REP_FORMAT_INDEX 600 else if ( pcSPS->getUpdateRepFormatFlag() ) 601 { 602 READ_CODE(8, uiCode, "update_rep_format_index"); 603 pcSPS->setUpdateRepFormatIndex(uiCode); 604 } 605 #endif 621 606 #endif 622 607 READ_FLAG( uiCode, "conformance_window_flag"); … … 637 622 } 638 623 #if REPN_FORMAT_IN_VPS 624 #if O0096_REP_FORMAT_INDEX 625 if( pcSPS->getLayerId() == 0 ) 626 #else 639 627 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 628 #endif 640 629 { 641 630 #endif … … 701 690 if(pcSPS->getScalingListFlag()) 702 691 { 692 #if SCALINGLIST_INFERRING 693 if( pcSPS->getLayerId() > 0 ) 694 { 695 READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setInferScalingListFlag( uiCode ); 696 } 697 698 if( pcSPS->getInferScalingListFlag() ) 699 { 700 READ_UVLC( uiCode, "sps_scaling_list_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode ); 701 702 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 703 assert( pcSPS->getScalingListRefLayerId() <= 62 ); 704 705 pcSPS->setScalingListPresentFlag( false ); 706 } 707 else 708 { 709 #endif 703 710 READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" ); pcSPS->setScalingListPresentFlag ( uiCode ); 704 711 if(pcSPS->getScalingListPresentFlag ()) 705 712 { 706 707 #if IL_SL_SIGNALLING_N0371708 pcSPS->getScalingList()->setLayerId( pcSPS->getLayerId() );709 710 if( pcSPS->getLayerId() > 0 )711 {712 READ_FLAG( uiCode, "sps_pred_scaling_list_flag" ); pcSPS->setPredScalingListFlag ( uiCode );713 pcSPS->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() );714 715 if( pcSPS->getPredScalingListFlag() )716 {717 READ_UVLC( uiCode, "scaling_list_sps_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode );718 719 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive720 assert( /*pcSPS->getScalingListRefLayerId() >= 0 &&*/ pcSPS->getScalingListRefLayerId() <= 62 );721 722 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0723 if( pcSPS->getVPS()->getAvcBaseLayerFlag() )724 {725 assert( pcSPS->getScalingListRefLayerId() > 0 );726 }727 728 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and729 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id730 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );731 732 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,733 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB734 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true );735 736 pcSPS->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() );737 parseScalingList( pcSPS->getScalingList() );738 }739 else740 {741 parseScalingList( pcSPS->getScalingList() );742 }743 }744 else745 {746 parseScalingList( pcSPS->getScalingList() );747 }748 #else749 713 parseScalingList( pcSPS->getScalingList() ); 750 #endif 751 752 } 714 } 715 #if SCALINGLIST_INFERRING 716 } 717 #endif 753 718 } 754 719 READ_FLAG( uiCode, "amp_enabled_flag" ); pcSPS->setUseAMP( uiCode ); … … 813 778 { 814 779 #if SPS_EXTENSION 780 781 #if O0142_CONDITIONAL_SPS_EXTENSION 782 UInt spsExtensionTypeFlag[8]; 783 for (UInt i = 0; i < 8; i++) 784 { 785 READ_FLAG( spsExtensionTypeFlag[i], "sps_extension_type_flag" ); 786 } 787 if (spsExtensionTypeFlag[1]) 788 { 789 parseSPSExtension( pcSPS ); 790 } 791 if (spsExtensionTypeFlag[7]) 792 { 793 #else 815 794 parseSPSExtension( pcSPS ); 816 795 READ_FLAG( uiCode, "sps_extension2_flag"); 817 796 if(uiCode) 818 797 { 798 #endif 799 819 800 #endif 820 801 while ( xMoreRbspData() ) … … 846 827 { 847 828 Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i); 829 #if O0098_SCALED_REF_LAYER_ID 830 READ_CODE( 6, uiCode, "scaled_ref_layer_left_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 831 #endif 848 832 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 849 833 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); … … 1090 1074 vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers); 1091 1075 } 1076 #endif 1077 #if VPS_TSLAYERS 1078 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); 1079 if (vps->getMaxTSLayersPresentFlag()) 1080 { 1081 for(i = 0; i < vps->getMaxLayers() - 1; i++) 1082 { 1083 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); 1084 } 1085 } 1086 else 1087 { 1088 for( i = 0; i < vps->getMaxLayers() - 1; i++) 1089 { 1090 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1091 } 1092 } 1092 1093 #endif 1093 1094 #if JCTVC_M0203_INTERLAYER_PRED_IDC … … 1208 1209 else 1209 1210 { 1211 #if VPS_DPB_SIZE_TABLE 1212 vps->setOutputLayerSetIdx( i, i ); 1213 #endif 1210 1214 // i <= (vps->getNumLayerSets() - 1) 1211 1215 // Assign OutputLayerFlag depending on default_one_target_output_layer_flag … … 1234 1238 } 1235 1239 1240 #if O0153_ALT_OUTPUT_LAYER_FLAG 1241 if( vps->getMaxLayers() > 1 ) 1242 { 1243 READ_FLAG( uiCode, "alt_output_layer_flag"); 1244 vps->setAltOuputLayerFlag( uiCode ? true : false ); 1245 } 1246 #endif 1247 1236 1248 #if REPN_FORMAT_IN_VPS 1237 1249 READ_FLAG( uiCode, "rep_format_idx_present_flag"); … … 1240 1252 if( vps->getRepFormatIdxPresentFlag() ) 1241 1253 { 1254 #if O0096_REP_FORMAT_INDEX 1255 READ_CODE( 8, uiCode, "vps_num_rep_formats_minus1" ); 1256 #else 1242 1257 READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); 1258 #endif 1243 1259 vps->setVpsNumRepFormats( uiCode + 1 ); 1244 1260 } … … 1263 1279 if( vps->getVpsNumRepFormats() > 1 ) 1264 1280 { 1281 #if O0096_REP_FORMAT_INDEX 1282 READ_CODE( 8, uiCode, "vps_rep_format_idx[i]" ); 1283 #else 1265 1284 READ_CODE( 4, uiCode, "vps_rep_format_idx[i]" ); 1285 #endif 1266 1286 vps->setVpsRepFormatIdx( i, uiCode ); 1267 1287 } … … 1305 1325 #endif 1306 1326 1327 #if VPS_DPB_SIZE_TABLE 1328 vps->deriveNumberOfSubDpbs(); 1329 for(i = 1; i < vps->getNumOutputLayerSets(); i++) 1330 { 1331 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1332 for(j = 0; j < vps->getMaxTLayers(); j++) 1333 { 1334 if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) ) 1335 { 1336 READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]"); vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false); 1337 } 1338 else 1339 { 1340 if( j == 0 ) // Always signal for the first sub-layer 1341 { 1342 vps->setSubLayerDpbInfoPresentFlag( i, j, true ); 1343 } 1344 else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i) 1345 { 1346 vps->setSubLayerDpbInfoPresentFlag( i, j, false ); 1347 } 1348 } 1349 if( vps->getSubLayerDpbInfoPresentFlag(i, j) ) // If sub-layer DPB information is present 1350 { 1351 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1352 { 1353 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); 1354 } 1355 READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" ); vps->setMaxVpsNumReorderPics( i, j, uiCode); 1356 READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" ); vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode); 1357 } 1358 } 1359 } 1360 #endif 1307 1361 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1308 1362 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2); 1363 #if O0096_DEFAULT_DEPENDENCY_TYPE 1364 READ_FLAG(uiCode, "default_direct_dependency_type_flag"); 1365 vps->setDefaultDirectDependecyTypeFlag(uiCode == 1? true : false); 1366 if (vps->getDefaultDirectDependencyTypeFlag()) 1367 { 1368 READ_CODE( vps->getDirectDepTypeLen(), uiCode, "default_direct_dependency_type" ); 1369 vps->setDefaultDirectDependecyType(uiCode); 1370 } 1371 #endif 1309 1372 for(i = 1; i < vps->getMaxLayers(); i++) 1310 1373 { … … 1313 1376 if (vps->getDirectDependencyFlag(i, j)) 1314 1377 { 1315 READ_CODE( vps->getDirectDepTypeLen(), uiCode, "direct_dependency_type[i][j]" ); vps->setDirectDependencyType(i, j, uiCode); 1316 } 1317 } 1318 } 1319 1320 #endif 1321 1322 #if IL_SL_SIGNALLING_N0371 1378 #if O0096_DEFAULT_DEPENDENCY_TYPE 1379 if (vps->getDefaultDirectDependencyTypeFlag()) 1380 { 1381 vps->setDirectDependencyType(i, j, vps->getDefaultDirectDependencyType()); 1382 } 1383 else 1384 { 1385 READ_CODE( vps->getDirectDepTypeLen(), uiCode, "direct_dependency_type[i][j]" ); 1386 vps->setDirectDependencyType(i, j, uiCode); 1387 } 1388 #else 1389 READ_CODE( vps->getDirectDepTypeLen(), uiCode, "direct_dependency_type[i][j]" ); 1390 vps->setDirectDependencyType(i, j, uiCode); 1391 #endif 1392 } 1393 } 1394 } 1395 #endif 1396 #if O0092_0094_DEPENDENCY_CONSTRAINT 1323 1397 for(i = 1; i < vps->getMaxLayers(); i++) 1324 { 1325 for(j = 0; j < i; j++) 1326 { 1327 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1328 } 1329 } 1398 { 1399 vps->setNumRefLayers(vps->getLayerIdInNuh(i)); // identify the number of direct and indirect reference layers of current layer and set recursiveRefLayersFlags 1400 } 1401 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1402 { 1403 for(i = 1;i < vps->getMaxLayers(); i++) 1404 { 1405 assert( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) <= MAX_REF_LAYERS); 1406 } 1407 } 1330 1408 #endif 1331 1409 … … 1333 1411 READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false); 1334 1412 #endif 1413 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1414 READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false); 1415 #endif 1335 1416 1336 1417 READ_FLAG( uiCode, "vps_vui_present_flag" ); … … 1351 1432 { 1352 1433 UInt uiCode; 1434 #if REPN_FORMAT_CONTROL_FLAG 1435 READ_FLAG ( uiCode, "chroma_and_bit_depth_vps_present_flag"); repFormat->setChromaAndBitDepthVpsPresentFlag(uiCode ? true : false); 1436 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1437 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1438 1439 if( repFormat->getChromaAndBitDepthVpsPresentFlag() ) 1440 { 1441 #if AUXILIARY_PICTURES 1442 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); 1443 #else 1444 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1445 #endif 1446 1447 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1448 { 1449 READ_FLAG( uiCode, "separate_colour_plane_flag"); repFormat->setSeparateColourPlaneVpsFlag(uiCode ? true : false); 1450 } 1451 1452 1453 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1454 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1455 } 1456 #else 1353 1457 #if AUXILIARY_PICTURES 1354 1458 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); … … 1367 1471 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1368 1472 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1369 1473 #endif 1370 1474 } 1371 1475 #endif … … 1375 1479 UInt i,j; 1376 1480 UInt uiCode; 1481 #if O0223_PICTURE_TYPES_ALIGN_FLAG 1482 READ_FLAG(uiCode, "cross_layer_pic_type_aligned_flag" ); 1483 vps->setCrossLayerPictureTypeAlignFlag(uiCode); 1484 if (!uiCode) 1485 { 1486 #endif 1377 1487 #if IRAP_ALIGN_FLAG_IN_VPS_VUI 1378 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1379 vps->setCrossLayerIrapAlignFlag(uiCode); 1488 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1489 vps->setCrossLayerIrapAlignFlag(uiCode); 1490 #endif 1491 #if O0223_PICTURE_TYPES_ALIGN_FLAG 1492 } 1493 else 1494 { 1495 vps->setCrossLayerIrapAlignFlag(true); 1496 } 1380 1497 #endif 1381 1498 #if VPS_VUI_BITRATE_PICRATE … … 1429 1546 } 1430 1547 #endif 1548 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 1549 UInt layerIdx; 1550 READ_FLAG( uiCode, "tiles_not_in_use_flag" ); vps->setTilesNotInUseFlag(uiCode == 1); 1551 if (!uiCode) 1552 { 1553 for(i = 0; i < vps->getMaxLayers(); i++) 1554 { 1555 READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1)); 1556 if (uiCode) 1557 { 1558 READ_FLAG( uiCode, "loop_filter_not_across_tiles_flag[ i ]" ); vps->setLoopFilterNotAcrossTilesFlag(i, (uiCode == 1)); 1559 } 1560 else 1561 { 1562 vps->setLoopFilterNotAcrossTilesFlag(i, false); 1563 } 1564 } 1565 #endif 1431 1566 #if TILE_BOUNDARY_ALIGNED_FLAG 1432 for(i = 1; i < vps->getMaxLayers(); i++) 1433 { 1434 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1435 { 1436 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1567 for(i = 1; i < vps->getMaxLayers(); i++) 1568 { 1569 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1570 { 1571 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 1572 layerIdx = vps->getLayerIdInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j)); 1573 if (vps->getTilesInUseFlag(i) && vps->getTilesInUseFlag(layerIdx)) { 1574 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1575 } 1576 #else 1577 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1578 #endif 1579 } 1580 } 1581 #endif 1582 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 1583 } 1584 #endif 1585 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 1586 READ_FLAG( uiCode, "wpp_not_in_use_flag" ); vps->setWppNotInUseFlag(uiCode == 1); 1587 if (!uiCode) 1588 { 1589 for(i = 0; i < vps->getMaxLayers(); i++) 1590 { 1591 READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1)); 1437 1592 } 1438 1593 } … … 1458 1613 } 1459 1614 } 1615 #endif 1616 #if VPS_VUI_VIDEO_SIGNAL 1617 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 ); 1618 if (vps->getVideoSigPresentVpsFlag()) 1619 { 1620 READ_CODE(4, uiCode, "vps_num_video_signal_info_minus1" ); vps->setNumVideoSignalInfo(uiCode + 1); 1621 } 1622 else 1623 { 1624 vps->setNumVideoSignalInfo(vps->getMaxLayers()); 1625 } 1626 1627 1628 for(i = 0; i < vps->getNumVideoSignalInfo(); i++) 1629 { 1630 READ_CODE(3, uiCode, "video_vps_format" ); vps->setVideoVPSFormat(i,uiCode); 1631 READ_FLAG(uiCode, "video_full_range_vps_flag" ); vps->setVideoFullRangeVpsFlag(i,uiCode); 1632 READ_CODE(8, uiCode, "color_primaries_vps" ); vps->setColorPrimaries(i,uiCode); 1633 READ_CODE(8, uiCode, "transfer_characteristics_vps" ); vps->setTransCharacter(i,uiCode); 1634 READ_CODE(8, uiCode, "matrix_coeffs_vps" );vps->setMaxtrixCoeff(i,uiCode); 1635 } 1636 if(!vps->getVideoSigPresentVpsFlag()) 1637 { 1638 for (i=0; i < vps->getMaxLayers(); i++) 1639 { 1640 vps->setVideoSignalInfoIdx(i,i); 1641 } 1642 } 1643 else { 1644 vps->setVideoSignalInfoIdx(0,0); 1645 if (vps->getNumVideoSignalInfo() > 1 ) 1646 { 1647 for (i=1; i < vps->getMaxLayers(); i++) 1648 READ_CODE(4, uiCode, "vps_video_signal_info_idx" ); vps->setVideoSignalInfoIdx(i, uiCode); 1649 } 1650 else { 1651 for (i=1; i < vps->getMaxLayers(); i++) 1652 { 1653 vps->setVideoSignalInfoIdx(i,0); 1654 } 1655 } 1656 } 1460 1657 #endif 1461 1658 } … … 1548 1745 iBits++; 1549 1746 } 1747 #if O0149_CROSS_LAYER_BLA_FLAG 1748 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1749 { 1750 READ_FLAG(uiCode, "cross_layer_bla_flag"); rpcSlice->setCrossLayerBLAFlag( uiCode ? true : false ); 1751 iBits++; 1752 } 1753 #endif 1550 1754 for (; iBits < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++) 1551 1755 { … … 1734 1938 Int pocLTCurr = rpcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 1735 1939 - iPOClsb + pocLsbLt; 1736 1737 1940 rps->setPOC (j, pocLTCurr); 1738 1941 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLTCurr); … … 1837 2040 else 1838 2041 { 2042 #if O0225_TID_BASED_IL_RPS_DERIV && TSLAYERS_IL_RPS 2043 if( (rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(0,rpcSlice->getLayerId()) > rpcSlice->getTLayer()) && 2044 (rpcSlice->getVPS()->getMaxTSLayersMinus1(0) >= rpcSlice->getTLayer()) ) 2045 { 2046 #endif 1839 2047 rpcSlice->setActiveNumILRRefIdx(1); 1840 2048 rpcSlice->setInterLayerPredLayerIdc(0,0); 2049 #if O0225_TID_BASED_IL_RPS_DERIV && TSLAYERS_IL_RPS 2050 } 2051 #endif 1841 2052 } 1842 2053 } … … 1844 2055 #if ILP_SSH_SIG 1845 2056 #if ILP_SSH_SIG_FIX 1846 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true )2057 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true && (rpcSlice->getLayerId() > 0 )) 1847 2058 #else 1848 2059 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == false ) … … 1850 2061 { 1851 2062 rpcSlice->setInterLayerPredEnabledFlag(true); 2063 2064 #if O0225_TID_BASED_IL_RPS_DERIV && TSLAYERS_IL_RPS 2065 Int numRefLayerPics = 0; 2066 Int i = 0; 2067 Int refLayerPicIdc [MAX_VPS_LAYER_ID_PLUS1]; 2068 for(i = 0, numRefLayerPics = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2069 { 2070 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2071 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2072 { 2073 refLayerPicIdc[ numRefLayerPics++ ] = i; 2074 } 2075 } 2076 rpcSlice->setActiveNumILRRefIdx(numRefLayerPics); 2077 for( i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 2078 { 2079 rpcSlice->setInterLayerPredLayerIdc(refLayerPicIdc[i],i); 2080 } 2081 #else 1852 2082 rpcSlice->setActiveNumILRRefIdx(rpcSlice->getNumILRRefIdx()); 1853 2083 for( Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) … … 1855 2085 rpcSlice->setInterLayerPredLayerIdc(i,i); 1856 2086 } 2087 #endif 1857 2088 } 1858 2089 #endif … … 1879 2110 ChromaFormat format; 1880 2111 #if REPN_FORMAT_IN_VPS 2112 #if O0096_REP_FORMAT_INDEX 2113 if( sps->getLayerId() == 0 ) 2114 { 2115 format = sps->getChromaFormatIdc(); 2116 } 2117 else 2118 { 2119 format = rpcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 2120 } 2121 #else 1881 2122 if( ( sps->getLayerId() == 0 ) || sps->getUpdateRepFormatFlag() ) 1882 2123 { … … 1887 2128 format = rpcSlice->getVPS()->getVpsRepFormat( rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 1888 2129 } 2130 #endif 1889 2131 #else 1890 2132 format = sps->getChromaFormatIdc(); … … 2039 2281 #if M0457_COL_PICTURE_SIGNALING 2040 2282 #if REMOVE_COL_PICTURE_SIGNALING 2041 rpcSlice->setMFMEnabledFlag( rpcSlice->getNumMotionPredRefLayers() > 0? true : false );2283 rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() ) ? true : false ); 2042 2284 #else 2043 2285 rpcSlice->setMFMEnabledFlag( false ); … … 2633 2875 UInt code, sizeId, listId; 2634 2876 Bool scalingListPredModeFlag; 2635 2636 2877 //for each size 2637 2878 for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2639 2880 for(listId = 0; listId < g_scalingListNum[sizeId]; listId++) 2640 2881 { 2641 #if IL_SL_SIGNALLING_N03712642 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )2643 {2644 READ_FLAG( code, "scaling_list_pred_mode_flag");2645 scalingListPredModeFlag = (code) ? true : false;2646 if(!scalingListPredModeFlag) //Copy Mode2647 {2648 READ_UVLC( code, "scaling_list_pred_matrix_id_delta");2649 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));2650 if( sizeId > SCALING_LIST_8x8 )2651 {2652 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))));2653 }2654 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));2655 2656 }2657 else //DPCM Mode2658 {2659 xDecodeScalingList(scalingList, sizeId, listId);2660 }2661 }2662 else2663 {2664 READ_FLAG( code, "scaling_list_pred_mode_flag");2665 scalingListPredModeFlag = (code) ? true : false;2666 if(!scalingListPredModeFlag) //Copy Mode2667 {2668 READ_UVLC( code, "scaling_list_pred_matrix_id_delta");2669 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));2670 if( sizeId > SCALING_LIST_8x8 )2671 {2672 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))));2673 }2674 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));2675 2676 }2677 else //DPCM Mode2678 {2679 xDecodeScalingList(scalingList, sizeId, listId);2680 }2681 }2682 #else2683 2882 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2684 2883 scalingListPredModeFlag = (code) ? true : false; … … 2698 2897 xDecodeScalingList(scalingList, sizeId, listId); 2699 2898 } 2700 #endif2701 2899 } 2702 2900 } … … 2720 2918 if( sizeId > SCALING_LIST_8x8 ) 2721 2919 { 2722 #if IL_SL_SIGNALLING_N03712723 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )2724 {2725 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId);2726 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]);2727 }2728 else2729 {2730 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8");2731 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8);2732 nextCoef = scalingList->getScalingListDC(sizeId,listId);2733 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId);2734 }2735 #else2736 2920 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2737 2921 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2738 2922 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2739 #endif2740 2923 } 2741 2924 2742 2925 for(i = 0; i < coefNum; i++) 2743 2926 { 2744 #if IL_SL_SIGNALLING_N03712745 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )2746 {2747 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]];2748 dst[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i];2749 }2750 else2751 {2752 READ_SVLC( data, "scaling_list_delta_coef");2753 nextCoef = (nextCoef + data + 256 ) % 256;2754 dst[scan[i]] = nextCoef;2755 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]];2756 }2757 #else2758 2927 READ_SVLC( data, "scaling_list_delta_coef"); 2759 2928 nextCoef = (nextCoef + data + 256 ) % 256; 2760 2929 dst[scan[i]] = nextCoef; 2761 #endif2762 2930 } 2763 2931 } … … 2791 2959 return (cnt>0); 2792 2960 } 2961 2793 2962 //! \} 2794 2963 -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r494 r540 317 317 } 318 318 319 #if HIGHER_LAYER_IRAP_SKIP_FLAG 320 if (pcCU->getSlice()->getVPS()->getHigherLayerIrapSkipFlag() && pcCU->getSlice()->getVPS()->getSingleLayerForNonIrapFlag() && pcCU->getLayerId() > 0) 321 { 322 Bool lowerLayerExist = false; 323 for(int i=0;i<pcCU->getLayerId();i++) 324 { 325 if(pcCU->getSlice()->getBaseColPic(pcCU->getSlice()->getInterLayerPredLayerIdc(i))) 326 { 327 lowerLayerExist = true; 328 } 329 } 330 if(lowerLayerExist) 331 { 332 assert(pcCU->isSkipped(uiAbsPartIdx)); 333 } 334 } 335 #endif 336 319 337 if( pcCU->isSkipped(uiAbsPartIdx) ) 320 338 { … … 945 963 946 964 } 965 947 966 //! \} -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r494 r540 106 106 virtual Void parseCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 107 107 virtual Void parseTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, UInt uiDepth, TextType eTType) = 0; 108 109 108 virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0; 110 109 … … 166 165 Void updateContextTables ( SliceType eSliceType, Int iQp ) { m_pcEntropyDecoderIf->updateContextTables( eSliceType, iQp ); } 167 166 167 168 168 private: 169 169 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP ); -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r442 r540 128 128 //-- For time output for each slice 129 129 long iBeforeTime = clock(); 130 130 #if !HM_CLEANUP_SAO 131 131 UInt uiStartCUAddr = pcSlice->getSliceSegmentCurStartCUAddr(); 132 132 … … 136 136 m_sliceStartCUAddress.push_back(uiSliceStartCuAddr); 137 137 } 138 138 #endif 139 139 m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC ); 140 140 m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder); … … 163 163 m_pcEntropyDecoder->setBitstream ( ppcSubstreams[0] ); 164 164 m_pcEntropyDecoder->resetEntropy (pcSlice); 165 165 #if !HM_CLEANUP_SAO 166 166 if(uiSliceStartCuAddr == uiStartCUAddr) 167 167 { 168 168 m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag()); 169 169 } 170 #endif 170 171 m_pcSbacDecoders[0].load(m_pcSbacDecoder); 171 172 m_pcSliceDecoder->decompressSlice( ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders); … … 195 196 m_pcLoopFilter->setCfg(bLFCrossTileBoundary); 196 197 m_pcLoopFilter->loopFilterPic( rpcPic ); 197 198 #if !HM_CLEANUP_SAO 198 199 if(pcSlice->getSPS()->getUseSAO()) 199 200 { … … 201 202 rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, 0, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary); 202 203 } 203 204 #endif 204 205 if( pcSlice->getSPS()->getUseSAO() ) 205 206 { 207 #if HM_CLEANUP_SAO 208 m_pcSAO->reconstructBlkSAOParams(rpcPic, rpcPic->getPicSym()->getSAOBlkParam()); 209 m_pcSAO->SAOProcess(rpcPic); 210 m_pcSAO->PCMLFDisableProcess(rpcPic); 211 #else 206 212 { 207 213 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); … … 214 220 m_pcSAO->destroyPicSaoInfo(); 215 221 } 216 } 217 222 #endif 223 } 224 #if !HM_CLEANUP_SAO 218 225 if(pcSlice->getSPS()->getUseSAO()) 219 226 { 220 227 rpcPic->destroyNonDBFilterInfo(); 221 228 } 222 229 #endif 223 230 rpcPic->compressMotion(); 224 231 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); … … 283 290 rpcPic->setOutputMark(true); 284 291 rpcPic->setReconMark(true); 292 #if !HM_CLEANUP_SAO 285 293 m_sliceStartCUAddress.clear(); 286 294 m_LFCrossSliceBoundaryFlag.clear(); 295 #endif 287 296 } 288 297 -
trunk/source/Lib/TLibDecoder/TDecGop.h
r313 r540 83 83 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 84 84 85 #if !HM_CLEANUP_SAO 85 86 //! list that contains the CU address of each slice plus the end address 86 87 std::vector<Int> m_sliceStartCUAddress; 87 88 std::vector<Bool> m_LFCrossSliceBoundaryFlag; 88 89 #endif 89 90 #if SVC_EXTENSION 90 91 UInt m_layerId; -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r494 r540 368 368 #if AUXILIARY_PICTURES 369 369 if (format == CHROMA_400) 370 { 370 371 uiSample = uiGrayVal; 372 } 371 373 else 372 374 #endif … … 389 391 #if AUXILIARY_PICTURES 390 392 if (format == CHROMA_400) 393 { 391 394 uiSample = uiGrayVal; 395 } 392 396 else 393 397 #endif … … 1378 1382 if (uiCode == 0) 1379 1383 { 1384 #if HM_CLEANUP_SAO 1385 ruiVal = 1; 1386 #else 1380 1387 ruiVal = 5; 1388 #endif 1381 1389 } 1382 1390 else 1383 1391 { 1392 #if HM_CLEANUP_SAO 1393 ruiVal = 2; 1394 #else 1384 1395 ruiVal = 1; 1385 } 1386 } 1387 } 1396 #endif 1397 } 1398 } 1399 } 1400 1401 #if HM_CLEANUP_SAO 1402 1403 Void TDecSbac::parseSaoSign(UInt& val) 1404 { 1405 m_pcTDecBinIf->decodeBinEP ( val ); 1406 } 1407 1408 Void TDecSbac::parseSAOBlkParam (SAOBlkParam& saoBlkParam 1409 , Bool* sliceEnabled 1410 , Bool leftMergeAvail 1411 , Bool aboveMergeAvail 1412 ) 1413 { 1414 UInt uiSymbol; 1415 1416 Bool isLeftMerge = false; 1417 Bool isAboveMerge= false; 1418 1419 if(leftMergeAvail) 1420 { 1421 parseSaoMerge(uiSymbol); //sao_merge_left_flag 1422 isLeftMerge = (uiSymbol?true:false); 1423 } 1424 1425 if( aboveMergeAvail && !isLeftMerge) 1426 { 1427 parseSaoMerge(uiSymbol); //sao_merge_up_flag 1428 isAboveMerge = (uiSymbol?true:false); 1429 } 1430 1431 if(isLeftMerge || isAboveMerge) //merge mode 1432 { 1433 saoBlkParam[SAO_Y].modeIdc = saoBlkParam[SAO_Cb].modeIdc = saoBlkParam[SAO_Cr].modeIdc = SAO_MODE_MERGE; 1434 saoBlkParam[SAO_Y].typeIdc = saoBlkParam[SAO_Cb].typeIdc = saoBlkParam[SAO_Cr].typeIdc = (isLeftMerge)?SAO_MERGE_LEFT:SAO_MERGE_ABOVE; 1435 } 1436 else //new or off mode 1437 { 1438 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 1439 { 1440 SAOOffset& ctbParam = saoBlkParam[compIdx]; 1441 1442 if(!sliceEnabled[compIdx]) 1443 { 1444 //off 1445 ctbParam.modeIdc = SAO_MODE_OFF; 1446 continue; 1447 } 1448 1449 //type 1450 if(compIdx == SAO_Y || compIdx == SAO_Cb) 1451 { 1452 parseSaoTypeIdx(uiSymbol); //sao_type_idx_luma or sao_type_idx_chroma 1453 1454 assert(uiSymbol ==0 || uiSymbol ==1 || uiSymbol ==2); 1455 1456 if(uiSymbol ==0) //OFF 1457 { 1458 ctbParam.modeIdc = SAO_MODE_OFF; 1459 } 1460 else if(uiSymbol == 1) //BO 1461 { 1462 ctbParam.modeIdc = SAO_MODE_NEW; 1463 ctbParam.typeIdc = SAO_TYPE_START_BO; 1464 } 1465 else //2, EO 1466 { 1467 ctbParam.modeIdc = SAO_MODE_NEW; 1468 ctbParam.typeIdc = SAO_TYPE_START_EO; 1469 } 1470 1471 } 1472 else //Cr, follow Cb SAO type 1473 { 1474 ctbParam.modeIdc = saoBlkParam[SAO_Cb].modeIdc; 1475 ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc; 1476 } 1477 1478 if(ctbParam.modeIdc == SAO_MODE_NEW) 1479 { 1480 Int offset[4]; 1481 for(Int i=0; i< 4; i++) 1482 { 1483 parseSaoMaxUvlc(uiSymbol, g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1484 offset[i] = (Int)uiSymbol; 1485 } 1486 1487 if(ctbParam.typeIdc == SAO_TYPE_START_BO) 1488 { 1489 for(Int i=0; i< 4; i++) 1490 { 1491 if(offset[i] != 0) 1492 { 1493 parseSaoSign(uiSymbol); //sao_offset_sign 1494 if(uiSymbol) 1495 { 1496 offset[i] = -offset[i]; 1497 } 1498 } 1499 } 1500 parseSaoUflc(NUM_SAO_BO_CLASSES_LOG2, uiSymbol ); //sao_band_position 1501 ctbParam.typeAuxInfo = uiSymbol; 1502 1503 for(Int i=0; i<4; i++) 1504 { 1505 ctbParam.offset[(ctbParam.typeAuxInfo+i)%MAX_NUM_SAO_CLASSES] = offset[i]; 1506 } 1507 1508 } 1509 else //EO 1510 { 1511 ctbParam.typeAuxInfo = 0; 1512 1513 if(compIdx == SAO_Y || compIdx == SAO_Cb) 1514 { 1515 parseSaoUflc(NUM_SAO_EO_TYPES_LOG2, uiSymbol ); //sao_eo_class_luma or sao_eo_class_chroma 1516 ctbParam.typeIdc += uiSymbol; 1517 } 1518 else 1519 { 1520 ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc; 1521 } 1522 ctbParam.offset[SAO_CLASS_EO_FULL_VALLEY] = offset[0]; 1523 ctbParam.offset[SAO_CLASS_EO_HALF_VALLEY] = offset[1]; 1524 ctbParam.offset[SAO_CLASS_EO_PLAIN ] = 0; 1525 ctbParam.offset[SAO_CLASS_EO_HALF_PEAK ] = -offset[2]; 1526 ctbParam.offset[SAO_CLASS_EO_FULL_PEAK ] = -offset[3]; 1527 } 1528 } 1529 } 1530 } 1531 } 1532 1533 #else 1388 1534 1389 1535 inline Void copySaoOneLcuParam(SaoLcuParam* psDst, SaoLcuParam* psSrc) … … 1559 1705 } 1560 1706 1707 #endif 1708 1561 1709 /** 1562 1710 - Initialize our contexts from the nominated source. -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r494 r540 90 90 Void parseSaoTypeIdx ( UInt& ruiVal ); 91 91 Void parseSaoUflc ( UInt uiLength, UInt& ruiVal ); 92 #if HM_CLEANUP_SAO 93 Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail); 94 Void parseSaoSign(UInt& val); 95 #else 92 96 Void parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp); 93 97 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam, UInt compIdx); 98 #endif 94 99 private: 95 100 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); -
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r345 r540 197 197 UInt uiTileLCUX; 198 198 Int iNumSubstreamsPerTile = 1; // if independent. 199 200 199 Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag(); 201 200 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr(); … … 323 322 g_bJustDoIt = g_bEncDecTraceEnable; 324 323 #endif 324 325 #if HM_CLEANUP_SAO 326 if ( pcSlice->getSPS()->getUseSAO() ) 327 { 328 SAOBlkParam& saoblkParam = (rpcPic->getPicSym()->getSAOBlkParam())[iCUAddr]; 329 if (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) 330 { 331 Bool sliceEnabled[NUM_SAO_COMPONENTS]; 332 sliceEnabled[SAO_Y] = pcSlice->getSaoEnabledFlag(); 333 sliceEnabled[SAO_Cb]= sliceEnabled[SAO_Cr]= pcSlice->getSaoEnabledFlagChroma(); 334 335 Bool leftMergeAvail = false; 336 Bool aboveMergeAvail= false; 337 338 //merge left condition 339 Int rx = (iCUAddr % uiWidthInLCUs); 340 if(rx > 0) 341 { 342 leftMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-1); 343 } 344 //merge up condition 345 Int ry = (iCUAddr / uiWidthInLCUs); 346 if(ry > 0) 347 { 348 aboveMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-uiWidthInLCUs); 349 } 350 351 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); 352 } 353 else 354 { 355 saoblkParam[SAO_Y ].modeIdc = SAO_MODE_OFF; 356 saoblkParam[SAO_Cb].modeIdc = SAO_MODE_OFF; 357 saoblkParam[SAO_Cr].modeIdc = SAO_MODE_OFF; 358 } 359 } 360 #else 325 361 if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) ) 326 362 { … … 374 410 } 375 411 } 412 #endif 413 376 414 m_pcCuDecoder->decodeCU ( pcCU, uiIsLast ); 377 415 m_pcCuDecoder->decompressCU ( pcCU ); -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r494 r540 79 79 m_prevSliceSkipped = false; 80 80 m_skippedPOC = 0; 81 #if NO_CLRAS_OUTPUT_FLAG 82 m_noClrasOutputFlag = false; 83 m_layerInitializedFlag = false; 84 m_firstPicInLayerDecodedFlag = false; 85 m_noOutputOfPriorPicsFlags = false; 86 m_bRefreshPending = false; 87 #endif 81 88 } 82 89 … … 170 177 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 171 178 { 179 #if USE_DPB_SIZE_TABLE 180 if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 ) 181 { 182 assert( this->getLayerId() == 0 ); 183 numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer); 184 } 185 else 186 { 187 TComVPS *vps = slice->getVPS(); 188 // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures. 189 numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer); 190 } 191 #else 172 192 numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer); 193 #endif 173 194 } 174 195 … … 260 281 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 261 282 { 283 #if USE_DPB_SIZE_TABLE 284 if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 ) 285 { 286 assert( this->getLayerId() == 0 ); 287 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 288 } 289 else 290 { 291 TComVPS *vps = pcSlice->getVPS(); 292 // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures. 293 numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer); 294 } 295 #else 262 296 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 263 } 264 297 #endif 298 } 299 300 #if USE_DPB_SIZE_TABLE 301 if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 ) 302 { 303 assert( this->getLayerId() == 0 ); 304 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 305 } 306 else 307 { 308 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 309 } 310 #else 265 311 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 312 #endif 266 313 267 314 #if SVC_EXTENSION … … 278 325 for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ ) 279 326 { 327 #if O0098_SCALED_REF_LAYER_ID 328 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 329 #else 280 330 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(i); 331 #endif 281 332 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 282 333 … … 344 395 #endif 345 396 #endif 346 397 #if !HM_CLEANUP_SAO 347 398 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 399 #endif 348 400 m_cListPic.pushBack( rpcPic ); 349 401 … … 425 477 #endif 426 478 #endif 479 #if !HM_CLEANUP_SAO 427 480 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 481 #endif 428 482 } 429 483 … … 531 585 printf("\ninserting lost poc : %d\n",iLostPoc); 532 586 TComSlice cFillSlice; 533 #if SVC_EXTENSION534 cFillSlice.setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );535 cFillSlice.setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );536 cFillSlice.setVPS( m_parameterSetManagerDecoder[m_layerId].getFirstVPS() );537 cFillSlice.initSlice( m_layerId );538 #else539 587 cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 540 588 cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 589 #if SVC_EXTENSION 590 cFillSlice.setVPS( m_parameterSetManagerDecoder.getFirstVPS() ); 591 cFillSlice.initSlice( m_layerId ); 592 #else 541 593 cFillSlice.initSlice(); 542 594 #endif 543 595 TComPic *cFillPic; 544 596 xGetNewPicBuffer(&cFillSlice,cFillPic); 545 #if SVC_EXTENSION546 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );547 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );548 cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder[m_layerId].getFirstVPS() );549 cFillPic->getSlice(0)->initSlice( m_layerId );550 #else551 597 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 552 598 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 599 #if SVC_EXTENSION 600 cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder.getFirstVPS() ); 601 cFillPic->getSlice(0)->initSlice( m_layerId ); 602 #else 553 603 cFillPic->getSlice(0)->initSlice(); 554 604 #endif … … 593 643 Void TDecTop::xActivateParameterSets() 594 644 { 595 #if SVC_EXTENSION596 m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS();597 598 TComPPS *pps = m_parameterSetManagerDecoder[m_layerId].getPPS(m_apcSlicePilot->getPPSId());599 assert (pps != 0);600 601 TComSPS *sps = m_parameterSetManagerDecoder[m_layerId].getSPS(pps->getSPSId());602 assert (sps != 0);603 604 if( false == m_parameterSetManagerDecoder[m_layerId].activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->isIRAP()) )605 #else606 645 m_parameterSetManagerDecoder.applyPrefetchedPS(); 607 646 … … 613 652 614 653 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 615 #endif616 654 { 617 655 printf ("Parameter set activation failed!"); 618 656 assert (0); 619 657 } 658 659 #if SCALINGLIST_INFERRING 660 // scaling list settings and checks 661 TComVPS *activeVPS = m_parameterSetManagerDecoder.getActiveVPS(); 662 TComSPS *activeSPS = m_parameterSetManagerDecoder.getActiveSPS(); 663 TComPPS *activePPS = m_parameterSetManagerDecoder.getActivePPS(); 664 665 if( activeSPS->getInferScalingListFlag() ) 666 { 667 UInt refLayerId = activeSPS->getScalingListRefLayerId(); 668 TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 669 670 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 671 if( activeVPS->getAvcBaseLayerFlag() ) 672 { 673 assert( refLayerId > 0 ); 674 } 675 676 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 677 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 678 assert( refSps->getInferScalingListFlag() == false ); 679 680 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 681 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 682 assert( activeVPS->getRecursiveRefLayerFlag( activeSPS->getLayerId(), refLayerId ) == true ); 683 684 if( activeSPS->getScalingList() != refSps->getScalingList() ) 685 { 686 // delete created instance of scaling list since it will be inferred 687 delete activeSPS->getScalingList(); 688 689 // infer scaling list 690 activeSPS->setScalingList( refSps->getScalingList() ); 691 } 692 } 693 694 if( activePPS->getInferScalingListFlag() ) 695 { 696 UInt refLayerId = activePPS->getScalingListRefLayerId(); 697 TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 698 699 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 700 if( activeVPS->getAvcBaseLayerFlag() ) 701 { 702 assert( refLayerId > 0 ); 703 } 704 705 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 706 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 707 assert( refPps->getInferScalingListFlag() == false ); 708 709 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 710 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 711 assert( activeVPS->getRecursiveRefLayerFlag( activePPS->getLayerId(), refLayerId ) == true ); 712 713 if( activePPS->getScalingList() != refPps->getScalingList() ) 714 { 715 // delete created instance of scaling list since it will be inferred 716 delete activePPS->getScalingList(); 717 718 // infer scaling list 719 activePPS->setScalingList( refPps->getScalingList() ); 720 } 721 722 } 723 #endif 620 724 621 725 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 670 774 m_cSAO.destroy(); 671 775 #if REPN_FORMAT_IN_VPS 776 #if AUXILIARY_PICTURES 777 #if HM_CLEANUP_SAO 778 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 779 #else 672 780 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 781 #endif 782 #else 783 #if HM_CLEANUP_SAO 784 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 785 #else 786 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 787 #endif 788 #endif 789 #else 790 #if HM_CLEANUP_SAO 791 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 673 792 #else 674 793 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 794 #endif 675 795 #endif 676 796 m_cLoopFilter.create( sps->getMaxCUDepth() ); … … 688 808 { 689 809 TComPic*& pcPic = m_pcPic; 810 #if NO_CLRAS_OUTPUT_FLAG 811 Bool bFirstSliceInSeq; 812 #endif 690 813 #if SVC_EXTENSION 691 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder[m_layerId].getPrefetchedVPS(0) ); 814 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); 815 #if OUTPUT_LAYER_SET_INDEX 816 // Following check should go wherever the VPS is activated 817 checkValueOfOutputLayerSetIdx( m_apcSlicePilot->getVPS()); 818 #endif 692 819 m_apcSlicePilot->initSlice( nalu.m_layerId ); 693 820 #else … … 727 854 m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() ); 728 855 #endif 729 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder[m_layerId]); 730 #else 856 #endif 731 857 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 732 #endif733 858 734 859 // set POC for dependent slices in skipped pictures … … 788 913 // actual decoding starts here 789 914 xActivateParameterSets(); 790 #if !O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS 915 #if !O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS && N0147_IRAP_ALIGN_FLAG 791 916 //Note setting O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS to 0 may cause decoder to crash. 792 917 //When cross_layer_irap_aligned_flag is equal to 0, num_extra_slice_header_bits >=1 … … 801 926 } 802 927 #endif 803 804 928 #if REPN_FORMAT_IN_VPS 805 929 // Initialize ILRP if needed, only for the current layer … … 816 940 #endif 817 941 } 942 #if NO_CLRAS_OUTPUT_FLAG 943 bFirstSliceInSeq = m_bFirstSliceInSequence; 944 #endif 818 945 m_bFirstSliceInSequence = false; 819 946 #if POC_RESET_FLAG … … 829 956 Int pocAdjustValue = m_apcSlicePilot->getPOC(); 830 957 958 #if PREVTID0_POC_RESET 959 m_apcSlicePilot->adjustPrevTid0POC(pocAdjustValue); 960 #endif 831 961 // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre 832 962 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); … … 882 1012 // Check for TSA alignment 883 1013 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 884 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_T LA_R1014 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R 885 1015 ) 886 1016 { … … 892 1022 { 893 1023 assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 894 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_T LA_R ); // TSA pictures should be aligned among depenedent layers1024 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R ); // TSA pictures should be aligned among depenedent layers 895 1025 } 896 1026 } … … 924 1054 { 925 1055 #if AVC_BASE 926 if( m_layerId == 1 && m_parameterSetManagerDecoder [0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1056 if( m_layerId == 1 && m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) 927 1057 { 928 1058 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 1059 pBLPic->getSlice(0)->setReferenced(true); 929 1060 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 930 1061 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(); … … 973 1104 #endif 974 1105 1106 #if NO_CLRAS_OUTPUT_FLAG 1107 if (m_layerId == 0 && 1108 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1109 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1110 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1111 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1112 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1113 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1114 { 1115 if (bFirstSliceInSeq) 1116 { 1117 setNoClrasOutputFlag(true); 1118 } 1119 else if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1120 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1121 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP) 1122 { 1123 setNoClrasOutputFlag(true); 1124 } 1125 #if O0149_CROSS_LAYER_BLA_FLAG 1126 else if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP) && 1127 m_apcSlicePilot->getCrossLayerBLAFlag()) 1128 { 1129 setNoClrasOutputFlag(true); 1130 } 1131 #endif 1132 else 1133 { 1134 setNoClrasOutputFlag(false); 1135 } 1136 if (getNoClrasOutputFlag()) 1137 { 1138 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++) 1139 { 1140 m_ppcTDecTop[i]->setLayerInitializedFlag(false); 1141 m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false); 1142 } 1143 } 1144 } 1145 #endif 1146 1147 #if NO_CLRAS_OUTPUT_FLAG 1148 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 1149 #endif 1150 975 1151 // Buffer initialize for prediction. 976 1152 m_cPrediction.initTempBuff(); … … 1143 1319 if (m_layerId == 0) 1144 1320 #endif 1145 #if FIX10711146 1321 pcSlice->setRefPicList( m_cListPic, true ); 1147 #else1148 pcSlice->setRefPicList( m_cListPic );1149 #endif1150 1322 1151 1323 #if SVC_EXTENSION … … 1154 1326 if( m_layerId > 0 && m_uiSliceIdx == 0 ) 1155 1327 { 1328 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1329 if( !pcSlice->getVPS()->getSingleLayerForNonIrapFlag() || ( pcSlice->getVPS()->getSingleLayerForNonIrapFlag() && pcSlice->isIRAP() ) ) 1330 #endif 1156 1331 for( i = 0; i < pcSlice->getNumILRRefIdx(); i++ ) 1157 1332 { 1158 1333 UInt refLayerIdc = i; 1159 1334 #if AVC_BASE 1160 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() ) 1335 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() ) 1336 { 1337 TComPic* pic = *m_ppcTDecTop[0]->getListPic()->begin(); 1338 1339 if( pic ) 1340 { 1341 pcSlice->setBaseColPic ( refLayerIdc, pic ); 1342 } 1343 else 1344 { 1345 continue; 1346 } 1347 #if AVC_SYNTAX 1348 TComPic* pBLPic = pcSlice->getBaseColPic(refLayerIdc); 1349 if( pcSlice->getPOC() == 0 ) 1350 { 1351 // initialize partition order. 1352 UInt* piTmp = &g_auiZscanToRaster[0]; 1353 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp ); 1354 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 ); 1355 } 1356 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice ); 1357 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 1358 #endif 1359 } 1360 else 1361 { 1362 #if VPS_EXTN_DIRECT_REF_LAYERS 1363 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc ); 1364 #else 1365 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 1366 #endif 1367 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 1368 if( !pcSlice->setBaseColPic ( *cListPic, refLayerIdc ) ) 1369 { 1370 continue; 1371 } 1372 } 1373 #else 1374 #if VPS_EXTN_DIRECT_REF_LAYERS 1375 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc ); 1376 #else 1377 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 1378 #endif 1379 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 1380 pcSlice->setBaseColPic ( *cListPic, refLayerIdc ); 1381 #endif 1382 1383 #if O0098_SCALED_REF_LAYER_ID 1384 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1385 #else 1386 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 1387 #endif 1388 1389 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 1390 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 1391 1392 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1393 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 1394 1395 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 1396 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 1397 1398 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 1399 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 1400 1401 #if SVC_UPSAMPLING 1402 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1403 { 1404 /*#if O0098_SCALED_REF_LAYER_ID 1405 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1406 #else 1407 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 1408 #endif*/ 1409 #if O0215_PHASE_ALIGNMENT 1410 #if O0194_JOINT_US_BITSHIFT 1411 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1412 #else 1413 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1414 #endif 1415 #else 1416 #if O0194_JOINT_US_BITSHIFT 1417 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1418 #else 1419 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1420 #endif 1421 #endif 1422 } 1423 else 1424 { 1425 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() ); 1426 } 1427 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1428 #endif 1429 } 1430 } 1431 1432 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1433 { 1434 for( i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1435 { 1436 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1437 #if AVC_BASE 1438 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() ) 1161 1439 { 1162 1440 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); … … 1194 1472 #endif 1195 1473 1196 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);1197 1198 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();1199 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight();1200 1201 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();1202 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset();1203 1204 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL);1205 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);1206 1207 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL;1208 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;1209 1210 #if SVC_UPSAMPLING1211 if( pcPic->isSpatialEnhLayer(refLayerIdc) )1212 {1213 #if O0215_PHASE_ALIGNMENT1214 #if O0194_JOINT_US_BITSHIFT1215 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );1216 #else1217 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );1218 #endif1219 #else1220 #if O0194_JOINT_US_BITSHIFT1221 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );1222 #else1223 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );1224 #endif1225 #endif1226 }1227 else1228 {1229 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() );1230 }1231 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) );1232 #endif1233 }1234 }1235 1236 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )1237 {1238 for( i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )1239 {1240 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);1241 #if AVC_BASE1242 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )1243 {1244 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() );1245 #if AVC_SYNTAX1246 TComPic* pBLPic = pcSlice->getBaseColPic(refLayerIdc);1247 if( pcSlice->getPOC() == 0 )1248 {1249 // initialize partition order.1250 UInt* piTmp = &g_auiZscanToRaster[0];1251 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp );1252 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 );1253 }1254 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice );1255 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES );1256 #endif1257 }1258 else1259 {1260 #if VPS_EXTN_DIRECT_REF_LAYERS1261 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc );1262 #else1263 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );1264 #endif1265 TComList<TComPic*> *cListPic = pcTDecTop->getListPic();1266 pcSlice->setBaseColPic ( *cListPic, refLayerIdc );1267 }1268 #else1269 #if VPS_EXTN_DIRECT_REF_LAYERS1270 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc );1271 #else1272 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );1273 #endif1274 TComList<TComPic*> *cListPic = pcTDecTop->getListPic();1275 pcSlice->setBaseColPic ( *cListPic, refLayerIdc );1276 #endif1277 1278 1474 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1279 1475 } … … 1315 1511 1316 1512 #if N0147_IRAP_ALIGN_FLAG 1317 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 1318 { 1513 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag() ) 1514 { 1515 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1516 if( !pcSlice->getVPS()->getSingleLayerForNonIrapFlag() || ( pcSlice->getVPS()->getSingleLayerForNonIrapFlag() && pcSlice->isIRAP() ) ) 1517 #endif 1319 1518 for(Int dependentLayerIdx = 0; dependentLayerIdx < pcSlice->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++) 1320 1519 { … … 1376 1575 if(pcSlice->getSPS()->getScalingListFlag()) 1377 1576 { 1378 #if IL_SL_SIGNALLING_N03711379 pcSlice->getSPS()->getScalingList()->setLayerId( m_layerId );1380 #endif1381 1382 1577 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1383 1384 1578 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1385 1579 { 1386 #if IL_SL_SIGNALLING_N03711387 pcSlice->getPPS()->getScalingList()->setLayerId( m_layerId );1388 #endif1389 1390 1580 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1391 1581 } 1582 #if SCALINGLIST_INFERRING 1583 if( m_layerId == 0 || ( m_layerId > 0 && !pcSlice->getPPS()->getInferScalingListFlag() && !pcSlice->getSPS()->getInferScalingListFlag() ) ) 1584 #endif 1392 1585 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1393 1586 { 1394 #if IL_SL_SIGNALLING_N03711395 pcSlice->setDefaultScalingList( m_layerId );1396 #else1397 1587 pcSlice->setDefaultScalingList(); 1398 #endif1399 1588 } 1400 1589 m_cTrQuant.setScalingListDec(pcSlice->getScalingList()); … … 1403 1592 else 1404 1593 { 1405 #if IL_SL_SIGNALLING_N03711406 m_cTrQuant.setFlatScalingList( m_layerId );1407 #else1408 1594 m_cTrQuant.setFlatScalingList(); 1409 #endif1410 1595 m_cTrQuant.setUseScalingList(false); 1411 1596 } … … 1425 1610 1426 1611 m_cEntropyDecoder.decodeVPS( vps ); 1427 #if SVC_EXTENSION1428 m_parameterSetManagerDecoder[0].storePrefetchedVPS(vps);1429 #else1430 1612 m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 1431 #endif1432 1613 } 1433 1614 … … 1437 1618 #if SVC_EXTENSION 1438 1619 sps->setLayerId(m_layerId); 1439 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder [0]);1440 m_parameterSetManagerDecoder [m_layerId].storePrefetchedSPS(sps);1620 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder ); 1621 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1441 1622 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1442 1623 if(m_numLayer>0) … … 1455 1636 TComPPS* pps = new TComPPS(); 1456 1637 1457 #if IL_SL_SIGNALLING_N03711458 pps->setLayerId( m_layerId);1638 #if SCALINGLIST_INFERRING 1639 pps->setLayerId( m_layerId ); 1459 1640 #endif 1460 1641 1461 1642 m_cEntropyDecoder.decodePPS( pps ); 1462 #if SVC_EXTENSION1463 m_parameterSetManagerDecoder[m_layerId].storePrefetchedPPS( pps );1464 #else1465 1643 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1466 #endif1467 1644 1468 1645 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 1492 1669 #endif 1493 1670 #if M0043_LAYERS_PRESENT_SEI 1494 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );1495 #else 1496 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveSPS() );1671 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); 1672 #else 1673 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1497 1674 #endif 1498 1675 } … … 1500 1677 { 1501 1678 #if M0043_LAYERS_PRESENT_SEI 1502 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );1503 #else 1504 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveSPS() );1679 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); 1680 #else 1681 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1505 1682 #endif 1506 1683 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); … … 1508 1685 { 1509 1686 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1510 m_parameterSetManagerDecoder [m_layerId].applyPrefetchedPS();1687 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1511 1688 assert(seiAps->activeSeqParamSetId.size()>0); 1512 if (! m_parameterSetManagerDecoder[m_layerId].activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))1689 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParamSetId[0] ) ) 1513 1690 { 1514 1691 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1565 1742 xDecodeVPS(); 1566 1743 #if AVC_BASE 1567 if( m_parameterSetManagerDecoder [0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1744 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) 1568 1745 { 1569 1746 if( !m_ppcTDecTop[0]->getBLReconFile()->good() ) … … 1591 1768 xDecodeSPS(); 1592 1769 #if AVC_BASE 1593 if( m_parameterSetManagerDecoder [0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1770 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) 1594 1771 { 1595 1772 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); … … 1597 1774 { 1598 1775 // using EL SPS with spsId = 1 1599 TComSPS* sps = m_parameterSetManagerDecoder [nalu.m_layerId].getPrefetchedSPS(1);1776 TComSPS* sps = m_parameterSetManagerDecoder.getPrefetchedSPS(1); 1600 1777 Int numReorderPics[MAX_TLAYER]; 1601 1778 Window &conformanceWindow = sps->getConformanceWindow(); … … 1644 1821 case NAL_UNIT_CODED_SLICE_TRAIL_R: 1645 1822 case NAL_UNIT_CODED_SLICE_TRAIL_N: 1646 case NAL_UNIT_CODED_SLICE_T LA_R:1823 case NAL_UNIT_CODED_SLICE_TSA_R: 1647 1824 case NAL_UNIT_CODED_SLICE_TSA_N: 1648 1825 case NAL_UNIT_CODED_SLICE_STSA_R: … … 1664 1841 #endif 1665 1842 break; 1843 1844 case NAL_UNIT_EOS: 1845 m_associatedIRAPType = NAL_UNIT_INVALID; 1846 m_pocCRA = 0; 1847 m_pocRandomAccess = MAX_INT; 1848 m_prevPOC = MAX_INT; 1849 m_bFirstSliceInPicture = true; 1850 m_bFirstSliceInSequence = true; 1851 m_prevSliceSkipped = false; 1852 m_skippedPOC = 0; 1853 return false; 1854 1855 case NAL_UNIT_ACCESS_UNIT_DELIMITER: 1856 // TODO: process AU delimiter 1857 return false; 1858 1859 case NAL_UNIT_EOB: 1860 return false; 1861 1666 1862 default: 1667 assert ( 1);1863 assert (0); 1668 1864 } 1669 1865 … … 1746 1942 TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdc ) 1747 1943 { 1748 TComVPS* vps = m_parameterSetManagerDecoder [0].getActiveVPS();1944 TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS(); 1749 1945 if( vps->getNumDirectRefLayers( m_layerId ) <= 0 ) 1750 1946 { … … 1838 2034 } 1839 2035 #endif 1840 2036 #if OUTPUT_LAYER_SET_INDEX 2037 Void TDecTop::checkValueOfOutputLayerSetIdx(TComVPS *vps) 2038 { 2039 CommonDecoderParams* params = this->getCommonDecoderParams(); 2040 if( params->getValueCheckedFlag() ) 2041 { 2042 return; // Already checked 2043 } 2044 if( params->getOutputLayerSetIdx() == -1 ) // Output layer set index not specified 2045 { 2046 Bool layerSetMatchFound = false; 2047 // Output layer set index not assigned. 2048 // Based on the value of targetLayerId, check if any of the output layer matches 2049 // Currently, the target layer ID in the encoder assumes that all the layers are decoded 2050 // Check if any of the output layer sets match this description 2051 for(Int i = 0; i < vps->getNumOutputLayerSets(); i++) 2052 { 2053 Bool layerSetMatchFlag = true; 2054 Int layerSetIdx = vps->getOutputLayerSetIdx( i ); 2055 if( vps->getNumLayersInIdList( layerSetIdx ) == params->getTargetLayerId() + 1 ) 2056 { 2057 for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++) 2058 { 2059 if( vps->getLayerSetLayerIdList( layerSetIdx, j ) != j ) 2060 { 2061 layerSetMatchFlag = false; 2062 break; 2063 } 2064 } 2065 } 2066 else 2067 { 2068 layerSetMatchFlag = false; 2069 } 2070 2071 if( layerSetMatchFlag ) // Potential output layer set candidate found 2072 { 2073 // If target dec layer ID list is also included - check if they match 2074 if( params->getTargetDecLayerIdSet() ) 2075 { 2076 if( params->getTargetDecLayerIdSet()->size() ) 2077 { 2078 for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++) 2079 { 2080 if( *(params->getTargetDecLayerIdSet()->begin() + j) != vps->getLayerIdInNuh(vps->getLayerSetLayerIdList( layerSetIdx, j ))) 2081 { 2082 layerSetMatchFlag = false; 2083 } 2084 } 2085 } 2086 } 2087 if( layerSetMatchFlag ) // The target dec layer ID list also matches, if present 2088 { 2089 // Match found 2090 layerSetMatchFound = true; 2091 params->setOutputLayerSetIdx( i ); 2092 params->setValueCheckedFlag( true ); 2093 break; 2094 } 2095 } 2096 } 2097 assert( layerSetMatchFound ); // No output layer set matched the value of either targetLayerId or targetdeclayerIdlist 2098 } 2099 else // Output layer set index is assigned - check if the values match 2100 { 2101 // Check if the target decoded layer is the highest layer in the list 2102 Int layerSetIdx = vps->getOutputLayerSetIdx( params->getOutputLayerSetIdx() ); // Index to the layer set 2103 assert( params->getTargetLayerId() == vps->getNumLayersInIdList( layerSetIdx ) - 1); 2104 2105 Bool layerSetMatchFlag = true; 2106 for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++) 2107 { 2108 if( vps->getLayerSetLayerIdList( layerSetIdx, j ) != j ) 2109 { 2110 layerSetMatchFlag = false; 2111 break; 2112 } 2113 } 2114 2115 assert(layerSetMatchFlag); // Signaled output layer set index does not match targetOutputLayerId. 2116 2117 // Check if the targetdeclayerIdlist matches the output layer set 2118 if( params->getTargetDecLayerIdSet() ) 2119 { 2120 if( params->getTargetDecLayerIdSet()->size() ) 2121 { 2122 for(Int i = 0; i < vps->getNumLayersInIdList( layerSetIdx ); i++) 2123 { 2124 assert( *(params->getTargetDecLayerIdSet()->begin() + i) == vps->getLayerIdInNuh(vps->getLayerSetLayerIdList( layerSetIdx, i ))); 2125 } 2126 } 2127 } 2128 params->setValueCheckedFlag( true ); 2129 2130 } 2131 } 2132 #endif 1841 2133 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r494 r540 72 72 73 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 74 #if SVC_EXTENSION75 ParameterSetManagerDecoder m_parameterSetManagerDecoder[MAX_LAYERS]; // storage for parameter sets76 #else77 74 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 78 #endif79 80 75 TComSlice* m_apcSlicePilot; 81 76 … … 134 129 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 135 130 #endif 131 #if OUTPUT_LAYER_SET_INDEX 132 CommonDecoderParams* m_commonDecoderParams; 133 #endif 136 134 #if AVC_SYNTAX || SYNTAX_OUTPUT 137 135 fstream* m_pBLSyntaxFile; 136 #endif 137 138 #if NO_CLRAS_OUTPUT_FLAG 139 Bool m_noClrasOutputFlag; 140 Bool m_layerInitializedFlag; 141 Bool m_firstPicInLayerDecodedFlag; 142 Bool m_noOutputOfPriorPicsFlags; 143 144 Bool m_bRefreshPending; 138 145 #endif 139 146 … … 241 248 #endif 242 249 250 #if NO_CLRAS_OUTPUT_FLAG 251 Int getNoClrasOutputFlag() { return m_noClrasOutputFlag;} 252 Void setNoClrasOutputFlag(Bool x) { m_noClrasOutputFlag = x; } 253 Int getLayerInitializedFlag() { return m_layerInitializedFlag;} 254 Void setLayerInitializedFlag(Bool x) { m_layerInitializedFlag = x; } 255 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 256 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 257 Int getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 258 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 259 #endif 260 public: 261 #if OUTPUT_LAYER_SET_INDEX 262 CommonDecoderParams* getCommonDecoderParams() { return m_commonDecoderParams; } 263 Void setCommonDecoderParams(CommonDecoderParams* x) { m_commonDecoderParams = x; } 264 Void checkValueOfOutputLayerSetIdx(TComVPS *vps); 265 #endif 266 #if SCALINGLIST_INFERRING 267 ParameterSetManagerDecoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; } 268 #endif 243 269 };// END CLASS DEFINITION TDecTop 244 270
Note: See TracChangeset for help on using the changeset viewer.