Changeset 493 in 3DVCSoftware for branches/HTM-DEV-0.3-dev0/source/App


Ignore:
Timestamp:
24 Jun 2013, 21:36:38 (11 years ago)
Author:
tech
Message:

Incorporated further encoder parameters.

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  
    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];
    229229  }
     230  in>>entry.m_collocatedRefLayerIdx;
    230231#endif
    231232  return in;
     
    397398  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 
    398399  ("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") 
    400401  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 
    401402  ("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")
    402407#endif
    403408  ("SourceWidth,-wdt",      m_iSourceWidth,        0, "Source picture width")
     
    13911396  }
    13921397  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  } 
    13931410#endif
    13941411  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
     
    15441561  for( Int i = 0; i < MAX_GOP; i++ )
    15451562  {
    1546     if( m_GOPListMvc[0][i].m_numInterViewRefPics != 0 )
     1563    if( m_GOPListMvc[0][i].m_numActiveRefLayerPics != 0 )
    15471564    {
    15481565      printf( "\nError: Frame%d inter_layer refs not available in layer 0\n", i );
     
    15601577      for( Int i = 0; i < MAX_GOP+1; i++ )
    15611578      {
    1562         for( Int j = 0; j < m_GOPListMvc[k][i].m_numInterViewRefPics; j++ )
     1579        for( Int j = 0; j < m_GOPListMvc[k][i].m_numActiveRefLayerPics; j++ )
    15631580        {
    1564           Int iAbsViewId = m_GOPListMvc[k][i].m_interViewRefs[j] + k;
    1565           if( iAbsViewId < 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() )
    15661583          {
    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 );
    15681585            bErrorIvpEnhV = true;
    15691586          }
     
    16151632          }
    16161633
    1617           if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'I' && m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics != 0 )
     1634          if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'I' && m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics != 0 )
    16181635          {
    16191636            printf( "\nError: inter-layer prediction not possible for FrameI_l%d with slice type I, #IL_ref_pics must be 0\n", k );
     
    16211638          }
    16221639
    1623           if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics )
     1640          if( m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive > m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics )
    16241641          {
    1625             m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics;
     1642            m_GOPListMvc[k][MAX_GOP].m_numRefPicsActive = m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics;
    16261643          }
    16271644
    16281645          if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'P' )
    16291646          {
    1630             if( m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )
     1647            if( m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics < 1 )
    16311648            {
    16321649              printf( "\nError: #IL_ref_pics must be at least one for FrameI_l%d with slice type P\n", k );
     
    16351652            else
    16361653            {
    1637               for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics; j++ )
     1654              for( Int j = 0; j < m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics; j++ )
    16381655              {
    16391656                if( m_GOPListMvc[k][MAX_GOP].m_interViewRefPosL[1][j] != -1 )
     
    16461663          }
    16471664
    1648           if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'B' && m_GOPListMvc[k][MAX_GOP].m_numInterViewRefPics < 1 )
     1665          if( m_GOPListMvc[k][MAX_GOP].m_sliceType == 'B' && m_GOPListMvc[k][MAX_GOP].m_numActiveRefLayerPics < 1 )
    16491666          {
    16501667            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  
    8787  std::vector<Int>       m_dimensionIdLen;                    ///< Length of scalability dimension s
    8888
    89   // layer sets
     89  // layer sets  
    9090  Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
    91   std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds of Layer set
     91  std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds in vps of layer set
    9292  Bool                   m_defaultOneTargetOutputLayerFlag;   ///< Output highest layer of layer sets by default
    93   Int                    numAddOuputLayerSets;              ///< Number of additional output layer sets
     93  Int                    numAddOuputLayerSets;                ///< Number of additional output layer sets
    9494  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 layers 
     95  std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
    9696  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
    98101#endif
    99102  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  
    118118  xSetLayerIds             ( vps );   
    119119  xSetDimensionIdAndLength ( vps );
    120   xSetDirectDependencyFlags( vps );
     120  xSetDependencies( vps );
    121121  xSetLayerSets            ( vps );
    122122#if H_3D
     
    985985}
    986986
    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 }
     987Void 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};
    10091046
    10101047Void TAppEncTop::xSetLayerIds( TComVPS& vps )
     
    10461083    }
    10471084    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] ) );
    10501087    }
    10511088  }
  • branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.h

    r492 r493  
    118118  Void xSetLayerIds               ( TComVPS& vps ); 
    119119  Void xSetDimensionIdAndLength   ( TComVPS& vps );
    120   Void xSetDirectDependencyFlags  ( TComVPS& vps );
     120  Void xSetDependencies           ( TComVPS& vps );
    121121  Void xSetLayerSets( TComVPS& vps );
    122122  Int  xGetMax( std::vector<Int>& vec);
Note: See TracChangeset for help on using the changeset viewer.