Changeset 941 in SHVCSoftware for branches/SHM-dev/source


Ignore:
Timestamp:
30 Dec 2014, 18:47:09 (10 years ago)
Author:
seregin
Message:

support profile, tier and level for each layer, patch was provided by Hendry <fhendry@…>

Location:
branches/SHM-dev/source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r925 r941  
    608608  string* cfg_outputLayerSetIdx      = new string;
    609609#endif
     610#if MULTIPLE_PTL_SUPPORT
     611  string* cfg_listOfLayerPTLOfOlss   = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
     612#endif
    610613#if AVC_BASE
    611614  string  cfg_BLInputFile;
     
    837840 
    838841  // Profile and level
     842#if !MULTIPLE_PTL_SUPPORT
    839843  ("Profile", m_profile,   Profile::NONE, "Profile to be used when encoding (Incomplete)")
    840844  ("Level",   m_level,     Level::NONE,   "Level limit to be used, eg 5.1 (Incomplete)")
     
    845849  ("NonPackedSource",   m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing")
    846850  ("FrameOnly",         m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
     851#else
     852  ("NumProfileTierLevel", m_numPTLInfo, 2, "Number of Profile, Tier and Level information")
     853  ("Profile%d", m_profileList,   Profile::NONE, NUM_POSSIBLE_LEVEL, "Profile to be used when encoding (Incomplete)")
     854  ("Level%d",   m_levelList,     Level::NONE, NUM_POSSIBLE_LEVEL, "Level limit to be used, eg 5.1 (Incomplete)")
     855  ("Tier%d",    m_levelTierList, Level::MAIN, NUM_POSSIBLE_LEVEL, "Tier to use for interpretation of --Level")
     856
     857  ("ProgressiveSource%d", m_progressiveSourceFlagList, false, MAX_VPS_LAYER_ID_PLUS1, "Indicate that source is progressive")
     858  ("InterlacedSource%d",  m_interlacedSourceFlagList,  false, MAX_VPS_LAYER_ID_PLUS1, "Indicate that source is interlaced")
     859  ("NonPackedSource%d",   m_nonPackedConstraintFlagList, false, MAX_VPS_LAYER_ID_PLUS1, "Indicate that source does not contain frame packing")
     860  ("FrameOnly%d",         m_frameOnlyConstraintFlagList, false, MAX_VPS_LAYER_ID_PLUS1, "Indicate that the bitstream contains only frames")
     861   
     862  ("LayerPTLIndex%d", m_layerPTLIdx, 0, MAX_VPS_LAYER_ID_PLUS1, "Index of PTL for each layer")
     863  ("ListOfProfileTierLevelOls%d", cfg_listOfLayerPTLOfOlss, string(""), MAX_VPS_LAYER_ID_PLUS1, "PTL Index for each layer in each OLS except the first OLS. The PTL index for layer in the first OLS is set to 1")
     864#endif
    847865
    848866#if LAYER_CTB
     
    19221940  // Layers in the output layer set
    19231941  m_listOfOutputLayers.resize(m_numOutputLayerSets);
     1942
     1943#if MULTIPLE_PTL_SUPPORT
     1944  m_listOfLayerPTLofOlss.resize(m_numOutputLayerSets);
     1945#endif
     1946
    19241947  Int startOlsCtr = 1;
    19251948  if( m_defaultTargetOutputLayerIdc == 0 || m_defaultTargetOutputLayerIdc == 1 )
     
    19411964      assert( scanStringToArray( cfg_listOfOutputLayers[olsCtr], m_numLayersInOutputLayerSet[olsCtr], "ListOfOutputLayers", m_listOfOutputLayers[olsCtr] ) );
    19421965    }
    1943   }
     1966#if MULTIPLE_PTL_SUPPORT
     1967    if (olsCtr > m_numLayerSets)
     1968    {
     1969      scanStringToArray( cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[m_outputLayerSetIdx[olsCtr - m_numLayerSets]], "ListOfOutputLayers", m_listOfLayerPTLofOlss[olsCtr] );
     1970    }
     1971    else
     1972    {
     1973      scanStringToArray( cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsCtr], "List of PTL for each layer in OLS", m_listOfLayerPTLofOlss[olsCtr] );
     1974    }
     1975#endif
     1976  }
     1977#if MULTIPLE_PTL_SUPPORT
     1978  m_listOfLayerPTLofOlss[0].push_back(m_layerPTLIdx[0]);
     1979  delete [] cfg_listOfLayerPTLOfOlss;
     1980#endif
    19441981  delete cfg_numLayersInOutputLayerSet;
    19451982  delete [] cfg_listOfOutputLayers;
     
    25032540    fprintf(stderr, "******************************************************************\n");
    25042541  }
     2542 
     2543#if !MULTIPLE_PTL_SUPPORT
    25052544  if( m_profile==Profile::NONE )
    25062545  {
     
    25152554    fprintf(stderr, "***************************************************************************\n");
    25162555  }
     2556#else
     2557  int ii = 0;
     2558  while ( ii < m_numPTLInfo )
     2559  {
     2560    if( m_profileList[ii] == Profile::NONE )
     2561    {
     2562      fprintf(stderr, "***************************************************************************\n");
     2563      fprintf(stderr, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n");
     2564      fprintf(stderr, "***************************************************************************\n");
     2565    }
     2566    if( m_levelList[ii] == Level::NONE )
     2567    {
     2568      fprintf(stderr, "***************************************************************************\n");
     2569      fprintf(stderr, "** WARNING: For conforming bitstreams a valid Level value must be set!   **\n");
     2570      fprintf(stderr, "***************************************************************************\n");
     2571    }
     2572    ii++;
     2573  }
     2574#endif
    25172575
    25182576  Bool check_failed = false; /* abort if there is a fatal configuration problem */
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r912 r941  
    120120
    121121  // profile/level
     122#if !MULTIPLE_PTL_SUPPORT
    122123  Profile::Name m_profile;
    123124  Level::Tier   m_levelTier;
     
    127128  Bool m_nonPackedConstraintFlag;
    128129  Bool m_frameOnlyConstraintFlag;
    129  
     130#else
     131  Int           m_numPTLInfo;
     132  Int           m_layerPTLIdx[MAX_VPS_LAYER_ID_PLUS1]; ///< scalability_mask
     133  Profile::Name m_profileList[NUM_POSSIBLE_LEVEL];
     134  Level::Tier   m_levelTierList[NUM_POSSIBLE_LEVEL];
     135  Level::Name   m_levelList[NUM_POSSIBLE_LEVEL];
     136  Bool          m_progressiveSourceFlagList[NUM_POSSIBLE_LEVEL];
     137  Bool          m_interlacedSourceFlagList[NUM_POSSIBLE_LEVEL];
     138  Bool          m_nonPackedConstraintFlagList[NUM_POSSIBLE_LEVEL];
     139  Bool          m_frameOnlyConstraintFlagList[NUM_POSSIBLE_LEVEL];
     140
     141  std::vector< std::vector<Int> > m_listOfLayerPTLofOlss;
     142#endif
    130143  // coding structure
    131144#if !SVC_EXTENSION
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r924 r941  
    200200#endif
    201201
     202#if MULTIPLE_PTL_SUPPORT
     203  //Populate PTL in VPS
     204  TComVPS *pVPS = m_acTEncTop[0].getVPS();
     205  ProfileTierLevel& profileTierLevel = *(pVPS->getPTL(0)->getGeneralPTL());
     206  for (int ii = 0; ii < m_numPTLInfo; ii++)
     207  {
     208    profileTierLevel = *(pVPS->getPTL(ii)->getGeneralPTL());
     209
     210    profileTierLevel.setLevelIdc(m_levelList[ii]);
     211    profileTierLevel.setTierFlag(m_levelTierList[ii]);
     212    profileTierLevel.setProfileIdc(m_profileList[ii]);
     213    profileTierLevel.setProfileCompatibilityFlag(m_profileList[ii], 1);
     214    profileTierLevel.setProgressiveSourceFlag(m_progressiveSourceFlagList[ii]);
     215    profileTierLevel.setInterlacedSourceFlag(m_interlacedSourceFlagList[ii]);
     216    profileTierLevel.setNonPackedConstraintFlag(m_nonPackedConstraintFlagList[ii]);
     217    profileTierLevel.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlagList[ii]);
     218  }
     219  pVPS->setNumProfileTierLevel(m_numPTLInfo);
     220
     221  std::vector<int> myvector;
     222  vps->getProfileLevelTierIdx()->resize(m_numOutputLayerSets);
     223  for (int ii = 0; ii < m_numOutputLayerSets; ii++)
     224  {
     225    myvector =  m_listOfLayerPTLofOlss[ii];
     226    vps->getProfileLevelTierIdx()->resize(myvector.size());
     227    for (std::vector<int>::iterator it = myvector.begin() ; it != myvector.end(); ++it)
     228    {
     229      pVPS->addProfileLevelTierIdx(ii, it[0]);
     230    }
     231  }
     232
     233  //pVPS->setProfileLevelTierIdx(
     234#endif
     235
    202236  assert( m_numLayers <= MAX_LAYERS );
    203237
     
    228262    m_acTEncTop[layer].setFramesToBeEncoded            ( m_framesToBeEncoded );
    229263
     264#if !MULTIPLE_PTL_SUPPORT
    230265    m_acTEncTop[layer].setProfile(m_profile);
    231266    m_acTEncTop[layer].setLevel(m_levelTier, m_level);
     
    234269    m_acTEncTop[layer].setNonPackedConstraintFlag(m_nonPackedConstraintFlag);
    235270    m_acTEncTop[layer].setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag);
     271#else
     272    m_acTEncTop[layer].setProfile(m_profileList[m_layerPTLIdx[layer]]);
     273    m_acTEncTop[layer].setLevel(m_levelTierList[m_layerPTLIdx[layer]], m_levelList[m_layerPTLIdx[layer]]);
     274    m_acTEncTop[layer].setProgressiveSourceFlag(m_progressiveSourceFlagList[m_layerPTLIdx[layer]]);
     275    m_acTEncTop[layer].setInterlacedSourceFlag(m_interlacedSourceFlagList[m_layerPTLIdx[layer]]);
     276    m_acTEncTop[layer].setNonPackedConstraintFlag(m_nonPackedConstraintFlagList[m_layerPTLIdx[layer]]);
     277    m_acTEncTop[layer].setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlagList[m_layerPTLIdx[layer]]);
     278#endif
    236279
    237280#if REF_IDX_MFM
     
    13851428    vps->setIlpSshSignalingEnabledFlag(false);
    13861429#if VPS_EXTN_PROFILE_INFO
    1387 
     1430#if !MULTIPLE_PTL_SUPPORT
    13881431#if LIST_OF_PTL
    13891432  vps->getPTLForExtnPtr()->resize(1);   // Dummy object - unused.
     
    14141457    *(vps->getPTLForExtn(setId)) = *(m_acTEncTop[setId].getSPS()->getPTL());
    14151458  }
     1459#endif
    14161460#endif
    14171461#endif
     
    15241568#endif
    15251569  // Target output layer
     1570#if !MULTIPLE_PTL_SUPPORT
    15261571#if LIST_OF_PTL
    15271572  vps->setNumProfileTierLevel( vps->getPTLForExtnPtr()->size() ); // +1 for the base VPS PTL()
     
    15291574  vps->setNumOutputLayerSets(vps->getNumLayerSets());
    15301575  vps->setNumProfileTierLevel(vps->getNumLayerSets());
     1576#endif
    15311577#endif
    15321578#if !OUTPUT_LAYER_SETS_CONFIG // Taken care by configuration file parameter
     
    16191665  vps->checkNecessaryLayerFlagCondition();
    16201666#endif
     1667#if !MULTIPLE_PTL_SUPPORT
    16211668#if PER_LAYER_PTL
    16221669  vps->getProfileLevelTierIdx()->resize(vps->getNumOutputLayerSets());
     
    16391686    }
    16401687  }
     1688#endif
    16411689#endif
    16421690#if SUB_LAYERS_IN_LAYER_SET
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r908 r941  
    582582  Bool        m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1];
    583583#endif
     584#if !MULTIPLE_PTL_SUPPORT
    584585  TComPTL     m_pcPTL;
     586#else
     587  TComPTL     m_pcPTLList[NUM_POSSIBLE_LEVEL];
     588#endif
    585589  TimingInfo  m_timingInfo;
    586590
     
    649653  UInt       m_profileLayerSetRef[MAX_VPS_LAYER_SETS_PLUS1];    // The value with index 0 will not be used.
    650654#endif
    651   std::vector<TComPTL>    m_pcPTLForExtn; 
     655#if !MULTIPLE_PTL_SUPPORT
     656  std::vector<TComPTL>    m_pcPTLForExtn;
     657#endif
    652658#endif
    653659#if VPS_EXTN_OP_LAYER_SETS
     
    964970  Void    setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id)  { m_layerIdIncludedFlag[opsIdx][id] = v;    }
    965971
     972#if !MULTIPLE_PTL_SUPPORT
    966973  TComPTL* getPTL() { return &m_pcPTL; }
     974#else
     975  TComPTL* getPTL() { return &m_pcPTLList[0]; }
     976  TComPTL* getPTL(UInt idx) { return &m_pcPTLList[idx]; }
     977#endif
    967978  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    968979
     
    10651076#endif
    10661077
     1078#if !MULTIPLE_PTL_SUPPORT
    10671079  std::vector<TComPTL>* getPTLForExtnPtr()                      { return &m_pcPTLForExtn;          }
    10681080  TComPTL* getPTLForExtn(Int id)                                { return &m_pcPTLForExtn[id];      }
     1081#endif
    10691082#endif
    10701083#if VPS_EXTN_OP_LAYER_SETS
     
    11321145  Int    getProfileLevelTierIdx(Int const olsIdx, Int const layerIdx)     { return m_profileLevelTierIdx[olsIdx][layerIdx]; }
    11331146  Void   setProfileLevelTierIdx(Int const olsIdx, Int const layerIdx, Int const ptlIdx)     { m_profileLevelTierIdx[olsIdx][layerIdx] = ptlIdx; }
     1147#if MULTIPLE_PTL_SUPPORT
     1148  Void   addProfileLevelTierIdx(Int const olsIdx, Int const ptlIdx)     { m_profileLevelTierIdx[olsIdx].push_back(ptlIdx); }
     1149#endif
    11341150  Int calculateLenOfSyntaxElement( Int const numVal );
    11351151#else
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r924 r941  
    6969#define VPS_VUI_BSP_HRD_PARAMS           1      ///< JCTVC-R0231: Define the VPS VUI BSP hrd_params() as a separate function, and apply changes adopted.
    7070#define O0137_MAX_LAYERID                1      ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1
     71
     72#define MULTIPLE_PTL_SUPPORT             1      ///< Fixing profile, tier and level signalling
     73#define NUM_POSSIBLE_LEVEL               13     ///< Number of possible level as described in R1013
    7174
    7275#define R0226_CONSTRAINT_TMVP_SEI        1      ///< JCTVC-R0226, Modification to semantics in temporal motion vector prediction constraints SEI message
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r937 r941  
    13751375  {
    13761376    vps->setProfilePresentFlag(1, false);
     1377#if !MULTIPLE_PTL_SUPPORT
    13771378    vps->getPTLForExtnPtr()->empty();
    13781379    vps->getPTLForExtnPtr()->resize(2);
    13791380    vps->getPTLForExtn(1)->copyProfileInfo( vps->getPTL() );
    13801381    parsePTL( vps->getPTLForExtn(1), vps->getProfilePresentFlag(1), vps->getMaxTLayers() - 1 );
     1382#else
     1383    parsePTL( vps->getPTL(1), vps->getProfilePresentFlag(1), vps->getMaxTLayers() - 1 );
     1384#endif
    13811385  }
    13821386#endif
     
    16001604  READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
    16011605#else
    1602   READ_UVLC(  uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
     1606  READ_UVLC(  uiCode, "vps_num_profile_tier_level_minus1");
     1607  vps->setNumProfileTierLevel( uiCode + 1 );
     1608  //vps->setNumProfileTierLevel( 3 );
     1609  int aa = vps->getNumProfileTierLevel();
    16031610#endif
    16041611#if PER_LAYER_PTL
    16051612  Int const numBitsForPtlIdx = vps->calculateLenOfSyntaxElement( vps->getNumProfileTierLevel() );
    16061613#endif
     1614#if !MULTIPLE_PTL_SUPPORT
    16071615  vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
     1616#endif
    16081617#if LIST_OF_PTL
    16091618  for(Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
     
    16121621#endif
    16131622  {
    1614     READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false);
     1623    READ_FLAG( uiCode, "vps_profile_present_flag[i]" );
     1624    vps->setProfilePresentFlag(idx, uiCode ? true : false);
    16151625    if( !vps->getProfilePresentFlag(idx) )
    16161626    {
    16171627#if P0048_REMOVE_PROFILE_REF
    16181628      // Copy profile information from previous one
     1629#if !MULTIPLE_PTL_SUPPORT
    16191630      vps->getPTLForExtn(idx)->copyProfileInfo( (idx==1) ? vps->getPTL() : vps->getPTLForExtn( idx - 1 ) );
     1631#else
     1632      vps->getPTL(idx)->copyProfileInfo( vps->getPTL( idx - 1 ) );
     1633#endif
    16201634#else
    16211635      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
     
    16291643#endif
    16301644    }
     1645#if !MULTIPLE_PTL_SUPPORT
    16311646    parsePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     1647#else
     1648    parsePTL( vps->getPTL(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     1649#endif
    16321650  }
    16331651#endif
     
    16731691  if( vps->getNumLayerSets() > 1 )
    16741692  {
    1675     READ_UVLC( uiCode, "num_add_olss" );            vps->setNumAddOutputLayerSets( uiCode );
     1693    READ_UVLC( uiCode, "num_add_olss" );           
     1694    vps->setNumAddOutputLayerSets( uiCode );
    16761695    READ_CODE( 2, uiCode, "default_output_layer_idc" );   vps->setDefaultTargetOutputLayerIdc( uiCode );
    16771696  }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r924 r941  
    354354#else
    355355    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    356     //TODO: HENDRY -- Do the checking here.
    357356#endif
    358357  }
     
    10881087    m_isNoOutputPriorPics = false;
    10891088  }
    1090 
    1091   //TODO: HENDRY -- Probably do the checking for max number of positive and negative pics here
    1092 
    10931089
    10941090  //For inference of PicOutputFlag
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r937 r941  
    10881088  if( vps->getMaxLayers() > 1 && vps->getBaseLayerInternalFlag() )
    10891089  {
     1090#if !MULTIPLE_PTL_SUPPORT
    10901091    codePTL( vps->getPTLForExtn(1), false, vps->getMaxTLayers() - 1 );
     1092#else
     1093    codePTL( vps->getPTL(1), false, vps->getMaxTLayers() - 1 );
     1094#endif
    10911095  }
    10921096#endif
     
    12541258#endif
    12551259#if LIST_OF_PTL
     1260#if !MULTIPLE_PTL_SUPPORT
    12561261  assert( vps->getNumProfileTierLevel() == vps->getPTLForExtnPtr()->size());
     1262#else
     1263  //Do something here to make sure the loop is correct to consider base layer internal stuff
     1264#endif
    12571265  for(Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
    12581266#else
     
    12601268#endif
    12611269  {
     1270#if MULTIPLE_PTL_SUPPORT
     1271    vps->setProfilePresentFlag(idx, true);
     1272#endif
    12621273    WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
    12631274#if !P0048_REMOVE_PROFILE_REF
     
    12671278    }
    12681279#endif
     1280#if !MULTIPLE_PTL_SUPPORT
    12691281    codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     1282#else
     1283    codePTL( vps->getPTL(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     1284#endif
    12701285  }
    12711286#endif
Note: See TracChangeset for help on using the changeset viewer.