Changeset 854 in 3DVCSoftware for branches/HTM-10.0-dev0/source/App
- Timestamp:
- 13 Feb 2014, 22:58:51 (11 years ago)
- Location:
- branches/HTM-10.0-dev0/source/App
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0-dev0/source/App/TAppDecoder/TAppDecTop.cpp
r852 r854 140 140 AOF( m_pScaleOffsetFile ); 141 141 } 142 #if !FIX_CAM_PARS_COLLECTOR 142 143 m_cCamParsCollector.init( m_pScaleOffsetFile ); 144 #endif 143 145 #endif 144 146 InputByteStream bytestream(bitstreamFile); … … 207 209 read(nalu, nalUnit); 208 210 #if H_MV 211 #if H_MV_FIX_VPS_LAYER_ID_NOT_EQUAL_ZERO 212 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) 213 || !isNaluWithinTargetDecLayerIdSet(&nalu) 214 || nalu.m_layerId > MAX_NUM_LAYER_IDS-1 215 || (nalu.m_nalUnitType == NAL_UNIT_VPS && nalu.m_layerId > 0) 216 #if H_MV_HLS_7_MISC_P0130_EOS 217 || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0) 218 #endif 219 ) 220 #else 209 221 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || nalu.m_layerId > MAX_NUM_LAYER_IDS-1 ) 222 #endif 210 223 { 211 224 bNewPicture = false; … … 235 248 } 236 249 250 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 251 if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() ) 252 { 253 fprintf(stderr, "\ntarget output layer set index must be in the range of 0 to %d, inclusive \n", vps->getNumOutputLayerSets() - 1 ); 254 exit(EXIT_FAILURE); 255 } 256 #endif 237 257 m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx ); 238 258 } 259 260 #if FIX_CAM_PARS_COLLECTOR 261 #if H_3D 262 if (nalu.m_nalUnitType == NAL_UNIT_VPS ) 263 { 264 265 m_cCamParsCollector.init( m_pScaleOffsetFile, m_tDecTop[decIdx]->getPrefetchedVPS() ); 266 } 267 #endif 268 #endif 239 269 bNewPicture = ( newSliceDiffLayer || newSliceDiffPoc ) && !sliceSkippedFlag; 240 270 if ( nalu.isSlice() && firstSlice && !sliceSkippedFlag ) -
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r852 r854 388 388 ("VpsNumLayerSets", m_vpsNumLayerSets , 1 , "Number of layer sets") 389 389 ("LayerIdsInSet_%d", m_layerIdsInSets , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 390 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 391 ("DefaultTargetOutputLayerIdc" , m_defaultTargetOutputLayerIdc , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet") 392 #else 390 393 ("DefaultOneTargetOutputLayerFlag" , m_defaultOneTargetOutputLayerIdc , 0, "Output highest layer of layer sets by default") 394 #endif 391 395 ("OutputLayerSetIdx", m_outputLayerSetIdx , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 396 397 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 398 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set") 399 ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 400 #else 392 401 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 402 #endif 393 403 ("ProfileLevelTierIdx", m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier") 394 404 … … 604 614 605 615 // DBP Size 616 #if !H_MV_HLS_7_FIX_SET_DPB_SIZE 606 617 ("SubLayerFlagInfoPresentFlag", m_subLayerFlagInfoPresentFlag , false , "SubLayerFlagInfoPresentFlag") 618 #endif 607 619 // VPS VUI 608 620 ("VpsVuiPresentFlag" , m_vpsVuiPresentFlag , false , "VpsVuiPresentFlag ") 609 621 ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false , "CrossLayerPicTypeAlignedFlag") // Could actually be derived by the encoder 610 622 ("CrossLayerIrapAlignedFlag" , m_crossLayerIrapAlignedFlag , false , "CrossLayerIrapAlignedFlag ") // Could actually be derived by the encoder 623 #if H_MV_HLS_7_MISC_P0068_21 624 ("AllLayersIdrAlignedFlag" , m_allLayersIdrAlignedFlag , false , "CrossLayerIrapAlignedFlag ") // Could actually be derived by the encoder 625 #endif 611 626 ("BitRatePresentVpsFlag" , m_bitRatePresentVpsFlag , false , "BitRatePresentVpsFlag ") 612 627 ("PicRatePresentVpsFlag" , m_picRatePresentVpsFlag , false , "PicRatePresentVpsFlag ") … … 1408 1423 } 1409 1424 1425 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1426 xConfirmPara( m_defaultTargetOutputLayerIdc < 0 || m_defaultTargetOutputLayerIdc > 2, "Default target output layer idc must greater than or equal to 0 and less than or equal to 2." ); 1427 1428 if( m_defaultTargetOutputLayerIdc != 2 ) 1429 { 1430 Bool anyDefaultOutputFlag = false; 1431 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++) 1432 { 1433 anyDefaultOutputFlag = anyDefaultOutputFlag || ( m_layerIdsInDefOutputLayerSet[lsIdx].size() != 0 ); 1434 } 1435 printf( "\nWarning: Ignoring LayerIdsInDefOutputLayerSet parameters, since defaultTargetOuputLayerIdc is not equal 2.\n" ); 1436 } 1437 else 1438 { 1439 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++) 1440 { 1441 for (Int i = 0; i < m_layerIdsInDefOutputLayerSet[ lsIdx ].size(); i++) 1442 { 1443 Bool inLayerSetFlag = false; 1444 for (Int j = 0; j < m_layerIdsInSets[ lsIdx].size(); j++ ) 1445 { 1446 if ( m_layerIdsInSets[ lsIdx ][ j ] == m_layerIdsInDefOutputLayerSet[ lsIdx ][ i ] ) 1447 { 1448 inLayerSetFlag = true; 1449 break; 1450 } 1451 } 1452 xConfirmPara( !inLayerSetFlag, "All output layers of a output layer set must be included in corresponding layer set."); 1453 } 1454 } 1455 } 1456 #else 1410 1457 xConfirmPara( m_defaultOneTargetOutputLayerIdc < 0 || m_defaultOneTargetOutputLayerIdc > 1, "Default one target output layer idc must be equal to 0 or equal to 1" ); 1458 #endif 1411 1459 xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" ); 1412 1460 -
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncCfg.h
r852 r854 89 89 Int m_vpsNumLayerSets; ///< Number of layer sets 90 90 std::vector< std::vector<Int> > m_layerIdsInSets; ///< LayerIds in vps of layer set 91 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 92 Int m_defaultTargetOutputLayerIdc; ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet 93 #else 91 94 Int m_defaultOneTargetOutputLayerIdc; ///< Output highest layer of layer sets by default when equal to 1 95 #endif 92 96 std::vector<Int> m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 93 97 std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers 98 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 99 std::vector< std::vector<Int> > m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets 100 #endif 94 101 std::vector<Int> m_profileLevelTierIdx; ///< Indices of of profile level tier 95 102 … … 99 106 100 107 // DBP Size 108 #if !H_MV_HLS_7_FIX_SET_DPB_SIZE 101 109 Bool m_subLayerFlagInfoPresentFlag; 110 #endif 102 111 103 112 // VPS VUI … … 105 114 Bool m_crossLayerPicTypeAlignedFlag; 106 115 Bool m_crossLayerIrapAlignedFlag; 116 #if H_MV_HLS_7_MISC_P0068_21 117 Bool m_allLayersIdrAlignedFlag; 118 #endif 107 119 Bool m_bitRatePresentVpsFlag; 108 120 Bool m_picRatePresentVpsFlag; -
branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r852 r854 127 127 xSetRepFormat ( vps ); 128 128 xSetLayerSets ( vps ); 129 #if H_MV_HLS_7_FIX_SET_DPB_SIZE 130 xSetDpbSize ( vps ); 131 #endif 129 132 xSetVPSVUI ( vps ); 130 133 #if H_3D … … 1491 1494 } 1492 1495 1496 #if H_MV_HLS_7_FIX_SET_DPB_SIZE 1497 Void TAppEncTop::xSetDpbSize ( TComVPS& vps ) 1498 { 1499 // These settings need to be verified 1500 1501 TComDpbSize* dpbSize = vps.getDpbSize(); 1502 1503 assert ( dpbSize != 0 ); 1504 1505 for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ ) 1506 { 1507 std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); 1508 Bool subLayerFlagInfoPresentFlag = false; 1509 1510 #if H_MV_HLS_7_HRD_P0156_7 1511 for( Int j = 0; j <= vps.getMaxSubLayersInLayerSetMinus1( i ); j++ ) 1512 #else 1513 for( Int j = 0; j <= vps.getMaxTLayers() - 1 ; j++ ) 1514 #endif 1515 { 1516 Bool subLayerDpbInfoPresentFlag = false; 1517 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1518 assert( vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i ) ) == targetDecLayerIdList.size() ); 1519 for( Int k = 0; k < vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i )); k++ ) 1520 #else 1521 assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() ); 1522 for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1523 #endif 1524 { 1525 Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] ); 1526 #if H_MV_HLS7_GEN 1527 // TBD. Some derivation based on output layer set might be added here. 1528 #endif 1529 dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 ); 1530 if ( j > 0 ) 1531 { 1532 subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) != dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) ); 1533 } 1534 } 1535 1536 Int maxNumReorderPics = MIN_INT; 1537 for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ ) 1538 { 1539 Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[ idx ] ); 1540 maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] ); 1541 } 1542 assert( maxNumReorderPics != MIN_INT ); 1543 1544 dpbSize->setMaxVpsNumReorderPics( i, j, maxNumReorderPics ); 1545 if ( j > 0 ) 1546 { 1547 subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsNumReorderPics( i, j ) != dpbSize->getMaxVpsNumReorderPics( i, j - 1 ) ); 1548 } 1549 1550 // To Be Done ! 1551 // dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, xx ); 1552 if ( j > 0 ) 1553 { 1554 subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) != dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1555 } 1556 1557 if( j > 0 ) 1558 { 1559 dpbSize->setSubLayerDpbInfoPresentFlag( i, j, subLayerDpbInfoPresentFlag ); 1560 subLayerFlagInfoPresentFlag = subLayerFlagInfoPresentFlag || subLayerDpbInfoPresentFlag; 1561 } 1562 } 1563 dpbSize->setSubLayerFlagInfoPresentFlag( i, subLayerFlagInfoPresentFlag ); 1564 } 1565 } 1566 #else 1493 1567 Void TAppEncTop::xSetDpbSize ( TComVPS& vps ) 1494 1568 { … … 1503 1577 std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); 1504 1578 dpbSize->setSubLayerFlagInfoPresentFlag( i, m_subLayerFlagInfoPresentFlag ); 1505 1506 1579 if ( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ) 1507 1580 { … … 1546 1619 } 1547 1620 } 1548 1621 #endif 1549 1622 1550 1623 Void TAppEncTop::xSetLayerSets( TComVPS& vps ) … … 1552 1625 // Layer sets 1553 1626 vps.setVpsNumLayerSetsMinus1 ( m_vpsNumLayerSets - 1 ); 1627 #if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1554 1628 vps.setVpsNumberLayerSetsMinus1( vps.getVpsNumLayerSetsMinus1() ); 1629 #endif 1555 1630 1556 1631 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) … … 1569 1644 Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size(); 1570 1645 // Additional output layer sets + profileLevelTierIdx 1646 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1647 vps.setDefaultTargetOutputLayerIdc ( m_defaultTargetOutputLayerIdc ); 1648 vps.setNumAddOutputLayerSets ( numAddOuputLayerSets ); 1649 vps.initTargetLayerIdLists(); 1650 #else 1571 1651 vps.setDefaultOneTargetOutputLayerIdc ( m_defaultOneTargetOutputLayerIdc ); 1572 1652 vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets != 0 ); 1573 1653 vps.setNumAddOutputLayerSetsMinus1 ( numAddOuputLayerSets - 1 ); 1574 1575 1576 1654 #endif 1655 1656 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1657 for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + numAddOuputLayerSets; olsIdx++) 1658 { 1659 Int addOutLsIdx = olsIdx - m_vpsNumLayerSets; 1660 1661 vps.setOutputLayerSetIdxMinus1( olsIdx, ( ( addOutLsIdx < 0 ) ? olsIdx : m_outputLayerSetIdx[ addOutLsIdx ] ) - 1 ); 1662 1663 std::vector<Int>& layerIdList = m_layerIdsInSets[ vps.getLayerSetIdxForOutputLayerSet( olsIdx ) ]; 1664 1665 if (vps.getDefaultTargetOutputLayerIdc() == 2 || addOutLsIdx >= 0 ) 1666 { 1667 for ( Int i = 0; i < layerIdList.size(); i++) 1668 { 1669 vps.setOutputLayerFlag( olsIdx, i, ( olsIdx == 0 && i == 0 ) ? vps.inferOutputLayerFlag(olsIdx, i ) : false ); // This is a software only fix for a bug in the spec. In spec outputLayerFlag neither present nor inferred for this case ! 1670 } 1671 1672 std::vector<Int>& outLayerIdList = ( addOutLsIdx >= 0 ) ? m_layerIdsInAddOutputLayerSet[addOutLsIdx] : m_layerIdsInDefOutputLayerSet[olsIdx]; 1673 1674 Bool outputLayerInLayerSetFlag = false; 1675 for (Int j = 0; j < outLayerIdList.size(); j++) 1676 { 1677 for (Int i = 0; i < layerIdList.size(); i++ ) 1678 { 1679 if ( layerIdList[ i ] == outLayerIdList[ j ] ) 1680 { 1681 vps.setOutputLayerFlag( olsIdx, i, true ); 1682 outputLayerInLayerSetFlag = true; 1683 break; 1684 } 1685 } 1686 assert( outputLayerInLayerSetFlag ); // The output layer is not not in the layer set. 1687 } 1688 } 1689 else 1690 { 1691 for ( Int i = 0; i < layerIdList.size(); i++) 1692 { 1693 vps.setOutputLayerFlag( olsIdx, i, vps.inferOutputLayerFlag( olsIdx, i ) ); 1694 } 1695 } 1696 1697 vps.deriveTargetLayerIdList( olsIdx ); 1698 1699 if ( olsIdx > 0 ) 1700 { 1701 vps.setProfileLevelTierIdx( olsIdx, m_profileLevelTierIdx[ olsIdx ] ); 1702 } 1703 1704 vps.setAltOutputLayerFlag( olsIdx , false); 1705 } 1706 #else 1577 1707 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++) 1578 1708 { … … 1612 1742 } 1613 1743 vps.deriveTargetLayerIdLists(); 1744 #endif 1614 1745 } 1615 1746 … … 1618 1749 vps.setVpsVuiPresentFlag( m_vpsVuiPresentFlag ); 1619 1750 1751 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG 1752 TComVPSVUI* pcVPSVUI = vps.getVPSVUI( ); 1753 assert( pcVPSVUI ); 1754 #endif 1755 1620 1756 if ( m_vpsVuiPresentFlag ) 1621 1757 { 1758 #if !H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG 1622 1759 TComVPSVUI* pcVPSVUI = vps.getVPSVUI( ); 1623 1760 1624 1761 assert( pcVPSVUI ); 1625 1762 #endif 1626 1763 1627 1764 // All this stuff could actually be derived by the encoder, … … 1630 1767 pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag ); 1631 1768 pcVPSVUI->setCrossLayerIrapAlignedFlag ( m_crossLayerIrapAlignedFlag ); 1632 1769 #if H_MV_HLS_7_MISC_P0068_21 1770 pcVPSVUI->setAllLayersIdrAlignedFlag ( m_allLayersIdrAlignedFlag ); 1771 #endif 1633 1772 pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag ); 1634 1773 pcVPSVUI->setPicRatePresentVpsFlag( m_picRatePresentVpsFlag ); … … 1636 1775 if( pcVPSVUI->getBitRatePresentVpsFlag( ) || pcVPSVUI->getPicRatePresentVpsFlag( ) ) 1637 1776 { 1777 #if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27 1778 for( Int i = 0; i <= vps.getVpsNumLayerSetsMinus1(); i++ ) 1779 #else 1638 1780 for( Int i = 0; i <= vps.getVpsNumberLayerSetsMinus1(); i++ ) 1781 #endif 1639 1782 { 1640 1783 for( Int j = 0; j <= vps.getMaxTLayers(); j++ ) … … 1754 1897 pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD 1755 1898 } 1899 #if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG 1900 else 1901 { 1902 pcVPSVUI->setCrossLayerIrapAlignedFlag ( false ); 1903 } 1904 #endif 1756 1905 } 1757 1906 #endif
Note: See TracChangeset for help on using the changeset viewer.