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


Ignore:
Timestamp:
4 Mar 2015, 00:19:05 (10 years ago)
Author:
seregin
Message:

use layerId as an index for m_ppcTEncTop

Location:
branches/SHM-dev/source/Lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1049 r1051  
    10701070#if VPS_EXTN_MASK_AND_DIM_INFO
    10711071#if VPS_AVC_BL_FLAG_REMOVAL
    1072   Bool   getNonHEVCBaseLayerFlag()                              { return m_nonHEVCBaseLayerFlag;       }
    1073   Void   setNonHEVCBaseLayerFlag(Bool x)                        { m_nonHEVCBaseLayerFlag = x;          }
     1072  Bool   getNonHEVCBaseLayerFlag()                              { return m_nonHEVCBaseLayerFlag;   }
     1073  Void   setNonHEVCBaseLayerFlag(Bool x)                        { m_nonHEVCBaseLayerFlag = x;      }
    10741074#else
    10751075  Bool   getAvcBaseLayerFlag()                                  { return m_avcBaseLayerFlag;       }
     
    10891089  Void   setNuhLayerIdPresentFlag(Bool x)                       { m_nuhLayerIdPresentFlag = x;     }
    10901090
    1091   UInt   getLayerIdInNuh(Int layerIdx)                          { return m_layerIdInNuh[id];      }
    1092   Void   setLayerIdInNuh(Int layerIdx, UInt x)                  { m_layerIdInNuh[id] = x;          }
     1091  UInt   getLayerIdInNuh(Int layerIdx)                          { return m_layerIdInNuh[layerIdx]; }
     1092  Void   setLayerIdInNuh(Int layerIdx, UInt x)                  { m_layerIdInNuh[layerIdx] = x;    }
    10931093
    10941094  UInt   getDimensionId(Int lyrId, Int id)                      { return m_dimensionId[lyrId][id]; }
     
    27112711  Void      setLayerId (UInt layerId)   { m_layerId = layerId; }
    27122712  UInt      getLayerId ()               { return m_layerId;    }
     2713  UInt      getLayerIdx()               { return m_pcVPS->getLayerIdxInVps(m_layerId); }
    27132714
    27142715  Void        setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1048 r1051  
    192192  if( pcTEncTop->getLayerId() )
    193193  {
    194     m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()-1] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()-1] , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ );
    195     m_Enc3DAsymLUTPPS.create(   m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()-1] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()-1] , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ );
     194    UInt prevLayerId = pcTEncTop->getLayerId()-1; // it should be changed
     195
     196    m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthLayer[CHANNEL_TYPE_LUMA][prevLayerId] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][prevLayerId] , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ );
     197    m_Enc3DAsymLUTPPS.create(   m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthLayer[CHANNEL_TYPE_LUMA][prevLayerId] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][prevLayerId] , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ );
    196198    if(!m_pColorMappedPic)
    197199    {
     
    11701172        for (UInt i = 0; i < m_pcCfg->getNumLayer(); i++)
    11711173        {
    1172           m_ppcTEncTop[i]->setLayerInitializedFlag(false);
    1173           m_ppcTEncTop[i]->setFirstPicInLayerDecodedFlag(false);
     1174          Int layerId = pcSlice->getVPS()->getLayerIdInNuh(i);
     1175          m_ppcTEncTop[layerId]->setLayerInitializedFlag(false);
     1176          m_ppcTEncTop[layerId]->setFirstPicInLayerDecodedFlag(false);
    11741177        }
    11751178      }
     
    13081311        UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc);
    13091312#if VPS_EXTN_DIRECT_REF_LAYERS
    1310         TComList<TComPic*> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getRefLayerEnc(refLayerIdc)->getListPic();
     1313        TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(refLayerIdc)->getListPic();
    13111314#else
    13121315        TComList<TComPic*> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)-1]->getListPic();
     
    14121415        {
    14131416          // check for the sample prediction picture type
    1414           if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId)) )
     1417          if( m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag(refLayerId) )
    14151418          {
    14161419#if P0312_VERT_PHASE_ADJ
     
    14911494        if(pcSlice->getVPS()->getCrossLayerIrapAlignFlag())
    14921495        {
    1493           TComList<TComPic*> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getRefLayerEnc(0)->getListPic();
     1496          TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic();
    14941497          TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() );
    14951498          if(picLayer0)
     
    15331536      if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R &&
    15341537#if SVC_EXTENSION
    1535         ( m_iGopSize != 1 || m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getIntraPeriod() > 1 ) )
     1538        ( m_iGopSize != 1 || m_ppcTEncTop[m_layerId]->getIntraPeriod() > 1 ) )
    15361539#else
    15371540          !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE))
     
    18381841        for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    18391842        {
    1840           if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, pcSlice->getInterLayerPredLayerIdc(i) ) ) )
     1843          if( m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, pcSlice->getInterLayerPredLayerIdc(i) ) ) )
    18411844          {
    18421845            foundSamplePredPicture = true;
     
    18721875        for( Int i = 0; i < pcSlice->getLayerId(); i++)
    18731876        {
    1874           TComList<TComPic *> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(i)]->getListPic();
     1877          TComList<TComPic *> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdInNuh(i)]->getListPic();
    18751878          TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC());
    1876           if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) )
     1879          if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerIdx(), i) )
    18771880          {
    18781881            if( lowerLayerPic->getSlice(0)->getSliceType() == I_SLICE)
     
    19661969          // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture,
    19671970          // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
    1968           if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerId() )
     1971          if( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerId() )
    19691972#if MFM_ENCCONSTRAINT
    1970             && pcSlice->getBaseColPic( *m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refPic->getLayerId())]->getListPic() )->checkSameRefInfo() == true
     1973            && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId()]->getListPic() )->checkSameRefInfo() == true
    19711974#endif
    19721975            )
     
    19881991            // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture,
    19891992            // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
    1990             if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerId() )
     1993            if( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerId() )
    19911994#if MFM_ENCCONSTRAINT
    1992               && pcSlice->getBaseColPic( *m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refPic->getLayerId())]->getListPic() )->checkSameRefInfo() == true
     1995              && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId()]->getListPic() )->checkSameRefInfo() == true
    19931996#endif
    19941997              )
     
    21072110        // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture,
    21082111        // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
    2109         if( refPic->isILR(m_layerId) && !m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag(refPic->getLayerId()) )
     2112        if( refPic->isILR(m_layerId) && !m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag(refPic->getLayerId()) )
    21102113        {
    21112114          pcSlice->setEnableTMVPFlag(false);
     
    21252128          TComPic* refPic = pcSlice->getRefPic(refList, refIdx);
    21262129
    2127           if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) )
     2130          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) )
    21282131          {
    21292132            break;
     
    21492152          TComPic* refPic = pcSlice->getRefPic(refList, refIdx);
    21502153
    2151           if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) )
     2154          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) )
    21522155          {
    21532156            break;
     
    46614664        for(Int i = 1; i < slice->getVPS()->getMaxLayers(); i++)
    46624665        {
    4663           Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 );
    4664           Bool refreshTypeFlag     = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() );
     4666          UInt layerId = slice->getVPS()->getLayerIdInNuh(i);
     4667          Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshInterval() == 0 );
     4668          Bool refreshTypeFlag     = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshType() );
    46654669          if( !(refreshIntervalFlag && refreshTypeFlag) )
    46664670          {
     
    46784682      for(Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++)
    46794683      {
    4680         Bool idrFlag = ( (m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2)
    4681                         && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
     4684        UInt layerId = slice->getVPS()->getLayerIdInNuh(i);
     4685        Bool idrFlag = ( (m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshType() == 2)
     4686                        && ( pocCurr % m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
    46824687                        );
    46834688        for(Int j = 0; j < slice->getVPS()->getMaxLayers(); j++)
     
    46874692            continue;
    46884693          }
    4689           Bool idrOtherPicFlag = ( (m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2)
    4690                                   && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
     4694
     4695          layerId = slice->getVPS()->getLayerIdInNuh(j);
     4696          Bool idrOtherPicFlag = ( (m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshType() == 2)
     4697                                  && ( pocCurr % m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
    46914698                                  );
    46924699
     
    47324739        for (UInt i = 0; i < MAX_LAYERS; i++)
    47334740        {
    4734           m_ppcTEncTop[i]->setPocDecrementedInDPBFlag(false);
     4741          UInt layerId = slice->getVPS()->getLayerIdInNuh(i);
     4742          m_ppcTEncTop[layerId]->setPocDecrementedInDPBFlag(false);
    47354743        }
    47364744#endif
     
    48204828  for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++)
    48214829  {
    4822     if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx])]->getPocDecrementedInDPBFlag())
    4823     {
    4824       m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx])]->setPocDecrementedInDPBFlag(true);
     4830    if (!m_ppcTEncTop[affectedLayerList[layerIdx]]->getPocDecrementedInDPBFlag())
     4831    {
     4832      m_ppcTEncTop[affectedLayerList[layerIdx]]->setPocDecrementedInDPBFlag(true);
    48254833
    48264834      // Decrement value of associatedIrapPoc of the TEncGop object
    4827       m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx])]->getGOPEncoder()->m_associatedIRAPPOC -= deltaPocVal;
     4835      m_ppcTEncTop[affectedLayerList[layerIdx]]->getGOPEncoder()->m_associatedIRAPPOC -= deltaPocVal;
    48284836
    48294837      // Decrememnt the value of m_pocCRA
    4830       m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx])]->getGOPEncoder()->m_pocCRA -= deltaPocVal;
    4831 
    4832       TComList<TComPic*>::iterator  iterPic = m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx])]->getListPic()->begin();
    4833       while (iterPic != m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx])]->getListPic()->end())
     4838      m_ppcTEncTop[affectedLayerList[layerIdx]]->getGOPEncoder()->m_pocCRA -= deltaPocVal;
     4839
     4840      TComList<TComPic*>::iterator  iterPic = m_ppcTEncTop[affectedLayerList[layerIdx]]->getListPic()->begin();
     4841      while (iterPic != m_ppcTEncTop[affectedLayerList[layerIdx]]->getListPic()->end())
    48344842#else
    48354843  // Decrement value of associatedIrapPoc of the TEncGop object
     
    53345342      {
    53355343        Int iLayerId = slice->getVPS()->getPredictedLayerId(dolLayerId, i);
    5336         m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(iLayerId)]->setLayerInitializedFlag(false);
    5337         m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(iLayerId)]->setFirstPicInLayerDecodedFlag(false);
     5344        m_ppcTEncTop[iLayerId]->setLayerInitializedFlag(false);
     5345        m_ppcTEncTop[iLayerId]->setFirstPicInLayerDecodedFlag(false);
    53385346      }
    53395347
    53405348      // Each picture that is in the DPB and has nuh_layer_id equal to dolLayerId is marked as "unused for reference".
    5341       for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(dolLayerId)]->getListPic()->begin(); pic != m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(dolLayerId)]->getListPic()->end(); pic++)
     5349      for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[dolLayerId]->getListPic()->begin(); pic != m_ppcTEncTop[dolLayerId]->getListPic()->end(); pic++)
    53425350      {
    53435351        if ((*pic)->getSlice(0)->getPOC() != slice->getPOC())
     
    53525360      {
    53535361        UInt predLId = slice->getVPS()->getPredictedLayerId(dolLayerId, i);
    5354         for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[predLId]->getListPic()->begin(); pic != m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(predLId)]->getListPic()->end(); pic++)
     5362        for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[predLId]->getListPic()->begin(); pic != m_ppcTEncTop[predLId]->getListPic()->end(); pic++)
    53555363        {
    53565364          if ((*pic)->getSlice(0)->getPOC() != slice->getPOC())
     
    53735381      m_noRaslOutputFlag = true;
    53745382    }
    5375     else if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->getLayerInitializedFlag())
     5383    else if (!m_ppcTEncTop[m_layerId]->getLayerInitializedFlag())
    53765384    {
    53775385      Bool refLayersInitialized = true;
    5378       for (UInt j = 0; j < slice->getVPS()->getNumDirectRefLayers(slice->getVPS()->getLayerIdxInVps(m_layerId)); j++)
     5386      for (UInt j = 0; j < slice->getVPS()->getNumDirectRefLayers(m_layerId); j++)
    53795387      {
    53805388        UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, j);
    5381         if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(refLayerId)]->getLayerInitializedFlag())
     5389        if (!m_ppcTEncTop[refLayerId]->getLayerInitializedFlag())
    53825390        {
    53835391          refLayersInitialized = false;
     
    53985406    if (m_layerId == 0)
    53995407    {
    5400       m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->setLayerInitializedFlag(true);
    5401     }
    5402     else if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->getLayerInitializedFlag() && slice->getVPS()->getNumDirectRefLayers(m_layerId) == 0)
    5403     {
    5404       m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->setLayerInitializedFlag(true);
    5405     }
    5406     else if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->getLayerInitializedFlag())
     5408      m_ppcTEncTop[m_layerId]->setLayerInitializedFlag(true);
     5409    }
     5410    else if (!m_ppcTEncTop[m_layerId]->getLayerInitializedFlag() && slice->getVPS()->getNumDirectRefLayers(m_layerId) == 0)
     5411    {
     5412      m_ppcTEncTop[m_layerId]->setLayerInitializedFlag(true);
     5413    }
     5414    else if (!m_ppcTEncTop[m_layerId]->getLayerInitializedFlag())
    54075415    {
    54085416      Bool refLayersInitialized = true;
     
    54105418      {
    54115419        UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, j);
    5412         if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(refLayerId)]->getLayerInitializedFlag())
     5420        if (!m_ppcTEncTop[refLayerId]->getLayerInitializedFlag())
    54135421        {
    54145422          refLayersInitialized = false;
     
    54175425      if (refLayersInitialized)
    54185426      {
    5419         m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->setLayerInitializedFlag(true);
     5427        m_ppcTEncTop[m_layerId]->setLayerInitializedFlag(true);
    54205428      }
    54215429    }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1048 r1051  
    139139{
    140140#if JCTVC_M0259_LAMBDAREFINEMENT
    141   if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(slice->getLayerId())]->getNumActiveRefLayers() && depth >= 3 && m_pcCfg->getGOPSize() == ( 1 << depth ) )
     141  if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getLayerId()]->getNumActiveRefLayers() && depth >= 3 && m_pcCfg->getGOPSize() == ( 1 << depth ) )
    142142  {
    143143    Int nCurLayerId = slice->getLayerId();
    144     Double gamma = xCalEnhLambdaFactor( m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(nCurLayerId)-1]->getQP() - m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(nCurLayerId)]->getQP() ,
    145       1.0 * m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(nCurLayerId)]->getSourceWidth() * m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(nCurLayerId)]->getSourceHeight()
    146       / m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(nCurLayerId)-1]->getSourceWidth() / m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(nCurLayerId)-1]->getSourceHeight() );
     144    UInt prevLayerId = slice->getVPS()->getLayerIdInNuh(slice->getVPS()->getLayerIdxInVps(nCurLayerId)-1);
     145
     146    Double gamma = xCalEnhLambdaFactor( m_ppcTEncTop[prevLayerId]->getQP() - m_ppcTEncTop[nCurLayerId]->getQP() ,
     147      1.0 * m_ppcTEncTop[nCurLayerId]->getSourceWidth() * m_ppcTEncTop[nCurLayerId]->getSourceHeight()
     148      / m_ppcTEncTop[prevLayerId]->getSourceWidth() / m_ppcTEncTop[prevLayerId]->getSourceHeight() );
    147149    dLambda *= gamma;
    148150  }
     
    163165
    164166#if JCTVC_M0259_LAMBDAREFINEMENT
    165     if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(slice->getLayerId())]->getNumActiveRefLayers() && m_pcCfg->getGOPSize() >= 8 && slice->isIntra() == false && depth == 0 )
     167    if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getLayerId()]->getNumActiveRefLayers() && m_pcCfg->getGOPSize() >= 8 && slice->isIntra() == false && depth == 0 )
    166168    {
    167169      dLambdas[0] = dLambda * 1.1;
     
    555557    if( rpcSlice->getNumILRRefIdx() > 0 )
    556558    {
    557       rpcSlice->setActiveNumILRRefIdx( m_ppcTEncTop[rpcSlice->getVPS()->getLayerIdxInVps(layerId)]->getNumActiveRefLayers() );
     559      rpcSlice->setActiveNumILRRefIdx( m_ppcTEncTop[layerId]->getNumActiveRefLayers() );
    558560      for( Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ )
    559561      {
    560         rpcSlice->setInterLayerPredLayerIdc( m_ppcTEncTop[rpcSlice->getVPS()->getLayerIdxInVps(layerId)]->getPredLayerId(i), i );
     562        rpcSlice->setInterLayerPredLayerIdc( m_ppcTEncTop[layerId]->getPredLayerId(i), i );
    561563      }
    562564      rpcSlice->setInterLayerPredEnabledFlag(1);
    563565    }
    564     rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[rpcSlice->getVPS()->getLayerIdxInVps(layerId)]->getMFMEnabledFlag());
     566    rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[layerId]->getMFMEnabledFlag());
    565567  }
    566568
     
    762764  }
    763765#if O0194_WEIGHTED_PREDICTION_CGS
    764   else if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())]->getInterLayerWeightedPredFlag() )
     766  else if( m_ppcTEncTop[pcSlice->getLayerId()]->getInterLayerWeightedPredFlag() )
    765767  {
    766768    // Calculate for the base layer to be used in EL as Inter layer reference
     
    11351137
    11361138#if SVC_EXTENSION
    1137         m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail);
     1139        m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerId()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail);
    11381140#else
    11391141        m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1048 r1051  
    15331533TEncTop* TEncTop::getRefLayerEnc( UInt refLayerIdx )
    15341534{
    1535   if( m_ppcTEncTop[m_cVPS.getLayerIdxInVps(m_layerId)]->getNumDirectRefLayers() <= 0 )
     1535  if( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() <= 0 )
    15361536  {
    15371537    return (TEncTop *)getLayerEnc( 0 );
    15381538  }
    15391539
    1540   return (TEncTop *)getLayerEnc( m_cVPS.getLayerIdxInVps(m_cVPS.getRefLayerId( m_layerId, refLayerIdx )));
     1540  return (TEncTop *)getLayerEnc( m_cVPS.getRefLayerId( m_layerId, refLayerIdx ) );
    15411541}
    15421542#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h

    r1048 r1051  
    117117  static Int              m_iPPSIdCnt;                    ///< next Id number for PPS   
    118118  TEncTop**               m_ppcTEncTop;
    119   TEncTop*                getLayerEnc(UInt layerIdx)   { return m_ppcTEncTop[layerIdx]; }
     119  TEncTop*                getLayerEnc(UInt layerId)       { return m_ppcTEncTop[layerId]; }
    120120  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
    121121#if REF_IDX_MFM
Note: See TracChangeset for help on using the changeset viewer.