Changeset 1043 in SHVCSoftware


Ignore:
Timestamp:
2 Mar 2015, 21:08:06 (10 years ago)
Author:
seregin
Message:

fix layerId/layerIdx mismatch at decoder, including fixes for the tickets 66 and 68

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

Legend:

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

    r1037 r1043  
    12631263  vps->setNuhLayerIdPresentFlag(false);
    12641264  vps->setLayerIdInNuh(0, 0);
    1265   vps->setLayerIdInVps(0, 0);
     1265  vps->setLayerIdxInVps(0, 0);
    12661266  for(i = 1; i < vps->getMaxLayers(); i++)
    12671267  {
    12681268    vps->setLayerIdInNuh(i, i);
    1269     vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
     1269    vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i);
    12701270    vps->setDimensionId(i, 0, i);
    12711271  }
     
    15291529  for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    15301530  {
    1531     vps->setNumDirectRefLayers(layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers());
     1531    UInt layerId = vps->getLayerIdInNuh(layerCtr);
     1532    vps->setNumDirectRefLayers(layerId, m_acTEncTop[layerCtr].getNumDirectRefLayers());
    15321533    maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layerCtr));
    15331534
    15341535    for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)
    15351536    {
    1536       vps->setRefLayerId(layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i));
     1537      vps->setRefLayerId(layerId, i, m_acTEncTop[layerCtr].getRefLayerId(i));
    15371538    }
    15381539    // Set direct dependency flag
     
    15441545    for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)
    15451546    {
    1546       vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true);
     1547      vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdxInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true);
    15471548    }
    15481549    // prediction indications
     
    17391740    for(Int j = 0; j < numLayerInLayerSet; j++)
    17401741    {
    1741       Int layerIdxInVps = vps->getLayerIdInVps( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j) );
     1742      Int layerIdxInVps = vps->getLayerIdxInVps( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j) );
    17421743      if( vps->getNecessaryLayerFlag(i, j) )
    17431744      {
     
    19471948                // Only for the default partition
    19481949                Int nuhlayerId = vps->getLayerSetLayerIdList( lsIdx, k);
    1949                 Int layerIdxInVps = vps->getLayerIdInVps( nuhlayerId );
     1950                Int layerIdxInVps = vps->getLayerIdxInVps( nuhlayerId );
    19501951                vps->setBspHrdIdx(h, i, t, j, k, layerIdxInVps + vps->getNumHrdParameters());
    19511952
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1029 r1043  
    198198
    199199#if SVC_EXTENSION
    200   Void          setLayerId (UInt layerId) { m_layerId = layerId; }
     200  Void          setLayerId (UInt layerId)   { m_layerId = layerId; }
    201201  UInt          getLayerId ()               { return m_layerId; }
     202  UInt          getLayerIdx ()              { return this->getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId); }
    202203  Bool          isSpatialEnhLayer(UInt refLayerIdc)             { return m_bSpatialEnhLayer[refLayerIdc]; }
    203204  Void          setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; }
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1036 r1043  
    20832083
    20842084  m_numScalabilityTypes = 0;
    2085   ::memset(m_layerIdInVps, 0, sizeof(m_layerIdInVps));
     2085  ::memset(m_layerIdxInVps, 0, sizeof(m_layerIdxInVps));
    20862086#endif
    20872087#if VPS_EXTN_PROFILE_INFO
     
    34853485      for( UInt j = 0; j < m_numPredictedLayers[iNuhLId]; j++ )
    34863486      {
    3487         if( !countedLayerIdxFlag[m_layerIdInVps[iNuhLId]] )
     3487        if( !countedLayerIdxFlag[m_layerIdxInVps[iNuhLId]] )
    34883488        {
    34893489          m_treePartitionLayerIdList[numIndependentLayers][m_numLayersInTreePartition[numIndependentLayers]] = m_predictedLayerId[iNuhLId][j];
    34903490          m_numLayersInTreePartition[numIndependentLayers] = m_numLayersInTreePartition[numIndependentLayers] + 1;
    3491           countedLayerIdxFlag[m_layerIdInVps[m_predictedLayerId[iNuhLId][j]]] = true;
     3491          countedLayerIdxFlag[m_layerIdxInVps[m_predictedLayerId[iNuhLId][j]]] = true;
    34923492        }
    34933493      }
     
    36583658    for(Int i = 0; i < this->getNumLayersInIdList( lsIdx ); i++)
    36593659    {
    3660       Int layerIdxInVps = this->getLayerIdInVps( this->getLayerSetLayerIdList(lsIdx, i) );
     3660      Int layerIdxInVps = this->getLayerIdxInVps( this->getLayerSetLayerIdList(lsIdx, i) );
    36613661      Int repFormatIdx  = this->getVpsRepFormatIdx( layerIdxInVps );
    36623662      RepFormat* repFormat = this->getVpsRepFormat( repFormatIdx );
     
    38723872    for(Int k = 0; k < getNumLayersInIdList(lsIdx); k++ ) {
    38733873      Int  lId = getLayerSetLayerIdList(lsIdx, k);
    3874       maxSLMinus1 = std::max(maxSLMinus1, getMaxTSLayersMinus1(getLayerIdInVps(lId)));
     3874      maxSLMinus1 = std::max(maxSLMinus1, getMaxTSLayersMinus1(getLayerIdxInVps(lId)));
    38753875    }
    38763876    setMaxSLayersInLayerSetMinus1(lsIdx,maxSLMinus1);
     
    39413941  else
    39423942  {
    3943     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)))->getPicWidthVpsInLumaSamples();
     3943    retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getPicWidthVpsInLumaSamples();
    39443944  }
    39453945#else
     
    39503950  else
    39513951  {
    3952     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)) )->getPicWidthVpsInLumaSamples();
     3952    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)) )->getPicWidthVpsInLumaSamples();
    39533953  }
    39543954#endif
     
    39843984  else
    39853985  {
    3986     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)))->getPicHeightVpsInLumaSamples();
     3986    retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getPicHeightVpsInLumaSamples();
    39873987  }
    39883988#else
     
    39933993  else
    39943994  {
    3995     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)) )->getPicHeightVpsInLumaSamples();
     3995    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)) )->getPicHeightVpsInLumaSamples();
    39963996  }
    39973997#endif
     
    40364036  else
    40374037  {
    4038     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)))->getChromaFormatVpsIdc();
     4038    retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getChromaFormatVpsIdc();
    40394039  }
    40404040#else
     
    40454045  else
    40464046  {
    4047     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)) )->getChromaFormatVpsIdc();
     4047    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)) )->getChromaFormatVpsIdc();
    40484048  }
    40494049#endif
     
    40784078  else
    40794079  {
    4080     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)))->getBitDepthVpsLuma();
     4080    retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getBitDepthVpsLuma();
    40814081  }
    40824082#else
     
    40874087  else
    40884088  {
    4089     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)) )->getBitDepthVpsLuma();
     4089    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)) )->getBitDepthVpsLuma();
    40904090  }
    40914091#endif
     
    41204120  else
    41214121  {
    4122     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)))->getBitDepthVpsChroma();
     4122    retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getBitDepthVpsChroma();
    41234123  }
    41244124#else
     
    41294129  else
    41304130  {
    4131     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)) )->getBitDepthVpsChroma();
     4131    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)) )->getBitDepthVpsChroma();
    41324132  }
    41334133#endif
     
    41734173  else
    41744174  {
    4175     return vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdInVps(layerId)))->getConformanceWindowVps();
     4175    return vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getConformanceWindowVps();
    41764176  }
    41774177#else
     
    41824182  else
    41834183  {
    4184     return vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdInVps(vps->getLayerIdInVps(layerId))) )->getConformanceWindowVps();
     4184    return vps->getVpsRepFormat( vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(vps->getLayerIdxInVps(layerId))) )->getConformanceWindowVps();
    41854185  }
    41864186#endif
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1035 r1043  
    676676  // Below are derived variables
    677677  UInt       m_numScalabilityTypes;
    678   UInt       m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer_id_in_nuh with the layer ID in the VPS
     678  UInt       m_layerIdxInVps[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer_id_in_nuh with the layer ID in the VPS
    679679#endif
    680680#if BITRATE_PICRATE_SIGNALLING
     
    10981098  Void   setNumScalabilityTypes(UInt x)                         { m_numScalabilityTypes = x;       }
    10991099
    1100   UInt   getLayerIdInVps(Int id)                                { return m_layerIdInVps[id];      }
    1101   Void   setLayerIdInVps(Int id, UInt x)                        { m_layerIdInVps[id] = x;          }
     1100  UInt   getLayerIdxInVps(Int layerId)                          { return m_layerIdxInVps[layerId]; }
     1101  Void   setLayerIdxInVps(Int layerId, UInt x)                  { m_layerIdxInVps[layerId] = x;    }
    11021102#endif
    11031103#if BITRATE_PICRATE_SIGNALLING
     
    11341134#if VPS_EXTN_DIRECT_REF_LAYERS
    11351135  // Direct dependency of layers
    1136   Bool   getDirectDependencyFlag(Int currLayerId, Int refLayerId)               { return m_directDependencyFlag[currLayerId][refLayerId]; }
    1137   Void   setDirectDependencyFlag(Int currLayerId, Int refLayerId, Bool x)       { m_directDependencyFlag[currLayerId][refLayerId] = x;    }
     1136  Bool   getDirectDependencyFlag(Int currLayerIdc, Int refLayerIdc)               { return m_directDependencyFlag[currLayerIdc][refLayerIdc]; }
     1137  Void   setDirectDependencyFlag(Int currLayerIdc, Int refLayerIdc, Bool x)       { m_directDependencyFlag[currLayerIdc][refLayerIdc] = x;    }
    11381138 
    11391139  UInt   getNumDirectRefLayers(Int layerId)                                     { return m_numDirectRefLayers[layerId];                   }
     
    13961396  Int    getScalabilityId(Int, ScalabilityType scalType );
    13971397
    1398   Int    getViewIndex    ( Int layerIdInNuh )                       { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
     1398  Int    getViewIndex    ( Int layerIdInNuh )                       { return getScalabilityId( getLayerIdxInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
    13991399
    14001400  Int    getNumViews();
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1030 r1043  
    13471347#if N0065_LAYER_POC_ALIGNMENT
    13481348#if O0062_POC_LSB_NOT_PRESENT_FLAG
    1349     if( ( pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() )
     1349    if( ( pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() )
    13501350#else
    13511351    if( pcSlice->getLayerId() > 0 || !pcSlice->getIdrPicFlag() )
     
    15361536          if(chkAssert)
    15371537          {
    1538             // There may be something wrong here (layer id assumed to be layer idx?)
    1539             assert(rps->getNumberOfNegativePictures() <= pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , pcSlice->getLayerId() , pcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)));
    1540             assert(rps->getNumberOfPositivePictures() <= pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , pcSlice->getLayerId() , pcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)) - rps->getNumberOfNegativePictures());
    1541             assert((rps->getNumberOfPositivePictures() + rps->getNumberOfNegativePictures() + rps->getNumberOfLongtermPictures()) <= pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , pcSlice->getLayerId() , pcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)));
     1538            UInt layerIdx = pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId());
     1539            assert(rps->getNumberOfNegativePictures() <= pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii, layerIdx, pcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)));
     1540            assert(rps->getNumberOfPositivePictures() <= pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii, layerIdx, pcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)) - rps->getNumberOfNegativePictures());
     1541            assert((rps->getNumberOfPositivePictures() + rps->getNumberOfNegativePictures() + rps->getNumberOfLongtermPictures()) <= pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii, layerIdx, pcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)));
    15421542          }
    15431543        }
     
    16011601            {
    16021602#if Q0060_MAX_TID_REF_EQUAL_TO_ZERO
    1603               if((pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() || pcSlice->getTLayer()==0) &&
    1604                 (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdInVps(i)) >=  pcSlice->getTLayer()) )
     1603              if((pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() || pcSlice->getTLayer()==0) &&
     1604                (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >=  pcSlice->getTLayer()) )
    16051605#else
    1606               if(pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() &&
    1607                 (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdInVps(i)) >=  pcSlice->getTLayer()) )
     1606              if(pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() &&
     1607                (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >=  pcSlice->getTLayer()) )
    16081608#endif
    16091609              {         
     
    16641664      {
    16651665#if Q0060_MAX_TID_REF_EQUAL_TO_ZERO
    1666         if((pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() || pcSlice->getTLayer()==0) &&
    1667           (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdInVps(i)) >=  pcSlice->getTLayer()) )
     1666        if((pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() || pcSlice->getTLayer()==0) &&
     1667          (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >=  pcSlice->getTLayer()) )
    16681668#else
    1669         if(pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() &&
    1670           (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdInVps(i)) >=  pcSlice->getTLayer()) )
     1669        if(pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i),pcSlice->getLayerId()) >  pcSlice->getTLayer() &&
     1670          (pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >=  pcSlice->getTLayer()) )
    16711671#endif
    16721672        {         
     
    17141714      else
    17151715      {
    1716         format = pcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : pcSlice->getVPS()->getVpsRepFormatIdx( pcSlice->getVPS()->getLayerIdInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc();
     1716        format = pcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : pcSlice->getVPS()->getVpsRepFormatIdx( pcSlice->getVPS()->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc();
    17171717#if Q0195_REP_FORMAT_CLEANUP
    17181718        assert( (sps->getUpdateRepFormatFlag()==false && pcSlice->getVPS()->getVpsNumRepFormats()==1) || pcSlice->getVPS()->getVpsNumRepFormats() > 1 ); //conformance check
     
    20622062    }
    20632063#if Q0142_POC_LSB_NOT_PRESENT
    2064     if ( pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdInVps(pcSlice->getLayerId()) ) && iPOClsb > 0 )
     2064    if ( pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId()) ) && iPOClsb > 0 )
    20652065    {
    20662066      assert( pcSlice->getPocResetIdc() != 2 );
     
    20822082      READ_CODE(pcSlice->getSPS()->getBitsForPOC(), uiCode,"poc_lsb_val"); pcSlice->setPocLsbVal(uiCode);
    20832083#if Q0142_POC_LSB_NOT_PRESENT
    2084       if ( pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdInVps(pcSlice->getLayerId()) ) && pcSlice->getFullPocResetFlag() )
     2084      if ( pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId()) ) && pcSlice->getFullPocResetFlag() )
    20852085      {
    20862086        assert( pcSlice->getPocLsbVal() == 0 );
     
    28542854  READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false);
    28552855  vps->setLayerIdInNuh(0, 0);
    2856   vps->setLayerIdInVps(0, 0);
     2856  vps->setLayerIdxInVps(0, 0);
    28572857  for(i = 1; i < vps->getMaxLayers(); i++)
    28582858  {
     
    28662866      vps->setLayerIdInNuh(i, i);
    28672867    }
    2868     vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
     2868    vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i);
    28692869
    28702870    if( !vps->getSplittingFlag() )
     
    28812881#endif
    28822882#if VIEW_ID_RELATED_SIGNALING
    2883   // if ( pcVPS->getNumViews() > 1 )
    2884   //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    2885   {
    28862883#if O0109_VIEW_ID_LEN
    2887     READ_CODE( 4, uiCode, "view_id_len" ); vps->setViewIdLen( uiCode );
    2888 #else
    2889     READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode );
    2890 #endif
    2891   }
     2884  READ_CODE( 4, uiCode, "view_id_len" ); vps->setViewIdLen( uiCode );
     2885#else
     2886  READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode );
     2887#endif
    28922888
    28932889#if O0109_VIEW_ID_LEN
     
    29102906  vps->setNumDirectRefLayers(0, 0);
    29112907  // For other layers
    2912   for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    2913   {
     2908  for( Int layerCtr = 1; layerCtr < vps->getMaxLayers(); layerCtr++)
     2909  {
     2910    UInt layerId = vps->getLayerIdInNuh(layerCtr);
    29142911    UInt numDirectRefLayers = 0;
    29152912    for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
     
    29182915      if(uiCode)
    29192916      {
    2920         vps->setRefLayerId(layerCtr, numDirectRefLayers, refLayerCtr);
     2917        vps->setRefLayerId(layerId, numDirectRefLayers, vps->getLayerIdInNuh(refLayerCtr));
    29212918        numDirectRefLayers++;
    29222919      }
    29232920    }
    2924     vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers);
     2921    vps->setNumDirectRefLayers(layerId, numDirectRefLayers);
    29252922  }
    29262923#endif
     
    36733670  {
    36743671    vps->setLayerIdInNuh(i, i);
    3675     vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i);
     3672    vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i);
    36763673  }
    36773674
     
    38683865    for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) {
    38693866      Int  lId = vps->getLayerSetLayerIdList(optLsIdx, k);
    3870       maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId)));
     3867      maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(lId)));
    38713868    }
    38723869    MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1;
     
    42294226      {
    42304227#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    4231         layerIdx = vps->getLayerIdInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j));
     4228        layerIdx = vps->getLayerIdxInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j));
    42324229        if (vps->getTilesInUseFlag(i) && vps->getTilesInUseFlag(layerIdx)) {
    42334230          READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1));
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.h

    r1029 r1043  
    103103 
    104104#if SVC_EXTENSION
    105   TDecTop*   getLayerDec        ( UInt LayerId )  { return m_ppcTDecTop[LayerId]; }
     105  TDecTop*   getLayerDec        ( UInt layerIdx )  { return m_ppcTDecTop[layerIdx]; }
    106106#endif
    107107protected:
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp

    r1029 r1043  
    252252  }
    253253#if CONFORMANCE_BITSTREAM_MODE
    254   if( this->getLayerDec(pcPic->getLayerId())->getConfModeFlag() )
     254  if( this->getLayerDec(pcPic->getLayerIdx())->getConfModeFlag() )
    255255  {
    256256    // Add this reconstructed picture to the parallel buffer.
    257     std::vector<TComPic> *thisLayerBuffer = (this->getLayerDec(pcPic->getLayerId()))->getConfListPic();
     257    std::vector<TComPic> *thisLayerBuffer = (this->getLayerDec(pcPic->getLayerIdx()))->getConfListPic();
    258258    thisLayerBuffer->push_back(*pcPic);
    259259    std::sort( thisLayerBuffer->begin(), thisLayerBuffer->end(), pocCompareFunction );
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.h

    r1029 r1043  
    118118#endif
    119119#if SVC_EXTENSION
    120   TDecTop*   getLayerDec(UInt LayerId)  { return m_ppcTDecTop[LayerId]; }
     120  TDecTop*   getLayerDec(UInt layerIdx)  { return m_ppcTDecTop[layerIdx]; }
    121121#endif
    122122
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1040 r1043  
    483483
    484484#if FIX_NON_OUTPUT_LAYER
    485   if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false )
     485  if( this->getLayerDec(pcPic->getLayerIdx())->m_isOutputLayerFlag == false )
    486486  {
    487487    pcPic->setOutputMark( false );
     
    764764
    765765#if P0182_VPS_VUI_PS_FLAG
    766     UInt layerIdx = activeVPS->getLayerIdInVps( m_layerId );
     766    UInt layerIdx = activeVPS->getLayerIdxInVps( m_layerId );
    767767
    768768    if( activeVPS->getBaseLayerPSCompatibilityFlag(layerIdx) )
     
    788788
    789789#if R0227_REP_FORMAT_CONSTRAINT //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer
    790   UInt layerIdx = activeVPS->getLayerIdInVps(m_apcSlicePilot->getLayerId());
     790  UInt layerIdx = activeVPS->getLayerIdxInVps(m_apcSlicePilot->getLayerId());
    791791
    792792  if ( activeVPS->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) )
     
    28492849
    28502850#if VPS_EXTN_DIRECT_REF_LAYERS
    2851 TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdc )
     2851TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdx )
    28522852{
    28532853  TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS();
     
    28572857  }
    28582858 
    2859   return (TDecTop *)getLayerDec( vps->getRefLayerId( m_layerId, refLayerIdc ) );
     2859  return (TDecTop *)getLayerDec( vps->getLayerIdxInVps( vps->getRefLayerId( m_layerId, refLayerIdx ) ) );
    28602860}
    28612861#endif
     
    28972897  {
    28982898    Int mIdx = 0, sIdx = 0;
    2899     Int iNuhLId = vps->getLayerIdInNuh(i);
    2900     TDecTop *decTop = (TDecTop *)getLayerDec(iNuhLId);
     2899    TDecTop *decTop = (TDecTop *)getLayerDec(i);
    29012900    for ( Int j = 0; j < i; j++ )
    29022901    {
     
    29612960  for ( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
    29622961  {
    2963     Int jLidx = pcSlice->getVPS()->getLayerIdInVps(targetDecLayerIdList[j]);
     2962    Int jLidx = pcSlice->getVPS()->getLayerIdxInVps(targetDecLayerIdList[j]);
    29642963    if ( currTid <= pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(latestDecLayerId,jLidx) - 1 )
    29652964    {
     
    31093108    if( vps->getOutputLayerFlag( targetOlsIdx, i ) )
    31103109    {
    3111       this->getLayerDec( vps->getLayerSetLayerIdList( targetLsIdx, i ) )->m_isOutputLayerFlag = true;
     3110      this->getLayerDec( vps->getLayerIdxInVps( vps->getLayerSetLayerIdList( targetLsIdx, i ) ) )->m_isOutputLayerFlag = true;
    31123111    }
    31133112  }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r1029 r1043  
    242242#endif
    243243#if POC_RESET_IDC_DECODER
    244   Int getParseIdc() { return m_parseIdc;}
    245   Void        setParseIdc(Int x) { m_parseIdc = x;}
    246   Void        markAllPicsAsNoCurrAu();
    247 
    248   Int   getLastPocPeriodId() { return m_lastPocPeriodId; }
    249   Void  setLastPocPeriodId(Int x)    { m_lastPocPeriodId = x; }
    250 
    251   Int   getPrevPicOrderCnt() { return m_prevPicOrderCnt; }
    252   Void  setPrevPicOrderCnt(Int const x) { m_prevPicOrderCnt = x; }
    253 #endif
    254   UInt      getLayerId            () { return m_layerId;              }
    255   Void      setLayerId            (UInt layer) { m_layerId = layer; }
    256   UInt      getNumLayer           () { return m_numLayer;             }
    257   Void      setNumLayer           (UInt uiNum)   { m_numLayer = uiNum;  }
    258   TComList<TComPic*>*      getListPic() { return &m_cListPic; }
    259   Void      setLayerDec(TDecTop **p)    { m_ppcTDecTop = p; }
    260   TDecTop*  getLayerDec(UInt layer)     { return m_ppcTDecTop[layer]; }
     244  Int       getParseIdc                     ()                              { return m_parseIdc;               }
     245  Void      setParseIdc                     (Int x)                         { m_parseIdc = x;                  }
     246  Void      markAllPicsAsNoCurrAu();
     247
     248  Int       getLastPocPeriodId              ()                              { return m_lastPocPeriodId;        }
     249  Void      setLastPocPeriodId              (Int x)                         { m_lastPocPeriodId = x;          }
     250
     251  Int       getPrevPicOrderCnt              ()                              { return m_prevPicOrderCnt;        }
     252  Void      setPrevPicOrderCnt              (Int const x)                   { m_prevPicOrderCnt = x;          }
     253#endif
     254  UInt      getLayerId                      ()                              { return m_layerId;                }
     255  Void      setLayerId                      (UInt layer)                    { m_layerId = layer;              }
     256  UInt      getNumLayer                     ()                              { return m_numLayer;               }
     257  Void      setNumLayer                     (UInt uiNum)                    { m_numLayer = uiNum;              }
     258  TComList<TComPic*>*  getListPic           ()                              { return &m_cListPic;              }
     259  Void      setLayerDec                     (TDecTop **p)                   { m_ppcTDecTop = p;                }
     260  TDecTop*  getLayerDec                     (UInt layerIdx)                 { return m_ppcTDecTop[layerIdx];  }
    261261#if R0235_SMALLEST_LAYER_ID
    262262  Void      xDeriveSmallestLayerId(TComVPS* vps);
    263263#endif
    264264#if VPS_EXTN_DIRECT_REF_LAYERS
    265   TDecTop*  getRefLayerDec(UInt refLayerIdc);
     265  TDecTop*  getRefLayerDec                  (UInt refLayerIdx);
    266266  Int       getNumDirectRefLayers           ()                              { return m_numDirectRefLayers;      }
    267267  Void      setNumDirectRefLayers           (Int num)                       { m_numDirectRefLayers = num;       }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1030 r1043  
    10771077#if N0065_LAYER_POC_ALIGNMENT
    10781078#if O0062_POC_LSB_NOT_PRESENT_FLAG
    1079     if( (pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag())
     1079    if( (pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag())
    10801080#else
    10811081    if( pcSlice->getLayerId() > 0 || !pcSlice->getIdrPicFlag() )
     
    27472747        for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) {
    27482748            Int  lId = vps->getLayerSetLayerIdList(optLsIdx, k);
    2749             maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId)));
     2749            maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(lId)));
    27502750        }
    27512751        MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1;
     
    29572957      {
    29582958#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    2959         layerIdx = vps->getLayerIdInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j));
     2959        layerIdx = vps->getLayerIdxInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j));
    29602960        if (vps->getTilesInUseFlag(i) && vps->getTilesInUseFlag(layerIdx)) {
    29612961          WRITE_FLAG( vps->getTileBoundariesAlignedFlag(i,j) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1030 r1043  
    930930  {
    931931#if REPN_FORMAT_IN_VPS
    932     m_cSPS.setBitDepth    (ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType))            );
    933     m_cSPS.setQpBDOffset  (ChannelType(channelType), (6 * (m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) - 8)));
     932    m_cSPS.setBitDepth    (ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType))            );
     933    m_cSPS.setQpBDOffset  (ChannelType(channelType), (6 * (m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) - 8)));
    934934#else
    935935    m_cSPS.setBitDepth    (ChannelType(channelType), g_bitDepth[channelType]            );
     
    15801580{
    15811581#if O0096_REP_FORMAT_INDEX
    1582   RepFormat *repFormat = m_cVPS.getVpsRepFormat( m_cSPS.getUpdateRepFormatFlag() ? m_cSPS.getUpdateRepFormatIndex() : m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdInVps(m_layerId) ) );
    1583 #else
    1584   RepFormat *repFormat = m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdInVps(m_layerId) ) );
     1582  RepFormat *repFormat = m_cVPS.getVpsRepFormat( m_cSPS.getUpdateRepFormatFlag() ? m_cSPS.getUpdateRepFormatIndex() : m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps(m_layerId) ) );
     1583#else
     1584  RepFormat *repFormat = m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps(m_layerId) ) );
    15851585#endif
    15861586  Int bitDepthY,bitDepthC,picWidth,picHeight;
     
    16451645    if( m_cVPS.getNumRefLayers( m_layerId ) == 0 )
    16461646    {
    1647       UInt layerIdx = m_cVPS.getLayerIdInVps( m_layerId );
     1647      UInt layerIdx = m_cVPS.getLayerIdxInVps( m_layerId );
    16481648      RepFormat* repFmt = m_cVPS.getVpsRepFormat(m_cVPS.getVpsRepFormatIdx(layerIdx));
    16491649     
Note: See TracChangeset for help on using the changeset viewer.