Changeset 1006 in SHVCSoftware


Ignore:
Timestamp:
27 Jan 2015, 19:44:15 (10 years ago)
Author:
seregin
Message:

port implementation of JCTVC-R0235 - Processing of bitstreams without an available base layer (rev 1005)

Location:
branches/SHM-upgrade/source
Files:
3 added
1 deleted
10 edited

Legend:

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

    r962 r1006  
    265265      }
    266266      fclose (targetDecLayerIdSetFile);
     267#if !R0235_SMALLEST_LAYER_ID  // LayerId=0 is not required anymore in some cases
    267268      if ( m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded )
    268269      {
     
    270271        return false;
    271272      }
     273#endif
    272274    }
    273275    else
  • branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.cpp

    r962 r1006  
    12121212    return true;
    12131213  }
     1214#if R0235_SMALLEST_LAYER_ID
     1215  if (nalu->m_layerId == 0 && (nalu->m_nalUnitType == NAL_UNIT_VPS || nalu->m_nalUnitType == NAL_UNIT_SPS || nalu->m_nalUnitType == NAL_UNIT_PPS || nalu->m_nalUnitType == NAL_UNIT_EOS))
     1216  {
     1217    return true;
     1218  }
     1219#endif
    12141220  for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++)
    12151221  {
  • branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.cpp

    r998 r1006  
    26812681#if MULTIPLE_PTL_SUPPORT
    26822682    Int olsToLsIndex = (olsCtr >= (m_numLayerSets + m_numAddLayerSets)) ? m_outputLayerSetIdx[olsCtr - (m_numLayerSets + m_numAddLayerSets)] : olsCtr;
     2683#if R0235_SMALLEST_LAYER_ID
     2684    // This is a fix to allow setting of PTL for additional layer sets
     2685    if (olsCtr >= m_numLayerSets && olsCtr < (m_numLayerSets + m_numAddLayerSets))
     2686    {
     2687      scanStringToArrayNumEntries(cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr]);
     2688    }
     2689    else
     2690    {
     2691      scanStringToArray(cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr]);
     2692    }
     2693#else
    26832694    scanStringToArray( cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr] );
     2695#endif
    26842696    //For conformance checking
    26852697    //Conformance of a layer in an output operation point associated with an OLS in a bitstream to the Scalable Main profile is indicated as follows:
     
    26882700    //If OpTid of the output operation point is equal to vps_max_sub_layer_minus1, the conformance is indicated by general_profile_idc being equal to 7 or general_profile_compatibility_flag[ 7 ] being equal to 1
    26892701    //The following assert may be updated / upgraded to take care of general_profile_compatibility_flag.
     2702#if R0235_SMALLEST_LAYER_ID
     2703    if (m_numAddLayerSets == 0)
     2704    {
     2705#endif
    26902706    for ( Int ii = 1; ii < m_numLayerInIdList[olsToLsIndex]; ii++)
    26912707    {
     
    26962712                (m_profileCompatibility[m_listOfLayerPTLofOlss[olsCtr][ii]] == m_profileList[m_listOfLayerPTLofOlss[olsCtr][ii - 1]]) );
    26972713      }
    2698     }   
     2714    }
     2715#if R0235_SMALLEST_LAYER_ID
     2716    }
     2717#endif
    26992718#endif
    27002719  }
     
    50845103}
    50855104#endif
     5105
     5106#if R0235_SMALLEST_LAYER_ID
     5107#if OUTPUT_LAYER_SETS_CONFIG
     5108Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString)
     5109{
     5110  Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());
     5111  if (numEntries > 0)
     5112  {
     5113    Char *arrayEntry;
     5114    Int i = 0;
     5115    *arr = new Int[numEntries];
     5116
     5117    if (tempChar == NULL)
     5118    {
     5119      arrayEntry = NULL;
     5120    }
     5121    else
     5122    {
     5123      arrayEntry = strtok(tempChar, " ,");
     5124    }
     5125    while (arrayEntry != NULL)
     5126    {
     5127      if (i >= numEntries)
     5128      {
     5129        printf("%s: The number of entries specified is larger than the allowed number.\n", logString);
     5130        exit(EXIT_FAILURE);
     5131      }
     5132      *(*arr + i) = atoi(arrayEntry);
     5133      arrayEntry = strtok(NULL, " ,");
     5134      i++;
     5135    }
     5136    numEntries = i;
     5137    /*
     5138    if (i < numEntries)
     5139    {
     5140      printf("%s: Some entries are not specified.\n", logString);
     5141      exit(EXIT_FAILURE);
     5142    }
     5143    */
     5144  }
     5145  else
     5146  {
     5147    *arr = NULL;
     5148  }
     5149
     5150  if (tempChar)
     5151  {
     5152    free(tempChar);
     5153    tempChar = NULL;
     5154  }
     5155}
     5156
     5157Bool TAppEncCfg::scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector)
     5158{
     5159  Int *tempArray = NULL;
     5160  numEntries = MAX_LAYERS;
     5161  // For all layer sets
     5162  cfgStringToArrayNumEntries(&tempArray, cfgString, numEntries, logString);
     5163  if (tempArray)
     5164  {
     5165    returnVector.empty();
     5166    for (Int i = 0; i < numEntries; i++)
     5167    {
     5168      returnVector.push_back(tempArray[i]);
     5169    }
     5170    delete[] tempArray; tempArray = NULL;
     5171    return true;
     5172  }
     5173  return false;
     5174}
     5175#endif
     5176#endif // R0235
    50865177#endif //SVC_EXTENSION
    50875178//! \}
  • branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.h

    r959 r1006  
    587587  Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> &  returnVector);
    588588  Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString);
     589#if R0235_SMALLEST_LAYER_ID
     590  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, Int * const returnArray);
     591  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> &  returnVector);
     592  Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString);
     593#endif
    589594#else
    590595  Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString);
  • branches/SHM-upgrade/source/Lib/TLibCommon/TComSlice.cpp

    r1000 r1006  
    901901 */
    902902#if NO_CLRAS_OUTPUT_FLAG
     903#if R0235_SMALLEST_LAYER_ID
     904Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId )
     905#else
    903906Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag )
     907#endif
    904908{
    905909  if( !isIRAP() )
     
    913917  // When the current picture is an IRAP picture with nuh_layer_id equal to 0 and NoClrasOutputFlag is equal to 1,
    914918  // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked as "unused for reference".
     919#if R0235_SMALLEST_LAYER_ID
     920  if (m_layerId == smallestLayerId && noClrasOutputFlag)
     921#else
    915922  if( m_layerId == 0 && noClrasOutputFlag )
     923#endif
    916924  {
    917925    // mark all pictures for all layers as not used for reference
  • branches/SHM-upgrade/source/Lib/TLibCommon/TComSlice.h

    r959 r1006  
    25362536  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);
    25372537#if NO_CLRAS_OUTPUT_FLAG
     2538#if R0235_SMALLEST_LAYER_ID
     2539  Void      decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 );
     2540#else
    25382541  Void      decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag );
     2542#endif
    25392543  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag);
    25402544#else
  • branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h

    r979 r1006  
    8181#define R0227_BR_PR_ADD_LAYER_SET        1      ///< JCTVC-R0227, Signalling of bit-rate and picture rate for additional layer set
    8282#define R0042_PROFILE_INDICATION         1      ///< JCTVC-R0042, Profile indication for additional layer sets
     83#define R0235_SMALLEST_LAYER_ID          1      ///< JCTVC-R0235, SmallestLayerId semantics
    8384
    8485#define Q0108_TSA_STSA                   1      ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1002 r1006  
    15251525          for(Int kk = 0; kk < pcSlice->getVPS()->getNumLayersInIdList(layerSetIdxForOutputLayerSet); kk++)
    15261526          {
     1527#if R0235_SMALLEST_LAYER_ID
     1528            if( pcSlice->getVPS()->getNecessaryLayerFlag(ii, kk) && pcSlice->getLayerId() == pcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk) )
     1529#else
    15271530            if(pcSlice->getLayerId() == pcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk))
     1531#endif
    15281532            {
    15291533              chkAssert=1;
     
    32183222#endif
    32193223      {
    3220         READ_CODE( numBitsForPtlIdx, uiCode, "profile_level_tier_idx[i]" );
     3224        READ_CODE( numBitsForPtlIdx, uiCode, "profile_tier_level_idx[i]" );
    32213225        vps->setProfileLevelTierIdx(i, j, uiCode );
    32223226
     
    32283232        //If OpTid of the output operation point is equal to vps_max_sub_layer_minus1, the conformance is indicated by general_profile_idc being equal to 7 or general_profile_compatibility_flag[ 7 ] being equal to 1
    32293233        //The following assert may be updated / upgraded to take care of general_profile_compatibility_flag.
     3234#if R0235_SMALLEST_LAYER_ID
     3235        // The assertion below is not valid for independent non-base layers
     3236        if (vps->getNumAddLayerSets() == 0)
     3237        {
     3238#endif
    32303239        if (j > 0 && vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j) != 0 && vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j - 1) != 0)
    32313240        {
     
    32343243                 vps->getPTL(vps->getProfileLevelTierIdx(i, j))->getGeneralPTL()->getProfileCompatibilityFlag(vps->getPTL(vps->getProfileLevelTierIdx(i, j - 1))->getGeneralPTL()->getProfileIdc())  );
    32353244        }
     3245#if R0235_SMALLEST_LAYER_ID
     3246        }
     3247#endif
    32363248#endif
    32373249      }
     
    32433255      numBits++;
    32443256    }
    3245     READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
     3257    READ_CODE( numBits, uiCode, "profile_tier_level_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
    32463258#endif
    32473259#if P0300_ALT_OUTPUT_LAYER_FLAG
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.cpp

    r1000 r1006  
    9191#if SVC_EXTENSION
    9292  m_layerId = 0;
     93#if R0235_SMALLEST_LAYER_ID
     94  m_smallestLayerId = 0;
     95#endif
    9396#if AVC_BASE
    9497  m_pBLReconFile = NULL;
     
    838841#if OUTPUT_LAYER_SET_INDEX
    839842  // Following check should go wherever the VPS is activated
     843#if R0235_SMALLEST_LAYER_ID
     844  if (!m_apcSlicePilot->getVPS()->getBaseLayerAvailableFlag())
     845  {
     846    assert(nalu.m_layerId != 0);
     847    assert(m_apcSlicePilot->getVPS()->getNumAddLayerSets() > 0);
     848    if (getCommonDecoderParams()->getTargetOutputLayerSetIdx() >= 0)
     849    {
     850      UInt layerIdx = m_apcSlicePilot->getVPS()->getOutputLayerSetIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx());
     851      assert(layerIdx > m_apcSlicePilot->getVPS()->getVpsNumLayerSetsMinus1());
     852    }
     853  }
     854  if (m_apcSlicePilot->getVPS()->getNumAddLayerSets() == 0)
     855  {
     856    checkValueOfTargetOutputLayerSetIdx(m_apcSlicePilot->getVPS());
     857  }
     858#else
    840859  checkValueOfTargetOutputLayerSetIdx( m_apcSlicePilot->getVPS());
     860#endif
    841861#endif
    842862#if RESOLUTION_BASED_DPB
     
    969989#if NO_OUTPUT_OF_PRIOR_PICS
    970990#if NO_CLRAS_OUTPUT_FLAG
     991#if R0235_SMALLEST_LAYER_ID
     992  if (m_layerId == m_smallestLayerId && m_apcSlicePilot->getRapPicFlag())
     993#else
    971994  if (m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() )
     995#endif
    972996  {
    973997    if (m_bFirstSliceInSequence)
     
    10011025  }
    10021026
     1027#if R0235_SMALLEST_LAYER_ID
     1028  m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag, m_smallestLayerId );
     1029#else
    10031030  m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag );
     1031#endif
    10041032#endif
    10051033
     
    24702498        cListPic->clear();
    24712499      }
     2500#endif
     2501#if R0235_SMALLEST_LAYER_ID
     2502      xDeriveSmallestLayerId(m_parameterSetManagerDecoder.getPrefetchedVPS(0));
    24722503#endif
    24732504      return false;
     
    31163147Void TDecTop::xCheckLayerReset()
    31173148{
     3149#if R0235_SMALLEST_LAYER_ID
     3150  if (m_apcSlicePilot->isIRAP() && m_layerId > m_smallestLayerId)
     3151#else
    31183152  if (m_apcSlicePilot->isIRAP() && m_layerId > 0)
     3153#endif
    31193154  {
    31203155    Bool layerResetFlag;
     
    32003235#endif
    32013236
     3237#if R0235_SMALLEST_LAYER_ID
     3238Void TDecTop::xDeriveSmallestLayerId(TComVPS* vps)
     3239{
     3240  UInt smallestLayerId;
     3241  UInt targetOlsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx();
     3242  UInt targetDecLayerSetIdx = vps->getOutputLayerSetIdx(targetOlsIdx);
     3243  UInt lsIdx = targetDecLayerSetIdx;
     3244  UInt targetDecLayerIdList[MAX_LAYERS] = {0};
     3245
     3246  for (UInt i = 0, j = 0; i < vps->getNumLayersInIdList(lsIdx); i++)
     3247  {
     3248    if (vps->getNecessaryLayerFlag(targetOlsIdx, i))
     3249    {
     3250      targetDecLayerIdList[j++] = vps->getLayerSetLayerIdList(lsIdx, i);
     3251    }
     3252  }
     3253
     3254  if (targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1())
     3255  {
     3256    smallestLayerId = 0;
     3257  }
     3258  else if (vps->getNumLayersInIdList(targetDecLayerSetIdx) == 1)
     3259  {
     3260    smallestLayerId = 0;
     3261  }
     3262  else
     3263  {
     3264    smallestLayerId = targetDecLayerIdList[0];
     3265  }
     3266
     3267  for (UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1 - 1; layer++)
     3268  {
     3269    m_ppcTDecTop[layer]->m_smallestLayerId = smallestLayerId;
     3270  }
     3271}
     3272#endif
     3273
    32023274#endif //SVC_EXTENSION
    32033275
  • branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.h

    r979 r1006  
    133133  UInt                    m_numLayer;
    134134  TDecTop**               m_ppcTDecTop;
     135#if R0235_SMALLEST_LAYER_ID
     136  UInt                    m_smallestLayerId;
     137#endif
    135138#if P0297_VPS_POC_LSB_ALIGNED_FLAG
    136139  Bool                    m_pocResettingFlag;
     
    256259  Void      setLayerDec(TDecTop **p)    { m_ppcTDecTop = p; }
    257260  TDecTop*  getLayerDec(UInt layer)     { return m_ppcTDecTop[layer]; }
     261#if R0235_SMALLEST_LAYER_ID
     262  Void      xDeriveSmallestLayerId(TComVPS* vps);
     263#endif
    258264#if VPS_EXTN_DIRECT_REF_LAYERS
    259265  TDecTop*  getRefLayerDec(UInt refLayerIdc);
Note: See TracChangeset for help on using the changeset viewer.