Changeset 582 in SHVCSoftware for branches/SHM-5.0-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
31 Jan 2014, 20:35:21 (11 years ago)
Author:
qualcomm
Message:

JCTVC-P0192: Resolution-based sub-DPB management <MACRO: RESOLUTION_BASED_DPB)

This patch includes the signaling, and assignment of resolution-based sub-DPB indices. Bumping process will be included in a following patch.

From: Adarsh K. Ramasubramonian <aramasub@…>

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

Legend:

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

    r580 r582  
    19371937, m_bitDepthVpsChroma           (0)
    19381938{}
     1939#if RESOLUTION_BASED_DPB
     1940Void RepFormat::init()
     1941{
     1942  m_chromaFormatVpsIdc          = CHROMA_420;
     1943  m_separateColourPlaneVpsFlag  = false;
     1944  m_picWidthVpsInLumaSamples    = 0;
     1945  m_picHeightVpsInLumaSamples   = 0;
     1946  m_bitDepthVpsLuma             = 0;
     1947  m_bitDepthVpsChroma           = 0;
     1948}
     1949#endif
    19391950#endif
    19401951
     
    21262137  ::memset( m_subLayerDpbInfoPresentFlag,   0, sizeof(m_subLayerDpbInfoPresentFlag )  );
    21272138  ::memset( m_maxVpsDecPicBufferingMinus1,  0, sizeof(m_maxVpsDecPicBufferingMinus1 ) );
     2139#if RESOLUTION_BASED_DPB
     2140  ::memset( m_maxVpsLayerDecPicBuffMinus1,  0, sizeof(m_maxVpsLayerDecPicBuffMinus1 ) );
     2141#endif
    21282142  ::memset( m_maxVpsNumReorderPics,         0, sizeof(m_maxVpsNumReorderPics )        );
    21292143  ::memset( m_maxVpsLatencyIncreasePlus1,   0, sizeof(m_maxVpsLatencyIncreasePlus1 )  );
     
    21822196}
    21832197#endif
     2198#if !RESOLUTION_BASED_DPB
    21842199#if VPS_DPB_SIZE_TABLE
    21852200Void TComVPS::deriveNumberOfSubDpbs()
     
    22052220}
    22062221#endif
     2222#endif
    22072223#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    22082224Void TComVPS::setTilesNotInUseFlag(Bool x)
     
    23292345        checkFlagInner[j] |= ( getMaxVpsNumReorderPics(i, j) != getMaxVpsNumReorderPics(i, j - 1) );
    23302346#if CHANGE_NUMSUBDPB_IDX
    2331         for(Int k = 0; k < getNumSubDpbs(layerSetIdxForOutputLayerSet) && !checkFlagInner[j]; k++)  // If checkFlagInner[j] is true, break and signal the values
     2347        for(Int subDpbIdx = 0; subDpbIdx < getNumSubDpbs(layerSetIdxForOutputLayerSet) && !checkFlagInner[j]; subDpbIdx++)  // If checkFlagInner[j] is true, break and signal the values
    23322348#else
    23332349        for(Int k = 0; k < getNumSubDpbs(i) && !checkFlagInner[j]; k++)  // If checkFlagInner[j] is true, break and signal the values
    23342350#endif
    23352351        {
    2336           checkFlagInner[j] |= ( getMaxVpsDecPicBufferingMinus1(i, k, j - 1) != getMaxVpsDecPicBufferingMinus1(i, k, j) );
     2352          checkFlagInner[j] |= ( getMaxVpsDecPicBufferingMinus1(i, subDpbIdx, j - 1) != getMaxVpsDecPicBufferingMinus1(i, subDpbIdx, j) );
    23372353        }
     2354#if RESOLUTION_BASED_DPB
     2355        for(Int layerIdx = 0; layerIdx < this->getNumLayersInIdList(layerSetIdxForOutputLayerSet) && !checkFlagInner[j]; layerIdx++)  // If checkFlagInner[j] is true, break and signal the values
     2356        {
     2357          checkFlagInner[j] |= ( getMaxVpsLayerDecPicBuffMinus1(i, layerIdx, j - 1) != getMaxVpsLayerDecPicBuffMinus1(i, layerIdx, j) );
     2358        }
     2359#endif
    23382360      }
    23392361      // If checkFlagInner[j] = true, then some value needs to be signalled for the j-th sub-layer
     
    23552377    setSubLayerFlagInfoPresentFlag( i, checkFlagOuter );
    23562378  }
     2379}
     2380#endif
     2381#if RESOLUTION_BASED_DPB
     2382Void TComVPS::assignSubDpbIndices()
     2383{
     2384  RepFormat layerRepFormat  [MAX_LAYERS];
     2385  RepFormat subDpbRepFormat [MAX_LAYERS];
     2386
     2387  for(Int lsIdx = 0; lsIdx < this->getNumLayerSets(); lsIdx++)
     2388  {
     2389    for(Int j = 0; j < MAX_LAYERS; j++)
     2390    {
     2391      layerRepFormat [j].init();
     2392      subDpbRepFormat[j].init();
     2393    }
     2394
     2395    // Assign resolution, bit-depth, colour format for each layer in the layer set
     2396    for(Int i = 0; i < this->getNumLayersInIdList( lsIdx ); i++)
     2397    {
     2398      Int layerIdxInVps = this->getLayerIdInVps( this->getLayerSetLayerIdList(lsIdx, i) );
     2399      Int repFormatIdx  = this->getVpsRepFormatIdx( layerIdxInVps );
     2400      RepFormat* repFormat = this->getVpsRepFormat( repFormatIdx );
     2401
     2402      // Assign the rep_format() to the layer
     2403      layerRepFormat[i] = *repFormat;
     2404    }
     2405
     2406    // ----------------------------------------
     2407    // Sub-DPB assignment
     2408    // ----------------------------------------
     2409    // For the base layer
     2410    m_subDpbAssigned[lsIdx][0] = 0;
     2411    subDpbRepFormat[0] = layerRepFormat[0];
     2412
     2413    // Sub-DPB counter
     2414    Int subDpbCtr = 1;
     2415
     2416    for(Int i = 1; i < this->getNumLayersInIdList( lsIdx ); i++)
     2417    {
     2418      Bool newSubDpbFlag = true;
     2419      for(Int j = 0; (j < subDpbCtr) && (newSubDpbFlag); j++)
     2420      {
     2421        if( RepFormat::checkSameSubDpb( layerRepFormat[i], subDpbRepFormat[j] ) )
     2422        {
     2423          // Belong to i-th sub-DPB
     2424          m_subDpbAssigned[lsIdx][i] = j;
     2425          newSubDpbFlag = false;
     2426        }
     2427      }
     2428      if( newSubDpbFlag )
     2429      {
     2430        // New sub-DPB
     2431        subDpbRepFormat[subDpbCtr] = layerRepFormat[i];
     2432        m_subDpbAssigned[lsIdx][i] = subDpbCtr;
     2433        subDpbCtr++;                                    // Increment # subDpbs
     2434      }
     2435    }
     2436    m_numSubDpbs[lsIdx] = subDpbCtr;
     2437  }
     2438}
     2439Int  TComVPS::findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId )
     2440{
     2441  for(Int i = 0; i < this->getNumLayersInIdList(lsIdx); i++)
     2442  {
     2443    if( this->getLayerSetLayerIdList( lsIdx, i) == nuhLayerId )
     2444    {
     2445      return i;
     2446    }
     2447  }
     2448  return -1;  // Layer not found
     2449}
     2450// RepFormat Assignment operator
     2451RepFormat& RepFormat::operator= (const RepFormat &other)
     2452{
     2453  if( this != &other)
     2454  {
     2455    m_chromaAndBitDepthVpsPresentFlag = other.m_chromaAndBitDepthVpsPresentFlag;
     2456    m_chromaFormatVpsIdc              = other.m_chromaFormatVpsIdc;
     2457    m_separateColourPlaneVpsFlag      = other.m_separateColourPlaneVpsFlag;
     2458    m_picWidthVpsInLumaSamples        = other.m_picWidthVpsInLumaSamples;
     2459    m_picHeightVpsInLumaSamples       = other.m_picHeightVpsInLumaSamples;
     2460    m_bitDepthVpsLuma                 = other.m_bitDepthVpsLuma;
     2461    m_bitDepthVpsChroma               = other.m_bitDepthVpsChroma;
     2462  }
     2463  return *this;
     2464}
     2465
     2466// Check whether x and y share the same resolution, chroma format and bit-depth.
     2467Bool RepFormat::checkSameSubDpb(const RepFormat &x, const RepFormat &y)
     2468{
     2469  return (    (x.m_chromaFormatVpsIdc              == y.m_chromaFormatVpsIdc)
     2470          &&  (x.m_picWidthVpsInLumaSamples        == y.m_picWidthVpsInLumaSamples)
     2471          &&  (x.m_picHeightVpsInLumaSamples       == y.m_picHeightVpsInLumaSamples)
     2472          &&  (x.m_bitDepthVpsLuma                 == y.m_bitDepthVpsLuma)
     2473          &&  (x.m_bitDepthVpsChroma               == y.m_bitDepthVpsChroma)
     2474          );
    23572475}
    23582476#endif
  • TabularUnified branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.h

    r580 r582  
    422422public:
    423423  RepFormat();
    424 
     424#if RESOLUTION_BASED_DPB
     425  Void init();
     426  RepFormat& operator= (const RepFormat &);
     427  static Bool checkSameSubDpb(const RepFormat &x, const RepFormat &y);
     428#endif
    425429#if REPN_FORMAT_CONTROL_FLAG
    426430  Bool getChromaAndBitDepthVpsPresentFlag() { return m_chromaAndBitDepthVpsPresentFlag; }
     
    650654  Bool    m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    651655  Int     m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
     656#if RESOLUTION_BASED_DPB
     657  Int     m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 
     658#endif
    652659  Int     m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    653660  Int     m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     
    670677#if P0307_VPS_NON_VUI_EXTENSION
    671678  Int     m_vpsNonVuiExtLength;
     679#endif
     680#if RESOLUTION_BASED_DPB
     681  Int     m_subDpbAssigned            [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS];
    672682#endif
    673683#endif //SVC_EXTENSION
     
    10201030  Void    setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x;    }
    10211031
     1032#if RESOLUTION_BASED_DPB
     1033  Int     getMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j)        { assert(i != 0); return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; }
     1034  Void    setMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j, Int x) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = x;    }
     1035#endif
     1036
    10221037  Int     getMaxVpsNumReorderPics(Int i, Int j)         { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; }
    10231038  Void    setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x;    }
     
    10451060  Int     getVpsNonVuiExtLength()         { return m_vpsNonVuiExtLength; }
    10461061  Void    setVpsNonVuiExtLength(Int x)    { m_vpsNonVuiExtLength = x; }
     1062#endif
     1063#if RESOLUTION_BASED_DPB
     1064  Void assignSubDpbIndices();
     1065  Int  getSubDpbAssigned  (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; }
     1066  Int  findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId );
    10471067#endif
    10481068#endif //SVC_EXTENSION
  • TabularUnified branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h

    r579 r582  
    5757#define VPS_EXTN_UEV_CODING              1      ///< JCTVC-P0306: Code some syntax elements as ue(v), and remove some syntax elements that duplicate behaviour
    5858#define CHANGE_NUMSUBDPB_IDX             1      ///< Change index of NumSubDpb from output layer set to layer set, to be more aligned with the Spec
     59#define RESOLUTION_BASED_DPB             1      ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS
    5960#define O0109_O0199_FLAGS_TO_VUI         1      ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui
    6061#define O0109_VIEW_ID_LEN                1      ///< JCTVC-O0109: view_id_len_minus1 to view_id_len, and add constraint (1<<view_id_len) is greater than or equal to NumViews
Note: See TracChangeset for help on using the changeset viewer.