Changeset 1043 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder


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

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

Location:
branches/SHM-dev/source/Lib/TLibDecoder
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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;       }
Note: See TracChangeset for help on using the changeset viewer.