Changeset 738 in 3DVCSoftware for trunk/source/App/TAppEncoder


Ignore:
Timestamp:
10 Dec 2013, 13:50:12 (11 years ago)
Author:
tech
Message:

Merged HTM-9.0-dev0@731. (MV-HEVC 6 HLS)

Location:
trunk/source/App/TAppEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r724 r738  
    391391  ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")   
    392392  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 
     393#if H_MV_6_PS_0109_25
     394  ("DefaultOneTargetOutputLayerFlag"  , m_defaultOneTargetOutputLayerIdc  , 0, "Output highest layer of layer sets by default")
     395#else
    393396  ("DefaultOneTargetOutputLayerFlag", m_defaultOneTargetOutputLayerFlag,  false , "Output highest layer of layer sets by default")     
     397#endif
    394398  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 
    395399  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") 
     
    448452  ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs")
    449453 
    450   // Coding structure paramters
     454  // Coding structure parameters
     455#if H_MV_LAYER_WISE_STARTUP
     456  ("IntraPeriod,-ip",         m_iIntraPeriod,std::vector<Int>(1,-1), "Intra period in frames, (-1: only first frame), per layer")
     457#else
    451458  ("IntraPeriod,-ip",         m_iIntraPeriod,              -1, "Intra period in frames, (-1: only first frame)")
     459#endif
    452460  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
    453461  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
     
    624632
    625633#if H_MV
     634
     635#if H_MV_6_HRD_O0217_13
     636  // DBP Size
     637  ("SubLayerFlagInfoPresentFlag",  m_subLayerFlagInfoPresentFlag , false                                           , "SubLayerFlagInfoPresentFlag")
     638#endif
    626639  // VPS VUI
    627640  ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
     641#if H_MV_6_PS_O0223_29
     642  ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false                                           , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
     643  ("CrossLayerIrapAlignedFlag"   , m_crossLayerIrapAlignedFlag   , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
     644#endif
    628645  ("BitRatePresentVpsFlag"       , m_bitRatePresentVpsFlag       , false                                           , "BitRatePresentVpsFlag       ")
    629646  ("PicRatePresentVpsFlag"       , m_picRatePresentVpsFlag       , false                                           , "PicRatePresentVpsFlag       ")
     
    634651  ("ConstantPicRateIdc"          , m_constantPicRateIdc          , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
    635652  ("AvgPicRate"                  , m_avgPicRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
     653#if H_MV_6_O0226_37
     654  ("TilesNotInUseFlag"            , m_tilesNotInUseFlag            , true                                          , "TilesNotInUseFlag            ")
     655  ("TilesInUseFlag"               , m_tilesInUseFlag               , std::vector< Bool >(1,false)                   , "TilesInUseFlag               ")
     656  ("LoopFilterNotAcrossTilesFlag" , m_loopFilterNotAcrossTilesFlag , std::vector< Bool >(1,false)                  , "LoopFilterNotAcrossTilesFlag ")
     657  ("WppNotInUseFlag"              , m_wppNotInUseFlag              , true                                          , "WppNotInUseFlag              ")
     658  ("WppInUseFlag"                 , m_wppInUseFlag                 , std::vector< Bool >(1,0)                      , "WppInUseFlag                 ")
     659#endif
    636660  ("TileBoundariesAlignedFlag"   , m_tileBoundariesAlignedFlag   , std::vector< Bool >(1,0)  ,MAX_NUM_LAYERS       , "TileBoundariesAlignedFlag    per direct reference for the N-th layer")
    637661  ("IlpRestrictedRefLayersFlag"  , m_ilpRestrictedRefLayersFlag  , false                                           , "IlpRestrictedRefLayersFlag")
     
    10501074  xResizeVector( m_bLoopFilterDisable );
    10511075  xResizeVector( m_bUseSAO );
    1052 
     1076#if H_MV_LAYER_WISE_STARTUP
     1077  xResizeVector( m_iIntraPeriod );
     1078#endif
     1079#if H_MV_6_O0226_37
     1080  xResizeVector( m_tilesInUseFlag );
     1081  xResizeVector( m_loopFilterNotAcrossTilesFlag );
     1082  xResizeVector( m_wppInUseFlag );
     1083#endif
    10531084#else
    10541085  m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
     
    13951426    for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++ )
    13961427    {
     1428#if H_MV_6_LAYER_ID_32
     1429      xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than MAX_NUM_LAYER_IDS" );
     1430#else
    13971431      xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than 64" );
     1432#endif
    13981433    }
    13991434  }
     
    14201455    }
    14211456  }
     1457
     1458#if H_MV_6_PS_0109_25
     1459  xConfirmPara( m_defaultOneTargetOutputLayerIdc < 0 || m_defaultOneTargetOutputLayerIdc > 1, "Default one target output layer idc must be equal to 0 or equal to 1" );
     1460#endif
    14221461  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" );
    14231462
     
    14361475  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
    14371476  xConfirmPara( m_iGOPSize > 1 &&  m_iGOPSize % 2,                                          "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
     1477#if H_MV_LAYER_WISE_STARTUP
     1478  for( Int layer = 0; layer < m_numberOfLayers; layer++ )
     1479  {
     1480    xConfirmPara( (m_iIntraPeriod[layer] > 0 && m_iIntraPeriod[layer] < m_iGOPSize) || m_iIntraPeriod[layer] == 0, "Intra period must be more than GOP size, or -1 , not 0" );
     1481  }
     1482#else
    14381483  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
     1484#endif
    14391485  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2,                   "Decoding Refresh Type must be equal to 0, 1 or 2" );
    14401486#if H_MV
     
    14621508  if (m_iDecodingRefreshType == 2)
    14631509  {
     1510#if H_MV_LAYER_WISE_STARTUP
     1511    for (Int i = 0; i < m_numberOfLayers; i++ )
     1512    {
     1513      xConfirmPara( m_iIntraPeriod[i] > 0 && m_iIntraPeriod[i] <= m_iGOPSize ,                      "Intra period must be larger than GOP size for periodic IDR pictures");
     1514    }
     1515#else
    14641516    xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize ,                      "Intra period must be larger than GOP size for periodic IDR pictures");
     1517#endif
    14651518  }
    14661519  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
     
    17211774  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
    17221775   * This permits the ability to omit a GOP structure specification */
     1776#if H_MV_LAYER_WISE_STARTUP
     1777  if (m_iIntraPeriod[layer] == 1 && m_GOPList[0].m_POC == -1) {
     1778#else
    17231779  if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) {
     1780#endif
    17241781    m_GOPList[0] = GOPEntry();
    17251782    m_GOPList[0].m_QPFactor = 1;
     
    17461803  }
    17471804  Int numOK=0;
     1805#if H_MV_LAYER_WISE_STARTUP
     1806  xConfirmPara( m_iIntraPeriod[layer] >=0&&(m_iIntraPeriod[layer]%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
     1807#else
    17481808  xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
     1809#endif
    17491810
    17501811  for(Int i=0; i<m_iGOPSize; i++)
     
    17571818 
    17581819#if H_MV
     1820#if H_MV_LAYER_WISE_STARTUP
     1821  if ( (m_iIntraPeriod[layer] != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) )
     1822#else
    17591823  if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) )
     1824#endif
    17601825#else
    17611826  if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) )
     
    22822347  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    22832348  printf("Motion search range          : %d\n", m_iSearchRange );
     2349#if H_MV_LAYER_WISE_STARTUP
     2350  xPrintParaVector( "Intra period", m_iIntraPeriod );
     2351#else
    22842352  printf("Intra period                 : %d\n", m_iIntraPeriod );
     2353#endif
    22852354  printf("Decoding refresh type        : %d\n", m_iDecodingRefreshType );
    22862355#if !H_MV
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r724 r738  
    8989  Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
    9090  std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds in vps of layer set
     91#if H_MV_6_PS_0109_25
     92  Int                    m_defaultOneTargetOutputLayerIdc;    ///< Output highest layer of layer sets by default when equal to 1
     93#else
    9194  Bool                   m_defaultOneTargetOutputLayerFlag;   ///< Output highest layer of layer sets by default 
     95#endif
    9296  std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets 
    9397  std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
     
    98102  std::vector< std::vector<Int> > m_dependencyTypes;          ///< Dependency types of direct reference layers
    99103
     104#if H_MV_6_HRD_O0217_13
     105  // DBP Size
     106  Bool m_subLayerFlagInfoPresentFlag;
     107#endif
     108
    100109  // VPS VUI
    101110  Bool m_vpsVuiPresentFlag;
     111#if H_MV_6_PS_O0223_29
     112  Bool m_crossLayerPicTypeAlignedFlag;
     113  Bool m_crossLayerIrapAlignedFlag;
     114#endif
    102115  Bool m_bitRatePresentVpsFlag;
    103116  Bool m_picRatePresentVpsFlag;
     
    108121  std::vector< std::vector<Int  > > m_constantPicRateIdc;
    109122  std::vector< std::vector<Int  > > m_avgPicRate;
     123#if H_MV_6_O0226_37
     124  Bool                              m_tilesNotInUseFlag;
     125  std::vector< Bool >               m_tilesInUseFlag;
     126  std::vector< Bool >               m_loopFilterNotAcrossTilesFlag;
     127  Bool                              m_wppNotInUseFlag;
     128  std::vector< Bool >               m_wppInUseFlag;
     129
     130#endif
    110131  std::vector< std::vector<Bool > > m_tileBoundariesAlignedFlag; 
    111132  Bool m_ilpRestrictedRefLayersFlag;
     
    175196 
    176197  // coding structure
     198#if H_MV_LAYER_WISE_STARTUP
     199  std::vector<Int> m_iIntraPeriod;                            ///< period of I-slice (random access period)
     200#else
    177201  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
     202#endif
    178203  Int       m_iDecodingRefreshType;                           ///< random access type
    179204  Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r735 r738  
    216216
    217217    m_cTEncTop.setIvPicLists                   ( &m_ivPicLists );
    218 #endif // H_MV
     218  // H_MV
    219219  m_cTEncTop.setVPS(&vps);
    220220
     
    234234 
    235235  //====== Coding Structure ========
     236#if H_MV_LAYER_WISE_STARTUP
     237  m_cTEncTop.setIntraPeriod                  ( m_iIntraPeriod[ layerIdInVps ] );
     238#else
    236239  m_cTEncTop.setIntraPeriod                  ( m_iIntraPeriod );
     240#endif
    237241  m_cTEncTop.setDecodingRefreshType          ( m_iDecodingRefreshType );
    238242  m_cTEncTop.setGOPSize                      ( m_iGOPSize );
     
    13321336  Int maxViewId = xGetMax( m_viewId );
    13331337
     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
    13341344  Int viewIdLenMinus1 = std::max( gCeilLog2( maxViewId + 1 ) - 1, 0 ) ;
    13351345  const Int maxViewIdLenMinus1 = ( 1 << 4 ) - 1;
    13361346  assert( viewIdLenMinus1 <= maxViewIdLenMinus1  );
    13371347  vps.setViewIdLenMinus1( viewIdLenMinus1 );
     1348#endif
    13381349  for (Int i = 0; i < m_iNumberOfViews; i++)
    13391350  {
     
    13551366    }
    13561367    }
     1368
     1369#if H_MV_6_PS_O0096_21
     1370  Int  defaultDirectDependencyType = -1;
     1371  Bool defaultDirectDependencyFlag = true;
     1372#endif
    13571373  for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ )
    13581374  {
     
    13631379      Int refLayer = m_directRefLayers[depLayer][i];
    13641380      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
    13651395      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
    13681432
    13691433  // Max temporal id for inter layer reference pictures + presence flag
     
    13711435  for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++)
    13721436    {
     1437#if !H_MV_6_ILDDS_O0225_30
    13731438    Int maxTid = -1;
     1439#endif
    13741440    for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++)
    13751441      {
     1442#if H_MV_6_ILDDS_O0225_30
     1443      Int maxTid = -1;
     1444#endif
    13761445      for( Int i = 0; i < getGOPSize(); i++ )
    13771446      {       
     
    13871456        }
    13881457      }
     1458#if H_MV_6_ILDDS_O0225_30   
     1459      vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 );
     1460      maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 );   
     1461    }
     1462#else
    13891463    }
    13901464    vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 );
    13911465    maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 );   
     1466#endif
    13921467  }
    13931468
     
    14061481  vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag );
    14071482 
     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
    14081493 
    14091494  // All Ref layers active flag
     
    14141499    {       
    14151500      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
    14161538      allRefLayersActiveFlag = allRefLayersActiveFlag && (ge.m_numActiveRefLayerPics == m_directRefLayers[ layerIdInVps ].size() );
     1539#endif
    14171540    }           
    14181541  }
     
    14201543  vps.setAllRefLayersActiveFlag( allRefLayersActiveFlag );
    14211544
     1545#if !H_MV_6_PS_O0223_29
    14221546  // Currently cross layer irap aligned is always true.   
    14231547  vps.setCrossLayerIrapAlignedFlag( true );
     1548#endif
    14241549  vps.setRefLayers();
    14251550};
     
    14911616  repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight );
    14921617  repFormat->setPicWidthVpsInLumaSamples  ( m_iSourceWidth  );   
     1618#if H_MV_6_PS_REP_FORM_18_19_20
     1619  repFormat->setChromaAndBitDepthVpsPresentFlag( true );   
     1620#endif
    14931621  // ToDo not supported yet.
    14941622  //repFormat->setSeparateColourPlaneVpsFlag( );
     
    15021630  }
    15031631}
     1632
     1633#if H_MV_6_HRD_O0217_13
     1634Void 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
    15041691
    15051692Void TAppEncTop::xSetLayerSets( TComVPS& vps )
     
    15201707    }
    15211708  }
     1709#if H_MV_6_HRD_O0217_13
     1710  vps.deriveLayerSetLayerIdList();
     1711#endif
    15221712
    15231713  Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size();
    15241714  // Additional output layer sets + profileLevelTierIdx
     1715#if H_MV_6_PS_0109_25
     1716  vps.setDefaultOneTargetOutputLayerIdc   ( m_defaultOneTargetOutputLayerIdc );
     1717#else
    15251718  vps.setDefaultOneTargetOutputLayerFlag   ( m_defaultOneTargetOutputLayerFlag );
     1719#endif
    15261720  vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets       != 0 );   
    15271721  vps.setNumAddOutputLayerSetsMinus1       ( numAddOuputLayerSets - 1        );
    15281722
     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
    15291741  for (Int lsIdx = 1; lsIdx < m_vpsNumLayerSets; lsIdx++)
    15301742  {
    15311743    vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] );
    15321744  }
     1745#endif
    15331746
    15341747  for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ )
     
    15531766    }
    15541767  }
     1768#if H_MV_6_HRD_O0217_13
     1769  vps.deriveTargetLayerIdLists();
     1770#endif
    15551771}
    15561772
     
    15641780
    15651781    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
    15661791
    15671792    pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag );
     
    16021827    }
    16031828
     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
    16041866    for( Int i = 1; i  <=  vps.getMaxLayersMinus1(); i++ )
    16051867    {
     
    16121874      }
    16131875    }
     1876#endif
    16141877
    16151878    pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag );
     
    16421905      }
    16431906    }     
     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
    16441931  }
    16451932}
     
    16831970    if( vps.getUseDLTFlag( layer ) )
    16841971    {
     1972#if H_MV_LAYER_WISE_STARTUP
     1973      xAnalyzeInputBaseDepth(layer, max(  m_iIntraPeriod[layer], 24), &vps);
     1974#else
    16851975      xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps);
     1976#endif
    16861977    }
    16871978#endif
     
    17202011}
    17212012#endif
     2013#endif
    17222014//! \}
  • trunk/source/App/TAppEncoder/TAppEncTop.h

    r655 r738  
    125125  Void xSetProfileTierLevel       ( TComVPS& vps );
    126126  Void xSetRepFormat              ( TComVPS& vps );
     127#if H_MV_6_HRD_O0217_13
     128  Void xSetDpbSize                ( TComVPS& vps );
     129#endif
    127130  Void xSetVPSVUI                 ( TComVPS& vps );
    128131  GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc );
Note: See TracChangeset for help on using the changeset viewer.