Ignore:
Timestamp:
13 Jul 2013, 10:26:41 (11 years ago)
Author:
tech
Message:

MergeMerged tags/HTM-DEV-1.0.

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  
    215215#endif
    216216#if H_MV
    217   in>>entry.m_numInterViewRefPics;
    218   for( Int i = 0; i < entry.m_numInterViewRefPics; i++ )
    219   {
    220     in>>entry.m_interViewRefs[i];
    221   }
    222   for( Int i = 0; i < entry.m_numInterViewRefPics; 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++ )
    223223  {
    224224    in>>entry.m_interViewRefPosL[0][i];
    225225  }
    226   for( Int i = 0; i < entry.m_numInterViewRefPics; i++ )
     226  for( Int i = 0; i < entry.m_numActiveRefLayerPics; i++ )
    227227  {
    228228    in>>entry.m_interViewRefPosL[1][i];
     229  }
     230  if (entry.m_numActiveRefLayerPics > 0 )
     231  {
     232    in>>entry.m_collocatedRefLayerIdx;
    229233  }
    230234#endif
     
    398402  ("LayerIdInNuh",          m_layerIdInNuh       , std::vector<Int>(1,0), "LayerId in Nuh")
    399403  ("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")
    400416#endif
    401417  ("SourceWidth,-wdt",      m_iSourceWidth,        0, "Source picture width")
     
    756772        cOSS<<"Frame"<<i;
    757773        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        }       
    758778      }
    759779    }
     
    762782      std::ostringstream cOSS1;
    763783      cOSS1<<"FrameI"<<"_l"<<k;
     784
    764785      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
    765791
    766792      for( Int i = 1; i < MAX_GOP + 1; i++ )
     
    769795        cOSS2<<"Frame"<<i<<"_l"<<k;
    770796        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        }       
    771801      }
    772802    }
     
    13111341#endif
    13121342
    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++ )
    13161347 {
    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
    13201363   for( Int i = 1; i < m_numberOfLayers; i++ )
    13211364   {     
    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      }
    13231371   }
    13241372 }
     
    13611409 }
    13621410
     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  } 
    13631459#endif
    13641460  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
     
    15181614  for( Int i = 0; i < MAX_GOP; i++ )
    15191615  {
    1520     if( m_GOPListMvc[0][i].m_numInterViewRefPics != 0 )
     1616    if( m_GOPListMvc[0][i].m_numActiveRefLayerPics != 0 )
    15211617    {
    15221618      printf( "\nError: Frame%d inter_layer refs not available in layer 0\n", i );
     
    15301626  if( m_numberOfLayers > 1 )
    15311627  {
    1532     for( Int k = 1; k < m_numberOfLayers; k++ )
     1628    for( Int layer = 1; layer < m_numberOfLayers; layer++ )
    15331629    {
    15341630      for( Int i = 0; i < MAX_GOP+1; i++ )
    15351631      {
    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++ )
    15371634        {
    1538           Int iAbsViewId = m_GOPListMvc[k][i].m_interViewRefs[j] + k;
    1539           if( iAbsViewId < 0 || iAbsViewId >= k )
     1635          Int ilPredLayerIdc = gopEntry.m_interLayerPredLayerIdc[j];
     1636          if( ilPredLayerIdc < 0 || ilPredLayerIdc >= m_directRefLayers[layer].size() )
    15401637          {
    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 );
    15421639            bErrorIvpEnhV = true;
    15431640          }
    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 )
    15451642          {
    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 );
    15471644            bErrorIvpEnhV = true;
    15481645          }
    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 )
    15501647          {
    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 );
    15521649            bErrorIvpEnhV = true;
    15531650          }
     
    15551652        if( i == MAX_GOP ) // inter-view refs at I pic position in base view
    15561653        {
    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' )
    15581655          {
    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 );
    15601657            bErrorIvpEnhV = true;
    15611658          }
    15621659
    1563           if( m_GOPListMvc[k][MAX_GOP].m_POC != 0 )
     1660          if( gopEntry.m_POC != 0 )
    15641661          {
    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 );
    15661663            bErrorIvpEnhV = true;
    15671664          }
    15681665
    1569           if( m_GOPListMvc[k][MAX_GOP].m_temporalId != 0 )
     1666          if( gopEntry.m_temporalId != 0 )
    15701667          {
    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;
    15731670          }
    15741671
    1575           if( m_GOPListMvc[k][MAX_GOP].m_numRefPics != 0 )
     1672          if( gopEntry.m_numRefPics != 0 )
    15761673          {
    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++ )
    15791676            {
    1580               m_GOPListMvc[k][MAX_GOP].m_referencePics[j] = 0;
     1677              gopEntry.m_referencePics[j] = 0;
    15811678            }
    1582             m_GOPListMvc[k][MAX_GOP].m_numRefPics = 0;
     1679            gopEntry.m_numRefPics = 0;
    15831680          }
    15841681
    1585           if( m_GOPListMvc[k][MAX_GOP].m_interRPSPrediction )
     1682          if( gopEntry.m_interRPSPrediction )
    15861683          {
    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 );
    15881685            bErrorIvpEnhV = true;
    15891686          }
    15901687
    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 )
    15921689          {
    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 );
    15941691            bErrorIvpEnhV = true;
    15951692          }
    15961693
    1597           if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics )
     1694          if( gopEntry.m_numRefPicsActive > gopEntry.m_numActiveRefLayerPics )
    15981695          {
    1599             m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics;
     1696            gopEntry.m_numRefPicsActive = gopEntry.m_numActiveRefLayerPics;
    16001697          }
    16011698
    1602           if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'P' )
     1699          if( gopEntry.m_sliceType == 'P' )
    16031700          {
    1604             if( m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )
     1701            if( gopEntry.m_numActiveRefLayerPics < 1 )
    16051702            {
    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 );
    16071704              bErrorIvpEnhV = true;
    16081705            }
    16091706            else
    16101707            {
    1611               for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics; j++ )
     1708              for( Int j = 0; j < gopEntry.m_numActiveRefLayerPics; j++ )
    16121709              {
    1613                 if( m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j] != -1 )
     1710                if( gopEntry.m_interViewRefPosL[1][j] != -1 )
    16141711                {
    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 );
    16161713                  bErrorIvpEnhV = true;
    16171714                }
     
    16201717          }
    16211718
    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 )
    16231720          {
    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 );
    16251722            bErrorIvpEnhV = true;
    16261723          }
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h

    r532 r534  
    8686  Int                    m_scalabilityMask;                   ///< Mask indicating scalabilities, 1: texture; 3: texture + depth                                                               
    8787  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
    88101#if H_3D_IV_MERGE
    89102  Bool                   m_ivMvPredFlag;                      ///< Interview motion vector prediction
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp

    r532 r534  
    118118  xSetLayerIds             ( vps );   
    119119  xSetDimensionIdAndLength ( vps );
    120   xSetDirectDependencyFlags( vps );
     120  xSetDependencies( vps );
     121  xSetProfileTierLevel     ( vps );
     122  xSetLayerSets            ( vps );
    121123#if H_3D
    122124  vps.initViewIndex();
     
    10791081}
    10801082
    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++ )
     1083Void 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++)
    10931111      {
    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        }
    10961124      }
    10971125    }
    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};
    11031143
    11041144Void TAppEncTop::xSetLayerIds( TComVPS& vps )
     
    11091149  Int  maxNuhLayerId = nuhLayerIdPresentFlag ? xGetMax( m_layerIdInNuh ) : ( m_numberOfLayers - 1 ) ;
    11101150
    1111   vps.setMaxNuhLayerId( maxNuhLayerId );
     1151  vps.setVpsMaxLayerId( maxNuhLayerId );
    11121152  vps.setVpsNuhLayerIdPresentFlag( nuhLayerIdPresentFlag );
    11131153
     
    11251165    maxVec = max( vec[i], maxVec );
    11261166  return maxVec;
     1167}
     1168
     1169Void 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
     1181Void 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  }
    11271231}
    11281232#endif
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.h

    r531 r534  
    118118  Void xSetLayerIds               ( TComVPS& vps ); 
    119119  Void xSetDimensionIdAndLength   ( TComVPS& vps );
    120   Void xSetDirectDependencyFlags  ( TComVPS& vps );
     120  Void xSetDependencies           ( TComVPS& vps );
     121  Void xSetLayerSets              ( TComVPS& vps );
     122  Void xSetProfileTierLevel       ( TComVPS& vps );
    121123  Int  xGetMax( std::vector<Int>& vec);
    122124#endif
Note: See TracChangeset for help on using the changeset viewer.