Changeset 622 in 3DVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 11 Sep 2013, 14:40:25 (12 years ago)
- Location:
- trunk/source/Lib/TLibDecoder
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r608 r622 50 50 xReadCode (length, rValue); 51 51 #if H_MV_ENC_DEC_TRAC 52 if ( g_disableHLSTrace )52 if ( g_disableHLSTrace || !g_HLSTraceEnable ) 53 53 { 54 54 return; … … 71 71 xReadUvlc (rValue); 72 72 #if H_MV_ENC_DEC_TRAC 73 if ( g_disableHLSTrace )73 if ( g_disableHLSTrace || !g_HLSTraceEnable ) 74 74 { 75 75 return; … … 85 85 xReadSvlc(rValue); 86 86 #if H_MV_ENC_DEC_TRAC 87 if ( g_disableHLSTrace )87 if ( g_disableHLSTrace || !g_HLSTraceEnable ) 88 88 { 89 89 return; … … 99 99 xReadFlag(rValue); 100 100 #if H_MV_ENC_DEC_TRAC 101 if ( g_disableHLSTrace )101 if ( g_disableHLSTrace || !g_HLSTraceEnable ) 102 102 { 103 103 return; -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r608 r622 330 330 } 331 331 } 332 #if H_MV5 333 #if H_MV 334 if ( pcPPS->getLayerId() > 0 ) 335 { 336 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 ); 337 } 338 339 if( pcPPS->getPpsInferScalingListFlag( ) ) 340 { 341 READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode ); 342 } 343 else 344 { 345 #endif 346 #endif 332 347 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 333 348 if(pcPPS->getScalingListPresentFlag ()) … … 335 350 parseScalingList( pcPPS->getScalingList() ); 336 351 } 352 #if H_MV5 353 #if H_MV 354 } 355 #endif 356 #endif 337 357 338 358 READ_FLAG( uiCode, "lists_modification_present_flag"); … … 410 430 { 411 431 Window &defDisp = pcVUI->getDefaultDisplayWindow(); 432 #if !H_MV5 412 433 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 413 434 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 414 435 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 415 436 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 437 #else 438 #if H_MV 439 defDisp.setScaledFlag( false ); 440 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode ); 441 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode ); 442 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode ); 443 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode ); 444 #else 445 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 446 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 447 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 448 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 449 #endif 450 #endif 416 451 } 417 452 TimingInfo *timingInfo = pcVUI->getTimingInfo(); … … 436 471 { 437 472 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 473 #if !H_MV5 438 474 #if H_MV 439 475 if ( pcSPS->getLayerId() > 0 ) … … 441 477 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 ); 442 478 } 479 #endif 443 480 #endif 444 481 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); … … 560 597 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 561 598 assert(uiCode <= 15); 599 #if H_MV5 600 #if H_MV 601 if ( pcSPS->getLayerId() > 0 ) 602 { 603 READ_FLAG( uiCode, "update_rep_format_flag" ); pcSPS->setUpdateRepFormatFlag( uiCode == 1 ); 604 } 562 605 606 if ( pcSPS->getUpdateRepFormatFlag() ) 607 { 608 #endif 609 #endif 563 610 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 564 611 assert(uiCode <= 3); … … 572 619 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 573 620 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 621 #if H_MV5 622 #if H_MV 623 } 624 #endif 625 #endif 574 626 READ_FLAG( uiCode, "conformance_window_flag"); 575 627 if (uiCode != 0) 576 628 { 577 629 Window &conf = pcSPS->getConformanceWindow(); 630 #if H_MV5 631 #if H_MV 632 // Needs to be scaled later, when ChromaFormatIdc is known. 633 conf.setScaledFlag( false ); 634 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode ); 635 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode ); 636 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode ); 637 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode ); 638 #else 578 639 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 579 640 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 580 641 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 581 642 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 582 } 583 643 #endif 644 #else 645 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 646 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 647 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 648 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 649 #endif 650 } 651 652 #if H_MV5 653 #if H_MV 654 if ( pcSPS->getUpdateRepFormatFlag() ) 655 { 656 #endif 657 #endif 584 658 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 585 659 assert(uiCode <= 6); … … 591 665 pcSPS->setBitDepthC( uiCode + 8 ); 592 666 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 667 #if H_MV5 668 #if H_MV 669 } 670 #endif 671 #endif 593 672 594 673 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); … … 613 692 pcSPS->setNumReorderPics(uiCode, i); 614 693 #if H_MV 694 #if H_MV5 695 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]"); 696 #else 615 697 READ_UVLC ( uiCode, "sps_max_latency_increase[i]"); 698 #endif 616 699 #else 617 READ_UVLC ( uiCode, "sps_max_latency_increase ");700 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 618 701 #endif 619 702 pcSPS->setMaxLatencyIncrease( uiCode, i ); … … 653 736 if(pcSPS->getScalingListFlag()) 654 737 { 738 #if H_MV5 739 #if H_MV 740 if ( pcSPS->getLayerId() > 0 ) 741 { 742 READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setSpsInferScalingListFlag( uiCode == 1 ); 743 } 744 745 if ( pcSPS->getSpsInferScalingListFlag() ) 746 { 747 READ_CODE( 6, uiCode, "sps_scaling_list_ref_layer_id" ); pcSPS->setSpsScalingListRefLayerId( uiCode ); 748 } 749 else 750 { 751 #endif 752 #endif 655 753 READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" ); pcSPS->setScalingListPresentFlag ( uiCode ); 656 754 if(pcSPS->getScalingListPresentFlag ()) … … 658 756 parseScalingList( pcSPS->getScalingList() ); 659 757 } 758 #if H_MV5 759 #if H_MV 760 } 761 #endif 762 #endif 660 763 } 661 764 READ_FLAG( uiCode, "amp_enabled_flag" ); pcSPS->setUseAMP( uiCode ); … … 711 814 if (uiCode) 712 815 { 816 #if !H_MV5 713 817 #if !H_MV 714 818 while ( xMoreRbspData() ) … … 789 893 } 790 894 } 895 #else 896 #if H_MV 897 parseSPSExtension( pcSPS ); 898 READ_FLAG( uiCode, "sps_extension2_flag"); 899 if ( uiCode ) 900 { 901 #if H_3D 902 parseSPSExtension2( pcSPS, viewIndex, depthFlag ); 903 READ_FLAG( uiCode, "sps_extension3_flag"); 904 if ( uiCode ) 905 { 906 #endif 907 #endif 908 while ( xMoreRbspData() ) 909 { 910 READ_FLAG( uiCode, "sps_extension_data_flag"); 911 } 912 #if H_MV 913 #if H_3D 914 } 915 #endif 916 } 917 #endif 918 } 919 } 920 #endif 921 #if H_MV5 922 Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS ) 923 { 924 UInt uiCode; 925 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false); 926 READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" ); 927 } 928 929 #if H_3D 930 Void TDecCavlc::parseSPSExtension2( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ) 931 { 932 UInt uiCode; 933 #if H_3D_QTLPC 934 //GT: This has to go to VPS 935 if( depthFlag ) 936 { 937 READ_FLAG( uiCode, "use_qtl_flag" ); 938 pcSPS->setUseQTL( uiCode ); 939 READ_FLAG( uiCode, "use_pc_flag" ); 940 pcSPS->setUsePC( uiCode ); 941 } 942 #endif 943 944 UInt uiCamParPrecision = 0; 945 Bool bCamParSlice = false; 946 if ( !depthFlag ) 947 { 948 READ_UVLC( uiCamParPrecision, "cp_precision" ); 949 READ_FLAG( uiCode, "cp_in_slice_header_flag" ); bCamParSlice = ( uiCode == 1 ); 950 if( !bCamParSlice ) 951 { 952 for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ ) 953 { 954 Int iCode; 955 READ_SVLC( iCode, "cp_scale" ); m_aaiTempScale [ uiBaseIndex ][ viewIndex ] = iCode; 956 READ_SVLC( iCode, "cp_off" ); m_aaiTempOffset [ uiBaseIndex ][ viewIndex ] = iCode; 957 READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale [ viewIndex ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ viewIndex ]; 958 READ_SVLC( iCode, "cp_inv_off_plus_off" ); m_aaiTempOffset [ viewIndex ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ viewIndex ]; 959 } 960 } 961 } 962 pcSPS->initCamParaSPS( viewIndex, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset ); 963 } 964 #endif 965 #endif 791 966 792 967 Void TDecCavlc::parseVPS(TComVPS* pcVPS) … … 797 972 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 798 973 #if H_MV 974 #if H_MV5 975 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayersMinus1( uiCode ); 976 #else 799 977 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1 ); 978 #endif 800 979 #else 801 980 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); … … 882 1061 if (uiCode) 883 1062 { 1063 #if !H_MV5 884 1064 #if H_MV 885 1065 m_pcBitstream->readOutTrailingBits(); … … 1099 1279 return; 1100 1280 } 1281 #else 1282 #if H_MV 1283 m_pcBitstream->readOutTrailingBits(); 1284 parseVPSExtension( pcVPS ); 1285 READ_FLAG( uiCode, "vps_extension2_flag" ); 1286 if (uiCode) 1287 { 1288 #if H_3D 1289 m_pcBitstream->readOutTrailingBits(); 1290 parseVPSExtension2( pcVPS ); 1291 READ_FLAG( uiCode, "vps_extension3_flag" ); 1292 if (uiCode) 1293 { 1294 #endif 1295 #endif 1296 while ( xMoreRbspData() ) 1297 { 1298 READ_FLAG( uiCode, "vps_extension_data_flag"); 1299 } 1300 #if H_MV 1301 #if H_3D 1302 } 1303 #endif 1304 } 1305 #endif 1306 } 1307 } 1308 #endif 1309 1310 #if H_MV5 1311 #if H_MV 1312 Void TDecCavlc::parseVPSExtension( TComVPS* pcVPS ) 1313 { 1314 UInt uiCode; 1315 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false ); 1316 READ_CODE( 16, uiCode, "vps_vui_offset" ); pcVPS->setVpsVuiOffset( uiCode ); 1317 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false ); 1318 1319 for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ ) 1320 { 1321 READ_FLAG( uiCode, "scalability_mask_flag[i]" ); pcVPS->setScalabilityMaskFlag( sIdx, uiCode == 1 ? true : false ); 1322 } 1323 1324 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ ) 1325 { 1326 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 ); 1327 } 1328 1329 if ( pcVPS->getSplittingFlag() ) 1330 { 1331 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLenMinus1() ); 1332 } 1333 1334 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false ); 1335 1336 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1337 { 1338 if ( pcVPS->getVpsNuhLayerIdPresentFlag() ) 1339 { 1340 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); pcVPS->setLayerIdInNuh( i, uiCode ); 1341 } 1342 else 1343 { 1344 pcVPS->setLayerIdInNuh( i, i );; 1345 } 1346 1347 pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i ); 1348 1349 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ ) 1350 { 1351 if ( !pcVPS->getSplittingFlag() ) 1352 { 1353 READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( i, j, uiCode ); 1354 } 1355 else 1356 { 1357 pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j) ); 1358 } 1359 } 1360 } 1361 1362 // GT spec says: trac #39 1363 // if ( pcVPS->getNumViews() > 1 ) 1364 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1365 { 1366 READ_CODE( 4, uiCode, "view_id_len_minus1" ); pcVPS->setViewIdLenMinus1( uiCode ); 1367 } 1368 1369 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 1370 { 1371 READ_CODE( pcVPS->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode ); 1372 } 1373 1374 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1375 { 1376 for( Int j = 0; j < i; j++ ) 1377 { 1378 READ_FLAG( uiCode, "direct_dependency_flag[i][j]" ); pcVPS->setDirectDependencyFlag( i, j, uiCode ); 1379 } 1380 } 1381 1382 READ_FLAG( uiCode, "max_tid_ref_present_flag" ); pcVPS->setMaxTidRefPresentFlag( uiCode == 1 ); 1383 1384 if ( pcVPS->getMaxTidRefPresentFlag() ) 1385 { 1386 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1387 { 1388 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); pcVPS->setMaxTidIlRefPicPlus1( i , uiCode ); 1389 } 1390 } 1391 1392 READ_FLAG( uiCode, "all_ref_layers_active_flag" ); pcVPS->setAllRefLayersActiveFlag( uiCode == 1 ); 1393 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); pcVPS->setVpsNumberLayerSetsMinus1 ( uiCode ); 1394 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1" ); pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 1395 1396 for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ ) 1397 { 1398 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 ); 1399 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 1400 { 1401 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode ); 1402 } 1403 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1); 1404 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 1405 { 1406 TComPTL temp = *pcVPS->getPTL( i ); 1407 *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 ); 1408 pcVPS->getPTL( i )->copyLevelFrom( &temp ); 1409 } 1410 } 1411 1412 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 1413 1414 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 ); 1415 1416 if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ) 1417 { 1418 READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1" ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode ); 1419 numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1); 1420 } 1421 1422 if( numOutputLayerSets > 1) 1423 { 1424 READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag( uiCode == 1); 1425 } 1426 1427 for( Int i = 1; i < numOutputLayerSets; i++ ) 1428 { 1429 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) ) 1430 { 1431 READ_UVLC( uiCode, "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode ); 1432 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 1433 { 1434 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 ); 1435 } 1436 } 1437 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 1438 { 1439 READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" ); pcVPS->setProfileLevelTierIdx( i , uiCode ); 1440 } 1441 } 1442 1443 READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 ); 1444 if ( pcVPS->getRepFormatIdxPresentFlag() ) 1445 { 1446 READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode ); 1447 } 1448 1449 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 1450 { 1451 assert( pcVPS->getRepFormat(i) == NULL ); 1452 TComRepFormat* repFormat = new TComRepFormat(); 1453 parseRepFormat( repFormat ); 1454 pcVPS->setRepFormat(i, repFormat ); 1455 } 1456 1457 if( pcVPS->getRepFormatIdxPresentFlag() ) 1458 { 1459 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1460 { 1461 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 1462 { 1463 READ_CODE( 4, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode ); 1464 } 1465 } 1466 } 1467 1468 READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 ); 1469 READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPS->setCrossLayerIrapAlignedFlag( uiCode == 1 ); 1470 READ_UVLC( uiCode, "direct_dep_type_len_minus2") ; pcVPS->setDirectDepTypeLenMinus2 ( uiCode ); 1471 1472 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1473 { 1474 for( Int j = 0; j < i; j++ ) 1475 { 1476 if (pcVPS->getDirectDependencyFlag( i, j) ) 1477 { 1478 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode); 1479 } 1480 } 1481 } 1482 1483 READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" ); 1484 READ_FLAG( uiCode, "vps_vui_present_flag" ) ; pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); 1485 1486 if( pcVPS->getVpsVuiPresentFlag() ) 1487 { 1488 m_pcBitstream->readOutTrailingBits(); // vps_vui_alignment_bit_equal_to_one 1489 parseVPSVUI( pcVPS ); 1490 } 1491 1492 pcVPS->checkVPSExtensionSyntax(); 1493 pcVPS->setRefLayers(); 1494 } 1495 1496 Void TDecCavlc::parseRepFormat( TComRepFormat* pcRepFormat ) 1497 { 1498 assert( pcRepFormat ); 1499 1500 UInt uiCode; 1501 READ_CODE( 2, uiCode, "chroma_format_vps_idc" ); pcRepFormat->setChromaFormatVpsIdc ( uiCode ); 1502 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 1503 { 1504 READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 ); 1505 } 1506 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1507 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode ); 1508 READ_CODE( 4, uiCode, "bit_depth_vps_luma_minus8" ); pcRepFormat->setBitDepthVpsLumaMinus8 ( uiCode ); 1509 READ_CODE( 4, uiCode, "bit_depth_vps_chroma_minus8" ); pcRepFormat->setBitDepthVpsChromaMinus8 ( uiCode ); 1510 } 1511 1512 1513 Void TDecCavlc::parseVPSVUI( TComVPS* pcVPS ) 1514 { 1515 assert( pcVPS ); 1516 1517 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1518 1519 assert( pcVPSVUI ); 1520 1521 UInt uiCode; 1522 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 ); 1523 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 ); 1524 if( pcVPSVUI->getBitRatePresentVpsFlag( ) || pcVPSVUI->getPicRatePresentVpsFlag( ) ) 1525 { 1526 for( Int i = 0; i <= pcVPS->getVpsNumberLayerSetsMinus1(); i++ ) 1527 { 1528 for( Int j = 0; j <= pcVPS->getMaxTLayers(); j++ ) 1529 { 1530 if( pcVPSVUI->getBitRatePresentVpsFlag( ) ) 1531 { 1532 READ_FLAG( uiCode, "bit_rate_present_flag" ); pcVPSVUI->setBitRatePresentFlag( i, j, uiCode == 1 ); 1533 } 1534 if( pcVPSVUI->getPicRatePresentVpsFlag( ) ) 1535 { 1536 READ_FLAG( uiCode, "pic_rate_present_flag" ); pcVPSVUI->setPicRatePresentFlag( i, j, uiCode == 1 ); 1537 } 1538 if( pcVPSVUI->getBitRatePresentFlag( i, j ) ) 1539 { 1540 READ_CODE( 16, uiCode, "avg_bit_rate" ); pcVPSVUI->setAvgBitRate( i, j, uiCode ); 1541 READ_CODE( 16, uiCode, "max_bit_rate" ); pcVPSVUI->setMaxBitRate( i, j, uiCode ); 1542 } 1543 if( pcVPSVUI->getPicRatePresentFlag( i, j ) ) 1544 { 1545 READ_CODE( 2, uiCode, "constant_pic_rate_idc" ); pcVPSVUI->setConstantPicRateIdc( i, j, uiCode ); 1546 READ_CODE( 16, uiCode, "avg_pic_rate" ); pcVPSVUI->setAvgPicRate( i, j, uiCode ); 1547 } 1548 } 1549 } 1550 } 1551 1552 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1553 { 1554 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ ) 1555 { 1556 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVPSVUI->setTileBoundariesAlignedFlag( i, j, uiCode == 1 ); 1557 } 1558 } 1559 1560 READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 ); 1561 1562 if( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ) 1563 { 1564 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1565 { 1566 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ ) 1567 { 1568 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1569 if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 ) 1570 { 1571 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag" ); pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, uiCode == 1 ); 1572 if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ) 1573 { 1574 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1" ); pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, uiCode ); 1575 } 1576 } 1577 } 1578 } 1579 } 1580 } 1581 #endif 1582 1583 #if H_3D 1584 Void TDecCavlc::parseVPSExtension2( TComVPS* pcVPS ) 1585 { 1586 UInt uiCode; 1587 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1588 { 1589 #if H_3D_ARP 1590 pcVPS->setUseAdvRP ( i, 0 ); 1591 pcVPS->setARPStepNum( i, 1 ); 1592 #endif 1593 if ( i != 0 ) 1594 { 1595 if( !( pcVPS->getDepthId( i ) == 1 ) ) 1596 { 1597 #if H_3D_IV_MERGE 1598 READ_FLAG( uiCode, "iv_mv_pred_flag[i]"); pcVPS->setIvMvPredFlag ( i, uiCode == 1 ? true : false ); 1599 #endif 1600 #if H_3D_ARP 1601 READ_FLAG( uiCode, "iv_res_pred_flag[i]" ); pcVPS->setUseAdvRP ( i, uiCode ); pcVPS->setARPStepNum( i, uiCode ? H_3D_ARP_WFNR : 1 ); 1602 1603 #endif 1604 #if H_3D_NBDV_REF 1605 READ_FLAG( uiCode, "depth_refinement_flag[i]"); pcVPS->setDepthRefinementFlag ( i, uiCode == 1 ? true : false ); 1606 #endif 1607 #if H_3D_VSP 1608 READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false ); 1609 #endif 1610 } 1611 else 1612 { 1613 1614 READ_FLAG( uiCode, "vps_depth_modes_flag[i]" ); pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false ); 1615 // READ_FLAG( uiCode, "lim_qt_pred_flag[i]"); pcVPS->setLimQtPreFlag ( i, uiCode == 1 ? true : false ); 1616 #if H_3D_DIM_DLT 1617 if( pcVPS->getVpsDepthModesFlag( i ) ) 1618 { 1619 READ_FLAG( uiCode, "dlt_flag[i]" ); pcVPS->setUseDLTFlag( i, uiCode == 1 ? true : false ); 1620 } 1621 if( pcVPS->getUseDLTFlag( i ) ) 1622 { 1623 // decode mapping 1624 UInt uiNumDepthValues; 1625 // parse number of values in DLT 1626 READ_UVLC(uiNumDepthValues, "num_depth_values_in_dlt[i]"); 1627 1628 // parse actual DLT values 1629 Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int)); 1630 for(Int d=0; d<uiNumDepthValues; d++) 1631 { 1632 READ_UVLC(uiCode, "dlt_depth_value[i][d]"); 1633 aiIdx2DepthValue[d] = (Int)uiCode; 1634 } 1635 1636 pcVPS->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues); 1637 1638 // clean memory 1639 free(aiIdx2DepthValue); 1640 } 1641 #endif 1642 #if LGE_INTER_SDC_E0156 1643 READ_FLAG( uiCode, "depth_inter_SDC_flag" ); pcVPS->setInterSDCFlag( i, uiCode ? true : false ); 1644 #endif 1645 } 1646 } 1647 } 1648 READ_FLAG( uiCode, "iv_mv_scaling_flag"); pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 1649 } 1650 #endif 1651 #endif 1101 1652 1102 1653 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) … … 1129 1680 #if H_MV 1130 1681 vps = parameterSetManager->getPrefetchedVPS(sps->getVPSId()); 1682 #if H_MV5 1683 assert( vps != NULL ); 1684 1685 sps->inferRepFormat ( vps , rpcSlice->getLayerId() ); 1686 sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); 1687 1688 rpcSlice->setVPS(vps); 1689 rpcSlice->setViewId ( vps->getViewId ( rpcSlice->getLayerId() ) ); 1690 rpcSlice->setViewIndex( vps->getViewIndex( rpcSlice->getLayerId() ) ); 1691 #if H_3D 1692 rpcSlice->setIsDepth ( vps->getDepthId ( rpcSlice->getLayerId() ) == 1 ); 1693 #endif 1694 #else 1131 1695 assert(vps!=0); 1132 1696 rpcSlice->setVPS(vps); … … 1137 1701 #endif 1138 1702 #endif 1703 #endif 1139 1704 rpcSlice->setSPS(sps); 1140 1705 rpcSlice->setPPS(pps); … … 1182 1747 { 1183 1748 #if H_MV 1749 #if H_MV5 1750 Int esb = 0; //Don't use i, otherwise will shadow something below 1751 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1752 { 1753 esb++; 1754 READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 ); 1755 } 1756 1757 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1758 { 1759 esb++; 1760 READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 ); 1761 } 1762 1763 for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) 1764 #else 1184 1765 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1185 1766 { … … 1188 1769 1189 1770 for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1771 #endif 1190 1772 #else 1191 1773 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) … … 1251 1833 } 1252 1834 rpcSlice->setPOC (iPOCmsb+iPOClsb); 1253 1835 #if H_MV5 1836 #if H_MV 1837 if ( rpcSlice->getPocResetFlag() ) 1838 { 1839 rpcSlice->setPocBeforeReset ( rpcSlice->getPOC() ); 1840 rpcSlice->setPOC ( 0 ); 1841 1842 } 1843 #endif 1844 #endif 1254 1845 TComReferencePictureSet* rps; 1255 1846 rps = rpcSlice->getLocalRPS(); … … 1379 1970 } 1380 1971 #if H_MV 1972 #if H_MV5 1973 Int layerId = rpcSlice->getLayerId(); 1974 if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) { 1975 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 ); 1976 if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 ) 1977 { 1978 if( !vps->getMaxOneActiveRefLayerFlag()) 1979 { 1980 READ_CODE( rpcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); rpcSlice->setNumInterLayerRefPicsMinus1( uiCode ); 1981 } 1982 if ( rpcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1983 { 1984 for( Int idx = 0; idx < rpcSlice->getNumActiveRefLayerPics(); idx++ ) 1985 { 1986 READ_CODE( rpcSlice->getInterLayerPredLayerIdcLen( ), uiCode, "inter_layer_pred_layer_idc" ); rpcSlice->setInterLayerPredLayerIdc( idx, uiCode ); 1987 } 1988 } 1989 } 1990 } 1991 #else 1381 1992 Int layerIdInVps = rpcSlice->getLayerIdInVps(); 1382 1993 if( rpcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 ) … … 1402 2013 READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode == 1 ); 1403 2014 } 1404 2015 #endif 1405 2016 #endif 1406 2017 if(sps->getUseSAO()) … … 1544 2155 if ( rpcSlice->getEnableTMVPFlag() ) 1545 2156 { 2157 #if !H_MV5 1546 2158 #if H_MV 1547 2159 if( rpcSlice->getLayerId() > 0 && rpcSlice->getNumActiveMotionPredRefLayers() > 0 ) … … 1557 2169 { 1558 2170 #endif 2171 #endif 1559 2172 if ( rpcSlice->getSliceType() == B_SLICE ) 1560 2173 { … … 1578 2191 rpcSlice->setColRefIdx(0); 1579 2192 } 1580 #if H_MV 1581 } 2193 #if !H_MV5 2194 #if H_MV 2195 } 2196 #endif 1582 2197 #endif 1583 2198 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r608 r622 76 76 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 77 77 Void parseVPS ( TComVPS* pcVPS ); 78 #if H_MV5 79 #if H_MV 80 Void parseVPSExtension ( TComVPS* pcVPS ); 81 Void parseRepFormat ( TComRepFormat* pcRepFormat ); 82 Void parseVPSVUI ( TComVPS* pcVPS ); 83 #endif 84 85 #if H_MV 86 Void parseSPSExtension ( TComSPS* pcSPS ); 87 #endif 88 #endif 78 89 #if H_3D 90 #if H_MV5 91 Void parseVPSExtension2 ( TComVPS* pcVPS ); 92 Void parseSPSExtension2 ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); 93 #endif 79 94 Void parseSPS ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); 80 95 #else -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r608 r622 315 315 #if H_3D_NBDV_REF 316 316 if(pcCU->getSlice()->getVPS()->getDepthRefinementFlag( pcCU->getSlice()->getLayerIdInVps() )) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done. 317 { 317 318 DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo, true); 319 } 318 320 else 319 321 #endif 322 { 320 323 DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo); 324 } 325 326 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 327 if ( g_decTraceDispDer ) 328 { 329 DTRACE_CU( "RefViewIdx", DvInfo.m_aVIdxCan ); 330 DTRACE_CU( "MvDisp[x]", DvInfo.m_acNBDV.getHor() ); 331 DTRACE_CU( "MvDisp[y]", DvInfo.m_acNBDV.getVer() ); 332 DTRACE_CU( "MvRefinedDisp[x]", DvInfo.m_acDoNBDV.getHor() ); 333 DTRACE_CU( "MvRefinedDisp[y]", DvInfo.m_acDoNBDV.getVer() ); 334 } 335 #endif 321 336 322 337 pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth); … … 366 381 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 367 382 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 368 #if MTK_VSP_FIX_ALIGN_WD_E0172369 383 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 370 384 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex ); 371 #else372 #if MTK_VSP_FIX_E0172373 Int vspDir[MRG_MAX_NUM_CANDS_MEM];374 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);375 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand, uiMergeIndex );376 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );377 #else378 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex );379 #endif380 #endif// end of MTK_VSP_FIX_ALIGN_WD_E0172381 385 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 382 386 #else 383 387 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 384 388 #endif 385 #if MTK_VSP_FIX_ALIGN_WD_E0172389 #if H_3D_VSP 386 390 if(vspFlag[uiMergeIndex]) 387 391 { … … 400 404 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 401 405 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 406 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 407 if ( g_decTraceMvFromMerge ) 408 { 409 if ( uiRefListIdx == 0 ) 410 { 411 DTRACE_PU( "mvL0[0]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getHor()); 412 DTRACE_PU( "mvL0[1]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getVer()); 413 DTRACE_PU( "refIdxL0 ", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx()); 414 } 415 else 416 { 417 DTRACE_PU( "mvL1[0]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getHor()); 418 DTRACE_PU( "mvL1[1]", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getVer()); 419 DTRACE_PU( "refIdxL1", cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx()); 420 } 421 } 422 #endif 402 423 } 403 424 } -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r608 r622 243 243 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 244 244 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 245 #if MTK_VSP_FIX_ALIGN_WD_E0172246 245 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 247 246 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 248 #else249 #if MTK_VSP_FIX_E0172250 Int vspDir[MRG_MAX_NUM_CANDS_MEM];251 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);252 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir, numValidMergeCand );253 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );254 #else255 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand );256 #endif257 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172258 247 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 259 #if MTK_VSP_FIX_ALIGN_WD_E0172 248 260 249 if(vspFlag[uiMergeIndex]) 261 250 { 262 251 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth); 263 252 } 264 #endif265 253 #else 266 254 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); … … 272 260 else 273 261 { 274 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); // Redundant line262 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 275 263 #if H_3D_VSP 276 264 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 277 265 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 278 #if MTK_VSP_FIX_ALIGN_WD_E0172279 266 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 280 267 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex ); 281 #else282 #if MTK_VSP_FIX_E0172283 Int vspDir[MRG_MAX_NUM_CANDS_MEM];284 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);285 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir,numValidMergeCand, uiMergeIndex );286 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );287 #else288 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex );289 #endif290 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172291 268 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 292 #if MTK_VSP_FIX_ALIGN_WD_E0172293 269 if(vspFlag[uiMergeIndex]) 294 270 { 295 271 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth); 296 272 } 297 #endif298 273 #else 299 274 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); … … 327 302 } 328 303 } 329 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172304 #if H_3D_VSP 330 305 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false)) 331 306 #else -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r608 r622 89 89 #if H_3D_DIM_DMM 90 90 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #if !SEC_DMM2_E0146 91 #if !SEC_DMM2_E0146_HHIFIX 92 92 , m_cDmm2DataSCModel ( 1, 1, NUM_DMM2_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 93 93 #endif … … 179 179 #if H_3D_DIM_DMM 180 180 m_cDmm1DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM1_DATA ); 181 #if !SEC_DMM2_E0146 181 #if !SEC_DMM2_E0146_HHIFIX 182 182 m_cDmm2DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM2_DATA ); 183 183 #endif … … 255 255 #if H_3D_DIM_DMM 256 256 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 257 #if !SEC_DMM2_E0146 257 #if !SEC_DMM2_E0146_HHIFIX 258 258 m_cDmm2DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA ); 259 259 #endif … … 444 444 ruiTabIdx = uiIdx; 445 445 } 446 #if !SEC_DMM2_E0146 446 #if !SEC_DMM2_E0146_HHIFIX 447 447 Void TDecSbac::xParseDmm2Offset( Int& riOffset ) 448 448 { … … 584 584 m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) ); 585 585 586 #if H_MV_ENC_DEC_TRAC 587 DTRACE_CU("sdc_residual_flag[i]", uiResidual) 588 #endif 589 586 590 if (uiResidual) 587 591 { 588 592 // decode residual sign bit 589 593 m_pcTDecBinIf->decodeBinEP(uiSign); 594 #if H_MV_ENC_DEC_TRAC 595 DTRACE_CU("sdc_residual_sign_flag[i]", uiSign) 596 #endif 590 597 591 598 // decode residual magnitude … … 617 624 } 618 625 else 626 { 619 627 uiAbsIdx = uiCount; 628 } 629 630 #if H_MV_ENC_DEC_TRAC 631 DTRACE_CU("sdc_residual_abs_minus1[i]", uiAbsIdx) 632 #endif 620 633 621 634 uiAbsIdx += 1; … … 1162 1175 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth ); 1163 1176 } break; 1164 #if !SEC_DMM2_E0146 1177 #if !SEC_DMM2_E0146_HHIFIX 1165 1178 case( DMM2_IDX ): 1166 1179 { … … 1333 1346 binNum = 0; 1334 1347 #if LGE_SDC_REMOVE_DC_E0158 1335 #if !SEC_DMM2_E0146 1348 #if !SEC_DMM2_E0146_HHIFIX 1336 1349 while( symbol && binNum < 2 ) 1337 1350 #endif 1338 1351 #else 1339 #if SEC_DMM2_E0146 1352 #if SEC_DMM2_E0146_HHIFIX 1340 1353 while( symbol && binNum < 2 ) 1341 1354 #else … … 1358 1371 else if( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1359 1372 #if LGE_SDC_REMOVE_DC_E0158 1360 #if SEC_DMM2_E0146 1373 #if SEC_DMM2_E0146_HHIFIX 1361 1374 else if( modeCode == 7 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1362 1375 #else … … 1366 1379 #else 1367 1380 else if( modeCode == 14 ) { dir = DC_IDX; sdcFlag = 1;} 1368 #if SEC_DMM2_E0146 1381 #if SEC_DMM2_E0146_HHIFIX 1369 1382 else if( modeCode == 15 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1370 1383 #else -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r608 r622 102 102 #if H_3D_DIM_DMM 103 103 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 104 #if !SEC_DMM2_E0146 104 #if !SEC_DMM2_E0146_HHIFIX 105 105 Void xParseDmm2Offset ( Int& riOffset ); 106 106 #endif … … 216 216 #if H_3D_DIM_DMM 217 217 ContextModel3DBuffer m_cDmm1DataSCModel; 218 #if !SEC_DMM2_E0146 218 #if !SEC_DMM2_E0146_HHIFIX 219 219 ContextModel3DBuffer m_cDmm2DataSCModel; 220 220 #endif -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r608 r622 436 436 Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window(); 437 437 438 #if H_MV5 439 #if H_MV 440 assert( conformanceWindow .getScaledFlag() ); 441 assert( defaultDisplayWindow.getScaledFlag() ); 442 #endif 443 #endif 438 444 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 439 445 { … … 512 518 m_cCuDecoder.destroy(); 513 519 #if H_MV 520 #if H_MV5 521 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 522 #else 514 523 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 524 #endif 515 525 TComSlice::markCurrPic( pcPic ); 516 526 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc ); … … 581 591 assert (sps != 0); 582 592 593 #if H_MV5 594 #if H_MV 595 TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId()); 596 assert (vps != 0); 597 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) ) 598 #else 583 599 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 600 #endif 601 #else 602 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 603 #endif 584 604 { 585 605 printf ("Parameter set activation failed!"); … … 607 627 m_apcSlicePilot->setSPS(sps); 608 628 #if H_MV 629 #if H_MV5 630 m_apcSlicePilot->setVPS(vps); 631 sps->inferRepFormat ( vps , m_layerId ); 632 sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); 633 #else 609 634 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getActiveVPS() ); 635 #endif 610 636 #endif 611 637 pps->setSPS(sps); … … 669 695 670 696 #if H_MV 697 #if H_MV5 698 m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 699 #else 671 700 m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer ); 701 #endif 672 702 m_apcSlicePilot->setLayerId( nalu.m_layerId ); 673 703 #endif … … 676 706 #if H_MV 677 707 TComVPS* vps = m_apcSlicePilot->getVPS(); 708 #if H_MV5 709 Int layerId = nalu.m_layerId; 710 setViewId ( vps->getViewId ( layerId ) ); 711 #if H_3D 712 setViewIndex( vps->getViewIndex( layerId ) ); 713 setIsDepth ( vps->getDepthId ( layerId ) == 1 ); 714 m_ivPicLists->setVPS( vps ); 715 #endif 716 #else 678 717 Int layerIdInVps = vps->getLayerIdInVps( nalu.m_layerId ); 679 718 setViewId ( vps->getViewId ( layerIdInVps ) ); … … 684 723 #endif 685 724 #endif 725 #endif 686 726 // Skip pictures due to random access 687 727 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 723 763 #endif 724 764 // actual decoding starts here 765 #if H_MV5 766 #if H_MV 767 // This part needs further testing ! 768 if ( m_apcSlicePilot->getPocResetFlag() ) 769 { 770 xResetPocInPicBuffer(); 771 } 772 #endif 773 #endif 725 774 xActivateParameterSets(); 726 775 … … 742 791 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 743 792 #if H_MV 793 #if H_MV5 794 m_apcSlicePilot->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 795 #else 744 796 m_apcSlicePilot->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer ); 797 #endif 745 798 #endif 746 799 // Get a new picture buffer … … 888 941 // Set reference list 889 942 #if H_MV 943 #if H_MV5 944 std::vector< TComPic* > tempRefPicLists[2]; 945 std::vector< Bool > usedAsLongTerm [2]; 946 Int numPocTotalCurr; 947 948 pcSlice->getTempRefPicLists( m_cListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr); 949 pcSlice->setRefPicList ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 950 #else 890 951 pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true ); 952 #endif 891 953 #if H_3D_ARP 892 954 pcSlice->setARPStepNum(); 893 955 if( pcSlice->getARPStepNum() > 1 ) 894 956 { 957 // GT: This seems to be broken, not all nuh_layer_ids are necessarily present 895 958 for(Int iLayerId = 0; iLayerId < nalu.m_layerId; iLayerId ++ ) 896 959 { … … 1021 1084 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1022 1085 assert( vps != 0 ); 1086 #if H_MV5 1087 m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) ); 1088 #else 1023 1089 Int layerIdInVPS = vps->getLayerIdInVps( m_layerId ); 1024 1090 m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( layerIdInVPS ), ( vps->getDepthId( layerIdInVPS ) == 1 ) ); 1091 #endif 1025 1092 #else 1026 1093 m_cEntropyDecoder.decodeSPS( sps ); … … 1032 1099 { 1033 1100 TComPPS* pps = new TComPPS(); 1101 #if H_MV5 1102 #if H_MV 1103 pps->setLayerId( getLayerId() ); 1104 #endif 1105 #endif 1034 1106 m_cEntropyDecoder.decodePPS( pps ); 1035 1107 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); … … 1040 1112 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1041 1113 { 1114 #if H_MV5 1115 #if H_MV 1116 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) ); 1117 #else 1042 1118 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1119 #endif 1120 #else 1121 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1122 #endif 1043 1123 } 1044 1124 else 1045 1125 { 1126 #if H_MV5 1127 #if H_MV 1128 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) ); 1129 #else 1046 1130 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1131 #endif 1132 #else 1133 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1134 #endif 1047 1135 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); 1048 1136 if (activeParamSets.size()>0) … … 1051 1139 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1052 1140 assert(seiAps->activeSeqParamSetId.size()>0); 1141 #if H_MV5 1142 #if H_MV 1143 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId )) 1144 #else 1053 1145 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] )) 1146 #endif 1147 #else 1148 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] )) 1149 #endif 1054 1150 { 1055 1151 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1210 1306 } 1211 1307 1308 #if H_MV5 1309 Void TDecTop::xResetPocInPicBuffer() 1310 { 1311 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1312 while (iterPic != m_cListPic.end()) 1313 { 1314 TComPic* pic = *(iterPic++); 1315 if ( pic->getReconMark() ) 1316 { 1317 for( Int i = 0; i < pic->getNumAllocatedSlice(); i++) 1318 { 1319 TComSlice* slice = pic->getSlice( i ); 1320 slice->setPOC ( slice->getPOC() - m_apcSlicePilot->getPocBeforeReset() ); 1321 } 1322 } 1323 } 1324 } 1325 #endif 1212 1326 #endif 1213 1327 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r608 r622 216 216 Int m_viewId; 217 217 TComPicLists* m_ivPicLists; 218 #if H_MV5 219 std::vector<TComPic*> m_refPicSetInterLayer0; 220 std::vector<TComPic*> m_refPicSetInterLayer1; 221 #else 218 222 std::vector<TComPic*> m_refPicSetInterLayer; 223 #endif 219 224 #if H_3D 220 225 Int m_viewIndex; … … 274 279 TComPic* xGetPic( Int layerId, Int poc ); 275 280 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 281 #if H_MV5 282 Void xResetPocInPicBuffer(); 283 #endif 276 284 #else 277 285 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
Note: See TracChangeset for help on using the changeset viewer.