Changeset 730 in 3DVCSoftware for branches/HTM-9.0-dev0/source/Lib/TLibEncoder
- Timestamp:
- 9 Dec 2013, 17:16:03 (11 years ago)
- Location:
- branches/HTM-9.0-dev0/source/Lib/TLibEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r724 r730 280 280 } 281 281 WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(), "video_signal_type_present_flag"); 282 #if H_MV_6_PS_O0118_33 283 assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() ); 284 #endif 282 285 if (pcVUI->getVideoSignalTypePresentFlag()) 283 286 { … … 443 446 { 444 447 WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" ); 448 #if H_MV_6_PS_REP_FORM_18_19_20 449 if ( pcSPS->getUpdateRepFormatFlag() ) 450 { 451 WRITE_CODE( pcSPS->getSpsRepFormatIdx( ), 8, "sps_rep_format_idx" ); 452 } 453 } 454 else 455 { 456 #else 445 457 } 446 458 447 459 if ( pcSPS->getUpdateRepFormatFlag() ) 448 460 { 461 #endif 449 462 #endif 450 463 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); … … 472 485 } 473 486 #if H_MV 487 #if H_MV_6_PS_REP_FORM_18_19_20 488 if ( pcSPS->getLayerId() == 0 ) 489 #else 474 490 if ( pcSPS->getUpdateRepFormatFlag() ) 491 #endif 475 492 { 476 493 #endif … … 577 594 WRITE_FLAG( 0, "sps_extension_flag" ); 578 595 #else 596 #if H_MV_6_PSEM_O0142_3 597 WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" ); 598 599 if ( pcSPS->getSpsExtensionFlag() ) 600 { 601 for (Int i = 0; i < PS_EX_T_MAX_NUM; i++) 602 { 603 WRITE_FLAG( pcSPS->getSpsExtensionTypeFlag( i ) ? 1 : 0 , "sps_extension_type_flag" ); 604 #if H_3D 605 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D ); 606 #else 607 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV ); 608 #endif 609 } 610 611 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV )) 612 { 613 codeSPSExtension( pcSPS ); 614 } 615 616 #if H_3D 617 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D )) 618 { 619 codeSPSExtension2( pcSPS, viewIndex, depthFlag ); 620 } 621 #endif 622 } 623 #else 579 624 WRITE_FLAG( 1, "sps_extension_flag" ); 580 625 codeSPSExtension( pcSPS ); … … 587 632 #endif 588 633 #endif 634 #endif 589 635 } 590 636 … … 593 639 { 594 640 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" ); 641 642 #if !H_MV_6_SHVC_O0098_36 595 643 WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" ); 644 #else 645 WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" ); 646 647 for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++) 648 { 649 WRITE_CODE( pcSPS->getScaledRefLayerId( i ), 6, "scaled_ref_layer_id" ); 650 651 Int j = pcSPS->getScaledRefLayerId( i ); 652 653 WRITE_SVLC( pcSPS->getScaledRefLayerLeftOffset( j ), "scaled_ref_layer_left_offset" ); 654 WRITE_SVLC( pcSPS->getScaledRefLayerTopOffset( j ), "scaled_ref_layer_top_offset" ); 655 WRITE_SVLC( pcSPS->getScaledRefLayerRightOffset( j ), "scaled_ref_layer_right_offset" ); 656 WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" ); 657 } 658 #endif 596 659 } 597 660 #endif … … 740 803 { 741 804 WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0, "avc_base_layer_flag" ); 805 #if H_MV_6_PS_O0109_24 806 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" ); 807 if ( pcVPS->getVpsVuiPresentFlag() ) 808 { 809 #endif 742 810 WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16, "vps_vui_offset" ); // TBD 811 #if H_MV_6_PS_O0109_24 812 } 813 #endif 743 814 WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0, "splitting_flag" ); 744 815 … … 786 857 } 787 858 859 860 #if H_MV_6_PS_O0109_22 861 WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" ); 862 863 if ( pcVPS->getViewIdLen( ) > 0 ) 864 { 865 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 866 { 867 WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" ); 868 } 869 } 870 else 871 { 872 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 873 { 874 assert( pcVPS->getViewIdVal( i ) == 0 ); 875 } 876 } 877 #else 788 878 // GT spec says: trac #39 789 879 // if ( pcVPS->getNumViews() > 1 ) … … 792 882 WRITE_CODE( pcVPS->getViewIdLenMinus1( ), 4, "view_id_len_minus1" ); 793 883 } 794 795 884 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 796 885 { 797 886 WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" ); 798 887 } 888 #endif 889 799 890 800 891 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 805 896 } 806 897 } 807 898 #if H_MV_6_ILDSD_O0120_26 899 WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" ); 900 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 901 { 902 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 903 { 904 WRITE_CODE( pcVPS->getSubLayersVpsMaxMinus1( i ), 3, "sub_layers_vps_max_minus1" ); 905 pcVPS->checkSubLayersVpsMaxMinus1( i ); 906 } 907 } 908 else 909 { 910 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 911 { 912 assert( pcVPS->getSubLayersVpsMaxMinus1( i ) + 1 == pcVPS->getMaxTLayers( ) ); 913 } 914 } 915 #endif 808 916 WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" ); 809 917 … … 812 920 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 813 921 { 922 #if H_MV_6_ILDDS_O0225_30 923 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 924 { 925 if ( pcVPS->getDirectDependencyFlag(j,i) ) 926 { 927 WRITE_CODE( pcVPS->getMaxTidIlRefPicsPlus1( i, j ), 3, "max_tid_il_ref_pics_plus1" ); 928 } 929 } 930 #else 814 931 WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3, "max_tid_il_ref_pics_plus1[i]" ); 932 #endif 815 933 } 816 934 } … … 826 944 { 827 945 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" ); 946 #if H_MV_6_PS_O0109_23 947 pcVPS->checkProfileRefMinus1( i ); 948 #endif 828 949 } 829 950 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 ); … … 842 963 if( numOutputLayerSets > 1) 843 964 { 965 #if H_MV_6_PS_0109_25 966 WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" ); 967 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 968 #else 844 969 WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" ); 970 #endif 845 971 } 846 972 973 #if H_MV_6_HRD_O0217_13 974 assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 975 assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 976 #endif 847 977 for( Int i = 1; i < numOutputLayerSets; i++ ) 848 978 { … … 855 985 } 856 986 } 987 #if H_MV_6_HRD_O0217_13 988 else 989 { // These inference rules would also be helpful in spec text 990 assert( pcVPS->getOutputLayerSetIdxMinus1(i ) == i - 1 ); 991 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 992 { 993 assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 994 } 995 } 996 #endif 997 857 998 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 858 999 { … … 861 1002 } 862 1003 1004 #if H_MV_6_GEN_0153_28 1005 if( pcVPS->getMaxLayersMinus1() > 0 ) 1006 { 1007 WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" ); 1008 } 1009 #endif 1010 863 1011 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); 864 1012 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 869 1017 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 870 1018 { 1019 #if H_MV_6_PS_REP_FORM_18_19_20 1020 TComRepFormat* curRepFormat = pcVPS->getRepFormat(i); 1021 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1022 codeRepFormat( i, curRepFormat , prevRepFormat); 1023 #else 871 1024 TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i); 872 1025 codeRepFormat( pcRepFormat ); 1026 #endif 873 1027 } 874 1028 … … 879 1033 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 880 1034 { 1035 #if H_MV_6_PS_REP_FORM_18_19_20 1036 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" ); 1037 #else 881 1038 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" ); 1039 #endif 882 1040 } 883 1041 } … … 885 1043 886 1044 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" ); 1045 #if H_MV_6_MISC_O0062_31 1046 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1047 { 1048 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) == 0 ) 1049 { 1050 WRITE_FLAG( pcVPS->getPocLsbNotPresentFlag( i ) ? 1 : 0 , "poc_lsb_not_present_flag" ); 1051 } 1052 } 1053 #endif 1054 #if H_MV_6_HRD_O0217_13 1055 codeDpbSize( pcVPS ); 1056 #endif 1057 1058 #if !H_MV_6_PS_O0223_29 887 1059 WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1060 #endif 888 1061 WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ), "direct_dep_type_len_minus2"); 889 1062 1063 #if H_MV_6_PS_O0096_21 1064 WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" ); 1065 1066 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1067 { 1068 WRITE_CODE( pcVPS->getDefaultDirectDependencyType( ), pcVPS->getDirectDepTypeLenMinus2( ) + 2 , "default_direct_dependency_type" ); 1069 } 1070 1071 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1072 { 1073 for( Int j = 0; j < i; j++ ) 1074 { 1075 if (pcVPS->getDirectDependencyFlag( i, j) ) 1076 { 1077 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1078 { 1079 assert( pcVPS->getDirectDependencyType( i, j ) == pcVPS->getDefaultDirectDependencyType( ) ); 1080 } 1081 else 1082 { 1083 assert ( pcVPS->getDirectDependencyType( i, j ) != -1 ); 1084 WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2, "direct_dependency_type[i][j]" ); 1085 } 1086 } 1087 } 1088 } 1089 #else 890 1090 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 891 1091 { … … 899 1099 } 900 1100 } 901 1101 #endif 902 1102 WRITE_FLAG ( 0, "vps_shvc_reserved_zero_flag" ); 1103 #if !H_MV_6_PS_O0109_24 903 1104 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" ); 1105 #endif 904 1106 905 1107 if( pcVPS->getVpsVuiPresentFlag() ) … … 909 1111 } 910 1112 } 911 1113 #if H_MV_6_PS_O0118_33 1114 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1115 { 1116 assert( pcVideoSignalInfo ); 1117 WRITE_CODE( pcVideoSignalInfo->getVideoVpsFormat( ), 3, "video_vps_format" ); 1118 WRITE_FLAG( pcVideoSignalInfo->getVideoFullRangeVpsFlag( ) ? 1 : 0 , "video_full_range_vps_flag" ); 1119 WRITE_CODE( pcVideoSignalInfo->getColourPrimariesVps( ), 8, "colour_primaries_vps" ); 1120 WRITE_CODE( pcVideoSignalInfo->getTransferCharacteristicsVps( ), 8, "transfer_characteristics_vps" ); 1121 WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" ); 1122 } 1123 #endif 1124 1125 #if H_MV_6_HRD_O0217_13 1126 Void TEncCavlc::codeDpbSize( TComVPS* vps ) 1127 { 1128 TComDpbSize* dpbSize = vps->getDpbSize(); 1129 assert ( dpbSize != 0 ); 1130 1131 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1132 { 1133 WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" ); 1134 1135 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1136 { 1137 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1138 { 1139 WRITE_FLAG( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ? 1 : 0 , "sub_layer_dpb_info_present_flag" ); 1140 } 1141 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1142 { 1143 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) // Preliminary fix does not match with spec 1144 { 1145 WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" ); 1146 } 1147 WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" ); 1148 WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" ); 1149 } 1150 else 1151 { 1152 if ( j > 0 ) 1153 { 1154 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1155 { 1156 assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); 1157 } 1158 assert( dpbSize->getMaxVpsNumReorderPics ( i, j ) == dpbSize->getMaxVpsNumReorderPics ( i, j - 1 ) ); 1159 assert( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) == dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1160 } 1161 } 1162 } 1163 } 1164 } 1165 #endif 1166 1167 #if H_MV_6_PS_REP_FORM_18_19_20 1168 Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1169 #else 912 1170 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat ) 1171 #endif 913 1172 { 914 1173 assert( pcRepFormat ); 915 1174 916 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 917 918 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 919 { 920 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 921 } 1175 #if H_MV_6_PS_REP_FORM_18_19_20 922 1176 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 923 1177 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1178 WRITE_FLAG( pcRepFormat->getChromaAndBitDepthVpsPresentFlag( ) ? 1 : 0 , "chroma_and_bit_depth_vps_present_flag" ); 1179 1180 pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i ); 1181 1182 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1183 { 1184 #endif 1185 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 1186 1187 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 1188 { 1189 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 1190 } 1191 #if !H_MV_6_PS_REP_FORM_18_19_20 1192 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 1193 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1194 #endif 924 1195 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" ); 925 1196 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" ); 1197 #if H_MV_6_PS_REP_FORM_18_19_20 1198 } 1199 else 1200 { 1201 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true ); 1202 } 1203 #endif 926 1204 } 927 1205 … … 933 1211 934 1212 assert( pcVPSVUI ); 1213 1214 #if H_MV_6_PS_O0223_29 1215 WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" ); 1216 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) 1217 { 1218 WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1219 } 1220 #endif 935 1221 936 1222 WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" ); … … 964 1250 } 965 1251 1252 #if H_MV_6_O0226_37 1253 WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" ); 1254 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1255 { 1256 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1257 { 1258 WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" ); 1259 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1260 { 1261 WRITE_FLAG( pcVPSVUI->getLoopFilterNotAcrossTilesFlag( i ) ? 1 : 0, "loop_filter_not_across_tiles_flag[i]" ); 1262 } 1263 } 1264 1265 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1266 { 1267 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) 1268 { 1269 Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j )); 1270 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1271 { 1272 WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" ); 1273 } 1274 } 1275 } 1276 } 1277 1278 WRITE_FLAG( pcVPSVUI->getWppNotInUseFlag( ) ? 1 : 0 , "wpp_not_in_use_flag" ); 1279 1280 if( !pcVPSVUI->getWppNotInUseFlag( ) ) 1281 { 1282 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1283 { 1284 WRITE_FLAG( pcVPSVUI->getWppInUseFlag( i ) ? 1 : 0 , "wpp_in_use_flag[i]" ); 1285 } 1286 } 1287 #else 966 1288 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 967 1289 { … … 971 1293 } 972 1294 } 973 1295 #endif 974 1296 WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" ); 975 1297 … … 992 1314 } 993 1315 } 994 } 1316 #if H_MV_6_PS_O0118_33 1317 WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" ); 1318 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1319 { 1320 WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" ); 1321 } 1322 else 1323 { 1324 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1325 } 1326 1327 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1328 { 1329 assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL ); 1330 TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i ); 1331 codeVideoSignalInfo( curVideoSignalInfo ); 1332 } 1333 1334 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1335 { 1336 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1337 { 1338 WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" ); 1339 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1340 } 1341 } 1342 else 1343 { 1344 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1345 { 1346 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 1347 } 1348 } 1349 #endif 1350 #if H_MV_6_HRD_O0164_15 1351 WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" ); 1352 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) 1353 { 1354 codeVpsVuiBspHrdParameters( pcVPS ); 1355 } 1356 #endif 1357 } 1358 #if H_MV_6_HRD_O0164_15 1359 Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1360 { 1361 assert( pcVPS ); 1362 1363 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1364 1365 assert( pcVPSVUI ); 1366 1367 TComVpsVuiBspHrdParameters* vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 1368 1369 assert ( vpsVuiBspHrdP ); 1370 1371 1372 WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" ); 1373 for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ ) 1374 { 1375 if( i > 0 ) 1376 { 1377 WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" ); 1378 } 1379 TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 1380 codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() ); 1381 } 1382 for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ ) 1383 { 1384 WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" ); 1385 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1386 { 1387 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1388 { 1389 if( pcVPS->getLayerIdIncludedFlag( h ,j ) ) 1390 { 1391 WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" ); 1392 } 1393 else 1394 { 1395 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1396 } 1397 } 1398 } 1399 vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 1400 1401 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1402 { 1403 WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" ); 1404 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1405 { 1406 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1407 { 1408 WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" ); 1409 WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" ); 1410 } 1411 } 1412 } 1413 } 1414 } 1415 #endif 1416 995 1417 #endif 996 1418 … … 1115 1537 #if H_MV 1116 1538 Int esb = 0; //Don't use i, otherwise will shadow something below 1539 #if !H_MV_6_RALS_O0149_11 1117 1540 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1118 1541 { … … 1120 1543 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1121 1544 } 1545 #endif 1122 1546 1123 1547 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1126 1550 WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" ); 1127 1551 } 1552 1553 #if H_MV_6_RALS_O0149_11 1554 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1555 { 1556 esb++; 1557 WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" ); 1558 } 1559 pcSlice->checkCrossLayerBlaFlag( ); 1560 1561 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1562 { 1563 esb++; 1564 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1565 } 1566 #endif 1567 1568 1128 1569 1129 1570 for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 1148 1589 // colour_plane_id u(2) 1149 1590 1591 #if H_MV_6_POC_31_35_38 1592 if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() ) 1593 { 1594 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1595 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb"); 1596 } 1597 #endif 1150 1598 if( !pcSlice->getIdrPicFlag() ) 1151 1599 { 1600 #if !H_MV_6_POC_31_35_38 1152 1601 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1153 1602 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1603 #endif 1154 1604 TComReferencePictureSet* rps = pcSlice->getRPS(); 1155 1605 … … 1265 1715 } 1266 1716 #if H_MV 1717 #if H_MV_6_ILDDS_ILREFPICS_27_34 1718 Bool interLayerPredLayerIdcPresentFlag = false; 1719 #endif 1267 1720 Int layerId = pcSlice->getLayerId(); 1268 1721 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) … … 1276 1729 } 1277 1730 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1278 { 1731 { 1732 #if H_MV_6_ILDDS_ILREFPICS_27_34 1733 interLayerPredLayerIdcPresentFlag = true; 1734 #endif 1279 1735 for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ ) 1280 1736 { … … 1284 1740 } 1285 1741 } 1742 #if H_MV_6_ILDDS_ILREFPICS_27_34 1743 if ( !interLayerPredLayerIdcPresentFlag ) 1744 { 1745 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1746 { 1747 assert( pcSlice->getInterLayerPredLayerIdc( i ) == pcSlice->getRefLayerPicIdc( i ) ); 1748 } 1749 } 1750 #endif 1286 1751 #endif 1287 1752 if(pcSlice->getSPS()->getUseSAO()) -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r655 r730 85 85 Void codeVPS ( TComVPS* pcVPS ); 86 86 #if H_MV 87 Void codeVPSExtension ( TComVPS *pcVPS ); 88 Void codeRepFormat ( TComRepFormat* pcRepFormat ); 89 Void codeVPSVUI ( TComVPS* pcVPS ); 87 Void codeVPSExtension ( TComVPS *pcVPS ); 88 #if H_MV_6_PS_O0118_33 89 Void codeVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo ); 90 #endif 91 92 #if H_MV_6_HRD_O0217_13 93 Void codeDpbSize ( TComVPS* vps ); 94 #endif 95 96 #if H_MV_6_PS_REP_FORM_18_19_20 97 Void codeRepFormat ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat ); 98 #else 99 Void codeRepFormat ( TComRepFormat* pcRepFormat ); 100 #endif 101 Void codeVPSVUI ( TComVPS* pcVPS ); 102 #if H_MV_6_HRD_O0164_15 103 Void codeVpsVuiBspHrdParameters( TComVPS* pcVPS ); 104 #endif 90 105 #endif 91 106 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r724 r730 664 664 refPicListModification->setRefPicListModificationFlagL1(0); 665 665 #if H_MV 666 #if H_MV_6_RALS_O0149_11 667 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 668 #else 666 669 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 ) 670 #endif 667 671 { 668 672 // Some more sophisticated algorithm to determine discardable_flag might be added here. … … 673 677 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 674 678 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 675 679 680 #if H_MV_6_ILDDS_ILREFPICS_27_34 681 Bool interLayerPredLayerIdcPresentFlag = false; 682 #endif 676 683 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 677 684 { … … 685 692 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 686 693 { 694 #if H_MV_6_ILDDS_ILREFPICS_27_34 695 interLayerPredLayerIdcPresentFlag = true; 696 #endif 687 697 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 688 698 { … … 692 702 } 693 703 } 704 #if H_MV_6_ILDDS_ILREFPICS_27_34 705 if ( !interLayerPredLayerIdcPresentFlag ) 706 { 707 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 708 { 709 pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) ); 710 } 711 } 712 #endif 713 714 694 715 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 695 716 -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncTop.cpp
r724 r730 719 719 720 720 #if H_MV 721 #if H_MV_6_PS_REP_FORM_18_19_20 722 m_cSPS.setUpdateRepFormatFlag ( false ); 723 #else 721 724 m_cSPS.setUpdateRepFormatFlag ( m_layerId == 0 ); 725 #endif 722 726 m_cSPS.setSpsInferScalingListFlag ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 723 727 m_cSPS.setSpsScalingListRefLayerId ( 0 ); 728 #if H_MV_6_PSEM_O0142_3 729 m_cSPS.setSpsExtensionFlag ( true ); 730 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_MV ,true ); 731 #if H_3D 732 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_3D ,true ); 733 #endif 734 #endif 724 735 #endif 725 736 m_cSPS.setPicWidthInLumaSamples ( m_iSourceWidth ); … … 808 819 pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag()); 809 820 pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag()); 821 #if H_MV_6_PS_O0118_33 822 pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 ); 823 #else 810 824 pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag()); 825 #endif 811 826 pcVUI->setVideoFormat(getVideoFormat()); 812 827 pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag()); … … 922 937 m_cPPS.setOutputFlagPresentFlag( false ); 923 938 #if H_MV 939 #if H_MV_6_RALS_O0149_11 940 m_cPPS.setNumExtraSliceHeaderBits( 3 ); 941 #else 924 942 m_cPPS.setNumExtraSliceHeaderBits( 2 ); 943 #endif 925 944 #endif 926 945 m_cPPS.setSignHideFlag(getSignHideFlag());
Note: See TracChangeset for help on using the changeset viewer.