Changeset 534 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder
- Timestamp:
- 13 Jul 2013, 10:26:41 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp
r532 r534 456 456 { 457 457 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 458 #if H_MV 459 if ( pcSPS->getLayerId() > 0 ) 460 { 461 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 ); 462 } 463 #endif 458 464 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 459 465 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); … … 577 583 UInt uiCode; 578 584 READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); 585 #if H_MV 586 if ( pcSPS->getLayerId() == 0 ) 587 { 588 #endif 579 589 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 580 590 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); … … 584 594 assert( uiCode == 1 ); 585 595 } 586 587 596 parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1); 597 #if H_MV 598 } 599 #endif 588 600 READ_UVLC( uiCode, "sps_seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 589 601 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); … … 743 755 #else 744 756 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false); 757 //// sps_extension_vui_parameters( ) 758 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() ) 759 { 760 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 761 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 762 { 763 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 764 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 765 { 766 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 767 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 768 { 769 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 770 } 771 } 772 } 773 } 774 775 //// sps_extension_vui_parameters( ) END 776 READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" ); 745 777 READ_FLAG( uiCode, "sps_extension2_flag"); 746 778 if ( uiCode ) … … 752 784 } 753 785 #else 786 754 787 UInt uiCamParPrecision = 0; 755 788 Bool bCamParSlice = false; … … 834 867 assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 ); 835 868 #if H_MV 836 assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 ); 837 READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" ); pcVPS->setMaxNuhLayerId( uiCode ); 869 assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 ); 870 READ_CODE( 6, uiCode, "vps_max_layer_id" ); pcVPS->setVpsMaxLayerId( uiCode ); 871 872 READ_UVLC( uiCode, "vps_max_num_layer_sets_minus1" ); pcVPS->setVpsNumLayerSetsMinus1( uiCode ); 873 for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ ) 874 { 875 for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ ) 838 876 #else 839 877 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 840 878 READ_CODE( 6, uiCode, "vps_max_nuh_reserved_zero_layer_id" ); pcVPS->setMaxNuhReservedZeroLayerId( uiCode ); 841 #endif 879 842 880 READ_UVLC( uiCode, "vps_max_op_sets_minus1" ); pcVPS->setMaxOpSets( uiCode + 1 ); 843 881 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ ) 844 882 { 845 883 // Operation point set 846 #if H_MV847 for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )848 #else849 884 for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ ) 850 885 #endif … … 893 928 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false ); 894 929 895 // Parse scalability_mask[i]896 930 for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ ) 897 931 { … … 899 933 } 900 934 901 Int numScalabilityTypes = pcVPS->getNumScalabilityTypes(); 902 903 // Parse dimension_id_len_minus1[j] 904 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ ) 935 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ ) 905 936 { 906 937 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 ); 907 938 } 908 939 909 // vps_nuh_layer_id_present_flag 940 if ( pcVPS->getSplittingFlag() ) 941 { 942 pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLenMinus1() ); 943 } 944 910 945 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false ); 911 946 912 // parse layer_id_in_nuh[i] and derive LayerIdInVps 913 // already updated to JCT3V-D0220 914 for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ ) 915 { 916 UInt layerIdInNuh; 917 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( layer != 0 ) ) 918 { 919 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); layerIdInNuh = uiCode; 947 for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ ) 948 { 949 if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) ) 950 { 951 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); pcVPS->setLayerIdInNuh( i, uiCode ); 920 952 } 921 953 else 922 954 { 923 layerIdInNuh = layer; 924 } 925 926 pcVPS->setLayerIdInNuh( layer, layerIdInNuh ); 927 pcVPS->setLayerIdInVps( layerIdInNuh, layer ); 928 929 // parse dimension_id[i][j] 930 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ ) 931 { 932 READ_CODE( pcVPS->getDimensionIdLen( sIdx ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( layer, sIdx, uiCode ); 933 } 934 } 935 936 for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ ) 937 { 938 READ_FLAG( uiCode, "vps_profile_present_flag[lsIdx]" ); pcVPS->setVpsProfilePresentFlag( layerSet, uiCode == 1 ? true : false ); 939 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false ) 940 { 941 READ_UVLC( uiCode, "profile_layer_set_ref_minus1[lsIdx]" ); pcVPS->setProfileLayerSetRefMinus1( layerSet, uiCode ); 942 } 943 944 parsePTL ( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers()-1); 945 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false ) 946 { 947 TComPTL temp = *pcVPS->getPTL( layerSet ); 948 *pcVPS->getPTL( layerSet ) = *pcVPS->getPTL( pcVPS->getProfileLayerSetRefMinus1( layerSet ) + 1 ); 949 pcVPS->getPTL( layerSet )->copyLevelFrom( &temp ); 950 } 951 } 952 953 READ_UVLC( uiCode, "num_output_layer_sets" ); pcVPS->setNumOutputLayerSets( uiCode ); 955 pcVPS->setLayerIdInNuh( i, i );; 956 } 957 958 pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i ); 954 959 955 for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ ) 956 { 957 READ_UVLC( uiCode, "output_layer_set_idx[i]" ); pcVPS->setOutputLayerSetIdx( layerSet, uiCode ); 958 for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ ) 959 { 960 if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true ) 961 { 962 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false ); 963 } 964 } 965 } 960 for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ ) 961 { 962 if ( !pcVPS->getSplittingFlag() ) 963 { 964 READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( i, j, uiCode ); 965 } 966 else 967 { 968 pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j) ); 969 } 970 } 971 } 972 966 973 967 974 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ ) … … 972 979 } 973 980 } 974 981 982 for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ ) 983 { 984 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); pcVPS->setMaxTidIlRefPicPlus1( i , uiCode ); 985 } 986 987 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); pcVPS->setVpsNumberLayerSetsMinus1 ( uiCode ); 988 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1" ); pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 989 990 for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ ) 991 { 992 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 ); 993 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 994 { 995 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode ); 996 } 997 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1); 998 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 999 { 1000 TComPTL temp = *pcVPS->getPTL( i ); 1001 *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 ); 1002 pcVPS->getPTL( i )->copyLevelFrom( &temp ); 1003 } 1004 } 1005 1006 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 1007 1008 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 ); 1009 1010 if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ) 1011 { 1012 READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1" ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode ); 1013 numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1); 1014 } 1015 1016 if( numOutputLayerSets > 1) 1017 { 1018 READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag( uiCode == 1); 1019 } 1020 1021 for( Int i = 1; i < numOutputLayerSets; i++ ) 1022 { 1023 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) ) 1024 { 1025 READ_UVLC( uiCode, "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode ); 1026 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 1027 { 1028 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 ); 1029 } 1030 } 1031 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 1032 { 1033 READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" ); pcVPS->setProfileLevelTierIdx( i , uiCode ); 1034 } 1035 } 1036 1037 READ_FLAG( uiCode , "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag( uiCode == 1 ); 1038 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); pcVPS->setDirectDepTypeLenMinus2 ( uiCode ); 1039 1040 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ ) 1041 { 1042 for( Int j = 0; j < i; j++ ) 1043 { 1044 if (pcVPS->getDirectDependencyFlag( i, j) ) 1045 { 1046 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode); 1047 } 1048 } 1049 } 1050 1051 READ_FLAG ( uiCode, "vps_shvc_reserved_zero_flag" ); 1052 1053 #if H_3D 975 1054 READ_FLAG( uiCode, "vps_extension2_flag" ); 976 1055 if (uiCode) 977 1056 { 978 #if H_3D979 1057 m_pcBitstream->readOutTrailingBits(); 980 1058 … … 1039 1117 } 1040 1118 READ_FLAG( uiCode, "iv_mv_scaling_flag"); pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 1041 #else1042 while ( xMoreRbspData() )1043 {1044 READ_FLAG( uiCode, "vps_extension2_data_flag");1045 }1046 1119 #endif 1047 1120 } … … 1049 1122 pcVPS->checkVPSExtensionSyntax(); 1050 1123 1051 pcVPS-> calcIvRefLayers();1124 pcVPS->setRefLayers(); 1052 1125 1053 1126 #else … … 1147 1220 if(!rpcSlice->getDependentSliceSegmentFlag()) 1148 1221 { 1222 #if H_MV 1223 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1224 { 1225 READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 ); 1226 } 1227 1228 for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1229 #else 1149 1230 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1231 #endif 1150 1232 { 1151 1233 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored … … 1175 1257 rps->setNumberOfPictures(0); 1176 1258 rpcSlice->setRPS(rps); 1259 #if H_MV 1260 rpcSlice->setEnableTMVPFlag(false); 1261 #endif 1177 1262 } 1178 1263 else … … 1332 1417 } 1333 1418 } 1419 #if H_MV 1420 Int layerIdInVps = rpcSlice->getLayerIdInVps(); 1421 if( rpcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 ) 1422 { 1423 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 ); 1424 if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 ) 1425 { 1426 if( !vps->getMaxOneActiveRefLayerFlag()) 1427 { 1428 READ_CODE( rpcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); rpcSlice->setNumInterLayerRefPicsMinus1( uiCode ); 1429 } 1430 for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ ) 1431 { 1432 READ_CODE( rpcSlice->getInterLayerPredLayerIdcLen( ), uiCode, "inter_layer_pred_layer_idc" ); rpcSlice->setInterLayerPredLayerIdc( i, uiCode ); 1433 } 1434 } 1435 } 1436 1437 rpcSlice->setActiveMotionPredRefLayers( ); 1438 1439 if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0 && rpcSlice->getNumActiveRefLayerPics() > 0 ) 1440 { 1441 READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode == 1 ); 1442 } 1443 1444 #endif 1334 1445 if(sps->getUseSAO()) 1335 1446 { … … 1472 1583 if ( rpcSlice->getEnableTMVPFlag() ) 1473 1584 { 1585 #if H_MV 1586 if( rpcSlice->getLayerId() > 0 && rpcSlice->getNumActiveMotionPredRefLayers() > 0 ) 1587 { 1588 READ_FLAG( uiCode, "alt_collocated_indication_flag" ); rpcSlice->setAltCollocatedIndicationFlag( uiCode == 1 ); 1589 } 1590 1591 if( rpcSlice->getAltCollocatedIndicationFlag() && rpcSlice->getNumActiveMotionPredRefLayers() > 1 ) 1592 { 1593 READ_UVLC( uiCode, "collocated_ref_layer_idx" ); rpcSlice->setCollocatedRefLayerIdx( uiCode ); 1594 } 1595 else 1596 { 1597 #endif 1474 1598 if ( rpcSlice->getSliceType() == B_SLICE ) 1475 1599 { … … 1493 1617 rpcSlice->setColRefIdx(0); 1494 1618 } 1619 #if H_MV 1620 } 1621 #endif 1495 1622 } 1496 1623 if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecTop.cpp
r532 r534 52 52 m_aaiCodedScale = new Int* [ MAX_NUM_LAYERS ]; 53 53 m_aiViewId = new Int [ MAX_NUM_LAYERS ]; 54 #if !H_3D_FIX55 m_aiLayerIdx = new Int [ MAX_NUM_LAYERS ];56 #endif57 54 58 55 m_bViewReceived = new Bool [ MAX_NUM_LAYERS ]; … … 520 517 #if H_MV 521 518 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 519 TComSlice::markCurrPic( pcPic ); 522 520 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc ); 523 521 #endif … … 675 673 676 674 #if H_MV 675 m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer ); 677 676 m_apcSlicePilot->setLayerId( nalu.m_layerId ); 678 677 #endif … … 1036 1035 { 1037 1036 TComSPS* sps = new TComSPS(); 1037 #if H_MV 1038 sps->setLayerId( getLayerId() ); 1039 #endif 1038 1040 #if H_3D 1039 1041 // Preliminary fix. assuming that all sps refer to the same SPS.
Note: See TracChangeset for help on using the changeset viewer.