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


Ignore:
Timestamp:
3 Mar 2015, 02:46:34 (10 years ago)
Author:
interdigital
Message:
  1. change MAX_VPS_LAYER_ID_PLUS1 to MAX_VPS_LAYER_IDX_PLUS1
  2. change layerId to layerIdx whenever layer index is used
  3. replace mistakenly used layer ID with layer index
Location:
branches/SHM-dev/source/App/TAppEncoder
Files:
3 edited

Legend:

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

    r1037 r1045  
    897897  Bool    tmpLowerBitRateConstraintFlag;
    898898  UInt    tmpBitDepthConstraint;
    899   Int*    cfg_layerPTLIdx[MAX_VPS_LAYER_ID_PLUS1];
     899  Int*    cfg_layerPTLIdx[MAX_VPS_LAYER_IDX_PLUS1];
    900900#endif
    901901
     
    11371137  ("NumLayerSets",                                  m_numLayerSets,                                          0, "Number of layer sets")
    11381138#endif
    1139   ("NumLayerInIdList%d",                            cfg_numLayerInIdList,            0, MAX_VPS_LAYER_ID_PLUS1, "Number of layers in the set")
    1140   ("LayerSetLayerIdList%d",                         cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set")
     1139  ("NumLayerInIdList%d",                            cfg_numLayerInIdList,            0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set")
     1140  ("LayerSetLayerIdList%d",                         cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set")
    11411141  ("NumAddLayerSets",                               m_numAddLayerSets,                                       0, "Number of additional layer sets")
    1142   ("NumHighestLayerIdx%d",                          cfg_numHighestLayerIdx,          0, MAX_VPS_LAYER_ID_PLUS1, "Number of highest layer idx")
    1143   ("HighestLayerIdx%d",                             cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Highest layer idx for an additional layer set")
     1142  ("NumHighestLayerIdx%d",                          cfg_numHighestLayerIdx,          0, MAX_VPS_LAYER_IDX_PLUS1, "Number of highest layer idx")
     1143  ("HighestLayerIdx%d",                             cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set")
    11441144#endif
    11451145#if OUTPUT_LAYER_SETS_CONFIG
     
    11471147  ("NumOutputLayerSets",                            m_numOutputLayerSets,                                    1, "Number of output layer sets excluding the 0-th output layer set")
    11481148  ("NumOutputLayersInOutputLayerSet",               cfg_numOutputLayersInOutputLayerSet,         string(""), 1, "List containing number of output layers in the output layer sets")
    1149   ("ListOfOutputLayers%d",                          cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]")
     1149  ("ListOfOutputLayers%d",                          cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]")
    11501150  ("OutputLayerSetIdx",                             cfg_outputLayerSetIdx,                       string(""), 1, "Corresponding layer set index, only for non-default output layer sets")
    11511151#endif
     
    13151315  ("FrameOnly%d",                                     m_frameOnlyConstraintFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that the bitstream contains only frames")
    13161316 
    1317   ("LayerPTLIndex%d",                                 cfg_layerPTLIdx,               0, MAX_VPS_LAYER_ID_PLUS1, "Index of PTL for each layer")
     1317  ("LayerPTLIndex%d",                                 cfg_layerPTLIdx,               0, MAX_VPS_LAYER_IDX_PLUS1, "Index of PTL for each layer")
    13181318  ("ListOfProfileTierLevelOls%d",                     cfg_listOfLayerPTLOfOlss, string(""), MAX_VPS_OUTPUT_LAYER_SETS_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")
    13191319#else
     
    32253225  // check validity of input parameters
    32263226#if SVC_EXTENSION
    3227   for( UInt layerId = 0; layerId < m_numLayers; layerId++ )
    3228   {
    3229     xCheckParameter(layerId);
     3227  for( UInt layerIdx = 0; layerIdx < m_numLayers; layerIdx++ )
     3228  {
     3229    xCheckParameter(layerIdx);
    32303230  }
    32313231#else
     
    32553255
    32563256#if SVC_EXTENSION
    3257 Void TAppEncCfg::xCheckParameter(UInt layerId)
     3257Void TAppEncCfg::xCheckParameter(UInt layerIdx)
    32583258{
    3259   Bool m_useExtendedPrecision                = m_acLayerCfg[layerId].m_useExtendedPrecision;
    3260   Bool m_useHighPrecisionPredictionWeighting = m_acLayerCfg[layerId].m_useHighPrecisionPredictionWeighting;
    3261   ChromaFormat m_chromaFormatIDC             = m_acLayerCfg[layerId].m_chromaFormatIDC;
    3262   ChromaFormat m_chromaFormatConstraint      = m_acLayerCfg[layerId].m_chromaFormatConstraint;
    3263   ChromaFormat m_InputChromaFormatIDC        = m_acLayerCfg[layerId].m_InputChromaFormatIDC;
    3264 
    3265   Int m_inputBitDepth[]       = {m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_LUMA],       m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA]};
    3266   Int m_internalBitDepth[]    = {m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA],    m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};
    3267   Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerId].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]}; 
    3268 
    3269   m_saoOffsetBitShift[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerId].m_saoOffsetBitShift[CHANNEL_TYPE_LUMA];
    3270   m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId].m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA];
     3259  Bool m_useExtendedPrecision                = m_acLayerCfg[layerIdx].m_useExtendedPrecision;
     3260  Bool m_useHighPrecisionPredictionWeighting = m_acLayerCfg[layerIdx].m_useHighPrecisionPredictionWeighting;
     3261  ChromaFormat m_chromaFormatIDC             = m_acLayerCfg[layerIdx].m_chromaFormatIDC;
     3262  ChromaFormat m_chromaFormatConstraint      = m_acLayerCfg[layerIdx].m_chromaFormatConstraint;
     3263  ChromaFormat m_InputChromaFormatIDC        = m_acLayerCfg[layerIdx].m_InputChromaFormatIDC;
     3264
     3265  Int m_inputBitDepth[]       = {m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA],       m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA]};
     3266  Int m_internalBitDepth[]    = {m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA],    m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};
     3267  Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]}; 
     3268
     3269  m_saoOffsetBitShift[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerIdx].m_saoOffsetBitShift[CHANNEL_TYPE_LUMA];
     3270  m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA];
    32713271
    32723272#if MULTIPLE_PTL_SUPPORT
    3273   Int layerPTLIdx = m_acLayerCfg[layerId].m_layerPTLIdx;
     3273  Int layerPTLIdx = m_acLayerCfg[layerIdx].m_layerPTLIdx;
    32743274  Profile::Name m_profile           = m_profileList[layerPTLIdx];
    3275   UInt m_bitDepthConstraint         = m_acLayerCfg[layerId].m_bitDepthConstraint;
    3276   Bool m_intraConstraintFlag        = m_acLayerCfg[layerId].m_intraConstraintFlag;
    3277   Bool m_lowerBitRateConstraintFlag = m_acLayerCfg[layerId].m_lowerBitRateConstraintFlag;
     3275  UInt m_bitDepthConstraint         = m_acLayerCfg[layerIdx].m_bitDepthConstraint;
     3276  Bool m_intraConstraintFlag        = m_acLayerCfg[layerIdx].m_intraConstraintFlag;
     3277  Bool m_lowerBitRateConstraintFlag = m_acLayerCfg[layerIdx].m_lowerBitRateConstraintFlag;
    32783278#endif
    32793279#else
     
    36623662  }
    36633663
    3664   if (m_acLayerCfg[layerId].m_iIntraPeriod == 1 && m_EhGOPList[layerId][0].m_POC == -1) {
    3665     m_EhGOPList[layerId][0] = GOPEntry();
    3666     m_EhGOPList[layerId][0].m_QPFactor = 1;
    3667     m_EhGOPList[layerId][0].m_betaOffsetDiv2 = 0;
    3668     m_EhGOPList[layerId][0].m_tcOffsetDiv2 = 0;
    3669     m_EhGOPList[layerId][0].m_POC = 1;
    3670     m_EhGOPList[layerId][0].m_numRefPicsActive = 4;
     3664  if (m_acLayerCfg[layerIdx].m_iIntraPeriod == 1 && m_EhGOPList[layerIdx][0].m_POC == -1) {
     3665    m_EhGOPList[layerIdx][0] = GOPEntry();
     3666    m_EhGOPList[layerIdx][0].m_QPFactor = 1;
     3667    m_EhGOPList[layerIdx][0].m_betaOffsetDiv2 = 0;
     3668    m_EhGOPList[layerIdx][0].m_tcOffsetDiv2 = 0;
     3669    m_EhGOPList[layerIdx][0].m_POC = 1;
     3670    m_EhGOPList[layerIdx][0].m_numRefPicsActive = 4;
    36713671  }
    36723672  else
     
    37533753
    37543754  // verify layer configuration parameters
    3755   if(m_acLayerCfg[layerId].xCheckParameter(m_isField))
    3756   {
    3757     printf("\nError: invalid configuration parameter found in layer %d \n", layerId);
     3755  if(m_acLayerCfg[layerIdx].xCheckParameter(m_isField))
     3756  {
     3757    printf("\nError: invalid configuration parameter found in layer %d \n", layerIdx);
    37583758    check_failed = true;
    37593759  }
    37603760
    37613761  // verify layer configuration parameters
    3762   Int m_iIntraPeriod = m_acLayerCfg[layerId].m_iIntraPeriod;
     3762  Int m_iIntraPeriod = m_acLayerCfg[layerIdx].m_iIntraPeriod;
    37633763#endif
    37643764  if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) )
     
    40434043
    40444044#if SVC_EXTENSION && Q0108_TSA_STSA
    4045   if( layerId > 0 )
     4045  if( layerIdx > 0 )
    40464046  {
    40474047    verifiedGOP=false;
     
    40614061    for(Int i=0; i<m_iGOPSize; i++)
    40624062    {
    4063       if(m_EhGOPList[layerId][i].m_POC==m_iGOPSize)
    4064       {
    4065         xConfirmPara( m_EhGOPList[layerId][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " );
     4063      if(m_EhGOPList[layerIdx][i].m_POC==m_iGOPSize)
     4064      {
     4065        xConfirmPara( m_EhGOPList[layerIdx][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " );
    40664066      }
    40674067    }
     
    40774077        for(Int i=0; i<m_iGOPSize; i++)
    40784078        {
    4079           xConfirmPara( (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
    4080           xConfirmPara( (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
     4079          xConfirmPara( (m_EhGOPList[layerIdx][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerIdx][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
     4080          xConfirmPara( (m_EhGOPList[layerIdx][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerIdx][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
    40814081        }
    40824082      }
     
    40874087    {
    40884088      Int curGOP = (checkGOP-1)%m_iGOPSize;
    4089       Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][curGOP].m_POC;   
    4090       if(m_EhGOPList[layerId][curGOP].m_POC<0)
     4089      Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerIdx][curGOP].m_POC;   
     4090      if(m_EhGOPList[layerIdx][curGOP].m_POC<0)
    40914091      {
    40924092        printf("\nError: found fewer Reference Picture Sets than GOPSize\n");
     
    40974097        //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP.
    40984098        Bool beforeI = false;
    4099         for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++)
     4099        for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++)
    41004100        {
    4101           Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i];
     4101          Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
    41024102          if(absPOC < 0)
    41034103          {
     
    41144114                for(Int k=0; k<m_iGOPSize; k++)
    41154115                {
    4116                   if(absPOC%m_iGOPSize == m_EhGOPList[layerId][k].m_POC%m_iGOPSize)
     4116                  if(absPOC%m_iGOPSize == m_EhGOPList[layerIdx][k].m_POC%m_iGOPSize)
    41174117                  {
    4118                     if(m_EhGOPList[layerId][k].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId)
     4118                    if(m_EhGOPList[layerIdx][k].m_temporalId==m_EhGOPList[layerIdx][curGOP].m_temporalId)
    41194119                    {
    4120                       m_EhGOPList[layerId][k].m_refPic = true;
     4120                      m_EhGOPList[layerIdx][k].m_refPic = true;
    41214121                    }
    4122                     m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerId][k].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId;
     4122                    m_EhGOPList[layerIdx][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerIdx][k].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId;
    41234123                  }
    41244124                }
     
    41274127            if(!found)
    41284128            {
    4129               printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerId][curGOP].m_referencePics[i],curGOP+1);
     4129              printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerIdx][curGOP].m_referencePics[i],curGOP+1);
    41304130              errorGOP=true;
    41314131            }
     
    41494149          //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0)
    41504150
    4151           m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]]=m_EhGOPList[layerId][curGOP];
     4151          m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]]=m_EhGOPList[layerIdx][curGOP];
    41524152          Int newRefs=0;
    4153           for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++)
     4153          for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++)
    41544154          {
    4155             Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i];
     4155            Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
    41564156            if(absPOC>=0)
    41574157            {
    4158               m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[newRefs]=m_EhGOPList[layerId][curGOP].m_referencePics[i];
    4159               m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i];
     4158              m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[newRefs]=m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
     4159              m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerIdx][curGOP].m_usedByCurrPic[i];
    41604160              newRefs++;
    41614161            }
    41624162          }
    4163           Int numPrefRefs = m_EhGOPList[layerId][curGOP].m_numRefPicsActive;
     4163          Int numPrefRefs = m_EhGOPList[layerIdx][curGOP].m_numRefPicsActive;
    41644164
    41654165          for(Int offset = -1; offset>-checkGOP; offset--)
     
    41674167            //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0.
    41684168            Int offGOP = (checkGOP-1+offset)%m_iGOPSize;
    4169             Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][offGOP].m_POC;
    4170             if(offPOC>=0&&m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId)
     4169            Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerIdx][offGOP].m_POC;
     4170            if(offPOC>=0&&m_EhGOPList[layerIdx][offGOP].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId)
    41714171            {
    41724172              Bool newRef=false;
     
    41804180              for(Int i=0; i<newRefs; i++)
    41814181              {
    4182                 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[i]==offPOC-curPOC)
     4182                if(m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[i]==offPOC-curPOC)
    41834183                {
    41844184                  newRef=false;
     
    41894189                Int insertPoint=newRefs;
    41904190                //this picture can be added, find appropriate place in list and insert it.
    4191                 if(m_EhGOPList[layerId][offGOP].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId)
     4191                if(m_EhGOPList[layerIdx][offGOP].m_temporalId==m_EhGOPList[layerIdx][curGOP].m_temporalId)
    41924192                {
    4193                   m_EhGOPList[layerId][offGOP].m_refPic = true;
     4193                  m_EhGOPList[layerIdx][offGOP].m_refPic = true;
    41944194                }
    41954195                for(Int j=0; j<newRefs; j++)
    41964196                {
    4197                   if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]>0)
     4197                  if(m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]>0)
    41984198                  {
    41994199                    insertPoint = j;
     
    42024202                }
    42034203                Int prev = offPOC-curPOC;
    4204                 Int prevUsed = m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId;
     4204                Int prevUsed = m_EhGOPList[layerIdx][offGOP].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId;
    42054205                for(Int j=insertPoint; j<newRefs+1; j++)
    42064206                {
    4207                   Int newPrev = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j];
    4208                   Int newUsed = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j];
    4209                   m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]=prev;
    4210                   m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]=prevUsed;
     4207                  Int newPrev = m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j];
     4208                  Int newUsed = m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j];
     4209                  m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]=prev;
     4210                  m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j]=prevUsed;
    42114211                  prevUsed=newUsed;
    42124212                  prev=newPrev;
     
    42204220            }
    42214221          }
    4222           m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics=newRefs;
    4223           m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC = curPOC;
    4224           if (m_extraRPSs[layerId] == 0)
     4222          m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefPics=newRefs;
     4223          m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_POC = curPOC;
     4224          if (m_extraRPSs[layerIdx] == 0)
    42254225          {
    4226             m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 0;
    4227             m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = 0;
     4226            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_interRPSPrediction = 0;
     4227            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefIdc = 0;
    42284228          }
    42294229          else
    42304230          {
    4231             Int rIdx =  m_iGOPSize + m_extraRPSs[layerId] - 1;
    4232             Int refPOC = m_EhGOPList[layerId][rIdx].m_POC;
    4233             Int refPics = m_EhGOPList[layerId][rIdx].m_numRefPics;
     4231            Int rIdx =  m_iGOPSize + m_extraRPSs[layerIdx] - 1;
     4232            Int refPOC = m_EhGOPList[layerIdx][rIdx].m_POC;
     4233            Int refPics = m_EhGOPList[layerIdx][rIdx].m_numRefPics;
    42344234            Int newIdc=0;
    42354235            for(Int i = 0; i<= refPics; i++)
    42364236            {
    4237               Int deltaPOC = ((i != refPics)? m_EhGOPList[layerId][rIdx].m_referencePics[i] : 0);  // check if the reference abs POC is >= 0
     4237              Int deltaPOC = ((i != refPics)? m_EhGOPList[layerIdx][rIdx].m_referencePics[i] : 0);  // check if the reference abs POC is >= 0
    42384238              Int absPOCref = refPOC+deltaPOC;
    42394239              Int refIdc = 0;
    4240               for (Int j = 0; j < m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics; j++)
     4240              for (Int j = 0; j < m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefPics; j++)
    42414241              {
    4242                 if ( (absPOCref - curPOC) == m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j])
     4242                if ( (absPOCref - curPOC) == m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j])
    42434243                {
    4244                   if (m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j])
     4244                  if (m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j])
    42454245                  {
    42464246                    refIdc = 1;
     
    42524252                }
    42534253              }
    4254               m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_refIdc[newIdc]=refIdc;
     4254              m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_refIdc[newIdc]=refIdc;
    42554255              newIdc++;
    42564256            }
    4257             m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 1; 
    4258             m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = newIdc;
    4259             m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_deltaRPS = refPOC - m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC;
     4257            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_interRPSPrediction = 1; 
     4258            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefIdc = newIdc;
     4259            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_deltaRPS = refPOC - m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_POC;
    42604260          }
    4261           curGOP=m_iGOPSize+m_extraRPSs[layerId];
    4262           m_extraRPSs[layerId]++;
     4261          curGOP=m_iGOPSize+m_extraRPSs[layerIdx];
     4262          m_extraRPSs[layerIdx]++;
    42634263        }
    42644264        numRefs=0;
    4265         for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++)
     4265        for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++)
    42664266        {
    4267           Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i];
     4267          Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
    42684268          if(absPOC >= 0)
    42694269          {
     
    42924292
    42934293#if Q0108_TSA_STSA
    4294   if( layerId > 0 )
    4295   {
    4296     m_EhMaxTempLayer[layerId] = 1;
     4294  if( layerIdx > 0 )
     4295  {
     4296    m_EhMaxTempLayer[layerIdx] = 1;
    42974297    for(Int i=0; i<m_iGOPSize; i++)
    42984298    {
    4299       if(m_EhGOPList[layerId][i].m_temporalId >= m_EhMaxTempLayer[layerId] )
    4300       {
    4301         m_EhMaxTempLayer[layerId] = m_EhGOPList[layerId][i].m_temporalId;
     4299      if(m_EhGOPList[layerIdx][i].m_temporalId >= m_EhMaxTempLayer[layerIdx] )
     4300      {
     4301        m_EhMaxTempLayer[layerIdx] = m_EhGOPList[layerIdx][i].m_temporalId;
    43024302      }
    43034303      xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I");
     
    43654365
    43664366#if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers
    4367   Int m_iSourceWidth = m_acLayerCfg[layerId].m_iSourceWidth;
    4368   Int m_iSourceHeight = m_acLayerCfg[layerId].m_iSourceHeight;
     4367  Int m_iSourceWidth = m_acLayerCfg[layerIdx].m_iSourceWidth;
     4368  Int m_iSourceHeight = m_acLayerCfg[layerIdx].m_iSourceHeight;
    43694369#if LAYER_CTB
    4370   Int m_uiMaxCUWidth = m_acLayerCfg[layerId].m_uiMaxCUWidth;
    4371   Int m_uiMaxCUHeight = m_acLayerCfg[layerId].m_uiMaxCUHeight;
     4370  Int m_uiMaxCUWidth = m_acLayerCfg[layerIdx].m_uiMaxCUWidth;
     4371  Int m_uiMaxCUHeight = m_acLayerCfg[layerIdx].m_uiMaxCUHeight;
    43724372#endif
    43734373
    43744374  Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 );
    4375   Int m_iWaveFrontSynchro = m_acLayerCfg[layerId].m_waveFrontSynchro;
     4375  Int m_iWaveFrontSynchro = m_acLayerCfg[layerIdx].m_waveFrontSynchro;
    43764376  xConfirmPara( tileFlag && m_iWaveFrontSynchro,            "Tile and Wavefront can not be applied together");
    43774377#endif
     
    45404540
    45414541#if RC_SHVC_HARMONIZATION
    4542   if ( m_acLayerCfg[layerId].m_RCEnableRateControl )
    4543   {
    4544     if ( m_acLayerCfg[layerId].m_RCForceIntraQP )
    4545     {
    4546       if ( m_acLayerCfg[layerId].m_RCInitialQP == 0 )
     4542  if ( m_acLayerCfg[layerIdx].m_RCEnableRateControl )
     4543  {
     4544    if ( m_acLayerCfg[layerIdx].m_RCForceIntraQP )
     4545    {
     4546      if ( m_acLayerCfg[layerIdx].m_RCInitialQP == 0 )
    45474547      {
    45484548        printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" );
    4549         m_acLayerCfg[layerId].m_RCForceIntraQP = false;
     4549        m_acLayerCfg[layerIdx].m_RCForceIntraQP = false;
    45504550      }
    45514551    }
     
    45964596  xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" );
    45974597  // NOTE: m_numSamplePredRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    4598   if( layerId > 0 )
    4599   {
    4600     xConfirmPara(m_acLayerCfg[layerId].m_numSamplePredRefLayers > layerId, "Cannot reference more layers than before current layer");
    4601     for(Int i = 0; i < m_acLayerCfg[layerId].m_numSamplePredRefLayers; i++)
    4602     {
    4603       xConfirmPara(m_acLayerCfg[layerId].m_samplePredRefLayerIds[i] > layerId, "Cannot reference higher layers");
    4604       xConfirmPara(m_acLayerCfg[layerId].m_samplePredRefLayerIds[i] == layerId, "Cannot reference the current layer itself");
     4598  if( layerIdx > 0 )
     4599  {
     4600    xConfirmPara(m_acLayerCfg[layerIdx].m_numSamplePredRefLayers > layerIdx, "Cannot reference more layers than before current layer");
     4601    for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numSamplePredRefLayers; i++)
     4602    {
     4603      xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] > layerIdx, "Cannot reference higher layers");
     4604      xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] == layerIdx, "Cannot reference the current layer itself");
    46054605    }
    46064606  }
    46074607  xConfirmPara( (m_acLayerCfg[0].m_numMotionPredRefLayers != 0) && (m_acLayerCfg[0].m_numMotionPredRefLayers != -1), "Layer 0 cannot have any reference layers" );
    46084608  // NOTE: m_numMotionPredRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    4609   if( layerId > 0 )
    4610   {
    4611     xConfirmPara(m_acLayerCfg[layerId].m_numMotionPredRefLayers > layerId, "Cannot reference more layers than before current layer");
    4612     for(Int i = 0; i < m_acLayerCfg[layerId].m_numMotionPredRefLayers; i++)
    4613     {
    4614       xConfirmPara(m_acLayerCfg[layerId].m_motionPredRefLayerIds[i] > layerId, "Cannot reference higher layers");
    4615       xConfirmPara(m_acLayerCfg[layerId].m_motionPredRefLayerIds[i] == layerId, "Cannot reference the current layer itself");
     4609  if( layerIdx > 0 )
     4610  {
     4611    xConfirmPara(m_acLayerCfg[layerIdx].m_numMotionPredRefLayers > layerIdx, "Cannot reference more layers than before current layer");
     4612    for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numMotionPredRefLayers; i++)
     4613    {
     4614      xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] > layerIdx, "Cannot reference higher layers");
     4615      xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] == layerIdx, "Cannot reference the current layer itself");
    46164616    }
    46174617  }
     
    46194619  xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" );
    46204620  // NOTE: m_numActiveRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    4621   if( layerId > 0 )
     4621  if( layerIdx > 0 )
    46224622  {
    46234623    Bool predEnabledFlag[MAX_LAYERS];
    4624     for (Int refLayer = 0; refLayer < layerId; refLayer++)
     4624    for (Int refLayer = 0; refLayer < layerIdx; refLayer++)
    46254625    {
    46264626      predEnabledFlag[refLayer] = false;
    46274627    }
    4628     for(Int i = 0; i < m_acLayerCfg[layerId].m_numSamplePredRefLayers; i++)
    4629     {
    4630       predEnabledFlag[m_acLayerCfg[layerId].m_samplePredRefLayerIds[i]] = true;
    4631     }
    4632     for(Int i = 0; i < m_acLayerCfg[layerId].m_numMotionPredRefLayers; i++)
    4633     {
    4634       predEnabledFlag[m_acLayerCfg[layerId].m_motionPredRefLayerIds[i]] = true;
     4628    for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numSamplePredRefLayers; i++)
     4629    {
     4630      predEnabledFlag[m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i]] = true;
     4631    }
     4632    for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numMotionPredRefLayers; i++)
     4633    {
     4634      predEnabledFlag[m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i]] = true;
    46354635    }
    46364636    Int numDirectRefLayers = 0;
    4637     for (Int refLayer = 0; refLayer < layerId; refLayer++)
     4637    for (Int refLayer = 0; refLayer < layerIdx; refLayer++)
    46384638    {
    46394639      if (predEnabledFlag[refLayer] == true) numDirectRefLayers++;
    46404640    }
    4641     xConfirmPara(m_acLayerCfg[layerId].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers");
    4642     for(Int i = 0; i < m_acLayerCfg[layerId].m_numActiveRefLayers; i++)
    4643     {
    4644       xConfirmPara(m_acLayerCfg[layerId].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers");
     4641    xConfirmPara(m_acLayerCfg[layerIdx].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers");
     4642    for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numActiveRefLayers; i++)
     4643    {
     4644      xConfirmPara(m_acLayerCfg[layerIdx].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers");
    46454645    }
    46464646  }
     
    46634663  }
    46644664#endif
    4665   if( layerId < MAX_LAYERS-1 )
    4666   {
    4667     xConfirmPara(m_acLayerCfg[layerId].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layerId].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7");
     4665  if( layerIdx < MAX_LAYERS-1 )
     4666  {
     4667    xConfirmPara(m_acLayerCfg[layerIdx].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layerIdx].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7");
    46684668  }
    46694669#if AUXILIARY_PICTURES
    4670   if( layerId < MAX_LAYERS-1 )
     4670  if( layerIdx < MAX_LAYERS-1 )
    46714671  {
    46724672#if R0062_AUX_PSEUDO_MONOCHROME
    4673     xConfirmPara(m_acLayerCfg[layerId].m_auxId < 0 || m_acLayerCfg[layerId].m_auxId > 2, "AuxId must be in range 0 to 2");
    4674 #else
    4675     xConfirmPara(m_acLayerCfg[layerId].m_auxId < 0 || m_acLayerCfg[layerId].m_auxId > 4, "AuxId must be in range 0 to 4");
    4676     xConfirmPara(m_acLayerCfg[layerId].m_auxId > 0 && m_acLayerCfg[layerId].m_chromaFormatIDC != CHROMA_400, "Auxiliary picture must be monochrome picture");
     4673    xConfirmPara(m_acLayerCfg[layerIdx].m_auxId < 0 || m_acLayerCfg[layerIdx].m_auxId > 2, "AuxId must be in range 0 to 2");
     4674#else
     4675    xConfirmPara(m_acLayerCfg[layerIdx].m_auxId < 0 || m_acLayerCfg[layerIdx].m_auxId > 4, "AuxId must be in range 0 to 4");
     4676    xConfirmPara(m_acLayerCfg[layerIdx].m_auxId > 0 && m_acLayerCfg[layerIdx].m_chromaFormatIDC != CHROMA_400, "Auxiliary picture must be monochrome picture");
    46774677#endif
    46784678  }
     
    47264726{
    47274727#if SVC_EXTENSION
    4728   // Check for layerId equal to 0, it has to pe extended to other layers.
    4729   UInt layerId = 0;
    4730   Bool m_useExtendedPrecision = m_acLayerCfg[layerId].m_useExtendedPrecision;
    4731   Int m_internalBitDepth[]    = {m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};
    4732   Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerId].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]};
    4733   ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerId].m_chromaFormatIDC;
     4728  // Check for layerIdx equal to 0, it has to pe extended to other layers.
     4729  UInt layerIdx = 0;
     4730  Bool m_useExtendedPrecision = m_acLayerCfg[layerIdx].m_useExtendedPrecision;
     4731  Int m_internalBitDepth[]    = {m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};
     4732  Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]};
     4733  ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerIdx].m_chromaFormatIDC;
    47344734#endif
    47354735
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1037 r1045  
    7979  Int       m_numLayerSets;
    8080  Int       m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
    81   Int       m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     81  Int       m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    8282  Int       m_numAddLayerSets;
    8383  Int       m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
    84   Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     84  Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    8585#endif
    8686#if OUTPUT_LAYER_SETS_CONFIG
     
    490490#endif
    491491#if SVC_EXTENSION
    492   Void  xCheckParameter (UInt layerId);                       ///< check validity of configuration values per layer
     492  Void  xCheckParameter (UInt layerIdx);                       ///< check validity of configuration values per layer
    493493#else
    494494  Void  xCheckParameter ();                                   ///< check validity of configuration values
     
    591591#endif
    592592  Int  getDecodingRefreshType()    {return m_iDecodingRefreshType; }
    593   Int  getWaveFrontSynchro(Int layerId)        { return m_acLayerCfg[layerId].m_waveFrontSynchro; }
     593  Int  getWaveFrontSynchro(Int layerIdx)        { return m_acLayerCfg[layerIdx].m_waveFrontSynchro; }
    594594  Void getDirFilename(string& filename, string& dir, const string path);
    595595#if OUTPUT_LAYER_SETS_CONFIG
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1043 r1045  
    354354    if(layer)
    355355    {
    356       for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
     356      for(Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++)
    357357      {
    358358        m_acTEncTop[layer].setSamplePredEnabledFlag                       (i, false);
     
    13231323      {
    13241324        Int layerId = m_layerSetLayerIdList[setId][i];
     1325        Int layerIdx = vps->getLayerIdxInVps(m_layerSetLayerIdList[setId][i]);
    13251326#else
    13261327      for( i = 0; i < m_numLayerInIdList[setId-1]; i++ )
     
    13301331#if O0194_DIFFERENT_BITDEPTH_EL_BL
    13311332        //4
    1332         g_bitDepth[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1333         g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    1334 
    1335         g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1336         g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
     1333        g_bitDepth[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
     1334        g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
     1335
     1336        g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
     1337        g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    13371338#endif
    13381339
     
    13481349    for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
    13491350    {
    1350       for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++)
     1351      for (Int layerIdx = 0; layerIdx <= vps->getMaxLayers(); layerIdx++)
    13511352      {
    13521353#if O0194_DIFFERENT_BITDEPTH_EL_BL
    13531354        //4
    1354         g_bitDepth[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1355         g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    1356 
    1357         g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1358         g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
     1355        UInt layerId = vps->getLayerIdInNuh(layerIdx);
     1356        g_bitDepth[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
     1357        g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
     1358
     1359        g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
     1360        g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    13591361#endif
    13601362        if (layerId <= setId)
     
    17871789        vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue );
    17881790#else
    1789         vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
    1790 #endif
    1791         maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));
     1791        vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[vps->getLayerIdxInVps(layerId)].getMaxDecPicBuffering(j) - 1 );
     1792#endif
     1793        maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[vps->getLayerIdxInVps(layerId)].getNumReorderPics(j));
    17921794      }
    17931795#if RESOLUTION_BASED_DPB
     
    18991901      vps->setNumSubLayerHrdMinus1( j, vps->getMaxTLayers() - 1 );
    19001902
    1901       UInt layerId = j;
    1902       TEncTop *pcCfgLayer = &m_acTEncTop[layerId];
     1903      UInt layerIdx = j;
     1904      TEncTop *pcCfgLayer = &m_acTEncTop[layerIdx];
    19031905
    19041906      Int iPicWidth         = pcCfgLayer->getSourceWidth();
    19051907      Int iPicHeight        = pcCfgLayer->getSourceHeight();
    19061908#if LAYER_CTB
    1907       UInt uiWidthInCU       = ( iPicWidth  % m_acLayerCfg[layerId].m_uiMaxCUWidth  ) ? iPicWidth  / m_acLayerCfg[layerId].m_uiMaxCUWidth  + 1 : iPicWidth  / m_acLayerCfg[layerId].m_uiMaxCUWidth;
    1908       UInt uiHeightInCU      = ( iPicHeight % m_acLayerCfg[layerId].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight;
    1909       UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId].m_uiMaxCUDepth << 1);
     1909      UInt uiWidthInCU       = ( iPicWidth  % m_acLayerCfg[layerIdx].m_uiMaxCUWidth  ) ? iPicWidth  / m_acLayerCfg[layerIdx].m_uiMaxCUWidth  + 1 : iPicWidth  / m_acLayerCfg[layerIdx].m_uiMaxCUWidth;
     1910      UInt uiHeightInCU      = ( iPicHeight % m_acLayerCfg[layerIdx].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerIdx].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerIdx].m_uiMaxCUHeight;
     1911      UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerIdx].m_uiMaxCUDepth << 1);
    19101912#else
    19111913      UInt uiWidthInCU       = ( iPicWidth %m_uiMaxCUWidth  ) ? iPicWidth /m_uiMaxCUWidth  + 1 : iPicWidth /m_uiMaxCUWidth;
Note: See TracChangeset for help on using the changeset viewer.