Changeset 854 in 3DVCSoftware for branches/HTM-10.0-dev0/source/Lib/TLibDecoder
- Timestamp:
- 13 Feb 2014, 22:58:51 (11 years ago)
- Location:
- branches/HTM-10.0-dev0/source/Lib/TLibDecoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r852 r854 366 366 367 367 READ_FLAG( uiCode, "pps_extension_flag"); 368 #if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION 369 if (uiCode) 370 { 371 #if H_MV 372 for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ ) 373 { 374 READ_FLAG( uiCode, "pps_extension_type_flag" ); pcPPS->setPpsExtensionTypeFlag( i, uiCode == 1 ); 375 #if H_3D 376 assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_3D || i == PPS_EX_T_ESC ); 377 #else 378 assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_ESC ); 379 #endif 380 } 381 382 383 if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) ) 384 { 385 #if H_MV_HLS7_GEN 386 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 ); 387 #endif 388 } 389 390 #if H_3D 391 if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC 392 { 393 parsePPSExtension( pcPPS, pcVPS ); 394 } 395 #endif 396 397 if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_ESC ) ) 398 { 399 #endif 400 while ( xMoreRbspData() ) 401 { 402 READ_FLAG( uiCode, "pps_extension_data_flag"); 403 } 404 #if H_MV 405 } 406 #endif 407 } 408 #else 368 409 if (uiCode) 369 410 { … … 382 423 #endif 383 424 } 425 #endif 384 426 } 385 427 … … 807 849 assert(uiCode <= 12); 808 850 851 #if H_MV_HLS_7_SPS_P0155_16_32 852 if ( pcSPS->getLayerId() == 0 ) 853 { 854 #endif 809 855 UInt subLayerOrderingInfoPresentFlag; 810 856 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); … … 842 888 } 843 889 } 890 #if H_MV_HLS_7_SPS_P0155_16_32 891 } 892 #endif 844 893 845 894 READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" ); … … 1004 1053 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode ); 1005 1054 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode ); 1055 #if H_MV_HLS_7_RESERVED_FLAGS 1056 READ_FLAG( uiCode, "sps_multilayer_ext_reserved_zero_flag[ i ]" ); 1057 #endif 1006 1058 } 1007 1059 } … … 1039 1091 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 1040 1092 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 1041 #if H_MV 1093 1094 1095 #if H_MV && !H_MV_HLS7_GEN 1042 1096 READ_CODE( 16, uiCode, "vps_extension_offset" ); 1043 1097 #else … … 1154 1208 UInt uiCode; 1155 1209 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false ); 1156 READ_FLAG( uiCode, "vps_vui_present_flag" ); pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); if ( pcVPS->getVpsVuiPresentFlag() ) 1210 #if !H_MV_HLS7_GEN 1211 READ_FLAG( uiCode, "vps_vui_present_flag" ); pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); 1212 if ( pcVPS->getVpsVuiPresentFlag() ) 1157 1213 { 1158 1214 READ_CODE( 16, uiCode, "vps_vui_offset" ); pcVPS->setVpsVuiOffset( uiCode ); 1159 1215 } 1216 #endif 1160 1217 1161 1218 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false ); … … 1233 1290 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 1234 1291 { 1235 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )1292 for (Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1236 1293 { 1237 1294 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode ); … … 1242 1299 else 1243 1300 { 1244 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )1301 for (Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1245 1302 { 1246 1303 pcVPS->setSubLayersVpsMaxMinus1( i, pcVPS->getMaxTLayers( ) - 1); … … 1264 1321 1265 1322 READ_FLAG( uiCode, "all_ref_layers_active_flag" ); pcVPS->setAllRefLayersActiveFlag( uiCode == 1 ); 1323 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1266 1324 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); pcVPS->setVpsNumberLayerSetsMinus1 ( uiCode ); 1325 #endif 1326 1327 #if !H_MV_HLS7_GEN 1267 1328 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1" ); pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 1268 1329 #else 1330 READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" ); pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 1331 #endif 1269 1332 for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ ) 1270 1333 { 1271 1334 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 ); 1335 #if !H_MV_HLS_7_VPS_P0048_14 1272 1336 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 1273 1337 { … … 1275 1339 pcVPS->checkProfileRefMinus1( i ); 1276 1340 } 1341 #endif 1277 1342 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1); 1278 1343 if( !pcVPS->getVpsProfilePresentFlag( i ) ) 1279 1344 { 1280 1345 TComPTL temp = *pcVPS->getPTL( i ); 1346 #if H_MV_HLS_7_VPS_P0048_14 1347 *pcVPS->getPTL( i ) = *pcVPS->getPTL( i - 1 ); 1348 #else 1281 1349 *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 ); 1350 #endif 1282 1351 pcVPS->getPTL( i )->copyLevelFrom( &temp ); 1283 1352 } 1284 1353 } 1285 1354 1355 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1356 READ_UVLC( uiCode, "num_add_output_layer_sets" ); pcVPS->setNumAddOutputLayerSets( uiCode ); 1357 pcVPS->initTargetLayerIdLists( ); 1358 if( pcVPS->getNumOutputLayerSets() > 1) 1359 { 1360 READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); pcVPS->setDefaultTargetOutputLayerIdc( std::min( uiCode, (UInt) 2 ) ); 1361 } 1362 1363 #else 1286 1364 Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 1287 1365 … … 1299 1377 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 1300 1378 } 1379 #endif 1301 1380 1302 1381 pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 )); 1303 1382 pcVPS->setOutputLayerSetIdxMinus1(0, -1); 1383 1384 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1385 pcVPS->deriveTargetLayerIdList( 0 ); 1386 for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ ) 1387 { 1388 if( i > pcVPS->getVpsNumLayerSetsMinus1( ) ) 1389 #else 1304 1390 for( Int i = 1; i < numOutputLayerSets; i++ ) 1305 1391 { 1306 1392 if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) ) 1393 #endif 1307 1394 { 1308 1395 READ_UVLC( uiCode, "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode ); 1396 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1397 } 1398 1399 if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultTargetOutputLayerIdc() == 2 ) 1400 { 1401 for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ ) 1402 { 1403 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 ); 1404 } 1405 } 1406 else 1407 { 1408 for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ ) 1409 { 1410 pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j )); 1411 } 1412 } 1413 pcVPS->deriveTargetLayerIdList( i ); 1414 #else 1309 1415 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 1310 1416 { … … 1320 1426 } 1321 1427 } 1322 1428 #endif 1323 1429 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 1324 1430 { 1325 1431 READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" ); pcVPS->setProfileLevelTierIdx( i , uiCode ); 1326 1432 } 1433 1434 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1435 if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 ) 1436 { 1437 READ_FLAG( uiCode, "alt_output_layer_flag[ i ]" ); pcVPS->setAltOutputLayerFlag( i, uiCode == 1 ); 1438 } 1439 } 1440 #else 1327 1441 } 1328 1442 if( pcVPS->getMaxLayersMinus1() > 0 ) … … 1330 1444 READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 ); 1331 1445 } 1446 #endif 1447 1448 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1332 1449 pcVPS->deriveTargetLayerIdLists(); 1450 #endif 1451 1333 1452 READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 ); 1334 1453 if ( pcVPS->getRepFormatIdxPresentFlag() ) 1335 1454 { 1455 #if H_MV_HLS7_GEN 1456 READ_UVLC( 4, uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode ); 1457 #else 1336 1458 READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode ); 1459 #endif 1337 1460 } 1338 1461 … … 1358 1481 1359 1482 READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 ); 1483 #if H_MV_HLS7_GEN 1484 READ_FLAG( uiCode, "vps_poc_lsb_aligned_flag" ); pcVPS->setVpsPocLsbAlignedFlag( uiCode == 1 ); 1485 #endif 1360 1486 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1361 1487 { … … 1366 1492 } 1367 1493 1494 #if H_MV_HLS_7_RESERVED_FLAGS 1495 READ_FLAG( uiCode, "vps_reserved_zero_flag" ); 1496 #endif 1368 1497 parseDpbSize( pcVPS ); 1369 1498 … … 1394 1523 } 1395 1524 1525 #if H_MV_HLS7_GEN 1526 READ_UVLC( uiCode, "vps_non_vui_extension_length" ); pcVPS->setVpsNonVuiExtensionLength( uiCode ); 1527 for ( Int i = 1; i < pcVPS->getVpsNonVuiExtensionLength(); i++ ) 1528 { 1529 READ_CODE( 8, uiCode, "vps_non_vui_extension_data_byte" ); 1530 } 1531 READ_FLAG( uiCode, "vps_vui_present_flag" ); pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); if ( pcVPS->getVpsVuiPresentFlag() ) 1532 #endif 1533 #if !H_MV_HLS_7_RESERVED_FLAGS 1396 1534 READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" ); 1397 1535 #endif 1398 1536 if( pcVPS->getVpsVuiPresentFlag() ) 1399 1537 { … … 1401 1539 parseVPSVUI( pcVPS ); 1402 1540 } 1541 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG 1542 { 1543 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1544 assert( pcVPSVUI ); 1545 pcVPSVUI->inferVpsVui( false ); 1546 } 1547 #endif 1403 1548 1404 1549 pcVPS->checkVPSExtensionSyntax(); … … 1448 1593 READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 ); 1449 1594 } 1595 #if H_MV_HLS_7_MISC_P0068_21 1596 if( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ) 1597 { 1598 READ_FLAG( uiCode, "all_layers_idr_aligned_flag" ); pcVPSVUI->setAllLayersIdrAlignedFlag( uiCode == 1 ); 1599 } 1600 #endif 1450 1601 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 ); 1451 1602 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 ); 1452 1603 if( pcVPSVUI->getBitRatePresentVpsFlag( ) || pcVPSVUI->getPicRatePresentVpsFlag( ) ) 1453 1604 { 1605 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1606 for( Int i = 0; i <= pcVPS->getVpsNumLayerSetsMinus1(); i++ ) 1607 #else 1454 1608 for( Int i = 0; i <= pcVPS->getVpsNumberLayerSetsMinus1(); i++ ) 1609 #endif 1455 1610 { 1456 1611 for( Int j = 0; j <= pcVPS->getMaxTLayers(); j++ ) … … 1477 1632 } 1478 1633 } 1634 1635 #if H_MV_HLS_7_VPS_P0076_15 1636 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 ); 1637 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1638 { 1639 READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode ); 1640 } 1641 else 1642 { 1643 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1644 } 1645 1646 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1647 { 1648 assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL ); 1649 TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo(); 1650 parseVideoSignalInfo( curVideoSignalInfo ); 1651 pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo ); 1652 } 1653 1654 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1655 { 1656 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1657 { 1658 READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode ); 1659 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1660 } 1661 } 1662 else 1663 { 1664 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1665 { 1666 pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ); 1667 } 1668 } 1669 #endif 1479 1670 1480 1671 READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 ); … … 1513 1704 } 1514 1705 1706 #if H_MV_HLS_7_RESERVED_FLAGS 1707 READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" ); 1708 #endif 1709 1515 1710 READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 ); 1516 1711 … … 1534 1729 } 1535 1730 1731 #if !H_MV_HLS_7_VPS_P0076_15 1536 1732 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 ); 1537 1733 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) … … 1567 1763 } 1568 1764 } 1765 #endif 1569 1766 READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 ); 1570 1767 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) … … 1572 1769 parseVpsVuiBspHrdParameters( pcVPS ); 1573 1770 } 1771 #if H_MV_HLS_7_MISC_P0182_13 1772 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1773 { 1774 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i )) == 0 ) 1775 { 1776 READ_FLAG( uiCode, "base_layer_parameter_set_compatibility_flag" ); pcVPSVUI->setBaseLayerParameterSetCompatibilityFlag( i, uiCode == 1 ); 1777 } 1778 } 1779 #endif 1574 1780 } 1575 1781 … … 1650 1856 { 1651 1857 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 ); 1652 1858 #if H_MV_HLS_7_HRD_P0156_7 1859 for( Int j = 0; j <= vps->getMaxSubLayersInLayerSetMinus1( i ); j++ ) 1860 #else 1653 1861 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1862 #endif 1654 1863 { 1655 1864 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) … … 1659 1868 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1660 1869 { 1870 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1871 for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ ) 1872 #else 1661 1873 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1874 #endif 1662 1875 { 1663 1876 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); 1664 1877 } 1665 1878 READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode ); 1879 #if H_MV_HLS7_GEN 1880 if( vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ) != vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ) ) 1881 { 1882 for( Int k = 0; k < vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ ) 1883 { 1884 READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1" ); dpbSize->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode ); 1885 } 1886 } 1887 #endif 1666 1888 READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode ); 1667 1889 } … … 1704 1926 #if H_3D_SPIVMP 1705 1927 #if SEC_SPIVMP_MCP_SIZE_G0077 1706 READ_UVLC (uiCode, "log2_sub_PU_size_minus3 "); pcVPS->setSubPULog2Size(i, uiCode+3);1928 READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]"); pcVPS->setSubPULog2Size(i, uiCode+3); 1707 1929 #else 1708 1930 READ_UVLC (uiCode, "log2_sub_PU_size_minus2"); pcVPS->setSubPULog2Size(i, uiCode+2); … … 1761 1983 for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++) 1762 1984 { 1985 #if FIX_CAM_PARS_COLLECTOR 1986 pcVPS->setCamParPresent ( viewIndex, false ); 1987 pcVPS->setHasCamParInSliceHeader( viewIndex, false ); 1988 #endif 1763 1989 READ_FLAG( uiCode, "cp_present_flag[i]" ); bCamParPresentFlag = ( uiCode == 1); 1764 1990 if ( bCamParPresentFlag ) … … 1890 2116 rpcSlice->checkCrossLayerBlaFlag( ); 1891 2117 2118 #if !H_MV_HLS7_GEN 1892 2119 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1893 2120 { … … 1895 2122 READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 ); 1896 2123 } 2124 #endif 1897 2125 1898 2126 for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 2492 2720 if(pps->getSliceHeaderExtensionPresentFlag()) 2493 2721 { 2722 #if !H_MV_HLS7_GEN 2494 2723 READ_UVLC(uiCode,"slice_header_extension_length"); 2495 2496 2724 for(Int i=0; i<uiCode; i++) 2497 2725 { … … 2500 2728 } 2501 2729 } 2730 #else 2731 #if H_MV 2732 READ_UVLC( uiCode, "slice_segment_header_extension_length" ); rpcSlice->setSliceSegmentHeaderExtensionLength( uiCode ); 2733 UInt posFollSliceSegHeaderExtLen = m_pcBitstream->getNumBitsRead(); 2734 2735 if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() ) 2736 { 2737 READ_CODE( 2, uiCode, "poc_reset_idc" ); rpcSlice->setPocResetIdc( uiCode ); 2738 } 2739 2740 if( rpcSlice->getPocResetIdc() != 0 ) 2741 { 2742 READ_CODE( 6, uiCode, "poc_reset_period_id" ); rpcSlice->setPocResetPeriodId( uiCode ); 2743 } 2744 2745 if( rpcSlice->getPocResetIdc() == 3 ) 2746 { 2747 READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 ); 2748 READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode ); 2749 } 2750 2751 if( !rpcSlice->getPocMsbValRequiredFlag() && rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() ) 2752 { 2753 READ_FLAG( uiCode, "poc_msb_val_present_flag" ); rpcSlice->setPocMsbValPresentFlag( uiCode == 1 ); 2754 } 2755 2756 if( rpcSlice->getPocMsbValPresentFlag() ) 2757 { 2758 READ_UVLC( uiCode, "poc_msb_val" ); rpcSlice->setPocMsbVal( uiCode ); 2759 } 2760 2761 while( ( m_pcBitstream->getNumBitsRead() - posFollSliceSegHeaderExtLen ) < rpcSlice->getSliceSegmentHeaderExtensionLength() * 8 ); 2762 { 2763 READ_FLAG( uiCode, "slice_segment_header_extension_data_bit" ); 2764 } 2765 assert( m_pcBitstream->getNumBitsRead() - posFollSliceSegHeaderExtLen ) == rpcSlice->getSliceSegmentHeaderExtensionLength() * 8 ); 2766 #else 2767 READ_UVLC( uiCode, "slice_header_extension_length" ); 2768 for(Int i=0; i<uiCode; i++) 2769 { 2770 UInt ignore; 2771 READ_CODE(8,ignore,"slice_header_extension_data_byte"); 2772 } 2773 } 2774 #endif 2775 #endif 2776 2502 2777 2503 2778 m_pcBitstream->readByteAlignment(); -
branches/HTM-10.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r852 r854 37 37 38 38 #include "TDecCu.h" 39 39 40 //! \ingroup TLibDecoder 40 41 //! \{ … … 638 639 639 640 m_ppcCU[uiDepth]->copySubCU( pcCU, uiAbsPartIdx, uiDepth ); 640 641 641 642 #if H_MV_ENC_DEC_TRAC 642 643 #if ENC_DEC_TRACE … … 927 928 } 928 929 #endif 929 930 930 931 #if H_3D && UPDATE_HM13 931 932 Bool useDltFlag = (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()); -
branches/HTM-10.0-dev0/source/Lib/TLibDecoder/TDecGop.cpp
r852 r854 43 43 #include "libmd5/MD5.h" 44 44 #include "TLibCommon/SEI.h" 45 45 46 #include <time.h> 46 47 -
branches/HTM-10.0-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r852 r854 51 51 m_aaiCodedOffset = new Int* [ MAX_NUM_LAYERS ]; 52 52 m_aaiCodedScale = new Int* [ MAX_NUM_LAYERS ]; 53 #if !FIX_CAM_PARS_COLLECTOR 53 54 m_aiViewId = new Int [ MAX_NUM_LAYERS ]; 54 55 55 56 m_bViewReceived = new Bool [ MAX_NUM_LAYERS ]; 57 #endif 56 58 for( UInt uiId = 0; uiId < MAX_NUM_LAYERS; uiId++ ) 57 59 { … … 63 65 m_iLog2Precision = LOG2_DISP_PREC_LUT; 64 66 m_uiBitDepthForLUT = 8; // fixed 67 #if FIX_CAM_PARS_COLLECTOR 68 m_receivedIdc = NULL; 69 m_vps = NULL; 70 #endif 65 71 } 66 72 … … 74 80 delete [] m_aaiCodedOffset; 75 81 delete [] m_aaiCodedScale; 82 #if !FIX_CAM_PARS_COLLECTOR 76 83 delete [] m_aiViewId; 77 84 delete [] m_bViewReceived; 85 #endif 78 86 79 87 xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 ); 80 88 xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 ); 81 } 82 89 #if FIX_CAM_PARS_COLLECTOR 90 xDeleteArray( m_receivedIdc, m_uiMaxViewIndex + 1 ); 91 #endif 92 } 93 94 95 #if FIX_CAM_PARS_COLLECTOR 96 Void 97 CamParsCollector::init( FILE* pCodedScaleOffsetFile, TComVPS* vps) 98 { 99 assert( !isInitialized() ); // Only one initialization currently supported 100 m_bInitialized = true; 101 m_vps = vps; 102 m_bCamParsVaryOverTime = false; 103 m_pCodedScaleOffsetFile = pCodedScaleOffsetFile; 104 m_lastPoc = -1; 105 m_firstReceivedPoc = -2; 106 107 m_uiMaxViewIndex = -1; 108 for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++) 109 { 110 Int curViewIdx = m_vps->getViewIndex( m_vps->getLayerIdInNuh( i )); 111 m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->hasCamParInSliceHeader( curViewIdx ); 112 m_uiMaxViewIndex = std::max( m_uiMaxViewIndex, curViewIdx ) ; 113 } 114 115 assert( m_receivedIdc == NULL ); 116 m_receivedIdc = new Int*[ m_uiMaxViewIndex + 1]; 117 for (Int i = 0; i <= m_uiMaxViewIndex; i++) 118 { 119 m_receivedIdc[i] = new Int[ m_uiMaxViewIndex + 1 ]; 120 } 121 122 xResetReceivedIdc( true ); 123 124 for (Int viewIndex = 0; viewIndex <= m_uiMaxViewIndex ; viewIndex++ ) 125 { 126 if (m_vps->getCamParPresent( viewIndex ) ) 127 { 128 if( !m_vps->hasCamParInSliceHeader( viewIndex ) ) 129 { 130 for (Int baseViewIndex = 0; baseViewIndex < viewIndex ; baseViewIndex++ ) 131 { 132 m_receivedIdc [ baseViewIndex ][ viewIndex ] = -1; 133 m_aaiCodedScale [ baseViewIndex ][ viewIndex ] = m_vps->getCodedScale (viewIndex) [ baseViewIndex ]; 134 m_aaiCodedOffset[ baseViewIndex ][ viewIndex ] = m_vps->getCodedOffset (viewIndex) [ baseViewIndex ]; 135 136 m_receivedIdc [ viewIndex ][ baseViewIndex ] = -1; 137 m_aaiCodedScale [ viewIndex ][ baseViewIndex ] = m_vps->getInvCodedScale (viewIndex) [ baseViewIndex ]; 138 m_aaiCodedOffset[ viewIndex ][ baseViewIndex ] = m_vps->getInvCodedOffset(viewIndex) [ baseViewIndex ]; 139 xInitLUTs( baseViewIndex, viewIndex, m_aaiCodedScale[ baseViewIndex ][ viewIndex ], m_aaiCodedOffset[ baseViewIndex ][ viewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 140 xInitLUTs( viewIndex, baseViewIndex, m_aaiCodedScale[ viewIndex ][ baseViewIndex ], m_aaiCodedOffset[ viewIndex ][ baseViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 141 } 142 } 143 } 144 } 145 } 146 147 Void 148 CamParsCollector::xResetReceivedIdc( Bool overWriteFlag ) 149 { 150 for (Int i = 0; i <= m_uiMaxViewIndex; i++) 151 { 152 for (Int j = 0; j <= m_uiMaxViewIndex; j++) 153 { 154 if ( overWriteFlag || ( m_receivedIdc[i][j] != -1 ) ) 155 { 156 m_receivedIdc[i][j] = 0; 157 } 158 } 159 } 160 } 161 #else 83 162 Void 84 163 CamParsCollector::init( FILE* pCodedScaleOffsetFile ) … … 92 171 m_uiMaxViewIndex = 0; 93 172 } 173 #endif 174 175 94 176 95 177 Void … … 124 206 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 125 207 { 208 #if FIX_CAM_PARS_COLLECTOR 209 Int iLog2DivLuma = m_uiBitDepthForLUT + m_vps->getCamParPrecision() + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 210 #else 126 211 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 212 #endif 127 213 Int iLog2DivChroma = iLog2DivLuma + 1; 128 214 … … 166 252 } 167 253 254 #if !FIX_CAM_PARS_COLLECTOR 168 255 Void 169 256 CamParsCollector::setSlice( TComSlice* pcSlice ) … … 284 371 } 285 372 373 #else 374 Void 375 CamParsCollector::setSlice( TComSlice* pcSlice ) 376 { 377 if( pcSlice == 0 ) 378 { 379 xOutput( m_lastPoc ); 380 return; 381 } 382 383 if ( pcSlice->getIsDepth()) 384 { 385 return; 386 } 387 388 Int curPoc = pcSlice->getPOC(); 389 if( m_firstReceivedPoc == -2 ) 390 { 391 m_firstReceivedPoc = curPoc; 392 } 393 394 Bool newPocFlag = ( m_lastPoc != curPoc ); 395 396 if ( newPocFlag ) 397 { 398 if( m_lastPoc != -1 ) 399 { 400 xOutput( m_lastPoc ); 401 } 402 403 xResetReceivedIdc( false ); 404 m_lastPoc = pcSlice->getPOC(); 405 } 406 407 UInt uiViewIndex = pcSlice->getViewIndex(); 408 if( m_vps->getCamParPresent( uiViewIndex ) ) 409 { 410 if( m_vps->hasCamParInSliceHeader( uiViewIndex ) ) // check consistency of slice parameters here 411 { 412 for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < uiViewIndex; uiBaseViewIndex++ ) 413 { 414 if ( m_receivedIdc[ uiViewIndex ][ uiBaseViewIndex ] != 0 ) 415 { 416 AOF( m_aaiCodedScale [ uiViewIndex ][ uiBaseViewIndex ] == pcSlice->getInvCodedScale () [ uiBaseViewIndex ] ); 417 AOF( m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ] == pcSlice->getInvCodedOffset() [ uiBaseViewIndex ] ); 418 } 419 else 420 { 421 m_receivedIdc [ uiViewIndex ][ uiBaseViewIndex ] = 1; 422 m_aaiCodedScale [ uiViewIndex ][ uiBaseViewIndex ] = pcSlice->getInvCodedScale () [ uiBaseViewIndex ]; 423 m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ] = pcSlice->getInvCodedOffset() [ uiBaseViewIndex ]; 424 xInitLUTs( uiViewIndex, uiBaseViewIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseViewIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 425 } 426 if ( m_receivedIdc[ uiBaseViewIndex ][ uiViewIndex ] != 0 ) 427 { 428 AOF( m_aaiCodedScale [ uiBaseViewIndex ][ uiViewIndex ] == pcSlice->getCodedScale () [ uiBaseViewIndex ] ); 429 AOF( m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ] == pcSlice->getCodedOffset () [ uiBaseViewIndex ] ); 430 } 431 else 432 { 433 m_receivedIdc [ uiBaseViewIndex ][ uiViewIndex ] = 1; 434 m_aaiCodedScale [ uiBaseViewIndex ][ uiViewIndex ] = pcSlice->getCodedScale () [ uiBaseViewIndex ]; 435 m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ] = pcSlice->getCodedOffset () [ uiBaseViewIndex ]; 436 xInitLUTs( uiBaseViewIndex, uiViewIndex, m_aaiCodedScale[ uiBaseViewIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 437 } 438 } 439 } 440 } 441 } 442 #endif 443 444 286 445 #if H_3D_IV_MERGE 287 446 Void … … 295 454 #endif 296 455 456 #if !FIX_CAM_PARS_COLLECTOR 297 457 Bool 298 458 CamParsCollector::xIsComplete() … … 307 467 return true; 308 468 } 469 #endif 309 470 310 471 Void … … 313 474 if( m_pCodedScaleOffsetFile ) 314 475 { 476 #if FIX_CAM_PARS_COLLECTOR 477 if( iPOC == m_firstReceivedPoc ) 478 #else 315 479 if( iPOC == 0 ) 480 #endif 316 481 { 317 482 fprintf( m_pCodedScaleOffsetFile, "# ViewIndex ViewId\n" ); 318 483 fprintf( m_pCodedScaleOffsetFile, "#----------- ------------\n" ); 484 #if FIX_CAM_PARS_COLLECTOR 319 485 for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ ) 320 486 { 487 fprintf( m_pCodedScaleOffsetFile, "%12d %12d\n", uiViewIndex, m_vps->getViewIdVal( uiViewIndex ) ); 488 #else 489 for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ ) 490 { 321 491 fprintf( m_pCodedScaleOffsetFile, "%12d %12d\n", uiViewIndex, m_aiViewId[ uiViewIndex ] ); 492 #endif 322 493 } 323 494 fprintf( m_pCodedScaleOffsetFile, "\n\n"); … … 325 496 fprintf( m_pCodedScaleOffsetFile, "#----------- ------------ ------------ ------------ ------------ ------------ ------------\n" ); 326 497 } 498 #if FIX_CAM_PARS_COLLECTOR 499 if( iPOC == m_firstReceivedPoc || m_bCamParsVaryOverTime ) 500 #else 327 501 if( iPOC == 0 || m_bCamParsVaryOverTime ) 502 #endif 328 503 { 329 504 Int iS = iPOC; … … 335 510 if( uiViewIndex != uiBaseIndex ) 336 511 { 512 #if FIX_CAM_PARS_COLLECTOR 513 if ( m_receivedIdc[uiBaseIndex][uiViewIndex] != 0 ) 514 { 515 fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n", 516 iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_vps->getCamParPrecision() ); 517 } 518 #else 337 519 fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n", 338 520 iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_uiCamParsCodedPrecision ); 521 #endif 522 339 523 } 340 524 } … … 457 641 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 458 642 { 643 #if H_MV_HLS_7_SPS_P0155_16_32 644 numReorderPics[temporalLayer] = ( getLayerId() == 0 ) ? pcSlice->getSPS()->getNumReorderPics(temporalLayer) : pcSlice->getVPS()->getNumReorderPics(temporalLayer); 645 #else 459 646 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 460 } 461 647 #endif 648 } 649 #if H_MV_HLS_7_SPS_P0155_16_32 650 if ( getLayerId() == 0 ) 651 { 652 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); 653 } 654 else 655 { 656 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); 657 #if H_MV_HLS7_GEN 658 TComVPS* vps = pcSlice->getVPS(); 659 TComDpbSize* dpbSize = vps->getDpbSize(); 660 Int lsIdx = vps->getLayerSetIdxForOutputLayerSet( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec? 661 Int layerIdx = vps->getIdxInLayerSet ( lsIdx, getLayerId() ); 662 Int subDpbIdx = dpbSize->getSubDpbAssigned( lsIdx, layerIdx ); 663 m_iMaxRefPicNum = dpbSize->getMaxVpsDecPicBufferingMinus1(getTargetOutputLayerSetIdx(), subDpbIdx , vps->getSubLayersVpsMaxMinus1( vps->getLayerIdInVps( getLayerId() ) ) + 1 ) + 1 ; 664 #endif 665 } 666 #else 462 667 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 668 #endif 463 669 if (m_cListPic.size() < (UInt)m_iMaxRefPicNum) 464 670 { -
branches/HTM-10.0-dev0/source/Lib/TLibDecoder/TDecTop.h
r852 r854 71 71 ~CamParsCollector (); 72 72 73 #if FIX_CAM_PARS_COLLECTOR 74 Void init ( FILE* pCodedScaleOffsetFile, TComVPS* vps ); 75 #else 73 76 Void init ( FILE* pCodedScaleOffsetFile ); 77 #endif 78 74 79 Void uninit (); 75 80 Void setSlice ( TComSlice* pcSlice ); … … 85 90 Int getCodedScale( Int iBaseView, Int iCureView){ return m_aaiCodedScale[ iBaseView ][ iCureView ];} 86 91 Int getCodedOffset( Int iBaseView, Int iCureView){ return m_aaiCodedOffset[ iBaseView ][ iCureView ];} 87 UInt getCamParsCodedPrecision(){ return m_ uiCamParsCodedPrecision; }92 UInt getCamParsCodedPrecision(){ return m_vps->getCamParPrecision(); } 88 93 #endif 89 94 90 95 private: 96 #if FIX_CAM_PARS_COLLECTOR 97 Void xResetReceivedIdc( Bool overWriteFlag ); 98 #else 91 99 Bool xIsComplete (); 100 #endif 92 101 Void xOutput ( Int iPOC ); 93 102 … … 98 107 Int** m_aaiCodedOffset; 99 108 Int** m_aaiCodedScale; 109 110 #if !FIX_CAM_PARS_COLLECTOR 100 111 Int* m_aiViewId; 101 112 #else 113 TComVPS* m_vps; 114 Int** m_receivedIdc; 115 Int m_uiMaxViewIndex; 116 Int m_lastPoc; 117 Int m_firstReceivedPoc; 118 #endif 119 120 121 #if !FIX_CAM_PARS_COLLECTOR 102 122 Bool* m_bViewReceived; 103 123 UInt m_uiCamParsCodedPrecision; 124 #endif 104 125 Bool m_bCamParsVaryOverTime; 126 #if !FIX_CAM_PARS_COLLECTOR 105 127 Int m_iLastViewIndex; 106 128 Int m_iLastPOC; 107 129 UInt m_uiMaxViewIndex; 130 #endif 108 131 109 132
Note: See TracChangeset for help on using the changeset viewer.