Changeset 521 in SHVCSoftware for branches/SHM-4.1-dev/source


Ignore:
Timestamp:
19 Dec 2013, 03:10:48 (11 years ago)
Author:
qualcomm
Message:

JCTVC-O0217: Output layer set index at the decoder (MACRO: OUTPUT_LAYER_SET_INDEX)

Patch includes output layer set index inference at the decoder.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-4.1-dev/source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.1-dev/source/App/TAppDecoder/TAppDecCfg.cpp

    r313 r521  
    6969  string cfg_ReconFile [MAX_LAYERS];
    7070  Int nLayerNum;
     71#if OUTPUT_LAYER_SET_INDEX
     72  Int olsIdx;
     73#endif
    7174#if AVC_BASE
    7275  string cfg_BLReconFile;
     
    110113#if SVC_EXTENSION
    111114  ("LayerNum,-ls", nLayerNum, 1, "Number of layers to be decoded.")
     115#if OUTPUT_LAYER_SET_INDEX
     116  ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.")
     117#endif
    112118#endif
    113119  ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
     
    138144  m_tgtLayerId = nLayerNum - 1;
    139145  assert( m_tgtLayerId >= 0 );
     146#if OUTPUT_LAYER_SET_INDEX 
     147  this->getCommonDecoderParams()->setOutputLayerSetIdx( olsIdx       );
     148  this->getCommonDecoderParams()->setTargetLayerId    ( m_tgtLayerId );
     149#endif
    140150  for(UInt layer=0; layer<= m_tgtLayerId; layer++)
    141151  {
     
    201211      fprintf(stderr, "File %s could not be opened. Using all LayerIds as default.\n", cfg_TargetDecLayerIdSetFile.c_str() );
    202212    }
     213#if OUTPUT_LAYER_SET_INDEX 
     214    this->getCommonDecoderParams()->setTargetDecLayerIdSet( &m_targetDecLayerIdSet );
     215#endif
    203216  }
    204217
  • branches/SHM-4.1-dev/source/App/TAppDecoder/TAppDecCfg.h

    r313 r521  
    9191  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    9292  Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
     93#if OUTPUT_LAYER_SET_INDEX
     94  CommonDecoderParams             m_commonDecoderParams;
     95#endif
    9396
    9497public:
     
    120123 
    121124  Bool  parseCfg        ( Int argc, Char* argv[] );   ///< initialize option class from configuration
     125#if OUTPUT_LAYER_SET_INDEX
     126  CommonDecoderParams* getCommonDecoderParams() {return &m_commonDecoderParams;}
     127#endif
    122128};
    123129
  • branches/SHM-4.1-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r494 r521  
    494494    m_acTDecTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
    495495    m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 );
     496#if OUTPUT_LAYER_SET_INDEX
     497    m_acTDecTop[layer].setCommonDecoderParams( this->getCommonDecoderParams() );
     498#endif
    496499  }
    497500
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/CommonDef.h

    r499 r521  
    4040
    4141#include <algorithm>
    42 
     42#include <vector>
    4343#if _MSC_VER > 1000
    4444// disable "signed and unsigned mismatch"
     
    280280};
    281281
     282#if OUTPUT_LAYER_SET_INDEX
     283class CommonDecoderParams
     284{
     285  Int m_targetLayerId;
     286  Int m_outputLayerSetIdx;
     287  std::vector<Int> *m_targetDecLayerIdSet;
     288  Bool m_valueCheckedFlag;
     289public:
     290  CommonDecoderParams():
     291    m_targetLayerId(0)
     292    , m_outputLayerSetIdx(-1)
     293    , m_targetDecLayerIdSet(NULL)
     294    , m_valueCheckedFlag(false)
     295 {}
     296
     297  Void setTargetLayerId(const Int x) { m_targetLayerId = x;   }
     298  Int  getTargetLayerId()            { return m_targetLayerId;}
     299 
     300  Void setOutputLayerSetIdx(const Int x) { m_outputLayerSetIdx = x;   }
     301  Int  getOutputLayerSetIdx()            { return m_outputLayerSetIdx;}
     302
     303  Void               setTargetDecLayerIdSet(std::vector<Int> *x) { m_targetDecLayerIdSet = x;   }
     304  std::vector<Int>*  getTargetDecLayerIdSet()                    { return m_targetDecLayerIdSet;}
     305 
     306  Void setValueCheckedFlag(const Bool x) { m_valueCheckedFlag = x;   }
     307  Bool getValueCheckedFlag()            { return m_valueCheckedFlag;}
     308 
     309};
     310#endif
    282311//! \}
    283312
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h

    r520 r521  
    193193
    194194#define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
     195#if VPS_DPB_SIZE_TABLE
     196#define OUTPUT_LAYER_SET_INDEX           1      ///< JCTVC-O0217: DPB operations: Inference/input of output layer set index
     197#endif
    195198#else
    196199#define SYNTAX_OUTPUT                    0
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r520 r521  
    694694#if SVC_EXTENSION
    695695  m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder[m_layerId].getPrefetchedVPS(0) );
     696#if OUTPUT_LAYER_SET_INDEX
     697  // Following check should go wherever the VPS is activated
     698  checkValueOfOutputLayerSetIdx( m_apcSlicePilot->getVPS());
     699#endif
    696700  m_apcSlicePilot->initSlice( nalu.m_layerId );
    697701#else
     
    805809  }
    806810#endif
    807 
    808811#if REPN_FORMAT_IN_VPS
    809812  // Initialize ILRP if needed, only for the current layer 
     
    18601863}
    18611864#endif
    1862 
     1865#if OUTPUT_LAYER_SET_INDEX
     1866Void TDecTop::checkValueOfOutputLayerSetIdx(TComVPS *vps)
     1867{
     1868  CommonDecoderParams* params = this->getCommonDecoderParams();
     1869  if( params->getValueCheckedFlag() )
     1870  {
     1871    return; // Already checked
     1872  }
     1873  if( params->getOutputLayerSetIdx() == -1 )  // Output layer set index not specified
     1874  {
     1875    Bool layerSetMatchFound = false;
     1876    // Output layer set index not assigned.
     1877    // Based on the value of targetLayerId, check if any of the output layer matches
     1878    // Currently, the target layer ID in the encoder assumes that all the layers are decoded   
     1879    // Check if any of the output layer sets match this description
     1880    for(Int i = 0; i < vps->getNumOutputLayerSets(); i++)
     1881    {
     1882      Bool layerSetMatchFlag = true;
     1883      Int layerSetIdx = vps->getOutputLayerSetIdx( i );
     1884      if( vps->getNumLayersInIdList( layerSetIdx ) == params->getTargetLayerId() + 1 )
     1885      {
     1886        for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++)
     1887        {
     1888          if( vps->getLayerSetLayerIdList( layerSetIdx, j ) != j )
     1889          {
     1890            layerSetMatchFlag = false;
     1891            break;
     1892          }
     1893        }
     1894      }
     1895      else
     1896      {
     1897        layerSetMatchFlag = false;
     1898      }
     1899     
     1900      if( layerSetMatchFlag ) // Potential output layer set candidate found
     1901      {
     1902        // If target dec layer ID list is also included - check if they match
     1903        if( params->getTargetDecLayerIdSet() )
     1904        {
     1905          if( params->getTargetDecLayerIdSet()->size() ) 
     1906          {
     1907            for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++)
     1908            {
     1909              if( *(params->getTargetDecLayerIdSet()->begin() + j) != vps->getLayerIdInNuh(vps->getLayerSetLayerIdList( layerSetIdx, j )))
     1910              {
     1911                layerSetMatchFlag = false;
     1912              }
     1913            }
     1914          }
     1915        }
     1916        if( layerSetMatchFlag ) // The target dec layer ID list also matches, if present
     1917        {
     1918          // Match found
     1919          layerSetMatchFound = true;
     1920          params->setOutputLayerSetIdx( i );
     1921          params->setValueCheckedFlag( true );
     1922          break;
     1923        }
     1924      }
     1925    }
     1926    assert( layerSetMatchFound ); // No output layer set matched the value of either targetLayerId or targetdeclayerIdlist
     1927  }   
     1928  else // Output layer set index is assigned - check if the values match
     1929  {
     1930    // Check if the target decoded layer is the highest layer in the list
     1931    Int layerSetIdx = vps->getOutputLayerSetIdx( params->getOutputLayerSetIdx() );  // Index to the layer set
     1932    assert( params->getTargetLayerId() == vps->getNumLayersInIdList( layerSetIdx ) - 1);
     1933
     1934    Bool layerSetMatchFlag = true;
     1935    for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++)
     1936    {
     1937      if( vps->getLayerSetLayerIdList( layerSetIdx, j ) != j )
     1938      {
     1939        layerSetMatchFlag = false;
     1940        break;
     1941      }
     1942    }
     1943
     1944    assert(layerSetMatchFlag);    // Signaled output layer set index does not match targetOutputLayerId.
     1945   
     1946    // Check if the targetdeclayerIdlist matches the output layer set
     1947    if( params->getTargetDecLayerIdSet() )
     1948    {
     1949      if( params->getTargetDecLayerIdSet()->size() ) 
     1950      {
     1951        for(Int i = 0; i < vps->getNumLayersInIdList( layerSetIdx ); i++)
     1952        {
     1953          assert( *(params->getTargetDecLayerIdSet()->begin() + i) == vps->getLayerIdInNuh(vps->getLayerSetLayerIdList( layerSetIdx, i )));
     1954        }
     1955      }
     1956    }
     1957    params->setValueCheckedFlag( true );
     1958
     1959  }
     1960}
     1961#endif
    18631962//! \}
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.h

    r494 r521  
    134134  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
    135135#endif
     136#if OUTPUT_LAYER_SET_INDEX
     137  CommonDecoderParams*    m_commonDecoderParams;
     138#endif
    136139#if AVC_SYNTAX || SYNTAX_OUTPUT
    137140  fstream*               m_pBLSyntaxFile;
     
    240243  TComPic*  getMotionPredIlp(TComSlice* pcSlice);
    241244#endif
    242 
     245public:
     246#if OUTPUT_LAYER_SET_INDEX
     247  CommonDecoderParams*    getCommonDecoderParams() { return m_commonDecoderParams; }
     248  Void                    setCommonDecoderParams(CommonDecoderParams* x) { m_commonDecoderParams = x; }
     249  Void      checkValueOfOutputLayerSetIdx(TComVPS *vps);
     250#endif
    243251};// END CLASS DEFINITION TDecTop
    244252
Note: See TracChangeset for help on using the changeset viewer.