Changeset 854 in 3DVCSoftware for branches/HTM-10.0-dev0/source/App/TAppEncoder/TAppEncTop.cpp
- Timestamp:
- 13 Feb 2014, 22:58:51 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.