Changeset 493 in 3DVCSoftware for branches/HTM-DEV-0.3-dev0/source/App
- Timestamp:
- 24 Jun 2013, 21:36:38 (12 years ago)
- Location:
- branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r492 r493 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 229 } 230 in>>entry.m_collocatedRefLayerIdx; 230 231 #endif 231 232 return in; … … 397 398 ("LayerIdsInSet_%d", m_layerIdsInSets , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 398 399 ("DefaultOneTargetOutputLayerFlag", m_defaultOneTargetOutputLayerFlag, false , "Output highest layer of layer sets by default") 399 ("OutputLayerSetIdx", m_outputLayerSetIdx , std::vector<Int>( 1,0), "Indices of layer sets used as additional output layer sets")400 ("OutputLayerSetIdx", m_outputLayerSetIdx , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 400 401 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 401 402 ("ProfileLevelTierIdx", m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier") 403 404 // Layer dependencies 405 ("DirectRefLayers_%d", m_directRefLayers , std::vector<Int>(0,0), MAX_NUM_LAYERS, "LayerIds of direct reference layers") 406 ("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") 402 407 #endif 403 408 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") … … 1391 1396 } 1392 1397 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" ); 1398 1399 // Layer Dependencies 1400 for (Int i = 0; i < m_numberOfLayers; i++ ) 1401 { 1402 xConfirmPara( (i == 0) && m_directRefLayers[0].size() != 0, "Layer 0 shall not have reference layers." ); 1403 xConfirmPara( m_directRefLayers[i].size() == m_dependencyTypes[ i ].size() != 0, "Each reference layer shall have a reference type" ); 1404 for (Int j = 0; j < m_directRefLayers[i].size(); j++) 1405 { 1406 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"); 1407 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"); 1408 } 1409 } 1393 1410 #endif 1394 1411 xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); … … 1544 1561 for( Int i = 0; i < MAX_GOP; i++ ) 1545 1562 { 1546 if( m_GOPListMvc[0][i].m_num InterViewRefPics != 0 )1563 if( m_GOPListMvc[0][i].m_numActiveRefLayerPics != 0 ) 1547 1564 { 1548 1565 printf( "\nError: Frame%d inter_layer refs not available in layer 0\n", i ); … … 1560 1577 for( Int i = 0; i < MAX_GOP+1; i++ ) 1561 1578 { 1562 for( Int j = 0; j < m_GOPListMvc[k][i].m_num InterViewRefPics; j++ )1579 for( Int j = 0; j < m_GOPListMvc[k][i].m_numActiveRefLayerPics; j++ ) 1563 1580 { 1564 Int i AbsViewId = m_GOPListMvc[k][i].m_interViewRefs[j] + k;1565 if( i AbsViewId < 0 || iAbsViewId >= k)1581 Int ilPredLayerIdc = m_directRefLayers[k][m_GOPListMvc[k][i].m_interLayerPredLayerIdc[j]]; 1582 if( ilPredLayerIdc < 0 || ilPredLayerIdc >= m_directRefLayers[k].size() ) 1566 1583 { 1567 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 );1584 printf( "\nError: inter-layer ref idc %d is not available for Frame%d_l%d\n", m_GOPListMvc[k][i].m_interLayerPredLayerIdc[j], i, k ); 1568 1585 bErrorIvpEnhV = true; 1569 1586 } … … 1615 1632 } 1616 1633 1617 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'I' && m_GOPListMvc[k][MAX_GOP].m_num InterViewRefPics != 0 )1634 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'I' && m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics != 0 ) 1618 1635 { 1619 1636 printf( "\nError: inter-layer prediction not possible for FrameI_l%d with slice type I, #IL_ref_pics must be 0\n", k ); … … 1621 1638 } 1622 1639 1623 if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_num InterViewRefPics )1640 if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics ) 1624 1641 { 1625 m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_num InterViewRefPics;1642 m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics; 1626 1643 } 1627 1644 1628 1645 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'P' ) 1629 1646 { 1630 if( m_GOPListMvc[k][MAX_GOP].m_num InterViewRefPics < 1 )1647 if( m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics < 1 ) 1631 1648 { 1632 1649 printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type P\n", k ); … … 1635 1652 else 1636 1653 { 1637 for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_num InterViewRefPics; j++ )1654 for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics; j++ ) 1638 1655 { 1639 1656 if( m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j] != -1 ) … … 1646 1663 } 1647 1664 1648 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'B' && m_GOPListMvc[k][MAX_GOP].m_num InterViewRefPics < 1 )1665 if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'B' && m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics < 1 ) 1649 1666 { 1650 1667 printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type B\n", k ); -
branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncCfg.h
r492 r493 87 87 std::vector<Int> m_dimensionIdLen; ///< Length of scalability dimension s 88 88 89 // layer sets 89 // layer sets 90 90 Int m_vpsNumLayerSets; ///< Number of layer sets 91 std::vector< std::vector<Int> > m_layerIdsInSets; ///< LayerIds of Layer set91 std::vector< std::vector<Int> > m_layerIdsInSets; ///< LayerIds in vps of layer set 92 92 Bool m_defaultOneTargetOutputLayerFlag; ///< Output highest layer of layer sets by default 93 Int numAddOuputLayerSets; ///< Number of additional output layer sets93 Int numAddOuputLayerSets; ///< Number of additional output layer sets 94 94 std::vector<Int> m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 95 std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds of additional output layers95 std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers 96 96 std::vector<Int> m_profileLevelTierIdx; ///< Indices of of profile level tier 97 97 98 // Dependencies 99 std::vector<std::vector<Int>> m_directRefLayers; ///< LayerIds of direct reference layers 100 std::vector<std::vector<Int>> m_dependencyTypes; ///< Dependency types of direct reference layers 98 101 #endif 99 102 Double m_adLambdaModifier[ MAX_TLAYER ]; ///< Lambda modifier array for each temporal layer -
branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r492 r493 118 118 xSetLayerIds ( vps ); 119 119 xSetDimensionIdAndLength ( vps ); 120 xSetD irectDependencyFlags( vps );120 xSetDependencies( vps ); 121 121 xSetLayerSets ( vps ); 122 122 #if H_3D … … 985 985 } 986 986 987 Void TAppEncTop::xSetDirectDependencyFlags( TComVPS& vps ) 988 { 989 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 990 { 991 if( m_GOPListMvc[layer][MAX_GOP].m_POC == -1 ) 992 { 993 continue; 994 } 995 for( Int i = 0; i < getGOPSize()+1; i++ ) 996 { 997 GOPEntry ge = ( i < getGOPSize() ) ? m_GOPListMvc[layer][i] : m_GOPListMvc[layer][MAX_GOP]; 998 for( Int j = 0; j < ge.m_numInterViewRefPics; j++ ) 999 { 1000 Int interLayerRef = layer + ge.m_interViewRefs[j]; 1001 vps.setDirectDependencyFlag( layer, interLayerRef, true ); 1002 } 1003 } 1004 } 1005 1006 vps.checkVPSExtensionSyntax(); 1007 vps.setRefLayers(); 1008 } 987 Void TAppEncTop::xSetDependencies( TComVPS& vps ) 988 { 989 // Direct dependency flags + dependency types 990 for( Int depLayer = 1; depLayer < MAX_NUM_LAYERS; depLayer++ ) 991 { 992 for( Int refLayer = 0; refLayer < MAX_NUM_LAYERS; refLayer++ ) 993 { 994 vps.setDirectDependencyFlag( depLayer, refLayer, false); 995 vps.setDirectDependencyType( depLayer, refLayer, 0 ); 996 } 997 } 998 for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ ) 999 { 1000 Int numRefLayers = m_directRefLayers[depLayer].size(); 1001 assert( numRefLayers == m_dependencyTypes[depLayer].size() ); 1002 for( Int i = 0; i < numRefLayers; i++ ) 1003 { 1004 Int refLayer = m_directRefLayers[depLayer][i]; 1005 vps.setDirectDependencyFlag( depLayer, refLayer, true); 1006 vps.setDirectDependencyType( depLayer, refLayer,m_dependencyTypes[depLayer][i]); 1007 } 1008 } 1009 1010 // Max temporal id for inter layer reference pictures 1011 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1012 { 1013 Int maxTid = -1; 1014 for ( Int currLayerIdInVps = 1; currLayerIdInVps < m_numberOfLayers; currLayerIdInVps++) 1015 { 1016 for( Int i = 0; i < getGOPSize(); i++ ) 1017 { 1018 GOPEntry ge = m_GOPListMvc[currLayerIdInVps][i]; 1019 1020 for (Int j = 0; j < ge.m_numRefPicsActive; j++) 1021 { 1022 if ( m_directRefLayers[ currLayerIdInVps ][ ge.m_interLayerPredLayerIdc[ j ]] == refLayerIdInVps ) 1023 { 1024 maxTid = std::max( maxTid, ge.m_temporalId ); 1025 } 1026 } 1027 } 1028 } 1029 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1030 } 1031 1032 // Max one active ref layer flag 1033 Bool maxOneActiveRefLayerFlag = true; 1034 for ( Int currLayerIdInVps = 1; currLayerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; currLayerIdInVps++) 1035 { 1036 for( Int i = 0; i < ( getGOPSize() + 1) && maxOneActiveRefLayerFlag; i++ ) 1037 { 1038 GOPEntry ge = m_GOPListMvc[currLayerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1039 maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numRefPicsActive <= 1); 1040 } 1041 } 1042 1043 vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); 1044 vps.setRefLayers(); 1045 }; 1009 1046 1010 1047 Void TAppEncTop::xSetLayerIds( TComVPS& vps ) … … 1046 1083 } 1047 1084 for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++) 1048 { 1049 vps.setLayerIdIncludedFlag( true, lsIdx, m_layerIdsInSets[lsIdx][i]);1085 { 1086 vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdsInSets[lsIdx][i] ) ); 1050 1087 } 1051 1088 } -
branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.h
r492 r493 118 118 Void xSetLayerIds ( TComVPS& vps ); 119 119 Void xSetDimensionIdAndLength ( TComVPS& vps ); 120 Void xSetD irectDependencyFlags( TComVPS& vps );120 Void xSetDependencies ( TComVPS& vps ); 121 121 Void xSetLayerSets( TComVPS& vps ); 122 122 Int xGetMax( std::vector<Int>& vec);
Note: See TracChangeset for help on using the changeset viewer.