Changeset 628 in SHVCSoftware for branches/SHM-5.1-dev/source/App


Ignore:
Timestamp:
14 Mar 2014, 15:29:06 (12 years ago)
Author:
nokia
Message:

Integrated JCTVC-O0164: Multi-layer HRD operation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r627 r628  
    13591359#endif
    13601360
     1361#if O0164_MULTI_LAYER_HRD
     1362  vps->setVpsVuiBspHrdPresentFlag(false);
     1363  TEncTop *pcCfg = &m_acTEncTop[0];
     1364  if( pcCfg->getBufferingPeriodSEIEnabled() )
     1365  {
     1366    vps->setVpsVuiBspHrdPresentFlag(true);
     1367    vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2);
     1368    vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1);
     1369    for (UInt i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++)
     1370    {
     1371      vps->setBspCprmsPresentFlag(i, true);
     1372
     1373      UInt layerId = i + 1;
     1374      TEncTop *pcCfgLayer = &m_acTEncTop[layerId];
     1375
     1376      Int iPicWidth         = pcCfgLayer->getSourceWidth();
     1377      Int iPicHeight        = pcCfgLayer->getSourceHeight();
     1378      UInt uhTotalDepth      = m_uiMaxCUDepth;
     1379      UInt uiNumPartitions   = 1<<(uhTotalDepth<<1);
     1380      UInt uiMinCUWidth      = m_uiMaxCUWidth  >> uhTotalDepth;
     1381      UInt uiMinCUHeight     = m_uiMaxCUHeight >> uhTotalDepth;
     1382      UInt uiWidthInCU       = ( iPicWidth %m_uiMaxCUWidth  ) ? iPicWidth /m_uiMaxCUWidth  + 1 : iPicWidth /m_uiMaxCUWidth;
     1383      UInt uiHeightInCU      = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight;
     1384      UInt uiNumCUsInFrame   = uiWidthInCU * uiHeightInCU;
     1385
     1386      UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1);
     1387      UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 );
     1388      if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 )
     1389      {
     1390        numDU ++;
     1391      }
     1392      vps->getBspHrd(i)->setNumDU( numDU );
     1393      vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) );
     1394    }
     1395    for (UInt h = 1; h <= (vps->getNumLayerSets()-1); h++)
     1396    {
     1397      vps->setNumBitstreamPartitions(h, 1);
     1398      for (UInt i = 0; i < vps->getNumBitstreamPartitions(h); i++)
     1399      {
     1400        for (UInt j = 0; j <= (vps->getMaxLayers()-1); j++)
     1401        {
     1402          if (vps->getLayerIdIncludedFlag(h, j) && h == j)
     1403          {
     1404            vps->setLayerInBspFlag(h, i, j, true);
     1405          }
     1406        }
     1407      }
     1408      vps->setNumBspSchedCombinations(h, 1);
     1409      for (UInt i = 0; i < vps->getNumBspSchedCombinations(h); i++)
     1410      {
     1411        for (UInt j = 0; j < vps->getNumBitstreamPartitions(h); j++)
     1412        {
     1413          vps->setBspCombHrdIdx(h, i, j, 0);
     1414          vps->setBspCombSchedIdx(h, i, j, 0);
     1415        }
     1416      }
     1417    }
     1418  }
     1419#endif
     1420
    13611421#else //SVC_EXTENSION
    13621422  m_cTEncTop.init(isFieldCoding);
Note: See TracChangeset for help on using the changeset viewer.