Changeset 738 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 10 Dec 2013, 13:50:12 (11 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r724 r738 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 ) … … 797 887 WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" ); 798 888 } 889 #endif 890 799 891 800 892 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 805 897 } 806 898 } 807 899 #if H_MV_6_ILDSD_O0120_26 900 WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" ); 901 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 902 { 903 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 904 { 905 WRITE_CODE( pcVPS->getSubLayersVpsMaxMinus1( i ), 3, "sub_layers_vps_max_minus1" ); 906 pcVPS->checkSubLayersVpsMaxMinus1( i ); 907 } 908 } 909 else 910 { 911 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 912 { 913 assert( pcVPS->getSubLayersVpsMaxMinus1( i ) + 1 == pcVPS->getMaxTLayers( ) ); 914 } 915 } 916 #endif 808 917 WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" ); 809 918 … … 812 921 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 813 922 { 923 #if H_MV_6_ILDDS_O0225_30 924 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 925 { 926 if ( pcVPS->getDirectDependencyFlag(j,i) ) 927 { 928 WRITE_CODE( pcVPS->getMaxTidIlRefPicsPlus1( i, j ), 3, "max_tid_il_ref_pics_plus1" ); 929 } 930 } 931 #else 814 932 WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3, "max_tid_il_ref_pics_plus1[i]" ); 933 #endif 815 934 } 816 935 } … … 826 945 { 827 946 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" ); 947 #if H_MV_6_PS_O0109_23 948 pcVPS->checkProfileRefMinus1( i ); 949 #endif 828 950 } 829 951 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 ); … … 842 964 if( numOutputLayerSets > 1) 843 965 { 966 #if H_MV_6_PS_0109_25 967 WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" ); 968 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 969 #else 844 970 WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" ); 971 #endif 845 972 } 846 973 974 #if H_MV_6_HRD_O0217_13 975 assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 976 assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 977 #endif 847 978 for( Int i = 1; i < numOutputLayerSets; i++ ) 848 979 { … … 855 986 } 856 987 } 988 #if H_MV_6_HRD_O0217_13 989 else 990 { // These inference rules would also be helpful in spec text 991 assert( pcVPS->getOutputLayerSetIdxMinus1(i ) == i - 1 ); 992 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 993 { 994 assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 995 } 996 } 997 #endif 998 857 999 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 858 1000 { … … 861 1003 } 862 1004 1005 #if H_MV_6_GEN_0153_28 1006 if( pcVPS->getMaxLayersMinus1() > 0 ) 1007 { 1008 WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" ); 1009 } 1010 #endif 1011 863 1012 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); 864 1013 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 869 1018 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 870 1019 { 1020 #if H_MV_6_PS_REP_FORM_18_19_20 1021 TComRepFormat* curRepFormat = pcVPS->getRepFormat(i); 1022 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1023 codeRepFormat( i, curRepFormat , prevRepFormat); 1024 #else 871 1025 TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i); 872 1026 codeRepFormat( pcRepFormat ); 1027 #endif 873 1028 } 874 1029 … … 879 1034 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 880 1035 { 1036 #if H_MV_6_PS_REP_FORM_18_19_20 1037 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" ); 1038 #else 881 1039 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" ); 1040 #endif 882 1041 } 883 1042 } … … 885 1044 886 1045 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" ); 1046 #if H_MV_6_MISC_O0062_31 1047 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1048 { 1049 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) == 0 ) 1050 { 1051 WRITE_FLAG( pcVPS->getPocLsbNotPresentFlag( i ) ? 1 : 0 , "poc_lsb_not_present_flag" ); 1052 } 1053 } 1054 #endif 1055 #if H_MV_6_HRD_O0217_13 1056 codeDpbSize( pcVPS ); 1057 #endif 1058 1059 #if !H_MV_6_PS_O0223_29 887 1060 WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1061 #endif 888 1062 WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ), "direct_dep_type_len_minus2"); 889 1063 1064 #if H_MV_6_PS_O0096_21 1065 WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" ); 1066 1067 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1068 { 1069 WRITE_CODE( pcVPS->getDefaultDirectDependencyType( ), pcVPS->getDirectDepTypeLenMinus2( ) + 2 , "default_direct_dependency_type" ); 1070 } 1071 1072 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1073 { 1074 for( Int j = 0; j < i; j++ ) 1075 { 1076 if (pcVPS->getDirectDependencyFlag( i, j) ) 1077 { 1078 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1079 { 1080 assert( pcVPS->getDirectDependencyType( i, j ) == pcVPS->getDefaultDirectDependencyType( ) ); 1081 } 1082 else 1083 { 1084 assert ( pcVPS->getDirectDependencyType( i, j ) != -1 ); 1085 WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2, "direct_dependency_type[i][j]" ); 1086 } 1087 } 1088 } 1089 } 1090 #else 890 1091 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 891 1092 { … … 899 1100 } 900 1101 } 901 1102 #endif 902 1103 WRITE_FLAG ( 0, "vps_shvc_reserved_zero_flag" ); 1104 #if !H_MV_6_PS_O0109_24 903 1105 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" ); 1106 #endif 904 1107 905 1108 if( pcVPS->getVpsVuiPresentFlag() ) … … 909 1112 } 910 1113 } 911 1114 #if H_MV_6_PS_O0118_33 1115 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1116 { 1117 assert( pcVideoSignalInfo ); 1118 WRITE_CODE( pcVideoSignalInfo->getVideoVpsFormat( ), 3, "video_vps_format" ); 1119 WRITE_FLAG( pcVideoSignalInfo->getVideoFullRangeVpsFlag( ) ? 1 : 0 , "video_full_range_vps_flag" ); 1120 WRITE_CODE( pcVideoSignalInfo->getColourPrimariesVps( ), 8, "colour_primaries_vps" ); 1121 WRITE_CODE( pcVideoSignalInfo->getTransferCharacteristicsVps( ), 8, "transfer_characteristics_vps" ); 1122 WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" ); 1123 } 1124 #endif 1125 1126 #if H_MV_6_HRD_O0217_13 1127 Void TEncCavlc::codeDpbSize( TComVPS* vps ) 1128 { 1129 TComDpbSize* dpbSize = vps->getDpbSize(); 1130 assert ( dpbSize != 0 ); 1131 1132 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1133 { 1134 WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" ); 1135 1136 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1137 { 1138 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1139 { 1140 WRITE_FLAG( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ? 1 : 0 , "sub_layer_dpb_info_present_flag" ); 1141 } 1142 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1143 { 1144 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) // Preliminary fix does not match with spec 1145 { 1146 WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" ); 1147 } 1148 WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" ); 1149 WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" ); 1150 } 1151 else 1152 { 1153 if ( j > 0 ) 1154 { 1155 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1156 { 1157 assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); 1158 } 1159 assert( dpbSize->getMaxVpsNumReorderPics ( i, j ) == dpbSize->getMaxVpsNumReorderPics ( i, j - 1 ) ); 1160 assert( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) == dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1161 } 1162 } 1163 } 1164 } 1165 } 1166 #endif 1167 1168 #if H_MV_6_PS_REP_FORM_18_19_20 1169 Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1170 #else 912 1171 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat ) 1172 #endif 913 1173 { 914 1174 assert( pcRepFormat ); 915 1175 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 } 1176 #if H_MV_6_PS_REP_FORM_18_19_20 922 1177 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 923 1178 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1179 WRITE_FLAG( pcRepFormat->getChromaAndBitDepthVpsPresentFlag( ) ? 1 : 0 , "chroma_and_bit_depth_vps_present_flag" ); 1180 1181 pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i ); 1182 1183 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1184 { 1185 #endif 1186 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 1187 1188 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 1189 { 1190 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 1191 } 1192 #if !H_MV_6_PS_REP_FORM_18_19_20 1193 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 1194 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1195 #endif 924 1196 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" ); 925 1197 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" ); 1198 #if H_MV_6_PS_REP_FORM_18_19_20 1199 } 1200 else 1201 { 1202 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true ); 1203 } 1204 #endif 926 1205 } 927 1206 … … 933 1212 934 1213 assert( pcVPSVUI ); 1214 1215 #if H_MV_6_PS_O0223_29 1216 WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" ); 1217 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) 1218 { 1219 WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1220 } 1221 #endif 935 1222 936 1223 WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" ); … … 964 1251 } 965 1252 1253 #if H_MV_6_O0226_37 1254 WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" ); 1255 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1256 { 1257 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1258 { 1259 WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" ); 1260 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1261 { 1262 WRITE_FLAG( pcVPSVUI->getLoopFilterNotAcrossTilesFlag( i ) ? 1 : 0, "loop_filter_not_across_tiles_flag[i]" ); 1263 } 1264 } 1265 1266 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1267 { 1268 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) 1269 { 1270 Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j )); 1271 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1272 { 1273 WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" ); 1274 } 1275 } 1276 } 1277 } 1278 1279 WRITE_FLAG( pcVPSVUI->getWppNotInUseFlag( ) ? 1 : 0 , "wpp_not_in_use_flag" ); 1280 1281 if( !pcVPSVUI->getWppNotInUseFlag( ) ) 1282 { 1283 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1284 { 1285 WRITE_FLAG( pcVPSVUI->getWppInUseFlag( i ) ? 1 : 0 , "wpp_in_use_flag[i]" ); 1286 } 1287 } 1288 #else 966 1289 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 967 1290 { … … 971 1294 } 972 1295 } 973 1296 #endif 974 1297 WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" ); 975 1298 … … 992 1315 } 993 1316 } 994 } 1317 #if H_MV_6_PS_O0118_33 1318 WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" ); 1319 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1320 { 1321 WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" ); 1322 } 1323 else 1324 { 1325 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1326 } 1327 1328 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1329 { 1330 assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL ); 1331 TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i ); 1332 codeVideoSignalInfo( curVideoSignalInfo ); 1333 } 1334 1335 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1336 { 1337 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1338 { 1339 WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" ); 1340 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1341 } 1342 } 1343 else 1344 { 1345 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1346 { 1347 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 1348 } 1349 } 1350 #endif 1351 #if H_MV_6_HRD_O0164_15 1352 WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" ); 1353 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) 1354 { 1355 codeVpsVuiBspHrdParameters( pcVPS ); 1356 } 1357 #endif 1358 } 1359 #if H_MV_6_HRD_O0164_15 1360 Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1361 { 1362 assert( pcVPS ); 1363 1364 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1365 1366 assert( pcVPSVUI ); 1367 1368 TComVpsVuiBspHrdParameters* vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 1369 1370 assert ( vpsVuiBspHrdP ); 1371 1372 1373 WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" ); 1374 for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ ) 1375 { 1376 if( i > 0 ) 1377 { 1378 WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" ); 1379 } 1380 TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 1381 codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() ); 1382 } 1383 for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ ) 1384 { 1385 WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" ); 1386 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1387 { 1388 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1389 { 1390 if( pcVPS->getLayerIdIncludedFlag( h ,j ) ) 1391 { 1392 WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" ); 1393 } 1394 else 1395 { 1396 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1397 } 1398 } 1399 } 1400 vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 1401 1402 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1403 { 1404 WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" ); 1405 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1406 { 1407 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1408 { 1409 WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" ); 1410 WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" ); 1411 } 1412 } 1413 } 1414 } 1415 } 1416 #endif 1417 995 1418 #endif 996 1419 … … 1115 1538 #if H_MV 1116 1539 Int esb = 0; //Don't use i, otherwise will shadow something below 1540 #if !H_MV_6_RALS_O0149_11 1117 1541 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1118 1542 { … … 1120 1544 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1121 1545 } 1546 #endif 1122 1547 1123 1548 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1126 1551 WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" ); 1127 1552 } 1553 1554 #if H_MV_6_RALS_O0149_11 1555 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1556 { 1557 esb++; 1558 WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" ); 1559 } 1560 pcSlice->checkCrossLayerBlaFlag( ); 1561 1562 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1563 { 1564 esb++; 1565 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1566 } 1567 #endif 1568 1569 1128 1570 1129 1571 for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 1148 1590 // colour_plane_id u(2) 1149 1591 1592 #if H_MV_6_POC_31_35_38 1593 if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() ) 1594 { 1595 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1596 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb"); 1597 } 1598 #endif 1150 1599 if( !pcSlice->getIdrPicFlag() ) 1151 1600 { 1601 #if !H_MV_6_POC_31_35_38 1152 1602 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1153 1603 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1604 #endif 1154 1605 TComReferencePictureSet* rps = pcSlice->getRPS(); 1155 1606 … … 1265 1716 } 1266 1717 #if H_MV 1718 #if H_MV_6_ILDDS_ILREFPICS_27_34 1719 Bool interLayerPredLayerIdcPresentFlag = false; 1720 #endif 1267 1721 Int layerId = pcSlice->getLayerId(); 1268 1722 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) … … 1277 1731 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1278 1732 { 1733 #if H_MV_6_ILDDS_ILREFPICS_27_34 1734 interLayerPredLayerIdcPresentFlag = true; 1735 #endif 1279 1736 for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ ) 1280 1737 { … … 1284 1741 } 1285 1742 } 1743 #if H_MV_6_ILDDS_ILREFPICS_27_34 1744 if ( !interLayerPredLayerIdcPresentFlag ) 1745 { 1746 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1747 { 1748 assert( pcSlice->getInterLayerPredLayerIdc( i ) == pcSlice->getRefLayerPicIdc( i ) ); 1749 } 1750 } 1751 #endif 1286 1752 #endif 1287 1753 if(pcSlice->getSPS()->getUseSAO()) -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r655 r738 86 86 #if H_MV 87 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 88 99 Void codeRepFormat ( TComRepFormat* pcRepFormat ); 100 #endif 89 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 ); -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r724 r738 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. … … 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 -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r724 r738 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.