Changeset 494 in SHVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-4.0-dev (added) merged: 444-493
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-4.0-dev/source (added) merged: 445-471,473-479,481-486,488-493
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r442 r494 359 359 { 360 360 WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(), "tiles_fixed_structure_flag"); 361 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG362 if ( pcSPS->getLayerId() > 0 )363 {364 WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );365 }366 #endif367 361 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 368 362 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); … … 454 448 #endif 455 449 WRITE_CODE( pcSPS->getVPSId (), 4, "sps_video_parameter_set_id" ); 456 #if S PS_SUB_LAYER_INFO450 #if SVC_EXTENSION 457 451 if(pcSPS->getLayerId() == 0) 458 452 { … … 460 454 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1" ); 461 455 WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0, "sps_temporal_id_nesting_flag" ); 462 #if S PS_SUB_LAYER_INFO456 #if SVC_EXTENSION 463 457 } 464 458 #endif … … 670 664 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 671 665 #endif 672 #if SCALED_REF_LAYER_OFFSETS673 666 if( pcSPS->getLayerId() > 0 ) 674 667 { … … 683 676 } 684 677 } 685 #endif686 678 #if M0463_VUI_EXT_ILP_REF 687 679 //// sps_extension_vui_parameters( ) … … 708 700 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 709 701 { 702 #if VPS_EXTN_OFFSET_CALC 703 UInt numBytesInVps = this->m_pcBitIf->getNumberOfWrittenBits(); 704 #endif 710 705 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 711 706 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); … … 811 806 WRITE_FLAG(1, "vps_extension_alignment_bit_equal_to_one"); 812 807 } 808 #if VPS_EXTN_OFFSET_CALC 809 Int vpsExntOffsetValueInBits = this->m_pcBitIf->getNumberOfWrittenBits() - numBytesInVps + 16; // 2 bytes for NUH 810 assert( vpsExntOffsetValueInBits % 8 == 0 ); 811 pcVPS->setExtensionOffset( vpsExntOffsetValueInBits >> 3 ); 812 #endif 813 813 codeVPSExtension(pcVPS); 814 814 WRITE_FLAG( 0, "vps_extension2_flag" ); // Flag value of 1 reserved … … 820 820 } 821 821 822 #if SVC_EXTENSION 822 823 #if VPS_EXTNS 823 824 Void TEncCavlc::codeVPSExtension (TComVPS *vps) … … 835 836 } 836 837 837 #if VPS_SPLIT_FLAG838 838 for(j = 0; j < vps->getNumScalabilityTypes() - vps->getSplittingFlag(); j++) 839 #else840 for(j = 0; j < vps->getNumScalabilityTypes(); j++)841 #endif842 839 { 843 840 WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3, "dimension_id_len_minus1[j]" ); … … 863 860 WRITE_CODE( vps->getLayerIdInNuh(i), 6, "layer_id_in_nuh[i]" ); 864 861 } 865 #if VPS_SPLIT_FLAG 866 if( !vps->getSplittingFlag())867 #endif 862 863 if( !vps->getSplittingFlag() ) 864 { 868 865 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 869 866 { … … 871 868 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 872 869 } 870 } 873 871 } 874 872 #endif … … 885 883 } 886 884 #endif 887 #if VPS_MOVE_DIR_DEPENDENCY_FLAG888 885 #if VPS_EXTN_DIRECT_REF_LAYERS 889 886 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) … … 894 891 } 895 892 } 896 #endif897 893 #endif 898 894 #if JCTVC_M0203_INTERLAYER_PRED_IDC … … 903 899 for( i = 0; i < vps->getMaxLayers() - 1; i++) 904 900 { 901 #if O0225_MAX_TID_FOR_REF_LAYERS 902 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 903 { 904 if(vps->getDirectDependencyFlag(j, i)) 905 { 906 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i,j), 3, "max_tid_il_ref_pics_plus1[i][j]" ); 907 } 908 } 909 #else 905 910 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 911 #endif 906 912 } 907 913 } … … 909 915 for( i = 0; i < vps->getMaxLayers() - 1; i++) 910 916 { 917 #if O0225_MAX_TID_FOR_REF_LAYERS 918 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 919 { 920 if(vps->getDirectDependencyFlag(j, i)) 921 { 922 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i,j), 3, "max_tid_il_ref_pics_plus1[i][j]" ); 923 } 924 } 925 #else 911 926 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 927 #endif 912 928 } 913 929 #endif … … 918 934 #if VPS_EXTN_PROFILE_INFO 919 935 // Profile-tier-level signalling 920 #if VPS_PROFILE_OUTPUT_LAYERS921 936 WRITE_CODE( vps->getNumLayerSets() - 1 , 10, "vps_number_layer_sets_minus1" ); 922 937 WRITE_CODE( vps->getNumProfileTierLevel() - 1, 6, "vps_num_profile_tier_level_minus1"); 923 938 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) 924 #else925 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)926 #endif927 939 { 928 940 WRITE_FLAG( vps->getProfilePresentFlag(idx), "vps_profile_present_flag[i]" ); 929 941 if( !vps->getProfilePresentFlag(idx) ) 930 942 { 931 #if VPS_PROFILE_OUTPUT_LAYERS932 943 WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" ); 933 #else934 WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" );935 #endif936 944 } 937 945 codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 ); … … 939 947 #endif 940 948 941 #if VPS_PROFILE_OUTPUT_LAYERS942 949 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; 943 950 WRITE_FLAG( (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" ); … … 974 981 WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" ); 975 982 } 976 #else977 #if VPS_EXTN_OP_LAYER_SETS978 // Target output layer signalling979 WRITE_UVLC( vps->getNumOutputLayerSets(), "vps_num_output_layer_sets");980 for(i = 0; i < vps->getNumOutputLayerSets(); i++)981 {982 #if VPS_OUTPUT_LAYER_SET_IDX983 assert(vps->getOutputLayerSetIdx(i) > 0);984 WRITE_UVLC( vps->getOutputLayerSetIdx(i) - 1, "vps_output_layer_set_idx_minus1[i]");985 #else986 WRITE_UVLC( vps->getOutputLayerSetIdx(i), "vps_output_layer_set_idx[i]");987 #endif988 Int lsIdx = vps->getOutputLayerSetIdx(i);989 for(j = 0; j <= vps->getMaxLayerId(); j++)990 {991 if(vps->getLayerIdIncludedFlag(lsIdx, j))992 {993 WRITE_FLAG( vps->getOutputLayerFlag(lsIdx, j), "vps_output_layer_flag[lsIdx][j]");994 }995 }996 }997 #endif998 #endif999 983 1000 984 #if REPN_FORMAT_IN_VPS … … 1025 1009 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1026 1010 WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag"); 1011 #endif 1012 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1013 for(i = 1; i< vps->getMaxLayers(); i++) 1014 { 1015 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1016 { 1017 WRITE_FLAG(vps->getPocLsbNotPresentFlag(i), "poc_lsb_not_present_flag[i]"); 1018 } 1019 } 1020 #endif 1021 #if O0215_PHASE_ALIGNMENT 1022 WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" ); 1023 #endif 1024 #if N0147_IRAP_ALIGN_FLAG && !IRAP_ALIGN_FLAG_IN_VPS_VUI 1025 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1027 1026 #endif 1028 #if N0147_IRAP_ALIGN_FLAG1029 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");1030 #endif1031 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG1032 #if VPS_EXTN_DIRECT_REF_LAYERS1033 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1034 {1035 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1036 {1037 WRITE_FLAG(vps->getDirectDependencyFlag(layerCtr, refLayerCtr), "direct_dependency_flag[i][j]" );1038 }1039 }1040 #endif1041 #endif1042 1027 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1043 1028 WRITE_UVLC( vps->getDirectDepTypeLen()-2, "direct_dep_type_len_minus2"); … … 1107 1092 { 1108 1093 Int i,j; 1094 #if IRAP_ALIGN_FLAG_IN_VPS_VUI 1095 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1096 #endif 1109 1097 #if VPS_VUI_BITRATE_PICRATE 1110 1098 WRITE_FLAG( vps->getBitRatePresentVpsFlag(), "bit_rate_present_vps_flag" ); … … 1173 1161 } 1174 1162 #endif 1163 #endif //SVC_EXTENSION 1175 1164 1176 1165 Void TEncCavlc::codeSliceHeader ( TComSlice* pcSlice ) … … 1218 1207 if ( !pcSlice->getDependentSliceSegmentFlag() ) 1219 1208 { 1220 1209 #if SVC_EXTENSION 1221 1210 #if POC_RESET_FLAG 1222 1211 Int iBits = 0; … … 1238 1227 } 1239 1228 #else 1240 #if SH_DISCARDABLE_FLAG1241 1229 if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1242 1230 { … … 1249 1237 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1250 1238 } 1251 #else 1239 #endif 1240 #else //SVC_EXTENSION 1252 1241 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1253 1242 { … … 1255 1244 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1256 1245 } 1257 #endif 1258 #endif 1246 #endif //SVC_EXTENSION 1259 1247 1260 1248 WRITE_UVLC( pcSlice->getSliceType(), "slice_type" ); … … 1265 1253 } 1266 1254 1255 #if !AUXILIARY_PICTURES 1267 1256 #if REPN_FORMAT_IN_VPS 1268 1257 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present … … 1272 1261 assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 ); 1273 1262 #endif 1263 #endif 1274 1264 // if( separate_colour_plane_flag == 1 ) 1275 1265 // colour_plane_id u(2) 1276 1266 1277 1267 #if N0065_LAYER_POC_ALIGNMENT 1268 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1269 if( (pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag()) 1270 #else 1278 1271 if( pcSlice->getLayerId() > 0 || !pcSlice->getIdrPicFlag() ) 1272 #endif 1279 1273 #else 1280 1274 if( !pcSlice->getIdrPicFlag() ) … … 1297 1291 1298 1292 #if N0065_LAYER_POC_ALIGNMENT 1293 #if SHM_FIX7 1294 } 1295 #endif 1299 1296 if( !pcSlice->getIdrPicFlag() ) 1300 1297 { … … 1414 1411 WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enable_flag" ); 1415 1412 } 1416 #if N0065_LAYER_POC_ALIGNMENT 1413 #if N0065_LAYER_POC_ALIGNMENT && !SHM_FIX7 1417 1414 } 1418 1415 #endif … … 1421 1418 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1422 1419 #if ILP_SSH_SIG 1420 #if ILP_SSH_SIG_FIX 1421 if((pcSlice->getSPS()->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1422 #else 1423 1423 if((pcSlice->getSPS()->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) ) 1424 #endif 1424 1425 #else 1425 1426 if((pcSlice->getSPS()->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) ) … … 1468 1469 WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" ); 1469 1470 { 1471 #if AUXILIARY_PICTURES 1472 if (pcSlice->getChromaFormatIdc() != CHROMA_400) 1473 { 1474 #endif 1470 1475 SAOParam *saoParam = pcSlice->getPic()->getPicSym()->getSaoParam(); 1471 1476 WRITE_FLAG( saoParam->bSaoFlag[1], "slice_sao_chroma_flag" ); 1477 #if AUXILIARY_PICTURES 1478 } 1479 #endif 1472 1480 } 1473 1481 } … … 1934 1942 UInt uiMode = 0; 1935 1943 UInt uiTotalSignalledWeightFlags = 0; 1944 #if AUXILIARY_PICTURES 1945 if (pcSlice->getChromaFormatIdc() == CHROMA_400) 1946 { 1947 bChroma = false; 1948 } 1949 #endif 1936 1950 if ( (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPred()) ) 1937 1951 {
Note: See TracChangeset for help on using the changeset viewer.