Changeset 534 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder
- Timestamp:
- 13 Jul 2013, 10:26:41 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp
r532 r534 215 215 #endif 216 216 #if H_MV 217 in>>entry.m_num InterViewRefPics;218 for( Int i = 0; i < entry.m_num InterViewRefPics; i++ )219 { 220 in>>entry.m_inter ViewRefs[i];221 } 222 for( Int i = 0; i < entry.m_num InterViewRefPics; i++ )217 in>>entry.m_numActiveRefLayerPics; 218 for( Int i = 0; i < entry.m_numActiveRefLayerPics; i++ ) 219 { 220 in>>entry.m_interLayerPredLayerIdc[i]; 221 } 222 for( Int i = 0; i < entry.m_numActiveRefLayerPics; i++ ) 223 223 { 224 224 in>>entry.m_interViewRefPosL[0][i]; 225 225 } 226 for( Int i = 0; i < entry.m_num InterViewRefPics; i++ )226 for( Int i = 0; i < entry.m_numActiveRefLayerPics; i++ ) 227 227 { 228 228 in>>entry.m_interViewRefPosL[1][i]; 229 } 230 if (entry.m_numActiveRefLayerPics > 0 ) 231 { 232 in>>entry.m_collocatedRefLayerIdx; 229 233 } 230 234 #endif … … 398 402 ("LayerIdInNuh", m_layerIdInNuh , std::vector<Int>(1,0), "LayerId in Nuh") 399 403 ("SplittingFlag", m_splittingFlag , false , "Splitting Flag") 404 405 // Layer Sets + Output Layer Sets + Profile Tier Level 406 ("VpsNumLayerSets", m_vpsNumLayerSets , 1 , "Number of layer sets") 407 ("LayerIdsInSet_%d", m_layerIdsInSets , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 408 ("DefaultOneTargetOutputLayerFlag", m_defaultOneTargetOutputLayerFlag, false , "Output highest layer of layer sets by default") 409 ("OutputLayerSetIdx", m_outputLayerSetIdx , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 410 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 411 ("ProfileLevelTierIdx", m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier") 412 413 // Layer dependencies 414 ("DirectRefLayers_%d", m_directRefLayers , std::vector<Int>(0,0), MAX_NUM_LAYERS, "LayerIds of direct reference layers") 415 ("DependencyTypes_%d", m_dependencyTypes , std::vector<Int>(0,0), MAX_NUM_LAYERS, "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion") 400 416 #endif 401 417 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") … … 756 772 cOSS<<"Frame"<<i; 757 773 opts.addOptions()( cOSS.str(), m_GOPListMvc[k][i-1], GOPEntry() ); 774 if ( i != 1 ) 775 { 776 opts.opt_list.back()->opt->opt_duplicate = true; 777 } 758 778 } 759 779 } … … 762 782 std::ostringstream cOSS1; 763 783 cOSS1<<"FrameI"<<"_l"<<k; 784 764 785 opts.addOptions()(cOSS1.str(), m_GOPListMvc[k][MAX_GOP], GOPEntry()); 786 if ( k > 1 ) 787 { 788 opts.opt_list.back()->opt->opt_duplicate = true; 789 } 790 765 791 766 792 for( Int i = 1; i < MAX_GOP + 1; i++ ) … … 769 795 cOSS2<<"Frame"<<i<<"_l"<<k; 770 796 opts.addOptions()(cOSS2.str(), m_GOPListMvc[k][i-1], GOPEntry()); 797 if ( i != 1 || k > 0 ) 798 { 799 opts.opt_list.back()->opt->opt_duplicate = true; 800 } 771 801 } 772 802 } … … 1311 1341 #endif 1312 1342 1313 xConfirmPara( m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. " ); 1314 1315 for( Int dim = 0; dim < m_dimIds.size(); dim++ ) 1343 xConfirmPara( m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. " ); Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1]; 1344 1345 dimBitOffset[ 0 ] = 0; 1346 for (Int j = 1; j <= ((Int) m_dimIds.size() - m_splittingFlag ? 1 : 0); j++ ) 1316 1347 { 1317 xConfirmPara( m_dimIds[dim].size() < m_numberOfLayers, "DimensionId must be given for all layers and all dimensions. "); 1318 xConfirmPara( ( dim != viewDimPosition ) && (m_dimIds[dim][0] != 0), "DimensionId of layer 0 must be 0. " ); 1319 xConfirmPara( m_dimensionIdLen[dim] < 1 || m_dimensionIdLen[dim] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 1348 dimBitOffset[ j ] = dimBitOffset[ j - 1 ] + m_dimensionIdLen[ j - 1]; 1349 } 1350 1351 if ( m_splittingFlag ) 1352 { 1353 dimBitOffset[ (Int) m_dimIds.size() ] = 6; 1354 } 1355 1356 for( Int j = 0; j < m_dimIds.size(); j++ ) 1357 { 1358 xConfirmPara( m_dimIds[j].size() < m_numberOfLayers, "DimensionId must be given for all layers and all dimensions. "); 1359 xConfirmPara( ( j != viewDimPosition ) && (m_dimIds[j][0] != 0), "DimensionId of layer 0 must be 0. " ); 1360 xConfirmPara( m_dimensionIdLen[j] < 1 || m_dimensionIdLen[j] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 1361 1362 1320 1363 for( Int i = 1; i < m_numberOfLayers; i++ ) 1321 1364 { 1322 xConfirmPara( ( m_dimIds[dim][i] < 0 ) || ( m_dimIds[dim][i] > ( ( 1 << m_dimensionIdLen[dim] ) - 1 ) ) , "DimensionId shall be in the range of 0 to 2^DimensionIdLen - 1. " ); 1365 xConfirmPara( ( m_dimIds[j][i] < 0 ) || ( m_dimIds[j][i] > ( ( 1 << m_dimensionIdLen[j] ) - 1 ) ) , "DimensionId shall be in the range of 0 to 2^DimensionIdLen - 1. " ); 1366 if ( m_splittingFlag ) 1367 { 1368 Int layerIdInNuh = (m_layerIdInNuh.size()!=1) ? m_layerIdInNuh[i] : i; 1369 xConfirmPara( ( ( layerIdInNuh & ( (1 << dimBitOffset[ j + 1 ] ) - 1) ) >> dimBitOffset[ j ] ) != m_dimIds[j][ i ] , "When Splitting Flag is equal to 1 dimension ids shall match values derived from layer ids. "); 1370 } 1323 1371 } 1324 1372 } … … 1361 1409 } 1362 1410 1411 /// Layer sets 1412 xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025") ; 1413 for( Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) 1414 { 1415 if (lsIdx == 0) 1416 { 1417 xConfirmPara( m_layerIdsInSets[lsIdx].size() != 1 || m_layerIdsInSets[lsIdx][0] != 0 , "0-th layer shall only include layer 0. "); 1418 } 1419 for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++ ) 1420 { 1421 xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than 64" ); 1422 } 1423 } 1424 1425 // Output layer sets 1426 xConfirmPara( m_outputLayerSetIdx.size() > 1024, "The number of output layer set indices must be less than 1025.") ; 1427 for (Int lsIdx = 0; lsIdx < m_outputLayerSetIdx.size(); lsIdx++) 1428 { 1429 Int refLayerSetIdx = m_outputLayerSetIdx[ lsIdx ]; 1430 xConfirmPara( refLayerSetIdx < 0 || refLayerSetIdx >= m_vpsNumLayerSets, "Output layer set idx must be greater or equal to 0 and less than the VpsNumLayerSets." ); 1431 1432 for (Int i = 0; i < m_layerIdsInAddOutputLayerSet[ lsIdx ].size(); i++) 1433 { 1434 Bool isAlsoInLayerSet = false; 1435 for (Int j = 0; j < m_layerIdsInSets[ refLayerSetIdx ].size(); j++ ) 1436 { 1437 if ( m_layerIdsInSets[ refLayerSetIdx ][ j ] == m_layerIdsInAddOutputLayerSet[ lsIdx ][ i ] ) 1438 { 1439 isAlsoInLayerSet = true; 1440 break; 1441 } 1442 } 1443 xConfirmPara( !isAlsoInLayerSet, "All output layers of a output layer set be included in corresponding layer set."); 1444 } 1445 } 1446 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" ); 1447 1448 // Layer Dependencies 1449 for (Int i = 0; i < m_numberOfLayers; i++ ) 1450 { 1451 xConfirmPara( (i == 0) && m_directRefLayers[0].size() != 0, "Layer 0 shall not have reference layers." ); 1452 xConfirmPara( m_directRefLayers[i].size() != m_dependencyTypes[ i ].size(), "Each reference layer shall have a reference type." ); 1453 for (Int j = 0; j < m_directRefLayers[i].size(); j++) 1454 { 1455 xConfirmPara( m_directRefLayers[i][j] < 0 || m_directRefLayers[i][j] >= i , "Reference layer id shall be greater than or equal to 0 and less than dependent layer id"); 1456 xConfirmPara( m_dependencyTypes[i][j] < 0 || m_dependencyTypes[i][j] > 2 , "Dependency type shall be greater than or equal to 0 and less than 3"); 1457 } 1458 } 1363 1459 #endif 1364 1460 xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); … … 1518 1614 for( Int i = 0; i < MAX_GOP; i++ ) 1519 1615 { 1520 if( m_GOPListMvc[0][i].m_num InterViewRefPics != 0 )1616 if( m_GOPListMvc[0][i].m_numActiveRefLayerPics != 0 ) 1521 1617 { 1522 1618 printf( "\nError: Frame%d inter_layer refs not available in layer 0\n", i ); … … 1530 1626 if( m_numberOfLayers > 1 ) 1531 1627 { 1532 for( Int k = 1; k < m_numberOfLayers; k++ )1628 for( Int layer = 1; layer < m_numberOfLayers; layer++ ) 1533 1629 { 1534 1630 for( Int i = 0; i < MAX_GOP+1; i++ ) 1535 1631 { 1536 for( Int j = 0; j < m_GOPListMvc[k][i].m_numInterViewRefPics; j++ ) 1632 GOPEntry gopEntry = m_GOPListMvc[layer][i]; 1633 for( Int j = 0; j < gopEntry.m_numActiveRefLayerPics; j++ ) 1537 1634 { 1538 Int i AbsViewId = m_GOPListMvc[k][i].m_interViewRefs[j] + k;1539 if( i AbsViewId < 0 || iAbsViewId >= k)1635 Int ilPredLayerIdc = gopEntry.m_interLayerPredLayerIdc[j]; 1636 if( ilPredLayerIdc < 0 || ilPredLayerIdc >= m_directRefLayers[layer].size() ) 1540 1637 { 1541 printf( "\nError: inter-layer ref pic %d is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interViewRefs[j], i, k);1638 printf( "\nError: inter-layer ref idc %d is not available for Frame%d_l%d\n", gopEntry.m_interLayerPredLayerIdc[j], i, layer ); 1542 1639 bErrorIvpEnhV = true; 1543 1640 } 1544 if( m_GOPListMvc[k][i].m_interViewRefPosL[0][j] < -1 || m_GOPListMvc[k][i].m_interViewRefPosL[0][j] > m_GOPListMvc[k][i].m_numRefPicsActive )1641 if( gopEntry.m_interViewRefPosL[0][j] < -1 || gopEntry.m_interViewRefPosL[0][j] > gopEntry.m_numRefPicsActive ) 1545 1642 { 1546 printf( "\nError: inter-layer ref pos %d on L0 is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interViewRefPosL[0][j], i, k);1643 printf( "\nError: inter-layer ref pos %d on L0 is not available for Frame%d_l%d\n", gopEntry.m_interViewRefPosL[0][j], i, layer ); 1547 1644 bErrorIvpEnhV = true; 1548 1645 } 1549 if( m_GOPListMvc[k][i].m_interViewRefPosL[1][j] < -1 || m_GOPListMvc[k][i].m_interViewRefPosL[1][j] > m_GOPListMvc[k][i].m_numRefPicsActive )1646 if( gopEntry.m_interViewRefPosL[1][j] < -1 || gopEntry.m_interViewRefPosL[1][j] > gopEntry.m_numRefPicsActive ) 1550 1647 { 1551 printf( "\nError: inter-layer ref pos %d on L1 is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interViewRefPosL[1][j], i, k);1648 printf( "\nError: inter-layer ref pos %d on L1 is not available for Frame%d_l%d\n", gopEntry.m_interViewRefPosL[1][j], i, layer ); 1552 1649 bErrorIvpEnhV = true; 1553 1650 } … … 1555 1652 if( i == MAX_GOP ) // inter-view refs at I pic position in base view 1556 1653 { 1557 if( m_GOPListMvc[k][MAX_GOP].m_sliceType != 'B' && m_GOPListMvc[k][MAX_GOP].m_sliceType != 'P' && m_GOPListMvc[k][MAX_GOP].m_sliceType != 'I' )1654 if( gopEntry.m_sliceType != 'B' && gopEntry.m_sliceType != 'P' && gopEntry.m_sliceType != 'I' ) 1558 1655 { 1559 printf( "\nError: slice type of FrameI_l%d must be equal to B or P or I\n", k);1656 printf( "\nError: slice type of FrameI_l%d must be equal to B or P or I\n", layer ); 1560 1657 bErrorIvpEnhV = true; 1561 1658 } 1562 1659 1563 if( m_GOPListMvc[k][MAX_GOP].m_POC != 0 )1660 if( gopEntry.m_POC != 0 ) 1564 1661 { 1565 printf( "\nError: POC %d not possible for FrameI_l%d, must be 0\n", m_GOPListMvc[k][MAX_GOP].m_POC, k);1662 printf( "\nError: POC %d not possible for FrameI_l%d, must be 0\n", gopEntry.m_POC, layer ); 1566 1663 bErrorIvpEnhV = true; 1567 1664 } 1568 1665 1569 if( m_GOPListMvc[k][MAX_GOP].m_temporalId != 0 )1666 if( gopEntry.m_temporalId != 0 ) 1570 1667 { 1571 printf( "\nWarning: Temporal id of FrameI_l%d must be 0 (cp. I-frame in base layer)\n", k);1572 m_GOPListMvc[k][MAX_GOP].m_temporalId = 0;1668 printf( "\nWarning: Temporal id of FrameI_l%d must be 0 (cp. I-frame in base layer)\n", layer ); 1669 gopEntry.m_temporalId = 0; 1573 1670 } 1574 1671 1575 if( m_GOPListMvc[k][MAX_GOP].m_numRefPics != 0 )1672 if( gopEntry.m_numRefPics != 0 ) 1576 1673 { 1577 printf( "\nWarning: temporal references not possible for FrameI_l%d\n", k);1578 for( Int j = 0; j < m_GOPListMvc[ k][MAX_GOP].m_numRefPics; j++ )1674 printf( "\nWarning: temporal references not possible for FrameI_l%d\n", layer ); 1675 for( Int j = 0; j < m_GOPListMvc[layer][MAX_GOP].m_numRefPics; j++ ) 1579 1676 { 1580 m_GOPListMvc[k][MAX_GOP].m_referencePics[j] = 0;1677 gopEntry.m_referencePics[j] = 0; 1581 1678 } 1582 m_GOPListMvc[k][MAX_GOP].m_numRefPics = 0;1679 gopEntry.m_numRefPics = 0; 1583 1680 } 1584 1681 1585 if( m_GOPListMvc[k][MAX_GOP].m_interRPSPrediction )1682 if( gopEntry.m_interRPSPrediction ) 1586 1683 { 1587 printf( "\nError: inter RPS prediction not possible for FrameI_l%d, must be 0\n", k);1684 printf( "\nError: inter RPS prediction not possible for FrameI_l%d, must be 0\n", layer ); 1588 1685 bErrorIvpEnhV = true; 1589 1686 } 1590 1687 1591 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'I' && m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics != 0 )1688 if( gopEntry.m_sliceType == 'I' && gopEntry.m_numActiveRefLayerPics != 0 ) 1592 1689 { 1593 printf( "\nError: inter-layer prediction not possible for FrameI_l%d with slice type I, #IL_ref_pics must be 0\n", k);1690 printf( "\nError: inter-layer prediction not possible for FrameI_l%d with slice type I, #IL_ref_pics must be 0\n", layer ); 1594 1691 bErrorIvpEnhV = true; 1595 1692 } 1596 1693 1597 if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics )1694 if( gopEntry.m_numRefPicsActive > gopEntry.m_numActiveRefLayerPics ) 1598 1695 { 1599 m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics;1696 gopEntry.m_numRefPicsActive = gopEntry.m_numActiveRefLayerPics; 1600 1697 } 1601 1698 1602 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'P' )1699 if( gopEntry.m_sliceType == 'P' ) 1603 1700 { 1604 if( m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )1701 if( gopEntry.m_numActiveRefLayerPics < 1 ) 1605 1702 { 1606 printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type P\n", k);1703 printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type P\n", layer ); 1607 1704 bErrorIvpEnhV = true; 1608 1705 } 1609 1706 else 1610 1707 { 1611 for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics; j++ )1708 for( Int j = 0; j < gopEntry.m_numActiveRefLayerPics; j++ ) 1612 1709 { 1613 if( m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j] != -1 )1710 if( gopEntry.m_interViewRefPosL[1][j] != -1 ) 1614 1711 { 1615 printf( "\nError: inter-layer ref pos %d on L1 not possible for FrameI_l%d with slice type P\n", m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j], k);1712 printf( "\nError: inter-layer ref pos %d on L1 not possible for FrameI_l%d with slice type P\n", gopEntry.m_interViewRefPosL[1][j], layer ); 1616 1713 bErrorIvpEnhV = true; 1617 1714 } … … 1620 1717 } 1621 1718 1622 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'B' && m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )1719 if( gopEntry.m_sliceType == 'B' && gopEntry.m_numActiveRefLayerPics < 1 ) 1623 1720 { 1624 printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type B\n", k);1721 printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type B\n", layer ); 1625 1722 bErrorIvpEnhV = true; 1626 1723 } -
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h
r532 r534 86 86 Int m_scalabilityMask; ///< Mask indicating scalabilities, 1: texture; 3: texture + depth 87 87 std::vector<Int> m_dimensionIdLen; ///< Length of scalability dimension s 88 89 // layer sets 90 Int m_vpsNumLayerSets; ///< Number of layer sets 91 std::vector< std::vector<Int> > m_layerIdsInSets; ///< LayerIds in vps of layer set 92 Bool m_defaultOneTargetOutputLayerFlag; ///< Output highest layer of layer sets by default 93 std::vector<Int> m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 94 std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers 95 std::vector<Int> m_profileLevelTierIdx; ///< Indices of of profile level tier 96 97 // Dependencies 98 std::vector< std::vector<Int> > m_directRefLayers; ///< LayerIds of direct reference layers 99 std::vector< std::vector<Int> > m_dependencyTypes; ///< Dependency types of direct reference layers 100 88 101 #if H_3D_IV_MERGE 89 102 Bool m_ivMvPredFlag; ///< Interview motion vector prediction -
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp
r532 r534 118 118 xSetLayerIds ( vps ); 119 119 xSetDimensionIdAndLength ( vps ); 120 xSetDirectDependencyFlags( vps ); 120 xSetDependencies( vps ); 121 xSetProfileTierLevel ( vps ); 122 xSetLayerSets ( vps ); 121 123 #if H_3D 122 124 vps.initViewIndex(); … … 1079 1081 } 1080 1082 1081 Void TAppEncTop::xSetDirectDependencyFlags( TComVPS& vps ) 1082 { 1083 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 1084 { 1085 if( m_GOPListMvc[layer][MAX_GOP].m_POC == -1 ) 1086 { 1087 continue; 1088 } 1089 for( Int i = 0; i < getGOPSize()+1; i++ ) 1090 { 1091 GOPEntry ge = ( i < getGOPSize() ) ? m_GOPListMvc[layer][i] : m_GOPListMvc[layer][MAX_GOP]; 1092 for( Int j = 0; j < ge.m_numInterViewRefPics; j++ ) 1083 Void TAppEncTop::xSetDependencies( TComVPS& vps ) 1084 { 1085 // Direct dependency flags + dependency types 1086 for( Int depLayer = 1; depLayer < MAX_NUM_LAYERS; depLayer++ ) 1087 { 1088 for( Int refLayer = 0; refLayer < MAX_NUM_LAYERS; refLayer++ ) 1089 { 1090 vps.setDirectDependencyFlag( depLayer, refLayer, false); 1091 vps.setDirectDependencyType( depLayer, refLayer, -1 ); 1092 } 1093 } 1094 for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ ) 1095 { 1096 Int numRefLayers = (Int) m_directRefLayers[depLayer].size(); 1097 assert( numRefLayers == (Int) m_dependencyTypes[depLayer].size() ); 1098 for( Int i = 0; i < numRefLayers; i++ ) 1099 { 1100 Int refLayer = m_directRefLayers[depLayer][i]; 1101 vps.setDirectDependencyFlag( depLayer, refLayer, true); 1102 vps.setDirectDependencyType( depLayer, refLayer,m_dependencyTypes[depLayer][i]); 1103 } 1104 } 1105 1106 // Max temporal id for inter layer reference pictures 1107 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1108 { 1109 Int maxTid = -1; 1110 for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++) 1093 1111 { 1094 Int interLayerRef = layer + ge.m_interViewRefs[j]; 1095 vps.setDirectDependencyFlag( layer, interLayerRef, true ); 1112 for( Int i = 0; i < getGOPSize(); i++ ) 1113 { 1114 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i]; 1115 GOPEntry geRef = m_GOPListMvc[refLayerIdInVps][i]; 1116 1117 for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++) 1118 { 1119 if ( m_directRefLayers[ curLayerIdInVps ][ geCur.m_interLayerPredLayerIdc[ j ]] == refLayerIdInVps ) 1120 { 1121 maxTid = std::max( maxTid, geRef.m_temporalId ); 1122 } 1123 } 1096 1124 } 1097 1125 } 1098 } 1099 1100 vps.checkVPSExtensionSyntax(); 1101 vps.calcIvRefLayers(); 1102 } 1126 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1127 } 1128 1129 // Max one active ref layer flag 1130 Bool maxOneActiveRefLayerFlag = true; 1131 for ( Int currLayerIdInVps = 1; currLayerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; currLayerIdInVps++) 1132 { 1133 for( Int i = 0; i < ( getGOPSize() + 1) && maxOneActiveRefLayerFlag; i++ ) 1134 { 1135 GOPEntry ge = m_GOPListMvc[currLayerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1136 maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numActiveRefLayerPics <= 1); 1137 } 1138 } 1139 1140 vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); 1141 vps.setRefLayers(); 1142 }; 1103 1143 1104 1144 Void TAppEncTop::xSetLayerIds( TComVPS& vps ) … … 1109 1149 Int maxNuhLayerId = nuhLayerIdPresentFlag ? xGetMax( m_layerIdInNuh ) : ( m_numberOfLayers - 1 ) ; 1110 1150 1111 vps.set MaxNuhLayerId( maxNuhLayerId );1151 vps.setVpsMaxLayerId( maxNuhLayerId ); 1112 1152 vps.setVpsNuhLayerIdPresentFlag( nuhLayerIdPresentFlag ); 1113 1153 … … 1125 1165 maxVec = max( vec[i], maxVec ); 1126 1166 return maxVec; 1167 } 1168 1169 Void TAppEncTop::xSetProfileTierLevel( TComVPS& vps ) 1170 { 1171 const Int vpsNumProfileTierLevelMinus1 = 0; //TBD 1172 vps.setVpsNumProfileTierLevelMinus1( vpsNumProfileTierLevelMinus1 ); 1173 1174 for (Int i = 0; i <= vps.getVpsNumProfileTierLevelMinus1(); i++ ) 1175 { 1176 vps.setVpsProfilePresentFlag( i, true ); 1177 } 1178 } 1179 1180 1181 Void TAppEncTop::xSetLayerSets( TComVPS& vps ) 1182 { 1183 // Layer sets 1184 vps.setVpsNumLayerSetsMinus1 ( m_vpsNumLayerSets - 1 ); 1185 vps.setVpsNumberLayerSetsMinus1( vps.getVpsNumLayerSetsMinus1() ); 1186 1187 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) 1188 { 1189 for( Int layerId = 0; layerId < MAX_NUM_LAYER_IDS; layerId++ ) 1190 { 1191 vps.setLayerIdIncludedFlag( false, lsIdx, layerId ); 1192 } 1193 for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++) 1194 { 1195 vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdsInSets[lsIdx][i] ) ); 1196 } 1197 } 1198 1199 Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size(); 1200 // Additional output layer sets + profileLevelTierIdx 1201 vps.setDefaultOneTargetOutputLayerFlag ( m_defaultOneTargetOutputLayerFlag ); 1202 vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets != 0 ); 1203 vps.setNumAddOutputLayerSetsMinus1 ( numAddOuputLayerSets - 1 ); 1204 1205 for (Int lsIdx = 1; lsIdx < m_vpsNumLayerSets; lsIdx++) 1206 { 1207 vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] ); 1208 } 1209 1210 for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ ) 1211 { 1212 vps.setProfileLevelTierIdx( m_vpsNumLayerSets + addOutLs, m_profileLevelTierIdx[ addOutLs ] ); 1213 1214 Int refLayerSetIdx = m_outputLayerSetIdx[ addOutLs ]; 1215 vps.setOutputLayerSetIdxMinus1( m_vpsNumLayerSets + addOutLs, refLayerSetIdx - 1 ); 1216 1217 for (Int i = 0; i < m_layerIdsInSets[ refLayerSetIdx].size(); i++ ) 1218 { 1219 Bool outputLayerFlag = false; 1220 for (Int j = 0; j < m_layerIdsInAddOutputLayerSet[ addOutLs ].size(); j++ ) 1221 { 1222 if ( m_layerIdsInAddOutputLayerSet[addOutLs][ j ] == m_layerIdsInSets[ refLayerSetIdx][ i ] ) 1223 { 1224 outputLayerFlag = true; 1225 break; 1226 } 1227 } 1228 vps.setOutputLayerFlag( m_vpsNumLayerSets + addOutLs, i, outputLayerFlag ); 1229 } 1230 } 1127 1231 } 1128 1232 #endif -
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.h
r531 r534 118 118 Void xSetLayerIds ( TComVPS& vps ); 119 119 Void xSetDimensionIdAndLength ( TComVPS& vps ); 120 Void xSetDirectDependencyFlags ( TComVPS& vps ); 120 Void xSetDependencies ( TComVPS& vps ); 121 Void xSetLayerSets ( TComVPS& vps ); 122 Void xSetProfileTierLevel ( TComVPS& vps ); 121 123 Int xGetMax( std::vector<Int>& vec); 122 124 #endif
Note: See TracChangeset for help on using the changeset viewer.