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


Ignore:
Timestamp:
3 Mar 2015, 23:36:18 (10 years ago)
Author:
seregin
Message:

fix the index for m_ppcTEncTop to be layerId

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1044 r1049  
    15451545    for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++)
    15461546    {
    1547       Int layerIdx = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr];
     1547      Int layerId = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr];
    15481548      // Output all picutres "decoded" in that layer that have POC less than the current picture
    1549       std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerIdx))->getConfListPic();
     1549      std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerId))->getConfListPic();
    15501550      // Write all pictures to the file.
    1551       if( this->getDecodedYuvLayerRefresh(layerIdx) )
    1552       {
    1553         m_outputBitDepth[CHANNEL_TYPE_LUMA]   = g_bitDepth[CHANNEL_TYPE_LUMA]   = g_bitDepthLayer[CHANNEL_TYPE_LUMA][layerIdx];
    1554         m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][layerIdx];
     1551      if( this->getDecodedYuvLayerRefresh(layerId) )
     1552      {
     1553        m_outputBitDepth[CHANNEL_TYPE_LUMA]   = g_bitDepth[CHANNEL_TYPE_LUMA]   = g_bitDepthLayer[CHANNEL_TYPE_LUMA][layerId];
     1554        m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][layerId];
    15551555
    15561556        char tempFileName[256];
    1557         strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str());
    1558         m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
    1559         this->setDecodedYuvLayerRefresh( layerIdx, false );
     1557        strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerId ).c_str());
     1558        m_confReconFile[layerId].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
     1559        this->setDecodedYuvLayerRefresh( layerId, false );
    15601560      }
    15611561
     
    15751575        {
    15761576          TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec();
    1577           m_confReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert,
     1577          m_confReconFile[layerId].write( pPicCYuvRec, m_outputColourSpaceConvert,
    15781578            conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    15791579            conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1043 r1049  
    200200  Void          setLayerId (UInt layerId)   { m_layerId = layerId; }
    201201  UInt          getLayerId ()               { return m_layerId; }
    202   UInt          getLayerIdx ()              { return this->getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId); }
    203202  Bool          isSpatialEnhLayer(UInt refLayerIdc)             { return m_bSpatialEnhLayer[refLayerIdc]; }
    204203  Void          setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; }
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1046 r1049  
    10891089  Void   setNuhLayerIdPresentFlag(Bool x)                       { m_nuhLayerIdPresentFlag = x;     }
    10901090
    1091   UInt   getLayerIdInNuh(Int id)                                { return m_layerIdInNuh[id];       }
    1092   Void   setLayerIdInNuh(Int id, UInt x)                        { m_layerIdInNuh[id] = x;          }
     1091  UInt   getLayerIdInNuh(Int layerIdx)                          { return m_layerIdInNuh[id];       }
     1092  Void   setLayerIdInNuh(Int layerIdx, UInt x)                  { m_layerIdInNuh[id] = x;          }
    10931093
    10941094  UInt   getDimensionId(Int lyrId, Int id)                      { return m_dimensionId[lyrId][id]; }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1047 r1049  
    29912991    {
    29922992#if O0225_MAX_TID_FOR_REF_LAYERS
    2993       for( j = i+1; j <= vps->getMaxLayers() - 1; j++)
     2993      for( j = i+1; j < vps->getMaxLayers(); j++)
    29942994      {
    29952995        if(vps->getDirectDependencyFlag(j, i))
     
    30093009    {
    30103010#if O0225_MAX_TID_FOR_REF_LAYERS
    3011       for( j = i+1; j <= vps->getMaxLayers() - 1; j++)
     3011      for( j = i+1; j < vps->getMaxLayers(); j++)
    30123012      {
    30133013        vps->setMaxTidIlRefPicsPlus1(i, j, 7);
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.h

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

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

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

    r1047 r1049  
    483483
    484484#if FIX_NON_OUTPUT_LAYER
    485   if( this->getLayerDec(pcPic->getLayerIdx())->m_isOutputLayerFlag == false )
     485  if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false )
    486486  {
    487487    pcPic->setOutputMark( false );
     
    10961096      resetPocRestrictionCheckParameters();
    10971097#endif
    1098       markAllPicsAsNoCurrAu();
     1098      markAllPicsAsNoCurrAu(m_apcSlicePilot->getVPS());
    10991099#if P0297_VPS_POC_LSB_ALIGNED_FLAG
    11001100      for (UInt i = 0; i < MAX_LAYERS; i++)
    11011101      {
    1102         m_ppcTDecTop[i]->m_pocDecrementedInDPBFlag = false;
     1102        m_ppcTDecTop[m_apcSlicePilot->getVPS()->getLayerIdInNuh(i)]->m_pocDecrementedInDPBFlag = false;
    11031103      }
    11041104#endif
     
    28572857  }
    28582858 
    2859   return (TDecTop *)getLayerDec( vps->getLayerIdxInVps( vps->getRefLayerId( m_layerId, refLayerIdx ) ) );
     2859  return (TDecTop *)getLayerDec( vps->getRefLayerId( m_layerId, refLayerIdx ) );
    28602860}
    28612861#endif
     
    28642864Void TDecTop::setRefLayerParams( TComVPS* vps )
    28652865{
    2866   for(UInt layer = 0; layer < m_numLayer; layer++)
    2867   {
    2868     TDecTop *decTop = (TDecTop *)getLayerDec(layer);
     2866  for(UInt layerIdx = 0; layerIdx < m_numLayer; layerIdx++)
     2867  {
     2868    TDecTop *decTop = (TDecTop *)getLayerDec(vps->getLayerIdInNuh(layerIdx));
    28692869    decTop->setNumSamplePredRefLayers(0);
    28702870    decTop->setNumMotionPredRefLayers(0);
     
    28772877      decTop->setMotionPredRefLayerId(i, 0);
    28782878    }
    2879     for(Int j = 0; j < layer; j++)
    2880     {
    2881       if (vps->getDirectDependencyFlag(layer, j))
    2882       {
    2883         decTop->setRefLayerId(decTop->getNumDirectRefLayers(), vps->getLayerIdInNuh(layer));
     2879    for(Int j = 0; j < layerIdx; j++)
     2880    {
     2881      if (vps->getDirectDependencyFlag(layerIdx, j))
     2882      {
     2883        decTop->setRefLayerId(decTop->getNumDirectRefLayers(), vps->getLayerIdInNuh(layerIdx));
    28842884        decTop->setNumDirectRefLayers(decTop->getNumDirectRefLayers() + 1);
    28852885
    2886         Int samplePredEnabledFlag = (vps->getDirectDependencyType(layer, j) + 1) & 1;
     2886        Int samplePredEnabledFlag = (vps->getDirectDependencyType(layerIdx, j) + 1) & 1;
    28872887        decTop->setSamplePredEnabledFlag(j, samplePredEnabledFlag == 1 ? true : false);
    28882888        decTop->setNumSamplePredRefLayers(decTop->getNumSamplePredRefLayers() + samplePredEnabledFlag);
    28892889
    2890         Int motionPredEnabledFlag = ((vps->getDirectDependencyType(layer, j) + 1) & 2) >> 1;
     2890        Int motionPredEnabledFlag = ((vps->getDirectDependencyType(layerIdx, j) + 1) & 2) >> 1;
    28912891        decTop->setMotionPredEnabledFlag(j, motionPredEnabledFlag == 1 ? true : false);
    28922892        decTop->setNumMotionPredRefLayers(decTop->getNumMotionPredRefLayers() + motionPredEnabledFlag);
     
    31083108    if( vps->getOutputLayerFlag( targetOlsIdx, i ) )
    31093109    {
    3110       this->getLayerDec( vps->getLayerIdxInVps( vps->getLayerSetLayerIdList( targetLsIdx, i ) ) )->m_isOutputLayerFlag = true;
     3110      this->getLayerDec( vps->getLayerSetLayerIdList( targetLsIdx, i ) )->m_isOutputLayerFlag = true;
    31113111    }
    31123112  }
     
    31303130#endif
    31313131#if POC_RESET_IDC_DECODER
    3132 Void TDecTop::markAllPicsAsNoCurrAu()
     3132Void TDecTop::markAllPicsAsNoCurrAu(TComVPS *vps)
    31333133{
    31343134  for(Int i = 0; i < MAX_LAYERS; i++)
    31353135  {
    3136     TComList<TComPic*>* listPic = this->getLayerDec(i)->getListPic();
     3136    TComList<TComPic*>* listPic = this->getLayerDec(vps->getLayerIdInNuh(i))->getListPic();
    31373137    TComList<TComPic*>::iterator  iterPic = listPic->begin();
    31383138    while ( iterPic != listPic->end() )
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r1047 r1049  
    244244  Int       getParseIdc                     ()                              { return m_parseIdc;               }
    245245  Void      setParseIdc                     (Int x)                         { m_parseIdc = x;                  }
    246   Void      markAllPicsAsNoCurrAu();
     246  Void      markAllPicsAsNoCurrAu           (TComVPS *vps);
    247247
    248248  Int       getLastPocPeriodId              ()                              { return m_lastPocPeriodId;        }
     
    258258  TComList<TComPic*>*  getListPic           ()                              { return &m_cListPic;              }
    259259  Void      setLayerDec                     (TDecTop **p)                   { m_ppcTDecTop = p;                }
    260   TDecTop*  getLayerDec                     (UInt layerIdx)                 { return m_ppcTDecTop[layerIdx];   }
     260  TDecTop*  getLayerDec                     (UInt layerId)                  { return m_ppcTDecTop[layerId];    }
    261261#if R0235_SMALLEST_LAYER_ID
    262262  Void      xDeriveSmallestLayerId(TComVPS* vps);
Note: See TracChangeset for help on using the changeset viewer.