Changeset 115 in SHVCSoftware for branches/HM-10.0-dev-SHM/source/Lib


Ignore:
Timestamp:
5 Apr 2013, 17:33:21 (12 years ago)
Author:
vidyo
Message:

Adding missing syntax elements for VPS extension; by default this code is disabled. Turn on VPS_EXTN_MASK_AND_DIM_INFO to enable this code.

Location:
branches/HM-10.0-dev-SHM/source/Lib
Files:
5 edited

Legend:

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

    r112 r115  
    14851485    m_uiMaxLatencyIncrease[i] = 0;
    14861486  }
     1487#if VPS_EXTN_MASK_AND_DIM_INFO
     1488  m_avcBaseLayerFlag = false;
     1489  m_splittingFlag = false;
     1490  ::memset(m_scalabilityMask, 0, sizeof(m_scalabilityMask));
     1491  ::memset(m_dimensionIdLen, 0, sizeof(m_dimensionIdLen));
     1492  m_nuhLayerIdPresentFlag = false;
     1493  ::memset(m_layerIdInNuh, 0, sizeof(m_layerIdInNuh));
     1494  ::memset(m_dimensionId, 0, sizeof(m_dimensionId));
     1495
     1496  m_numScalabilityTypes = 0;
     1497  ::memset(m_layerIdInVps, 0, sizeof(m_layerIdInVps));
     1498#endif
    14871499#if VPS_EXTN_PROFILE_INFO
    14881500  ::memset(m_profilePresentFlag, 0, sizeof(m_profilePresentFlag));
  • branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.h

    r112 r115  
    516516  // Variables related to VPS extensions
    517517  // ------------------------------------------
     518#if VPS_EXTN_MASK_AND_DIM_INFO
     519  Bool       m_avcBaseLayerFlag;                                // For now, always set to true.
     520  Bool       m_splittingFlag;
     521  Bool       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES];
     522  UInt       m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES];
     523  Bool       m_nuhLayerIdPresentFlag;
     524  UInt       m_layerIdInNuh[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer ID in the VPS with layer_id_in_nuh
     525  UInt       m_dimensionId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES];
     526
     527  // Below are derived variables
     528  UInt       m_numScalabilityTypes;
     529  UInt       m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer_id_in_nuh with the layer ID in the VPS
     530#endif
    518531#if VPS_EXTN_PROFILE_INFO
    519532  // Profile-tier-level signalling related
     
    594607#if L0043_TIMING_INFO
    595608  TimingInfo* getTimingInfo() { return &m_timingInfo; }
     609#endif
     610#if VPS_EXTN_MASK_AND_DIM_INFO
     611  Bool   getAvcBaseLayerFlag()                                  { return m_avcBaseLayerFlag;       }
     612  Void   setAvcBaseLayerFlag(Bool x)                            { m_avcBaseLayerFlag = x;          }
     613
     614  Bool   getSplittingFlag()                                     { return m_splittingFlag;          }
     615  Void   setSplittingFlag(Bool x)                               { m_splittingFlag = x;             }
     616
     617  Bool   getScalabilityMask(Int id)                             { return m_scalabilityMask[id];    }
     618  Void   setScalabilityMask(Int id, Bool x)                     { m_scalabilityMask[id] = x;       }
     619
     620  UInt   getDimensionIdLen(Int id)                              { return m_dimensionIdLen[id];     }
     621  Void   setDimensionIdLen(Int id, UInt x)                      { m_dimensionIdLen[id] = x;        }
     622
     623  Bool   getNuhLayerIdPresentFlag()                             { return m_nuhLayerIdPresentFlag;  }
     624  Void   setNuhLayerIdPresentFlag(Bool x)                       { m_nuhLayerIdPresentFlag = x;     }
     625
     626  UInt   getLayerIdInNuh(Int id)                                { return m_layerIdInNuh[id];       }
     627  Void   setLayerIdInNuh(Int id, UInt x)                        { m_layerIdInNuh[id] = x;          }
     628
     629  UInt   getDimensionId(Int lyrId, Int id)                      { return m_dimensionId[lyrId][id]; }
     630  Void   setDimensionId(Int lyrId, Int id, UInt x)              { m_dimensionId[lyrId][id] = x;    }
     631
     632  UInt   getNumScalabilityTypes()                               { return m_numScalabilityTypes;    }
     633  Void   setNumScalabilityTypes(UInt x)                         { m_numScalabilityTypes = x;       }
     634
     635  UInt   getLayerIdInVps(Int id)                                { return m_layerIdInVps[id];       }
     636  Void   setLayerIdInVps(Int id, UInt x)                        { m_layerIdInVps[id] = x;          }
    596637#endif
    597638#if VPS_EXTN_PROFILE_INFO
  • branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TypeDef.h

    r112 r115  
    4747#define VPS_EXTNS                        1      ///< Include function structure for VPS extensions
    4848#if VPS_EXTNS
     49#define VPS_EXTN_MASK_AND_DIM_INFO       0      ///< Include avc_base_layer_flag, splitting_flag, scalability mask and dimension related info
    4950#define VPS_EXTN_OP_LAYER_SETS           1      ///< Include output layer sets in VPS extension
    5051#define VPS_EXTN_PROFILE_INFO            1      ///< Include profile information for layer sets in VPS extension
     
    137138#define L0232_RD_PENALTY           1  ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices
    138139
     140#if VPS_EXTN_MASK_AND_DIM_INFO
     141#define MAX_VPS_NUM_SCALABILITY_TYPES             16
     142#endif
    139143#if VPS_RENAME
    140144#define MAX_VPS_LAYER_SETS_PLUS1                  1024
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r114 r115  
    845845  UInt uiCode;
    846846  // ... More syntax elements to be parsed here
     847#if VPS_EXTN_MASK_AND_DIM_INFO
     848  UInt numScalabilityTypes = 0, i = 0, j = 0;
     849
     850  READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
     851  READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
     852
     853  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     854  {
     855    READ_FLAG( uiCode, "scalability_mask[i]" ); vps->setScalabilityMask(i, uiCode ? true : false);
     856    numScalabilityTypes += uiCode;
     857    if( i != 1 )
     858    {
     859      // Multiview and reserved masks are not used in this version of software
     860      assert( uiCode == 0 );
     861    }
     862  }
     863  vps->setNumScalabilityTypes(numScalabilityTypes);
     864
     865  for(j = 0; j < numScalabilityTypes; j++)
     866  {
     867    READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1);
     868  }
     869  if(vps->getSplittingFlag())
     870  {
     871    UInt numBits = 0;
     872    for(j = 0; j < numScalabilityTypes; j++)
     873    {
     874      numBits += vps->getDimensionIdLen(j);
     875    }
     876    assert( numBits <= 6 );
     877  }
     878
     879  READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false);
     880  vps->setLayerIdInNuh(0, 0);
     881  vps->setLayerIdInVps(0, 0);
     882  for(i = 1; i <= vps->getMaxLayerId(); i++) // TODO: we should use vps->getMaxLayers(), but currently it is always set to 1
     883  {
     884    if( vps->getNuhLayerIdPresentFlag() )
     885    {
     886      READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); vps->setLayerIdInNuh(i, uiCode);
     887      assert( uiCode > vps->getLayerIdInNuh(i-1) );
     888    }
     889    else
     890    {
     891      vps->setLayerIdInNuh(i, i);
     892    }
     893    vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
     894
     895    for(j = 0; j < numScalabilityTypes; j++)
     896    {
     897      READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);
     898      assert( uiCode <= vps->getMaxLayerId() );
     899    }
     900  }
     901#endif
     902
    847903#if VPS_EXTN_PROFILE_INFO
    848904  // Profile-tier-level signalling
  • branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncCavlc.cpp

    r114 r115  
    673673{
    674674  // ... More syntax elements to be written here
     675#if VPS_EXTN_MASK_AND_DIM_INFO
     676  UInt i = 0, j = 0;
     677
     678  WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
     679  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
     680
     681  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     682  {
     683    WRITE_FLAG( vps->getScalabilityMask(i),            "scalability_mask[i]" );
     684  }
     685
     686  for(j = 0; j < vps->getNumScalabilityTypes(); j++)
     687  {
     688    WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3,      "dimension_id_len_minus1[j]" );
     689  }
     690
     691  WRITE_FLAG( vps->getNuhLayerIdPresentFlag(),         "vps_nuh_layer_id_present_flag" );
     692  for(i = 1; i <= vps->getMaxLayerId(); i++) // TODO: we should use vps->getMaxLayers(), but currently it is always set to 1
     693  {
     694    if( vps->getNuhLayerIdPresentFlag() )
     695    {
     696      WRITE_CODE( vps->getLayerIdInNuh(i),     6,      "layer_id_in_nuh[i]" );
     697    }
     698    for(j = 0; j < vps->getNumScalabilityTypes(); j++)
     699    {
     700      UInt bits = vps->getDimensionIdLen(j);
     701      WRITE_CODE( vps->getDimensionId(i, j),   bits,   "dimension_id[i][j]" );
     702    }
     703  }
     704#endif
    675705#if VPS_EXTN_PROFILE_INFO
    676706  // Profile-tier-level signalling
Note: See TracChangeset for help on using the changeset viewer.