Changeset 738 in 3DVCSoftware for trunk/source/App/TAppEncoder/TAppEncTop.cpp
- Timestamp:
- 10 Dec 2013, 13:50:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r735 r738 216 216 217 217 m_cTEncTop.setIvPicLists ( &m_ivPicLists ); 218 #endif// H_MV218 // H_MV 219 219 m_cTEncTop.setVPS(&vps); 220 220 … … 234 234 235 235 //====== Coding Structure ======== 236 #if H_MV_LAYER_WISE_STARTUP 237 m_cTEncTop.setIntraPeriod ( m_iIntraPeriod[ layerIdInVps ] ); 238 #else 236 239 m_cTEncTop.setIntraPeriod ( m_iIntraPeriod ); 240 #endif 237 241 m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType ); 238 242 m_cTEncTop.setGOPSize ( m_iGOPSize ); … … 1332 1336 Int maxViewId = xGetMax( m_viewId ); 1333 1337 1338 #if H_MV_6_PS_O0109_22 1339 Int viewIdLen = gCeilLog2( maxViewId + 1 ); 1340 const Int maxViewIdLen = ( 1 << 4 ) - 1; 1341 assert( viewIdLen <= maxViewIdLen ); 1342 vps.setViewIdLen( viewIdLen ); 1343 #else 1334 1344 Int viewIdLenMinus1 = std::max( gCeilLog2( maxViewId + 1 ) - 1, 0 ) ; 1335 1345 const Int maxViewIdLenMinus1 = ( 1 << 4 ) - 1; 1336 1346 assert( viewIdLenMinus1 <= maxViewIdLenMinus1 ); 1337 1347 vps.setViewIdLenMinus1( viewIdLenMinus1 ); 1348 #endif 1338 1349 for (Int i = 0; i < m_iNumberOfViews; i++) 1339 1350 { … … 1355 1366 } 1356 1367 } 1368 1369 #if H_MV_6_PS_O0096_21 1370 Int defaultDirectDependencyType = -1; 1371 Bool defaultDirectDependencyFlag = true; 1372 #endif 1357 1373 for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ ) 1358 1374 { … … 1363 1379 Int refLayer = m_directRefLayers[depLayer][i]; 1364 1380 vps.setDirectDependencyFlag( depLayer, refLayer, true); 1381 #if H_MV_6_PS_O0096_21 1382 Int curDirectDependencyType = m_dependencyTypes[depLayer][i]; 1383 1384 if ( defaultDirectDependencyType != -1 ) 1385 { 1386 defaultDirectDependencyFlag = defaultDirectDependencyFlag && (curDirectDependencyType == defaultDirectDependencyType ); 1387 } 1388 else 1389 { 1390 defaultDirectDependencyType = curDirectDependencyType; 1391 } 1392 1393 vps.setDirectDependencyType( depLayer, refLayer, curDirectDependencyType); 1394 #else 1365 1395 vps.setDirectDependencyType( depLayer, refLayer,m_dependencyTypes[depLayer][i]); 1366 } 1367 } 1396 #endif 1397 } 1398 } 1399 1400 #if H_MV_6_PS_O0096_21 1401 vps.setDefaultDirectDependencyFlag( defaultDirectDependencyFlag ); 1402 vps.setDefaultDirectDependencyType( defaultDirectDependencyFlag ? defaultDirectDependencyType : -1 ); 1403 #endif 1404 1405 #if H_MV_6_ILDSD_O0120_26 1406 // Max sub layers, + presence flag 1407 Bool subLayersMaxMinus1PresentFlag = false; 1408 Int subLayersMaxMinus1 = -1; 1409 for (Int curLayerIdInVps = 0; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++ ) 1410 { 1411 Int curSubLayersMaxMinus1 = -1; 1412 for( Int i = 0; i < getGOPSize(); i++ ) 1413 { 1414 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i]; 1415 curSubLayersMaxMinus1 = std::max( curSubLayersMaxMinus1, geCur.m_temporalId ); 1416 } 1417 1418 vps.setSubLayersVpsMaxMinus1( curLayerIdInVps, curSubLayersMaxMinus1 ); 1419 if ( subLayersMaxMinus1 == -1 ) 1420 { 1421 subLayersMaxMinus1 = curSubLayersMaxMinus1; 1422 } 1423 else 1424 { 1425 subLayersMaxMinus1PresentFlag = subLayersMaxMinus1PresentFlag || ( curSubLayersMaxMinus1 != subLayersMaxMinus1 ); 1426 } 1427 } 1428 1429 vps.setVpsSubLayersMaxMinus1PresentFlag( subLayersMaxMinus1PresentFlag ); 1430 #endif 1431 1368 1432 1369 1433 // Max temporal id for inter layer reference pictures + presence flag … … 1371 1435 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1372 1436 { 1437 #if !H_MV_6_ILDDS_O0225_30 1373 1438 Int maxTid = -1; 1439 #endif 1374 1440 for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++) 1375 1441 { 1442 #if H_MV_6_ILDDS_O0225_30 1443 Int maxTid = -1; 1444 #endif 1376 1445 for( Int i = 0; i < getGOPSize(); i++ ) 1377 1446 { … … 1387 1456 } 1388 1457 } 1458 #if H_MV_6_ILDDS_O0225_30 1459 vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 ); 1460 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1461 } 1462 #else 1389 1463 } 1390 1464 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1391 1465 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1466 #endif 1392 1467 } 1393 1468 … … 1406 1481 vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); 1407 1482 1483 // Poc Lsb Not Present Flag 1484 #if H_MV_6_MISC_O0062_31 1485 for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers; layerIdInVps++) 1486 { 1487 if ( m_directRefLayers[ layerIdInVps ].size() == 0 ) 1488 { 1489 vps.setPocLsbNotPresentFlag( layerIdInVps, true ); 1490 } 1491 } 1492 #endif 1408 1493 1409 1494 // All Ref layers active flag … … 1414 1499 { 1415 1500 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1501 #if H_MV_6_ILDDS_ILREFPICS_27_34 1502 Int tId = ge.m_temporalId; // Should be equal for all layers. 1503 1504 // check if all reference layers when allRefLayerActiveFlag is equal to 1 are reference layer pictures specified in the gop entry 1505 for (Int k = 0; k < m_directRefLayers[ layerIdInVps].size() && allRefLayersActiveFlag; k++ ) 1506 { 1507 Int refLayerIdInVps = vps.getLayerIdInVps( m_directRefLayers[ layerIdInVps ][ k ] ); 1508 if ( vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId && vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId ) 1509 { 1510 Bool gopEntryFoundFlag = false; 1511 for( Int l = 0; l < ge.m_numActiveRefLayerPics && !gopEntryFoundFlag; l++ ) 1512 { 1513 gopEntryFoundFlag = gopEntryFoundFlag || ( ge.m_interLayerPredLayerIdc[l] == k ); 1514 } 1515 allRefLayersActiveFlag = allRefLayersActiveFlag && gopEntryFoundFlag; 1516 } 1517 } 1518 1519 // check if all inter layer reference pictures specified in the gop entry are valid reference layer pictures when allRefLayerActiveFlag is equal to 1 1520 // (Should actually always be true) 1521 Bool maxTidIlRefAndSubLayerMaxVaildFlag = true; 1522 for( Int l = 0; l < ge.m_numActiveRefLayerPics; l++ ) 1523 { 1524 Bool referenceLayerFoundFlag = false; 1525 for (Int k = 0; k < m_directRefLayers[ layerIdInVps].size(); k++ ) 1526 { 1527 Int refLayerIdInVps = vps.getLayerIdInVps( m_directRefLayers[ layerIdInVps ][ k ] ); 1528 1529 if ( vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId && vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId ) 1530 { 1531 referenceLayerFoundFlag = referenceLayerFoundFlag || ( ge.m_interLayerPredLayerIdc[l] == k ); 1532 } 1533 } 1534 maxTidIlRefAndSubLayerMaxVaildFlag = maxTidIlRefAndSubLayerMaxVaildFlag && referenceLayerFoundFlag; 1535 } 1536 assert ( maxTidIlRefAndSubLayerMaxVaildFlag ); // Something wrong with MaxTidIlRefPicsPlus1 or SubLayersVpsMaxMinus1 1537 #else 1416 1538 allRefLayersActiveFlag = allRefLayersActiveFlag && (ge.m_numActiveRefLayerPics == m_directRefLayers[ layerIdInVps ].size() ); 1539 #endif 1417 1540 } 1418 1541 } … … 1420 1543 vps.setAllRefLayersActiveFlag( allRefLayersActiveFlag ); 1421 1544 1545 #if !H_MV_6_PS_O0223_29 1422 1546 // Currently cross layer irap aligned is always true. 1423 1547 vps.setCrossLayerIrapAlignedFlag( true ); 1548 #endif 1424 1549 vps.setRefLayers(); 1425 1550 }; … … 1491 1616 repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight ); 1492 1617 repFormat->setPicWidthVpsInLumaSamples ( m_iSourceWidth ); 1618 #if H_MV_6_PS_REP_FORM_18_19_20 1619 repFormat->setChromaAndBitDepthVpsPresentFlag( true ); 1620 #endif 1493 1621 // ToDo not supported yet. 1494 1622 //repFormat->setSeparateColourPlaneVpsFlag( ); … … 1502 1630 } 1503 1631 } 1632 1633 #if H_MV_6_HRD_O0217_13 1634 Void TAppEncTop::xSetDpbSize ( TComVPS& vps ) 1635 { 1636 // These settings need to be verified 1637 1638 TComDpbSize* dpbSize = vps.getDpbSize(); 1639 1640 assert ( dpbSize != 0 ); 1641 1642 for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ ) 1643 { 1644 std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); 1645 dpbSize->setSubLayerFlagInfoPresentFlag( i, m_subLayerFlagInfoPresentFlag ); 1646 1647 if ( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ) 1648 { 1649 for( Int j = 0; j <= vps.getMaxTLayers() - 1 ; j++ ) 1650 { 1651 Int maxNumReorderPics = MIN_INT; 1652 Int maxDecPicBuffering = MIN_INT; 1653 Int maxLatencyIncrease = MIN_INT; 1654 1655 Int prevMaxNumReorderPics = MIN_INT; 1656 Int prevMaxDecPicBuffering = MIN_INT; 1657 Int prevMaxLatencyIncrease = MIN_INT; 1658 1659 assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() ); 1660 for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1661 { 1662 Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] ); 1663 dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 ); 1664 } 1665 1666 for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ ) 1667 { 1668 Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[ idx ] ); 1669 maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] ); 1670 } 1671 assert( maxNumReorderPics != MIN_INT ); 1672 dpbSize->setMaxVpsNumReorderPics( i, j, maxNumReorderPics ); 1673 1674 // To Be Done ! 1675 // dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode ); 1676 1677 if( j > 0 ) 1678 { 1679 dpbSize->setSubLayerDpbInfoPresentFlag( i, j, prevMaxDecPicBuffering == maxDecPicBuffering && prevMaxLatencyIncrease == maxLatencyIncrease && prevMaxNumReorderPics == maxNumReorderPics ); 1680 } 1681 1682 prevMaxNumReorderPics = maxNumReorderPics; 1683 prevMaxDecPicBuffering = maxDecPicBuffering; 1684 prevMaxLatencyIncrease = maxLatencyIncrease; 1685 } 1686 } 1687 } 1688 } 1689 #endif 1690 1504 1691 1505 1692 Void TAppEncTop::xSetLayerSets( TComVPS& vps ) … … 1520 1707 } 1521 1708 } 1709 #if H_MV_6_HRD_O0217_13 1710 vps.deriveLayerSetLayerIdList(); 1711 #endif 1522 1712 1523 1713 Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size(); 1524 1714 // Additional output layer sets + profileLevelTierIdx 1715 #if H_MV_6_PS_0109_25 1716 vps.setDefaultOneTargetOutputLayerIdc ( m_defaultOneTargetOutputLayerIdc ); 1717 #else 1525 1718 vps.setDefaultOneTargetOutputLayerFlag ( m_defaultOneTargetOutputLayerFlag ); 1719 #endif 1526 1720 vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets != 0 ); 1527 1721 vps.setNumAddOutputLayerSetsMinus1 ( numAddOuputLayerSets - 1 ); 1528 1722 1723 1724 1725 #if H_MV_6_HRD_O0217_13 1726 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++) 1727 { 1728 if ( lsIdx > 0 ) 1729 { 1730 vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] ); 1731 } 1732 1733 vps.setOutputLayerSetIdxMinus1( lsIdx, lsIdx - 1 ); 1734 1735 for (Int i = 0; i < m_layerIdsInSets[ lsIdx ].size(); i++ ) 1736 { 1737 vps.setOutputLayerFlag( lsIdx, i, vps.inferOutputLayerFlag( lsIdx, i )); 1738 } 1739 } 1740 #else 1529 1741 for (Int lsIdx = 1; lsIdx < m_vpsNumLayerSets; lsIdx++) 1530 1742 { 1531 1743 vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] ); 1532 1744 } 1745 #endif 1533 1746 1534 1747 for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ ) … … 1553 1766 } 1554 1767 } 1768 #if H_MV_6_HRD_O0217_13 1769 vps.deriveTargetLayerIdLists(); 1770 #endif 1555 1771 } 1556 1772 … … 1564 1780 1565 1781 assert( pcVPSVUI ); 1782 1783 1784 // All this stuff could actually be derived by the encoder, 1785 // however preliminary setting it from input parameters 1786 1787 #if H_MV_6_PS_O0223_29 1788 pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag ); 1789 pcVPSVUI->setCrossLayerIrapAlignedFlag ( m_crossLayerIrapAlignedFlag ); 1790 #endif 1566 1791 1567 1792 pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag ); … … 1602 1827 } 1603 1828 1829 #if H_MV_6_O0226_37 1830 pcVPSVUI->setTilesNotInUseFlag( m_tilesNotInUseFlag ); 1831 1832 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1833 { 1834 for( Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) 1835 { 1836 pcVPSVUI->setTilesInUseFlag( i, m_tilesInUseFlag[ i ] ); 1837 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1838 { 1839 pcVPSVUI->setLoopFilterNotAcrossTilesFlag( i, m_loopFilterNotAcrossTilesFlag[ i ] ); 1840 } 1841 } 1842 1843 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1844 { 1845 for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ) ; j++ ) 1846 { 1847 Int layerIdx = vps.getLayerIdInVps( vps.getRefLayerId(vps.getLayerIdInNuh( i ) , j )); 1848 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1849 { 1850 pcVPSVUI->setTileBoundariesAlignedFlag( i, j, m_tileBoundariesAlignedFlag[i][j] ); 1851 } 1852 } 1853 } 1854 } 1855 1856 pcVPSVUI->setWppNotInUseFlag( m_wppNotInUseFlag ); 1857 1858 if( !pcVPSVUI->getWppNotInUseFlag( ) ) 1859 { 1860 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1861 { 1862 pcVPSVUI->setWppInUseFlag( i, m_wppInUseFlag[ i ]); 1863 } 1864 } 1865 #else 1604 1866 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1605 1867 { … … 1612 1874 } 1613 1875 } 1876 #endif 1614 1877 1615 1878 pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag ); … … 1642 1905 } 1643 1906 } 1907 #if H_MV_6_PS_O0118_33 1908 pcVPSVUI->setVideoSignalInfoIdxPresentFlag( true ); 1909 pcVPSVUI->setVpsNumVideoSignalInfoMinus1 ( 0 ); 1910 1911 assert ( pcVPSVUI->getVideoSignalInfo( 0 ) == NULL ); 1912 1913 TComVideoSignalInfo* videoSignalInfo = new TComVideoSignalInfo; 1914 1915 videoSignalInfo->setColourPrimariesVps ( m_colourPrimaries ); 1916 videoSignalInfo->setMatrixCoeffsVps ( m_matrixCoefficients ); 1917 videoSignalInfo->setTransferCharacteristicsVps( m_transferCharacteristics ); 1918 videoSignalInfo->setVideoVpsFormat ( m_videoFormat ); 1919 videoSignalInfo->setVideoFullRangeVpsFlag ( m_videoFullRangeFlag ); 1920 1921 pcVPSVUI->setVideoSignalInfo( 0, videoSignalInfo ); 1922 1923 for (Int i = 0; i < m_numberOfLayers; i++) 1924 { 1925 pcVPSVUI->setVpsVideoSignalInfoIdx( i, 0 ); 1926 } 1927 #endif 1928 #if H_MV_6_HRD_O0164_15 1929 pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD 1930 #endif 1644 1931 } 1645 1932 } … … 1683 1970 if( vps.getUseDLTFlag( layer ) ) 1684 1971 { 1972 #if H_MV_LAYER_WISE_STARTUP 1973 xAnalyzeInputBaseDepth(layer, max( m_iIntraPeriod[layer], 24), &vps); 1974 #else 1685 1975 xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps); 1976 #endif 1686 1977 } 1687 1978 #endif … … 1720 2011 } 1721 2012 #endif 2013 #endif 1722 2014 //! \}
Note: See TracChangeset for help on using the changeset viewer.