Changeset 879 in SHVCSoftware for branches


Ignore:
Timestamp:
28 Aug 2014, 20:58:03 (10 years ago)
Author:
seregin
Message:

unroll layer set init

Location:
branches/SHM-dev/source/Lib/TLibCommon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r874 r879  
    27702770Void TComVPS::setPredictedLayerIds()
    27712771{
    2772   for (UInt i = 0; i < getMaxLayers() - 1; i++)
    2773   {
    2774     UInt iNuhLId = getLayerIdInNuh(i);
     2772  for (UInt i = 0; i < m_uiMaxLayers - 1; i++)
     2773  {
     2774    UInt iNuhLId = m_layerIdInNuh[i];
    27752775    UInt predIdx = 0;
    27762776    for (UInt j = iNuhLId + 1; j < MAX_NUM_LAYER_IDS; j++)
    27772777    {
    2778       if (getRecursiveRefLayerFlag(j, iNuhLId))
    2779       {
    2780         setPredictedLayerId(i, predIdx, j);
     2778      if( m_recursiveRefLayerFlag[j][iNuhLId] )
     2779      {
     2780        m_predictedLayerId[i][predIdx] = j;
    27812781        predIdx++;
    27822782      }
    27832783    }
    2784     setNumPredictedLayers(iNuhLId, predIdx);
     2784    m_numPredictedLayers[iNuhLId] = predIdx;
    27852785  }
    27862786}
     
    27892789{
    27902790  Bool countedLayerIdxFlag[MAX_NUM_LAYER_IDS];
    2791 
    2792   for (UInt i = 0; i <= getMaxLayers() - 1; i++)
    2793   {
    2794     countedLayerIdxFlag[i] = false;
    2795   }
     2791  memset( countedLayerIdxFlag, 0, sizeof(countedLayerIdxFlag) );
    27962792
    27972793  Int numIndependentLayers = 0;
    27982794
    2799   for (UInt i = 0; i <= getMaxLayers() - 1; i++)
    2800   {
    2801     UInt iNuhLId = getLayerIdInNuh(i);
    2802     if (getNumDirectRefLayers(iNuhLId) == 0)
    2803     {
    2804       setTreePartitionLayerId(numIndependentLayers, 0, iNuhLId);
    2805       setNumLayersInTreePartition(numIndependentLayers, 1);
    2806       for (UInt j = 0; j < getNumPredictedLayers(iNuhLId); j++)
    2807       {
    2808         if (!countedLayerIdxFlag[getLayerIdInVps(iNuhLId)])
    2809         {
    2810           setTreePartitionLayerId(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers), getPredictedLayerId(iNuhLId, j));
    2811           setNumLayersInTreePartition(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers) + 1);
    2812           countedLayerIdxFlag[getLayerIdInVps(getPredictedLayerId(iNuhLId, j))] = true;
     2795  for (UInt i = 0; i < m_uiMaxLayers; i++)
     2796  {
     2797    UInt iNuhLId = m_layerIdInNuh[i];
     2798    if( m_numDirectRefLayers[iNuhLId] == 0 )
     2799    {
     2800      m_treePartitionLayerIdList[numIndependentLayers][0] = iNuhLId;
     2801      m_numLayersInTreePartition[numIndependentLayers] = 1;
     2802      for( UInt j = 0; j < m_numPredictedLayers[iNuhLId]; j++ )
     2803      {
     2804        if( !countedLayerIdxFlag[m_layerIdInVps[iNuhLId]] )
     2805        {
     2806          m_treePartitionLayerIdList[numIndependentLayers][m_numLayersInTreePartition[numIndependentLayers]] = m_predictedLayerId[iNuhLId][j];
     2807          m_numLayersInTreePartition[numIndependentLayers] = m_numLayersInTreePartition[numIndependentLayers] + 1;
     2808          countedLayerIdxFlag[m_layerIdInVps[m_predictedLayerId[iNuhLId][j]]] = true;
    28132809        }
    28142810      }
     
    28172813  }
    28182814
    2819   setNumIndependentLayers(numIndependentLayers);
     2815  m_numIndependentLayers = numIndependentLayers;
    28202816}
    28212817
    28222818void TComVPS::setLayerIdIncludedFlagsForAddLayerSets()
    28232819{
    2824   for (UInt i = 0; i < getNumAddLayerSets(); i++)
    2825   {
    2826     for (UInt j = 1; j < getNumIndependentLayers(); j++)
     2820  for (UInt i = 0; i < m_numAddLayerSets; i++)
     2821  {
     2822    for (UInt j = 1; j < m_numIndependentLayers; j++)
    28272823    {
    28282824      Int layerNum = 0;
    2829       Int lsIdx = getVpsNumLayerSetsMinus1() + 1 + i;
     2825      Int lsIdx = m_vpsNumLayerSetsMinus1 + 1 + i;
    28302826      for (Int layerId = 0; layerId < MAX_VPS_LAYER_ID_PLUS1; layerId++)
    28312827      {
    2832         setLayerIdIncludedFlag(false, lsIdx, layerId);
    2833       }
    2834       for (Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++)
    2835       {
    2836         for (Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1(i, j); layerCnt++)
    2837         {
    2838           setLayerSetLayerIdList(lsIdx, layerNum, getTreePartitionLayerId(treeIdx, layerCnt));
    2839           setLayerIdIncludedFlag(true, lsIdx, getTreePartitionLayerId(treeIdx, layerCnt));
     2828        m_layerIdIncludedFlag[lsIdx][layerId] = false;
     2829      }
     2830      for (Int treeIdx = 1; treeIdx < m_numIndependentLayers; treeIdx++)
     2831      {
     2832        for (Int layerCnt = 0; layerCnt < m_highestLayerIdxPlus1[i][j]; layerCnt++)
     2833        {
     2834          m_layerSetLayerIdList[lsIdx][layerNum] = m_treePartitionLayerIdList[treeIdx][layerCnt];
     2835          m_layerIdIncludedFlag[lsIdx][m_treePartitionLayerIdList[treeIdx][layerCnt]] = true;
    28402836          layerNum++;
    28412837        }
    28422838      }
    2843       setNumLayersInIdList(lsIdx, layerNum);
     2839      m_numLayerInIdList[lsIdx] = layerNum;
    28442840    }
    28452841  }
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r874 r879  
    925925#if DERIVE_LAYER_ID_LIST_VARIABLES
    926926  Int     getLayerSetLayerIdList(Int set, Int layerId)          { return m_layerSetLayerIdList[set][layerId]; }
    927   Void    setLayerSetLayerIdList(Int set, Int layerId, Int x)   { m_layerSetLayerIdList[set][layerId] = x   ; }
     927  Void    setLayerSetLayerIdList(Int set, Int layerId, Int x)   { m_layerSetLayerIdList[set][layerId] = x;    }
    928928
    929929  Int     getNumLayersInIdList(Int set)                          { return m_numLayerInIdList[set]; }
    930   Void    setNumLayersInIdList(Int set, Int x)                   { m_numLayerInIdList[set] = x   ; }
     930  Void    setNumLayersInIdList(Int set, Int x)                   { m_numLayerInIdList[set] = x;    }
    931931
    932932  Void    deriveLayerIdListVariables();
Note: See TracChangeset for help on using the changeset viewer.