Changeset 778 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
28 May 2014, 13:26:07 (11 years ago)
Author:
nokia
Message:

JCTVC-Q0078/R0042: Additional layer sets and independent non-base layer rewriting tool (utils/BLRewrite)

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h

    r776 r778  
    3737#include <cstring>
    3838
     39#if Q0078_ADD_LAYER_SETS
     40#include "TLibCommon/NAL.h"
     41#endif
     42
    3943//! \ingroup TLibCommon
    4044//! \{
     
    9498#if Q0074_SEI_COLOR_MAPPING
    9599    COLOR_MAPPING_INFO                   = 143,
     100#endif
     101#if Q0078_ADD_LAYER_SETS
     102    OUTPUT_LAYER_SET_NESTING             = 144,
     103    VPS_REWRITING                        = 145,
    96104#endif
    97105  };
     
    606614};
    607615
     616#if Q0078_ADD_LAYER_SETS
     617class SEIOutputLayerSetNesting : public SEI
     618{
     619public:
     620  PayloadType payloadType() const { return OUTPUT_LAYER_SET_NESTING; }
     621
     622  SEIOutputLayerSetNesting() {}
     623  virtual ~SEIOutputLayerSetNesting()
     624  {
     625    if (!m_callerOwnsSEIs)
     626    {
     627      deleteSEIs(m_nestedSEIs);
     628    }
     629  }
     630
     631  Bool m_olsFlag;
     632  UInt m_numOlsIndicesMinus1;
     633  UInt m_olsIdx[1024];
     634  Bool  m_callerOwnsSEIs;
     635  SEIMessages m_nestedSEIs;
     636};
     637
     638class SEIVPSRewriting : public SEI
     639{
     640public:
     641  PayloadType payloadType() const { return VPS_REWRITING; }
     642
     643  SEIVPSRewriting() {}
     644  virtual ~SEIVPSRewriting() {}
     645
     646  NALUnit* nalu;
     647};
     648#endif
     649
    608650//! \}
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComRom.h

    r644 r778  
    159159
    160160#ifndef ENC_DEC_TRACE
    161 # define ENC_DEC_TRACE 0
     161# define ENC_DEC_TRACE 1
    162162#endif
    163163
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp

    r767 r778  
    25482548    }
    25492549  }
     2550}
     2551#endif
     2552
     2553#if Q0078_ADD_LAYER_SETS
     2554Void TComVPS::setPredictedLayerIds()
     2555{
     2556  for (UInt i = 0; i < getMaxLayers() - 1; i++)
     2557  {
     2558    UInt iNuhLId = getLayerIdInNuh(i);
     2559    UInt predIdx = 0;
     2560    for (UInt j = iNuhLId + 1; j < 63; j++)
     2561    {
     2562      if (getRecursiveRefLayerFlag(j, iNuhLId))
     2563      {
     2564        setPredictedLayerId(i, predIdx, j);
     2565        predIdx++;
     2566      }
     2567    }
     2568    setNumPredictedLayers(iNuhLId, predIdx);
     2569  }
     2570}
     2571
     2572Void TComVPS::setTreePartitionLayerIdList()
     2573{
     2574  Bool countedLayerIdxFlag[MAX_NUM_LAYER_IDS];
     2575
     2576  for (UInt i = 0; i <= getMaxLayers() - 1; i++)
     2577  {
     2578    countedLayerIdxFlag[i] = false;
     2579  }
     2580
     2581  Int numIndependentLayers = 0;
     2582
     2583  for (UInt i = 0; i <= getMaxLayers() - 1; i++)
     2584  {
     2585    UInt iNuhLId = getLayerIdInNuh(i);
     2586    if (getNumDirectRefLayers(iNuhLId) == 0)
     2587    {
     2588      setTreePartitionLayerId(numIndependentLayers, 0, iNuhLId);
     2589      setNumLayersInTreePartition(numIndependentLayers, 1);
     2590      for (UInt j = 0; j < getNumPredictedLayers(iNuhLId); j++)
     2591      {
     2592        if (!countedLayerIdxFlag[getLayerIdInVps(iNuhLId)])
     2593        {
     2594          setTreePartitionLayerId(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers), getPredictedLayerId(iNuhLId, j));
     2595          setNumLayersInTreePartition(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers) + 1);
     2596          countedLayerIdxFlag[getLayerIdInVps(getPredictedLayerId(iNuhLId, j))] = true;
     2597        }
     2598      }
     2599      numIndependentLayers++;
     2600    }
     2601  }
     2602
     2603  setNumIndependentLayers(numIndependentLayers);
    25502604}
    25512605#endif
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h

    r774 r778  
    140140 
    141141  Void  create  (Int numberOfEntries);
    142   Void  destroy ();
     142#if Q0078_ADD_LAYER_SETS
     143  Void  copy(TComRPSList& a);
     144#endif
     145  Void  destroy();
    143146
    144147
     
    495498  UInt        m_maxLayerId;
    496499  UInt        m_numLayerSets;
     500#if Q0078_ADD_LAYER_SETS
     501  Bool        m_layerIdIncludedFlag[2*MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     502#else
    497503  Bool        m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     504#endif
    498505#endif
    499506
     
    661668  Bool       m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
    662669#endif
     670#if Q0078_ADD_LAYER_SETS
     671  Int        m_numAddLayerSets;
     672  UInt       m_highestLayerIdxPlus1[MAX_VPS_LAYER_SETS_PLUS1][MAX_NUM_LAYER_IDS];
     673  UInt       m_predictedLayerId[MAX_NUM_LAYER_IDS][64];
     674  UInt       m_numPredictedLayers[MAX_NUM_LAYER_IDS];
     675  Int        m_numIndependentLayers;
     676  Int        m_numLayersInTreePartition[MAX_NUM_LAYER_IDS];
     677  UInt       m_treePartitionLayerIdList[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
     678#endif
    663679#if SPS_DPB_PARAMS
    664680  Int        m_TolsIdx;
     
    804820  Int     getNumRefLayers(Int currLayerId)                                       { return m_numberRefLayers[currLayerId];                  }
    805821  Void    setNumRefLayers();
     822#endif
     823#if Q0078_ADD_LAYER_SETS
     824  UInt    getNumAddLayerSets()                                                   { return m_numAddLayerSets; }
     825  Void    setNumAddLayerSets(UInt x)                                             { m_numAddLayerSets = x; }
     826  UInt    getHighestLayerIdxPlus1(UInt set, UInt idx)                             { return m_highestLayerIdxPlus1[set][idx]; }
     827  Void    setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx)              { m_highestLayerIdxPlus1[set][idx] = layerIdx; }
     828  Void    setPredictedLayerIds();
     829  UInt    getPredictedLayerId(UInt layerIdx, UInt predIdx)                       { return m_predictedLayerId[layerIdx][predIdx]; }
     830  Void    setPredictedLayerId(UInt layerIdx, UInt predIdx, UInt x)               { m_predictedLayerId[layerIdx][predIdx] = x; }
     831  UInt    getNumPredictedLayers(UInt layerId)                                    { return m_numPredictedLayers[layerId]; }
     832  Void    setNumPredictedLayers(UInt layerId, UInt x)                            { m_numPredictedLayers[layerId] = x; }
     833  Void    setTreePartitionLayerIdList();
     834  Int     getNumIndependentLayers()                                              { return m_numIndependentLayers; }
     835  Void    setNumIndependentLayers(Int x)                                         { m_numIndependentLayers = x; }
     836  Int     getNumLayersInTreePartition(Int idx)                                   { return m_numLayersInTreePartition[idx]; }
     837  Void    setNumLayersInTreePartition(Int idx, Int x)                            { m_numLayersInTreePartition[idx] = x; }
     838  UInt    getTreePartitionLayerId(Int idx, Int layerIdx)                         { return m_treePartitionLayerIdList[idx][layerIdx]; }
     839  Void    setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId)           { m_treePartitionLayerIdList[idx][layerIdx] = layerId; }
    806840#endif
    807841#if VPS_RENAME
     
    24812515  }
    24822516
     2517#if Q0078_ADD_LAYER_SETS
     2518  Void removePS(Int psId)
     2519  {
     2520    assert(psId < m_maxId);
     2521    if (m_paramsetMap.find(psId) != m_paramsetMap.end())
     2522    {
     2523      m_paramsetMap.erase(psId);
     2524    }
     2525  }
     2526#endif
     2527
     2528
    24832529private:
    24842530  std::map<Int,T *> m_paramsetMap;
     
    25032549  TComSPS* getSPS(Int spsId)  { return m_spsMap.getPS(spsId); };
    25042550  TComSPS* getFirstSPS()      { return m_spsMap.getFirstPS(); };
     2551#if Q0078_ADD_LAYER_SETS
     2552  Void     removeSPS(Int spsId) { m_spsMap.removePS(spsId); };
     2553#endif
    25052554
    25062555  //! store picture parameter set and take ownership of it
     
    25092558  TComPPS* getPPS(Int ppsId)  { return m_ppsMap.getPS(ppsId); };
    25102559  TComPPS* getFirstPPS()      { return m_ppsMap.getFirstPS(); };
     2560#if Q0078_ADD_LAYER_SETS
     2561  Void     removePPS(Int ppsId) { m_ppsMap.removePS(ppsId); };
     2562#endif
    25112563
    25122564  //! activate a SPS from a active parameter sets SEI message
  • branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h

    r777 r778  
    246246#define Q0165_OUTPUT_LAYER_SET           1      ///< JCTVC-Q0165: add a constraint to disallow an empty output layer set
    247247#define Q0165_NUM_ADD_OUTPUT_LAYER_SETS  1      ///< JCTVC-Q0165: signal num_add_output_layer_set and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0
     248
     249#define Q0078_ADD_LAYER_SETS             1      ///< JCTVC-Q0078: additional layer sets and layer set config
    248250
    249251#define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
Note: See TracChangeset for help on using the changeset viewer.