Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecSlice.cpp


Ignore:
Timestamp:
1 Sep 2013, 22:47:26 (11 years ago)
Author:
tech
Message:

Merged DEV-2.0-dev0@604.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r443 r608  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2012, ITU/ISO/IEC
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5555TDecSlice::~TDecSlice()
    5656{
    57 }
    58 
    59 Void TDecSlice::create( TComSlice* pcSlice, Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
     57  for (std::vector<TDecSbac*>::iterator i = CTXMem.begin(); i != CTXMem.end(); i++)
     58  {
     59    delete (*i);
     60  }
     61  CTXMem.clear();
     62}
     63
     64Void TDecSlice::initCtxMem(  UInt i )               
     65{   
     66  for (std::vector<TDecSbac*>::iterator j = CTXMem.begin(); j != CTXMem.end(); j++)
     67  {
     68    delete (*j);
     69  }
     70  CTXMem.clear();
     71  CTXMem.resize(i);
     72}
     73
     74Void TDecSlice::create()
    6075{
    6176}
     
    91106}
    92107
    93 Void TDecSlice::decompressSlice(TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders)
     108Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders)
    94109{
    95110  TComDataCU* pcCU;
    96111  UInt        uiIsLast = 0;
    97   Int   iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getEntropySliceCurStartCUAddr()/rpcPic->getNumPartInCU());
     112  Int   iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr()/rpcPic->getNumPartInCU());
    98113  Int   iStartCUAddr = rpcPic->getPicSym()->getCUOrderMap(iStartCUEncOrder);
    99114
     
    108123  DTRACE_CABAC_T( "\tPOC: " );
    109124  DTRACE_CABAC_V( rpcPic->getPOC() );
     125#if H_MV_ENC_DEC_TRAC
     126  DTRACE_CABAC_T( " Layer: " );
     127  DTRACE_CABAC_V( rpcPic->getLayerId() );
     128#endif
    110129  DTRACE_CABAC_T( "\n" );
    111130
     
    116135  UInt uiTilesAcross   = rpcPic->getPicSym()->getNumColumnsMinus1()+1;
    117136  TComSlice*  pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
    118   UInt iSymbolMode    = pcSlice->getPPS()->getEntropyCodingMode();
    119137  Int  iNumSubstreams = pcSlice->getPPS()->getNumSubstreams();
    120138
    121   if( iSymbolMode )
    122   {
    123     m_pcBufferSbacDecoders = new TDecSbac    [uiTilesAcross]; 
    124     m_pcBufferBinCABACs    = new TDecBinCABAC[uiTilesAcross];
    125     for (UInt ui = 0; ui < uiTilesAcross; ui++)
    126     {
    127       m_pcBufferSbacDecoders[ui].init(&m_pcBufferBinCABACs[ui]);
    128     }
    129     //save init. state
    130     for (UInt ui = 0; ui < uiTilesAcross; ui++)
    131     {
    132       m_pcBufferSbacDecoders[ui].load(pcSbacDecoder);
    133     }
    134   } 
    135   if( iSymbolMode )
    136   {
    137     m_pcBufferLowLatSbacDecoders = new TDecSbac    [uiTilesAcross]; 
    138     m_pcBufferLowLatBinCABACs    = new TDecBinCABAC[uiTilesAcross];
    139     for (UInt ui = 0; ui < uiTilesAcross; ui++)
    140       m_pcBufferLowLatSbacDecoders[ui].init(&m_pcBufferLowLatBinCABACs[ui]);
    141     //save init. state
    142     for (UInt ui = 0; ui < uiTilesAcross; ui++)
    143       m_pcBufferLowLatSbacDecoders[ui].load(pcSbacDecoder);
     139  // delete decoders if already allocated in previous slice
     140  if (m_pcBufferSbacDecoders)
     141  {
     142    delete [] m_pcBufferSbacDecoders;
     143  }
     144  if (m_pcBufferBinCABACs)
     145  {
     146    delete [] m_pcBufferBinCABACs;
     147  }
     148  // allocate new decoders based on tile numbaer
     149  m_pcBufferSbacDecoders = new TDecSbac    [uiTilesAcross]; 
     150  m_pcBufferBinCABACs    = new TDecBinCABAC[uiTilesAcross];
     151  for (UInt ui = 0; ui < uiTilesAcross; ui++)
     152  {
     153    m_pcBufferSbacDecoders[ui].init(&m_pcBufferBinCABACs[ui]);
     154  }
     155  //save init. state
     156  for (UInt ui = 0; ui < uiTilesAcross; ui++)
     157  {
     158    m_pcBufferSbacDecoders[ui].load(pcSbacDecoder);
     159  }
     160
     161  // free memory if already allocated in previous call
     162  if (m_pcBufferLowLatSbacDecoders)
     163  {
     164    delete [] m_pcBufferLowLatSbacDecoders;
     165  }
     166  if (m_pcBufferLowLatBinCABACs)
     167  {
     168    delete [] m_pcBufferLowLatBinCABACs;
     169  }
     170  m_pcBufferLowLatSbacDecoders = new TDecSbac    [uiTilesAcross]; 
     171  m_pcBufferLowLatBinCABACs    = new TDecBinCABAC[uiTilesAcross];
     172  for (UInt ui = 0; ui < uiTilesAcross; ui++)
     173  {
     174    m_pcBufferLowLatSbacDecoders[ui].init(&m_pcBufferLowLatBinCABACs[ui]);
     175  }
     176  //save init. state
     177  for (UInt ui = 0; ui < uiTilesAcross; ui++)
     178  {
     179    m_pcBufferLowLatSbacDecoders[ui].load(pcSbacDecoder);
    144180  }
    145181
     
    151187  UInt uiTileStartLCU;
    152188  UInt uiTileLCUX;
    153   UInt uiTileLCUY;
    154   UInt uiTileWidth;
    155   UInt uiTileHeight;
    156189  Int iNumSubstreamsPerTile = 1; // if independent.
    157 
     190  Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag();
     191  uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr();
     192  if( depSliceSegmentsEnabled )
     193  {
     194    if( (!rpcPic->getSlice(rpcPic->getCurrSliceIdx())->isNextSlice()) &&
     195       iStartCUAddr != rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr())
     196    {
     197      if(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
     198      {
     199        uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1);
     200        m_pcBufferSbacDecoders[uiTileCol].loadContexts( CTXMem[1]  );//2.LCU
     201        if ( (iStartCUAddr%uiWidthInLCUs+1) >= uiWidthInLCUs  )
     202        {
     203          uiTileLCUX = uiTileStartLCU % uiWidthInLCUs;
     204          uiCol     = iStartCUAddr % uiWidthInLCUs;
     205          if(uiCol==uiTileLCUX)
     206          {
     207            CTXMem[0]->loadContexts(pcSbacDecoder);
     208          }
     209        }
     210      }
     211      pcSbacDecoder->loadContexts(CTXMem[0] ); //end of depSlice-1
     212      pcSbacDecoders[uiSubStrm].loadContexts(pcSbacDecoder);
     213    }
     214    else
     215    {
     216      if(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
     217      {
     218        CTXMem[1]->loadContexts(pcSbacDecoder);
     219      }
     220      CTXMem[0]->loadContexts(pcSbacDecoder);
     221    }
     222  }
    158223  for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr = rpcPic->getPicSym()->xCalculateNxtCUAddr(iCUAddr) )
    159224  {
     
    163228    uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr();
    164229    uiTileLCUX = uiTileStartLCU % uiWidthInLCUs;
    165     uiTileLCUY = uiTileStartLCU / uiWidthInLCUs;
    166     uiTileWidth = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileWidth();
    167     uiTileHeight = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileHeight();
    168230    uiCol     = iCUAddr % uiWidthInLCUs;
    169     uiLin     = iCUAddr / uiWidthInLCUs;
     231    // The 'line' is now relative to the 1st line in the slice, not the 1st line in the picture.
     232    uiLin     = (iCUAddr/uiWidthInLCUs)-(iStartCUAddr/uiWidthInLCUs);
    170233    // inherit from TR if necessary, select substream to use.
    171     if( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() > 1 )
    172     {
    173       if (pcSlice->getPPS()->getNumSubstreams() > 1)
    174       {
    175         // independent tiles => substreams are "per tile".  iNumSubstreams has already been multiplied.
    176         iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles();
    177         uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(iCUAddr)*iNumSubstreamsPerTile
    178                       + uiLin%iNumSubstreamsPerTile;
    179       }
    180       else
    181       {
    182         // dependent tiles => substreams are "per frame".
    183         uiSubStrm = uiLin % iNumSubstreams;
    184       }
     234    if( (pcSlice->getPPS()->getNumSubstreams() > 1) || ( depSliceSegmentsEnabled  && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) ))
     235    {
     236      // independent tiles => substreams are "per tile".  iNumSubstreams has already been multiplied.
     237      iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles();
     238      uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(iCUAddr)*iNumSubstreamsPerTile
     239                  + uiLin%iNumSubstreamsPerTile;
    185240      m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] );
    186241      // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.
    187       if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX)
     242      if (((pcSlice->getPPS()->getNumSubstreams() > 1) || depSliceSegmentsEnabled ) && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()))
    188243      {
    189244        // We'll sync if the TR is available.
     
    201256             ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) ||
    202257             ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
    203              ))||
    204              (true/*bEnforceEntropySliceRestriction*/ &&
    205              ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) ||
    206              ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr()) ||
    207              ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
    208258             ))
    209259           )
     
    214264        {
    215265          // TR is available, we use it.
    216             pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );
     266          pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );
    217267        }
    218268      }
    219269      pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]);  //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
    220270    }
    221     else if ( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() <= 1 )
     271    else if ( pcSlice->getPPS()->getNumSubstreams() <= 1 )
    222272    {
    223273      // Set variables to appropriate values to avoid later code change.
     
    226276
    227277    if ( (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) && // 1st in tile.
    228          (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())) // !1st in frame && !1st in slice
     278         (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())
     279         && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr())/rpcPic->getNumPartInCU())
     280         ) // !1st in frame && !1st in slice
    229281    {
    230282      if (pcSlice->getPPS()->getNumSubstreams() > 1)
     
    238290      else
    239291      {
    240 #if CABAC_INIT_FLAG
    241292        SliceType sliceType  = pcSlice->getSliceType();
    242293        if (pcSlice->getCabacInitFlag())
     
    255306        }
    256307        m_pcEntropyDecoder->updateContextTables( sliceType, pcSlice->getSliceQp() );
    257 #else
    258         m_pcEntropyDecoder->updateContextTables( pcSlice->getSliceType(), pcSlice->getSliceQp() );
    259 #endif
    260308      }
    261309     
    262       Bool bTileMarkerFoundFlag = false;
    263       TComInputBitstream *pcTmpPtr;
    264       pcTmpPtr = ppcSubstreams[uiSubStrm]; // for CABAC
    265 
    266       for (UInt uiIdx=0; uiIdx<pcTmpPtr->getTileMarkerLocationCount(); uiIdx++)
    267       {
    268         if ( pcTmpPtr->getByteLocation() == (pcTmpPtr->getTileMarkerLocation( uiIdx )+2) )
    269         {
    270           bTileMarkerFoundFlag = true;
    271           break;
    272         }
    273       }
    274 
    275       if (bTileMarkerFoundFlag)
    276       {
    277         UInt uiTileIdx;
    278         // Read tile index
    279         m_pcEntropyDecoder->readTileMarker( uiTileIdx, rpcPic->getPicSym()->getBitsUsedByTileIdx() );
    280       }
    281     }
    282 
    283 
     310    }
    284311
    285312#if ENC_DEC_TRACE
    286313    g_bJustDoIt = g_bEncDecTraceEnable;
    287314#endif
    288 #if LGE_SAO_MIGRATION_D0091
    289315    if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) )
    290316    {
    291         SAOParam *saoParam =  pcSlice->getAPS()->getSaoParam();
    292         saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
    293     if (iCUAddr == iStartCUAddr)
    294     {
     317      SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam();
     318      saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
     319      if (iCUAddr == iStartCUAddr)
     320      {
    295321        saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
    296     }
    297     Int numCuInWidth     = saoParam->numCuInWidth;
    298     Int cuAddrInSlice = iCUAddr - rpcPic->getPicSym()->getCUOrderMap(pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU());
    299     Int cuAddrUpInSlice  = cuAddrInSlice - numCuInWidth;
    300     Int rx = iCUAddr % numCuInWidth;
    301     Int ry = iCUAddr / numCuInWidth;
    302     Int allowMergeLeft = 1;
    303     Int allowMergeUp   = 1;
    304     if (rx!=0)
    305     {
    306         if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-1) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
    307         {
    308             allowMergeLeft = 0;
    309         }
    310     }
    311     if (ry!=0)
    312     {
    313         if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-numCuInWidth) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
    314         {
    315         allowMergeUp = 0;
    316         }
    317     }
    318     pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp);
    319     }
    320 #else
    321     if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() )
    322     {
    323       pcSlice->getAPS()->getSaoParam()->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
    324       if (iCUAddr == iStartCUAddr)
    325       {
    326         pcSlice->getAPS()->getSaoParam()->bSaoFlag[1] = pcSlice->getSaoEnabledFlagCb();
    327         pcSlice->getAPS()->getSaoParam()->bSaoFlag[2] = pcSlice->getSaoEnabledFlagCr();
    328       }
    329       Int numCuInWidth     = pcSlice->getAPS()->getSaoParam()->numCuInWidth;
    330       Int cuAddrInSlice = iCUAddr - pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU();
     322      }
     323      Int numCuInWidth     = saoParam->numCuInWidth;
     324      Int cuAddrInSlice = iCUAddr - rpcPic->getPicSym()->getCUOrderMap(pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU());
    331325      Int cuAddrUpInSlice  = cuAddrInSlice - numCuInWidth;
    332326      Int rx = iCUAddr % numCuInWidth;
    333327      Int ry = iCUAddr / numCuInWidth;
    334       pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() );
    335     }
    336 #endif
    337 
     328      Int allowMergeLeft = 1;
     329      Int allowMergeUp   = 1;
     330      if (rx!=0)
     331      {
     332        if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-1) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
     333        {
     334          allowMergeLeft = 0;
     335        }
     336      }
     337      if (ry!=0)
     338      {
     339        if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-numCuInWidth) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
     340        {
     341          allowMergeUp = 0;
     342        }
     343      }
     344      pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp);
     345    }
     346    else if ( pcSlice->getSPS()->getUseSAO() )
     347    {
     348      Int addr = pcCU->getAddr();
     349      SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam();
     350      for (Int cIdx=0; cIdx<3; cIdx++)
     351      {
     352        SaoLcuParam *saoLcuParam = &(saoParam->saoLcuParam[cIdx][addr]);
     353        if ( ((cIdx == 0) && !pcSlice->getSaoEnabledFlag()) || ((cIdx == 1 || cIdx == 2) && !pcSlice->getSaoEnabledFlagChroma()))
     354        {
     355          saoLcuParam->mergeUpFlag   = 0;
     356          saoLcuParam->mergeLeftFlag = 0;
     357          saoLcuParam->subTypeIdx    = 0;
     358          saoLcuParam->typeIdx       = -1;
     359          saoLcuParam->offset[0]     = 0;
     360          saoLcuParam->offset[1]     = 0;
     361          saoLcuParam->offset[2]     = 0;
     362          saoLcuParam->offset[3]     = 0;
     363        }
     364      }
     365    }
    338366    m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
    339367    m_pcCuDecoder->decompressCU ( pcCU );
     
    342370    g_bJustDoIt = g_bEncDecTraceDisable;
    343371#endif
    344     if( iSymbolMode )
    345     {
    346       /*If at the end of a LCU line but not at the end of a substream, perform CABAC flush*/
    347       if (!uiIsLast && pcSlice->getPPS()->getNumSubstreams() > 1)
    348       {
    349         if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight))
    350         {
    351           m_pcEntropyDecoder->decodeFlush();
    352         }
    353       }
    354       pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
    355 
    356       //Store probabilities of second LCU in line into buffer
    357       if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiCol == uiTileLCUX+1))
    358       {
    359         m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );
    360       }
    361 
    362     }
    363   }
    364 
     372    pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
     373
     374    if ( uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU()
     375        && pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()
     376        && !uiIsLast )
     377    {
     378      // Parse end_of_substream_one_bit for WPP case
     379      UInt binVal;
     380      pcSbacDecoder->parseTerminatingBit( binVal );
     381      assert( binVal );
     382    }
     383
     384    //Store probabilities of second LCU in line into buffer
     385    if ( (uiCol == uiTileLCUX+1)&& (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) )
     386    {
     387      m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );
     388    }
     389    if( uiIsLast && depSliceSegmentsEnabled )
     390    {
     391      if (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
     392       {
     393         CTXMem[1]->loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );//ctx 2.LCU
     394       }
     395      CTXMem[0]->loadContexts( pcSbacDecoder );//ctx end of dep.slice
     396      return;
     397    }
     398  }
    365399}
    366400
    367401ParameterSetManagerDecoder::ParameterSetManagerDecoder()
    368 : m_spsBuffer(256)
    369 , m_ppsBuffer(16)
    370 , m_apsBuffer(64)
    371 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    372 , m_vpsBuffer(16)
    373 #endif
    374 {
    375 
     402: m_vpsBuffer(MAX_NUM_VPS)
     403, m_spsBuffer(MAX_NUM_SPS)
     404, m_ppsBuffer(MAX_NUM_PPS)
     405{
    376406}
    377407
     
    381411}
    382412
    383 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    384413TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS  (Int vpsId)
    385414{
     
    393422  }
    394423}
    395 #endif
     424
    396425
    397426TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS  (Int spsId)
     
    419448}
    420449
    421 TComAPS* ParameterSetManagerDecoder::getPrefetchedAPS  (Int apsId)
    422 {
    423   if (m_apsBuffer.getPS(apsId) != NULL )
    424   {
    425     return m_apsBuffer.getPS(apsId);
    426   }
    427   else
    428   {
    429     return getAPS(apsId);
    430   }
    431 }
    432 
    433450Void     ParameterSetManagerDecoder::applyPrefetchedPS()
    434451{
    435   m_apsMap.mergePSList(m_apsBuffer);
     452  m_vpsMap.mergePSList(m_vpsBuffer);
    436453  m_ppsMap.mergePSList(m_ppsBuffer);
    437454  m_spsMap.mergePSList(m_spsBuffer);
    438 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    439   m_vpsMap.mergePSList(m_vpsBuffer);
    440 #endif
    441455}
    442456
Note: See TracChangeset for help on using the changeset viewer.