Changeset 738 in 3DVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 10 Dec 2013, 13:50:12 (11 years ago)
- Location:
- trunk/source/Lib/TLibDecoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r724 r738 396 396 397 397 READ_FLAG( uiCode, "video_signal_type_present_flag"); pcVUI->setVideoSignalTypePresentFlag(uiCode); 398 #if H_MV_6_PS_O0118_33 399 assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() ); 400 #endif 401 398 402 if (pcVUI->getVideoSignalTypePresentFlag()) 399 403 { … … 582 586 { 583 587 READ_FLAG( uiCode, "update_rep_format_flag" ); pcSPS->setUpdateRepFormatFlag( uiCode == 1 ); 588 #if H_MV_6_PS_REP_FORM_18_19_20 589 if ( pcSPS->getUpdateRepFormatFlag() ) 590 { 591 READ_CODE( 8, uiCode, "sps_rep_format_idx" ); pcSPS->setSpsRepFormatIdx( uiCode ); 592 } 593 } 594 else 595 { 596 #else 584 597 } 585 598 586 599 if ( pcSPS->getUpdateRepFormatFlag() ) 587 600 { 601 #endif 588 602 #endif 589 603 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); … … 621 635 622 636 #if H_MV 637 #if H_MV_6_PS_REP_FORM_18_19_20 638 if ( pcSPS->getLayerId() == 0 ) 639 #else 623 640 if ( pcSPS->getUpdateRepFormatFlag() ) 641 #endif 624 642 { 625 643 #endif … … 770 788 771 789 READ_FLAG( uiCode, "sps_extension_flag"); 772 if (uiCode) 773 { 790 #if H_MV_6_PSEM_O0142_3 791 pcSPS->setSpsExtensionFlag( uiCode ); 792 #endif 793 if (pcSPS->getSpsExtensionFlag( ) ) 794 { 795 #if !H_MV_6_PSEM_O0142_3 774 796 #if H_MV 775 797 parseSPSExtension( pcSPS ); … … 784 806 #endif 785 807 #endif 808 #else 809 for (Int i = 0; i < PS_EX_T_MAX_NUM; i++) 810 { 811 READ_FLAG( uiCode, "sps_extension_type_flag" ); pcSPS->setSpsExtensionTypeFlag( i, uiCode ); 812 #if H_3D 813 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D || i == PS_EX_T_ESC ); 814 #else 815 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_ESC ); 816 #endif 817 } 818 819 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV )) 820 { 821 parseSPSExtension( pcSPS ); 822 } 823 824 #if H_3D 825 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D )) 826 { 827 parseSPSExtension2( pcSPS, viewIndex, depthFlag ); 828 } 829 #endif 830 831 if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC )) 832 { 833 #endif 786 834 while ( xMoreRbspData() ) 787 835 { 788 836 READ_FLAG( uiCode, "sps_extension_data_flag"); 789 837 } 838 #if H_MV_6_PSEM_O0142_3 839 } 840 #else 790 841 #if H_MV 791 842 #if H_3D … … 794 845 } 795 846 #endif 847 #endif 796 848 } 797 849 } … … 802 854 UInt uiCode; 803 855 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false); 856 #if !H_MV_6_SHVC_O0098_36 804 857 READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" ); 858 #else 859 860 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets( uiCode ); 861 862 for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++) 863 { 864 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 865 866 Int j = pcSPS->getScaledRefLayerId( i ); 867 Int iCode; 868 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); pcSPS->setScaledRefLayerLeftOffset( j, iCode ); 869 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); pcSPS->setScaledRefLayerTopOffset( j, iCode ); 870 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode ); 871 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode ); 872 } 873 #endif 805 874 } 806 875 … … 850 919 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 851 920 #if H_MV 921 #if H_MV_6_LAYER_ID_32 922 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayersMinus1( std::min( uiCode, (UInt) ( MAX_NUM_LAYER_IDS-1) ) ); 923 #else 852 924 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayersMinus1( uiCode ); 925 #endif 853 926 #else 854 927 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); … … 905 978 } 906 979 } 980 #if H_MV_6_HRD_O0217_13 981 pcVPS->deriveLayerSetLayerIdList(); 982 #endif 907 983 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 908 984 READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 968 1044 UInt uiCode; 969 1045 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false ); 1046 #if H_MV_6_PS_O0109_24 1047 READ_FLAG( uiCode, "vps_vui_present_flag" ); pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); if ( pcVPS->getVpsVuiPresentFlag() ) 1048 { 1049 #endif 970 1050 READ_CODE( 16, uiCode, "vps_vui_offset" ); pcVPS->setVpsVuiOffset( uiCode ); 1051 #if H_MV_6_PS_O0109_24 1052 } 1053 #endif 1054 971 1055 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false ); 972 1056 … … 1014 1098 } 1015 1099 1100 #if H_MV_6_PS_O0109_22 1101 READ_CODE( 4, uiCode, "view_id_len" ); pcVPS->setViewIdLen( uiCode ); 1102 1103 if ( pcVPS->getViewIdLen( ) > 0 ) 1104 { 1105 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 1106 { 1107 READ_CODE( pcVPS->getViewIdLen( ), uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode ); 1108 } 1109 } 1110 else 1111 { 1112 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 1113 { 1114 pcVPS->setViewIdVal( i, 0 ); 1115 } 1116 } 1117 #else 1016 1118 // GT spec says: trac #39 1017 1119 // if ( pcVPS->getNumViews() > 1 ) … … 1025 1127 READ_CODE( pcVPS->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode ); 1026 1128 } 1129 #endif 1130 1027 1131 1028 1132 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 1033 1137 } 1034 1138 } 1035 1139 #if H_MV_6_MISC_O0062_31 1140 pcVPS->setRefLayers(); 1141 #endif 1142 #if H_MV_6_ILDSD_O0120_26 1143 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 ); 1144 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 1145 { 1146 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1147 { 1148 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode ); 1149 pcVPS->checkSubLayersVpsMaxMinus1( i ); 1150 1151 } 1152 } 1153 else 1154 { 1155 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1156 { 1157 pcVPS->setSubLayersVpsMaxMinus1( i, pcVPS->getMaxTLayers( ) - 1); 1158 } 1159 } 1160 #endif 1036 1161 READ_FLAG( uiCode, "max_tid_ref_present_flag" ); pcVPS->setMaxTidRefPresentFlag( uiCode == 1 ); 1037 1162 … … 1040 1165 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1041 1166 { 1167 #if H_MV_6_ILDDS_O0225_30 1168 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1169 { 1170 if ( pcVPS->getDirectDependencyFlag(j,i) ) 1171 { 1172 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1" ); pcVPS->setMaxTidIlRefPicsPlus1( i, j, uiCode ); 1173 } 1174 } 1175 #else 1042 1176 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); pcVPS->setMaxTidIlRefPicPlus1( i , uiCode ); 1177 #endif 1043 1178 } 1044 1179 } … … 1054 1189 { 1055 1190 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode ); 1191 #if H_MV_6_PS_O0109_23 1192 pcVPS->checkProfileRefMinus1( i ); 1193 #endif 1056 1194 } 1057 1195 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1); … … 1076 1214 if( numOutputLayerSets > 1) 1077 1215 { 1216 #if H_MV_6_PS_0109_25 1217 READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" ); pcVPS->setDefaultOneTargetOutputLayerIdc( uiCode ); 1218 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 1219 #else 1078 1220 READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag( uiCode == 1); 1221 #endif 1079 1222 } 1080 1223 1224 #if H_MV_6_HRD_O0217_13 1225 pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 )); 1226 pcVPS->setOutputLayerSetIdxMinus1(0, -1); 1227 #endif 1081 1228 for( Int i = 1; i < numOutputLayerSets; i++ ) 1082 1229 { … … 1089 1236 } 1090 1237 } 1238 #if H_MV_6_HRD_O0217_13 1239 else 1240 { // These inference rules would also be helpful in spec text 1241 pcVPS->setOutputLayerSetIdxMinus1(i, i - 1 ); 1242 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 1243 { 1244 pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j )); 1245 } 1246 } 1247 #endif 1248 1091 1249 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 1092 1250 { … … 1094 1252 } 1095 1253 } 1096 1254 #if H_MV_6_GEN_0153_28 1255 if( pcVPS->getMaxLayersMinus1() > 0 ) 1256 { 1257 READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 ); 1258 } 1259 #endif 1260 #if H_MV_6_HRD_O0217_13 1261 pcVPS->deriveTargetLayerIdLists(); 1262 #endif 1097 1263 READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 ); 1098 1264 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 1103 1269 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 1104 1270 { 1271 #if H_MV_6_PS_REP_FORM_18_19_20 1272 assert( pcVPS->getRepFormat(i) == NULL ); 1273 TComRepFormat* curRepFormat = new TComRepFormat(); 1274 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1275 parseRepFormat( i, curRepFormat , prevRepFormat); 1276 pcVPS->setRepFormat(i, curRepFormat ); 1277 #else 1105 1278 assert( pcVPS->getRepFormat(i) == NULL ); 1106 1279 TComRepFormat* repFormat = new TComRepFormat(); 1107 1280 parseRepFormat( repFormat ); 1108 1281 pcVPS->setRepFormat(i, repFormat ); 1282 #endif 1109 1283 } 1110 1284 … … 1115 1289 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 1116 1290 { 1291 #if H_MV_6_PS_REP_FORM_18_19_20 1292 READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode ); 1293 #else 1117 1294 READ_CODE( 4, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode ); 1295 #endif 1118 1296 } 1119 1297 } … … 1121 1299 1122 1300 READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 ); 1301 #if H_MV_6_MISC_O0062_31 1302 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1303 { 1304 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) == 0 ) 1305 { 1306 READ_FLAG( uiCode, "poc_lsb_not_present_flag" ); pcVPS->setPocLsbNotPresentFlag( i, uiCode == 1 ); 1307 } 1308 } 1309 #endif 1310 1311 #if H_MV_6_HRD_O0217_13 1312 parseDpbSize( pcVPS ); 1313 #endif 1314 1315 #if !H_MV_6_PS_O0223_29 1123 1316 READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPS->setCrossLayerIrapAlignedFlag( uiCode == 1 ); 1317 #endif 1124 1318 READ_UVLC( uiCode, "direct_dep_type_len_minus2") ; pcVPS->setDirectDepTypeLenMinus2 ( uiCode ); 1125 1319 1320 #if H_MV_6_PS_O0096_21 1321 READ_FLAG( uiCode, "default_direct_dependency_flag" ); pcVPS->setDefaultDirectDependencyFlag( uiCode == 1 ); 1322 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1323 { 1324 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "default_direct_dependency_type" ); pcVPS->setDefaultDirectDependencyType( uiCode ); 1325 } 1326 1327 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1328 { 1329 for( Int j = 0; j < i; j++ ) 1330 { 1331 if (pcVPS->getDirectDependencyFlag( i, j) ) 1332 { 1333 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1334 { 1335 pcVPS->setDirectDependencyType( i, j , pcVPS->getDefaultDirectDependencyType( ) ); 1336 } 1337 else 1338 { 1339 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode); 1340 } 1341 } 1342 } 1343 } 1344 #else 1126 1345 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1127 1346 { … … 1134 1353 } 1135 1354 } 1355 #endif 1136 1356 1137 1357 READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" ); 1358 #if !H_MV_6_PS_O0109_24 1138 1359 READ_FLAG( uiCode, "vps_vui_present_flag" ) ; pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); 1360 #endif 1139 1361 1140 1362 if( pcVPS->getVpsVuiPresentFlag() ) … … 1145 1367 1146 1368 pcVPS->checkVPSExtensionSyntax(); 1369 #if !H_MV_6_MISC_O0062_31 1147 1370 pcVPS->setRefLayers(); 1148 } 1149 1371 #endif 1372 } 1373 1374 #if H_MV_6_PS_REP_FORM_18_19_20 1375 Void TDecCavlc::parseRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1376 #else 1150 1377 Void TDecCavlc::parseRepFormat( TComRepFormat* pcRepFormat ) 1378 #endif 1151 1379 { 1152 1380 assert( pcRepFormat ); 1153 1381 1154 1382 UInt uiCode; 1383 1384 #if H_MV_6_PS_REP_FORM_18_19_20 1385 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1386 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode ); 1387 READ_FLAG( uiCode, "chroma_and_bit_depth_vps_present_flag" ); pcRepFormat->setChromaAndBitDepthVpsPresentFlag( uiCode == 1 ); 1388 1389 pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i ); 1390 1391 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1392 { 1393 #endif 1155 1394 READ_CODE( 2, uiCode, "chroma_format_vps_idc" ); pcRepFormat->setChromaFormatVpsIdc ( uiCode ); 1156 1395 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) … … 1158 1397 READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 ); 1159 1398 } 1399 #if !H_MV_6_PS_REP_FORM_18_19_20 1160 1400 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1161 1401 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode ); 1402 #endif 1162 1403 READ_CODE( 4, uiCode, "bit_depth_vps_luma_minus8" ); pcRepFormat->setBitDepthVpsLumaMinus8 ( uiCode ); 1163 1404 READ_CODE( 4, uiCode, "bit_depth_vps_chroma_minus8" ); pcRepFormat->setBitDepthVpsChromaMinus8 ( uiCode ); 1405 #if H_MV_6_PS_REP_FORM_18_19_20 1406 } 1407 else 1408 { 1409 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, false ); 1410 } 1411 #endif 1164 1412 } 1165 1413 … … 1174 1422 1175 1423 UInt uiCode; 1424 #if H_MV_6_PS_O0223_29 1425 READ_FLAG( uiCode, "cross_layer_pic_type_aligned_flag" ); pcVPSVUI->setCrossLayerPicTypeAlignedFlag( uiCode == 1 ); 1426 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) 1427 { 1428 READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 ); 1429 } 1430 #endif 1176 1431 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 ); 1177 1432 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 ); … … 1204 1459 } 1205 1460 1461 #if H_MV_6_O0226_37 1462 READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 ); 1463 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1464 { 1465 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1466 { 1467 READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 ); 1468 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1469 { 1470 READ_FLAG( uiCode, "loop_filter_not_across_tiles_flag[i]" ); pcVPSVUI->setLoopFilterNotAcrossTilesFlag( i, uiCode == 1 ); 1471 } 1472 } 1473 1474 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1475 { 1476 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) 1477 { 1478 Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j )); 1479 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1480 { 1481 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); pcVPSVUI->setTileBoundariesAlignedFlag( i, j, uiCode == 1 ); 1482 } 1483 } 1484 } 1485 } 1486 1487 READ_FLAG( uiCode, "wpp_not_in_use_flag" ); pcVPSVUI->setWppNotInUseFlag( uiCode == 1 ); 1488 1489 if( !pcVPSVUI->getWppNotInUseFlag( )) 1490 { 1491 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1492 { 1493 READ_FLAG( uiCode, "wpp_in_use_flag[i]" ); pcVPSVUI->setWppInUseFlag( i, uiCode == 1 ); 1494 } 1495 } 1496 #else 1206 1497 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1207 1498 { … … 1211 1502 } 1212 1503 } 1504 #endif 1213 1505 1214 1506 READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 ); … … 1232 1524 } 1233 1525 } 1234 } 1526 1527 #if H_MV_6_PS_O0118_33 1528 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 ); 1529 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1530 { 1531 READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode ); 1532 } 1533 else 1534 { 1535 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1536 } 1537 1538 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1539 { 1540 assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL ); 1541 TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo(); 1542 parseVideoSignalInfo( curVideoSignalInfo ); 1543 pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo ); 1544 } 1545 1546 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1547 { 1548 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1549 { 1550 READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode ); 1551 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1552 } 1553 } 1554 else 1555 { 1556 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1557 { 1558 pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ); 1559 } 1560 } 1561 #endif 1562 #if H_MV_6_HRD_O0164_15 1563 READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 ); 1564 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) 1565 { 1566 parseVpsVuiBspHrdParameters( pcVPS ); 1567 } 1568 #endif 1569 } 1570 1571 #if H_MV_6_HRD_O0164_15 1572 Void TDecCavlc::parseVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1573 { 1574 assert( pcVPS ); 1575 1576 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1577 1578 assert( pcVPSVUI ); 1579 1580 TComVpsVuiBspHrdParameters* vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 1581 1582 assert ( vpsVuiBspHrdP ); 1583 1584 UInt uiCode; 1585 READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vpsVuiBspHrdP->setVpsNumBspHrdParametersMinus1( uiCode ); 1586 for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ ) 1587 { 1588 if( i > 0 ) 1589 { 1590 READ_FLAG( uiCode, "bsp_cprms_present_flag" ); vpsVuiBspHrdP->setBspCprmsPresentFlag( i, uiCode == 1 ); 1591 } 1592 TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 1593 parseHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() ); 1594 } 1595 for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ ) 1596 { 1597 READ_UVLC( uiCode, "num_bitstream_partitions" ); vpsVuiBspHrdP->setNumBitstreamPartitions( h, uiCode ); 1598 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1599 { 1600 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1601 { 1602 if( pcVPS->getLayerIdIncludedFlag( h ,j ) ) 1603 { 1604 READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 ); 1605 } 1606 else 1607 { 1608 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1609 } 1610 } 1611 } 1612 vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 1613 1614 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1615 { 1616 READ_UVLC( uiCode, "num_bsp_sched_combinations" ); vpsVuiBspHrdP->setNumBspSchedCombinations( h, uiCode ); 1617 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1618 { 1619 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1620 { 1621 READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode ); 1622 READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode ); 1623 } 1624 } 1625 } 1626 } 1627 } 1628 #endif 1629 1630 #if H_MV_6_PS_O0118_33 1631 Void TDecCavlc::parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1632 { 1633 UInt uiCode; 1634 READ_CODE( 3, uiCode, "video_vps_format" ); pcVideoSignalInfo->setVideoVpsFormat( uiCode ); 1635 READ_FLAG( uiCode, "video_full_range_vps_flag" ); pcVideoSignalInfo->setVideoFullRangeVpsFlag( uiCode == 1 ); 1636 READ_CODE( 8, uiCode, "colour_primaries_vps" ); pcVideoSignalInfo->setColourPrimariesVps( uiCode ); 1637 READ_CODE( 8, uiCode, "transfer_characteristics_vps" ); pcVideoSignalInfo->setTransferCharacteristicsVps( uiCode ); 1638 READ_CODE( 8, uiCode, "matrix_coeffs_vps" ); pcVideoSignalInfo->setMatrixCoeffsVps( uiCode ); 1639 } 1640 #endif 1641 1642 #if H_MV_6_HRD_O0217_13 1643 Void TDecCavlc::parseDpbSize( TComVPS* vps ) 1644 { 1645 UInt uiCode; 1646 TComDpbSize* dpbSize = vps->getDpbSize(); 1647 assert ( dpbSize != 0 ); 1648 1649 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1650 { 1651 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 ); 1652 1653 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1654 { 1655 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1656 { 1657 READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag" ); dpbSize->setSubLayerDpbInfoPresentFlag( i, j, uiCode == 1 ); 1658 } 1659 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1660 { 1661 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1662 { 1663 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); 1664 } 1665 READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode ); 1666 READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode ); 1667 } 1668 else 1669 { 1670 if ( j > 0 ) 1671 { 1672 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1673 { 1674 dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); 1675 } 1676 dpbSize->setMaxVpsNumReorderPics ( i, j, dpbSize->getMaxVpsNumReorderPics ( i, j - 1 ) ); 1677 dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1678 } 1679 } 1680 } 1681 } 1682 } 1683 #endif 1235 1684 #endif 1236 1685 … … 1280 1729 if (i!=1) 1281 1730 { 1282 READ_UVLC (uiCode, "log2_sub_PU_size_minus2 "); pcVPS->setSubPULog2Size(i, uiCode+2);1731 READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]"); pcVPS->setSubPULog2Size(i, uiCode+2); 1283 1732 } 1284 1733 #endif … … 1357 1806 sps->inferRepFormat ( vps , rpcSlice->getLayerId() ); 1358 1807 sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); 1359 1808 #if H_MV_6_PS_O0118_33 1809 if ( sps->getVuiParametersPresentFlag() ) 1810 { 1811 sps->getVuiParameters()->inferVideoSignalInfo( vps, rpcSlice->getLayerId() ); 1812 } 1813 #endif 1360 1814 rpcSlice->setVPS(vps); 1361 1815 rpcSlice->setViewId ( vps->getViewId ( rpcSlice->getLayerId() ) ); … … 1411 1865 #if H_MV 1412 1866 Int esb = 0; //Don't use i, otherwise will shadow something below 1867 #if !H_MV_6_RALS_O0149_11 1413 1868 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1414 1869 { … … 1416 1871 READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 ); 1417 1872 } 1873 #endif 1418 1874 1419 1875 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1422 1878 READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 ); 1423 1879 } 1880 1881 #if H_MV_6_RALS_O0149_11 1882 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1883 { 1884 esb++; 1885 READ_FLAG( uiCode, "cross_layer_bla_flag" ); rpcSlice->setCrossLayerBlaFlag( uiCode == 1 ); 1886 } 1887 rpcSlice->checkCrossLayerBlaFlag( ); 1888 1889 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1890 { 1891 esb++; 1892 READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 ); 1893 } 1894 #endif 1424 1895 1425 1896 for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 1445 1916 // colour_plane_id u(2) 1446 1917 1918 1919 #if H_MV_6_POC_31_35_38 1920 UInt slicePicOrderCntLsb = 0; 1921 Int iPOClsb = slicePicOrderCntLsb; // Needed later 1922 if ( (rpcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( rpcSlice->getLayerIdInVps())) || !rpcSlice->getIdrPicFlag() ) 1923 { 1924 READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb"); 1925 } 1926 1927 Bool picOrderCntMSBZeroFlag = false; 1928 1929 // as in HM code. However are all cases for IRAP picture with NoRaslOutputFlag equal to 1 covered?? 1930 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP ); 1931 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 1932 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ); 1933 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || rpcSlice->getIdrPicFlag(); 1934 1935 // TBD picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getLayerId() > 0 && !rpcSlice->getFirstPicInLayerDecodedFlag() ); 1936 1937 Int picOrderCntMSB = 0; 1938 1939 if ( !picOrderCntMSBZeroFlag ) 1940 { 1941 Int prevPicOrderCnt = rpcSlice->getPrevTid0POC(); 1942 Int maxPicOrderCntLsb = 1 << sps->getBitsForPOC(); 1943 Int prevPicOrderCntLsb = prevPicOrderCnt & (maxPicOrderCntLsb - 1); 1944 Int prevPicOrderCntMsb = prevPicOrderCnt - prevPicOrderCntLsb; 1945 1946 if( ( slicePicOrderCntLsb < prevPicOrderCntLsb ) && ( ( prevPicOrderCntLsb - slicePicOrderCntLsb ) >= ( maxPicOrderCntLsb / 2 ) ) ) 1947 { 1948 picOrderCntMSB = prevPicOrderCntMsb + maxPicOrderCntLsb; 1949 } 1950 else if( (slicePicOrderCntLsb > prevPicOrderCntLsb ) && ( (slicePicOrderCntLsb - prevPicOrderCntLsb ) > ( maxPicOrderCntLsb / 2 ) ) ) 1951 { 1952 picOrderCntMSB = prevPicOrderCntMsb - maxPicOrderCntLsb; 1953 } 1954 else 1955 { 1956 picOrderCntMSB = prevPicOrderCntMsb; 1957 } 1958 } 1959 1960 rpcSlice->setPOC( picOrderCntMSB + slicePicOrderCntLsb ); 1961 if ( rpcSlice->getPocResetFlag() ) 1962 { 1963 rpcSlice->setPocBeforeReset ( rpcSlice->getPOC() ); 1964 rpcSlice->setPOC ( 0 ); 1965 } 1966 #endif 1967 1447 1968 if( rpcSlice->getIdrPicFlag() ) 1448 1969 { 1970 #if !H_MV_6_POC_31_35_38 1449 1971 rpcSlice->setPOC(0); 1972 #endif 1450 1973 TComReferencePictureSet* rps = rpcSlice->getLocalRPS(); 1451 1974 rps->setNumberOfNegativePictures(0); … … 1460 1983 else 1461 1984 { 1985 #if !H_MV_6_POC_31_35_38 1462 1986 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1463 1987 Int iPOClsb = uiCode; … … 1494 2018 1495 2019 } 2020 #endif 1496 2021 #endif 1497 2022 TComReferencePictureSet* rps; … … 1628 2153 } 1629 2154 #if H_MV 2155 #if H_MV_6_ILDDS_ILREFPICS_27_34 2156 Bool interLayerPredLayerIdcPresentFlag = false; 2157 #endif 1630 2158 Int layerId = rpcSlice->getLayerId(); 1631 if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) { 2159 if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) 2160 { 1632 2161 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 ); 1633 2162 if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 ) … … 1639 2168 if ( rpcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1640 2169 { 2170 #if H_MV_6_ILDDS_ILREFPICS_27_34 2171 interLayerPredLayerIdcPresentFlag = true; 2172 #endif 1641 2173 for( Int idx = 0; idx < rpcSlice->getNumActiveRefLayerPics(); idx++ ) 1642 2174 { … … 1646 2178 } 1647 2179 } 2180 #if H_MV_6_ILDDS_ILREFPICS_27_34 2181 if ( !interLayerPredLayerIdcPresentFlag ) 2182 { 2183 for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ ) 2184 { 2185 rpcSlice->setInterLayerPredLayerIdc( i, rpcSlice->getRefLayerPicIdc( i ) ); 2186 } 2187 } 2188 #endif 1648 2189 #endif 1649 2190 if(sps->getUseSAO()) -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r655 r738 78 78 #if H_MV 79 79 Void parseVPSExtension ( TComVPS* pcVPS ); 80 #if H_MV_6_PS_REP_FORM_18_19_20 81 Void parseRepFormat ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat ); 82 #else 80 83 Void parseRepFormat ( TComRepFormat* pcRepFormat ); 84 #endif 81 85 Void parseVPSVUI ( TComVPS* pcVPS ); 86 #if H_MV_6_PS_O0118_33 87 Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo ); 88 #endif 89 #if H_MV_6_HRD_O0217_13 90 Void parseDpbSize ( TComVPS* pcVPS ); 91 #endif 92 #if H_MV_6_HRD_O0164_15 93 Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS ); 94 #endif 82 95 #endif 83 96 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r724 r738 635 635 #if H_MV 636 636 m_apcSlicePilot->setVPS(vps); 637 #if H_MV_6_PS_0092_17 638 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 639 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) ); 640 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 641 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) ); 642 #endif 637 643 sps->inferRepFormat ( vps , m_layerId ); 638 644 sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); … … 665 671 666 672 #if H_MV 673 #if H_MV_FIX_SKIP_PICTURES 674 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 675 #else 667 676 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ) 677 #endif 668 678 { 669 679 assert( nalu.m_layerId == m_layerId ); … … 722 732 #endif 723 733 #endif 734 735 #if H_MV_LAYER_WISE_STARTUP 736 xCeckNoClrasOutput(); 737 #endif 724 738 // Skip pictures due to random access 725 739 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 727 741 m_prevSliceSkipped = true; 728 742 m_skippedPOC = m_apcSlicePilot->getPOC(); 743 #if H_MV_FIX_SKIP_PICTURES 744 sliceSkippedFlag = true; 745 #endif 729 746 return false; 730 747 } … … 734 751 m_prevSliceSkipped = true; 735 752 m_skippedPOC = m_apcSlicePilot->getPOC(); 753 #if H_MV_FIX_SKIP_PICTURES 754 sliceSkippedFlag = true; 755 #endif 736 756 return false; 737 757 } … … 1171 1191 1172 1192 #if H_MV 1193 #if H_MV_FIX_SKIP_PICTURES 1194 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 1195 #else 1173 1196 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag) 1197 #endif 1174 1198 #else 1175 1199 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) … … 1216 1240 case NAL_UNIT_CODED_SLICE_RASL_R: 1217 1241 #if H_MV 1242 #if H_MV_FIX_SKIP_PICTURES 1243 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag ); 1244 #else 1218 1245 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag); 1246 #endif 1219 1247 #else 1220 1248 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); … … 1265 1293 return true; 1266 1294 } 1295 #if H_MV_LAYER_WISE_STARTUP 1296 else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet. 1297 #else 1267 1298 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1299 #endif 1268 1300 { 1269 1301 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA … … 1272 1304 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ) 1273 1305 { 1306 1307 #if H_MV_LAYER_WISE_STARTUP 1308 if ( xAllRefLayersInitilized() ) 1309 { 1310 m_layerInitilizedFlag[ m_layerId ] = true; 1311 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1312 } 1313 else 1314 { 1315 return true; 1316 } 1317 #else 1274 1318 // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT. 1275 1319 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1320 #endif 1276 1321 } 1277 1322 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1278 1323 { 1324 #if H_MV_LAYER_WISE_STARTUP 1325 if ( xAllRefLayersInitilized() ) 1326 { 1327 m_layerInitilizedFlag[ m_layerId ] = true; 1279 1328 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1280 1329 } 1281 1330 else 1282 1331 { 1332 return true; 1333 } 1334 #else 1335 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1336 #endif 1337 } 1338 else 1339 { 1340 #if H_MV_FIX_SKIP_PICTURES 1341 static Bool warningMessage[MAX_NUM_LAYERS]; 1342 static Bool warningInitFlag = false; 1343 1344 if (!warningInitFlag) 1345 { 1346 for ( Int i = 0; i < MAX_NUM_LAYERS; i++) 1347 { 1348 warningMessage[i] = true; 1349 } 1350 warningInitFlag = true; 1351 } 1352 1353 if ( warningMessage[getLayerId()] ) 1354 { 1355 printf("\nLayer%3d No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() ); 1356 warningMessage[m_layerId] = false; 1357 } 1358 #else 1283 1359 static Bool warningMessage = false; 1284 1360 if(!warningMessage) … … 1287 1363 warningMessage = true; 1288 1364 } 1365 #endif 1289 1366 return true; 1290 1367 } … … 1296 1373 return true; 1297 1374 } 1375 #if H_MV_LAYER_WISE_STARTUP 1376 return !m_layerInitilizedFlag[ getLayerId() ]; 1377 #else 1298 1378 // if we reach here, then the picture is not skipped. 1299 1379 return false; 1380 #endif 1300 1381 } 1301 1382 … … 1338 1419 } 1339 1420 } 1421 1422 #if H_MV_LAYER_WISE_STARTUP 1423 Void TDecTop::xCeckNoClrasOutput() 1424 { 1425 // This part needs further testing! 1426 if ( getLayerId() == 0 ) 1427 { 1428 NalUnitType nut = m_apcSlicePilot->getNalUnitType(); 1429 1430 Bool isBLA = ( nut == NAL_UNIT_CODED_SLICE_BLA_W_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 1431 Bool isIDR = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP ); 1432 Bool noClrasOutputFlag = isBLA || ( isIDR && m_apcSlicePilot->getCrossLayerBlaFlag() ); 1433 1434 if ( noClrasOutputFlag ) 1435 { 1436 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 1437 { 1438 m_layerInitilizedFlag[i] = false; 1439 } 1440 } 1441 } 1442 } 1443 1444 Bool TDecTop::xAllRefLayersInitilized() 1445 { 1446 Bool allRefLayersInitilizedFlag = true; 1447 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1448 for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId() ); i++ ) 1449 { 1450 Int refLayerId = vps->getRefLayerId( m_layerId, i ); 1451 allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 1452 } 1453 1454 return allRefLayersInitilizedFlag; 1455 } 1456 #endif 1340 1457 #endif 1341 1458 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r724 r738 186 186 TComList<TComPic*> m_cListPic; // Dynamic buffer 187 187 #if H_MV 188 #if H_MV_LAYER_WISE_STARTUP 189 Bool* m_layerInitilizedFlag; // initialization Layers 190 #endif 188 191 static ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 189 192 #else … … 243 246 Void init(); 244 247 #if H_MV 248 #if H_MV_FIX_SKIP_PICTURES 249 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag ); 250 #else 251 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer ); 252 #endif 245 253 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer ); 246 254 #else … … 260 268 TComList<TComPic*>* getListPic () { return &m_cListPic; } 261 269 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; } 262 270 #if H_MV_LAYER_WISE_STARTUP 271 Void setLayerInitilizedFlags( Bool* val ) { m_layerInitilizedFlag = val; } 272 #endif 273 #if H_MV_6_HRD_O0217_13 274 TComVPS* getPrefetchedVPS () { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present. 275 #endif 263 276 Int getCurrPoc () { return m_apcSlicePilot->getPOC(); } 264 277 Void setLayerId ( Int layer) { m_layerId = layer; } … … 281 294 #if H_MV 282 295 TComPic* xGetPic( Int layerId, Int poc ); 296 #if H_MV_FIX_SKIP_PICTURES 297 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 298 #else 283 299 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 300 #endif 284 301 Void xResetPocInPicBuffer(); 302 #if H_MV_LAYER_WISE_STARTUP 303 Void xCeckNoClrasOutput(); 304 305 Bool xAllRefLayersInitilized(); 306 #endif 285 307 #else 286 308 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
Note: See TracChangeset for help on using the changeset viewer.