source: 3DVCSoftware/branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSlice.cpp @ 166

Last change on this file since 166 was 166, checked in by mitsubishi-htm, 12 years ago

Initial integration of VSP into HTM 4.0.1. The version used for JCT3V-B0102 at Shanghai meeting.

  • VC9 project/solution files updated. Other Visual C++ project/solution files are not updated.
  • Linux make file updated.

TODO

  • A second release is expected to include some bug fix and improvements on the interface, e.g. to move switches from macro definition to the configuration file.
  • A third release is expected after being integrated within HTM 5.x, which is to be used for CE1.h anchor.
  • Property svn:eol-style set to native
File size: 18.5 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license. 
5 *
6 * Copyright (c) 2010-2012, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     TDecSlice.cpp
35    \brief    slice decoder class
36*/
37
38#include "TDecSlice.h"
39
40//! \ingroup TLibDecoder
41//! \{
42
43//////////////////////////////////////////////////////////////////////
44// Construction/Destruction
45//////////////////////////////////////////////////////////////////////
46
47TDecSlice::TDecSlice()
48{
49  m_pcBufferSbacDecoders = NULL;
50  m_pcBufferBinCABACs    = NULL;
51  m_pcBufferLowLatSbacDecoders = NULL;
52  m_pcBufferLowLatBinCABACs    = NULL;
53}
54
55TDecSlice::~TDecSlice()
56{
57}
58
59Void TDecSlice::create( TComSlice* pcSlice, Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
60{
61}
62
63Void TDecSlice::destroy()
64{
65  if ( m_pcBufferSbacDecoders )
66  {
67    delete[] m_pcBufferSbacDecoders;
68    m_pcBufferSbacDecoders = NULL;
69  }
70  if ( m_pcBufferBinCABACs )
71  {
72    delete[] m_pcBufferBinCABACs;
73    m_pcBufferBinCABACs = NULL;
74  }
75  if ( m_pcBufferLowLatSbacDecoders )
76  {
77    delete[] m_pcBufferLowLatSbacDecoders;
78    m_pcBufferLowLatSbacDecoders = NULL;
79  }
80  if ( m_pcBufferLowLatBinCABACs )
81  {
82    delete[] m_pcBufferLowLatBinCABACs;
83    m_pcBufferLowLatBinCABACs = NULL;
84  }
85}
86
87Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)
88{
89  m_pcEntropyDecoder  = pcEntropyDecoder;
90  m_pcCuDecoder       = pcCuDecoder;
91}
92
93Void TDecSlice::decompressSlice(TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders)
94{
95  TComDataCU* pcCU;
96  UInt        uiIsLast = 0;
97  Int   iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getEntropySliceCurStartCUAddr()/rpcPic->getNumPartInCU());
98  Int   iStartCUAddr = rpcPic->getPicSym()->getCUOrderMap(iStartCUEncOrder);
99
100  // decoder don't need prediction & residual frame buffer
101  rpcPic->setPicYuvPred( 0 );
102  rpcPic->setPicYuvResi( 0 );
103 
104#if DEBUGLOGOUT
105  char fname[128];
106  sprintf(fname, "%sV%02d_%05d%s.csv", "DecLog", rpcPic->getSlice(0)->getViewId(), rpcPic->getPOC(), rpcPic->getSlice(0)->getIsDepth() ? "depth":"text");
107  m_pcCuDecoder->m_cDebug.DebugLogFileOpen( fname );
108#endif
109#if ENC_DEC_TRACE
110  g_bJustDoIt = g_bEncDecTraceEnable;
111#endif
112  DTRACE_CABAC_VL( g_nSymbolCounter++ );
113  DTRACE_CABAC_T( "\tPOC: " );
114  DTRACE_CABAC_V( rpcPic->getPOC() );
115  DTRACE_CABAC_T( "\n" );
116
117#if ENC_DEC_TRACE
118  g_bJustDoIt = g_bEncDecTraceDisable;
119#endif
120
121  UInt uiTilesAcross   = rpcPic->getPicSym()->getNumColumnsMinus1()+1;
122  TComSlice*  pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx());
123  UInt iSymbolMode    = pcSlice->getPPS()->getEntropyCodingMode();
124  Int  iNumSubstreams = pcSlice->getPPS()->getNumSubstreams();
125
126  if( iSymbolMode )
127  {
128    m_pcBufferSbacDecoders = new TDecSbac    [uiTilesAcross]; 
129    m_pcBufferBinCABACs    = new TDecBinCABAC[uiTilesAcross];
130    for (UInt ui = 0; ui < uiTilesAcross; ui++)
131    {
132      m_pcBufferSbacDecoders[ui].init(&m_pcBufferBinCABACs[ui]);
133    }
134    //save init. state
135    for (UInt ui = 0; ui < uiTilesAcross; ui++)
136    {
137      m_pcBufferSbacDecoders[ui].load(pcSbacDecoder);
138    }
139  } 
140  if( iSymbolMode )
141  {
142    m_pcBufferLowLatSbacDecoders = new TDecSbac    [uiTilesAcross]; 
143    m_pcBufferLowLatBinCABACs    = new TDecBinCABAC[uiTilesAcross];
144    for (UInt ui = 0; ui < uiTilesAcross; ui++)
145      m_pcBufferLowLatSbacDecoders[ui].init(&m_pcBufferLowLatBinCABACs[ui]);
146    //save init. state
147    for (UInt ui = 0; ui < uiTilesAcross; ui++)
148      m_pcBufferLowLatSbacDecoders[ui].load(pcSbacDecoder);
149  }
150
151  UInt uiWidthInLCUs  = rpcPic->getPicSym()->getFrameWidthInCU();
152  //UInt uiHeightInLCUs = rpcPic->getPicSym()->getFrameHeightInCU();
153  UInt uiCol=0, uiLin=0, uiSubStrm=0;
154
155#if !REMOVE_TILE_DEPENDENCE
156  Int iBreakDep;
157#endif
158  UInt uiTileCol;
159  UInt uiTileStartLCU;
160  UInt uiTileLCUX;
161  UInt uiTileLCUY;
162  UInt uiTileWidth;
163  UInt uiTileHeight;
164  Int iNumSubstreamsPerTile = 1; // if independent.
165
166  for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr = rpcPic->getPicSym()->xCalculateNxtCUAddr(iCUAddr) )
167  {
168    pcCU = rpcPic->getCU( iCUAddr );
169    pcCU->initCU( rpcPic, iCUAddr );
170#if !REMOVE_TILE_DEPENDENCE
171    iBreakDep = rpcPic->getPicSym()->getTileBoundaryIndependenceIdr();
172#endif
173    uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // what column of tiles are we in?
174    uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr();
175    uiTileLCUX = uiTileStartLCU % uiWidthInLCUs;
176    uiTileLCUY = uiTileStartLCU / uiWidthInLCUs;
177    uiTileWidth = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileWidth();
178    uiTileHeight = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getTileHeight();
179    uiCol     = iCUAddr % uiWidthInLCUs;
180    uiLin     = iCUAddr / uiWidthInLCUs;
181    // inherit from TR if necessary, select substream to use.
182#if WPP_SIMPLIFICATION
183    if( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() > 1 )
184#else
185    if( iSymbolMode && pcSlice->getPPS()->getEntropyCodingSynchro() )
186#endif
187    {
188#if !REMOVE_TILE_DEPENDENCE
189#if WPP_SIMPLIFICATION
190      if (iBreakDep && pcSlice->getPPS()->getNumSubstreams() > 1)
191#else
192      if (iBreakDep && pcSlice->getPPS()->getEntropyCodingSynchro())
193#endif
194#else
195#if WPP_SIMPLIFICATION
196      if (pcSlice->getPPS()->getNumSubstreams() > 1)
197#else
198      if (pcSlice->getPPS()->getEntropyCodingSynchro())
199#endif
200#endif
201      {
202        // independent tiles => substreams are "per tile".  iNumSubstreams has already been multiplied.
203        iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles();
204        uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(iCUAddr)*iNumSubstreamsPerTile
205                      + uiLin%iNumSubstreamsPerTile;
206      }
207      else
208      {
209        // dependent tiles => substreams are "per frame".
210        uiSubStrm = uiLin % iNumSubstreams;
211      }
212      m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] );
213      // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.
214#if WPP_SIMPLIFICATION
215      if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX)
216#else
217      if (pcSlice->getPPS()->getEntropyCodingSynchro() && uiCol == uiTileLCUX)
218#endif
219      {
220        // We'll sync if the TR is available.
221        TComDataCU *pcCUUp = pcCU->getCUAbove();
222        UInt uiWidthInCU = rpcPic->getFrameWidthInCU();
223        TComDataCU *pcCUTR = NULL;
224#if WPP_SIMPLIFICATION
225        if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU)  )
226        {
227          pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 );
228        }
229#else
230        if ( pcCUUp && ((iCUAddr%uiWidthInCU+pcSlice->getPPS()->getEntropyCodingSynchro()) < uiWidthInCU)  )
231        {
232          pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + pcSlice->getPPS()->getEntropyCodingSynchro() );
233        }
234#endif
235        UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);
236
237        if ( (true/*bEnforceSliceRestriction*/ &&
238             ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 
239             ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) ||
240#if !REMOVE_TILE_DEPENDENCE
241             (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
242#else
243             ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
244#endif
245             ))||
246             (true/*bEnforceEntropySliceRestriction*/ &&
247             ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 
248             ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr()) ||
249#if !REMOVE_TILE_DEPENDENCE
250             (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
251#else
252             ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))
253#endif
254             ))
255           )
256        {
257          // TR not available.
258        }
259        else
260        {
261          // TR is available, we use it.
262            pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );
263        }
264      }
265      pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]);  //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
266    }
267#if WPP_SIMPLIFICATION
268    else if ( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() <= 1 )
269#else
270    else if ( iSymbolMode && !pcSlice->getPPS()->getEntropyCodingSynchro() )
271#endif
272    {
273      // Set variables to appropriate values to avoid later code change.
274      iNumSubstreamsPerTile = 1;
275    }
276
277    if ( (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) && // 1st in tile.
278         (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())) // !1st in frame && !1st in slice
279    {
280#if WPP_SIMPLIFICATION
281      if (pcSlice->getPPS()->getNumSubstreams() > 1)
282#else
283      if (pcSlice->getPPS()->getEntropyCodingSynchro())
284#endif
285      {
286        // We're crossing into another tile, tiles are independent.
287        // When tiles are independent, we have "substreams per tile".  Each substream has already been terminated, and we no longer
288        // have to perform it here.
289        // For TILES_DECODER, there can be a header at the start of the 1st substream in a tile.  These are read when the substreams
290        // are extracted, not here.
291      }
292      else
293      {
294#if CABAC_INIT_FLAG
295        SliceType sliceType  = pcSlice->getSliceType();
296        if (pcSlice->getCabacInitFlag())
297        {
298          switch (sliceType)
299          {
300          case P_SLICE:           // change initialization table to B_SLICE intialization
301            sliceType = B_SLICE; 
302            break;
303          case B_SLICE:           // change initialization table to P_SLICE intialization
304            sliceType = P_SLICE; 
305            break;
306          default     :           // should not occur
307            assert(0);
308          }
309        }
310        m_pcEntropyDecoder->updateContextTables( sliceType, pcSlice->getSliceQp() );
311#else
312        m_pcEntropyDecoder->updateContextTables( pcSlice->getSliceType(), pcSlice->getSliceQp() );
313#endif
314      }
315     
316      Bool bTileMarkerFoundFlag = false;
317      TComInputBitstream *pcTmpPtr;
318      pcTmpPtr = ppcSubstreams[uiSubStrm]; // for CABAC
319
320      for (UInt uiIdx=0; uiIdx<pcTmpPtr->getTileMarkerLocationCount(); uiIdx++)
321      {
322        if ( pcTmpPtr->getByteLocation() == (pcTmpPtr->getTileMarkerLocation( uiIdx )+2) )
323        {
324          bTileMarkerFoundFlag = true;
325          break;
326        }
327      }
328
329      if (bTileMarkerFoundFlag)
330      {
331        UInt uiTileIdx;
332        // Read tile index
333        m_pcEntropyDecoder->readTileMarker( uiTileIdx, rpcPic->getPicSym()->getBitsUsedByTileIdx() );
334      }
335    }
336
337#if !REMOVE_TILE_DEPENDENCE
338    if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )
339    {   
340      // Synchronize cabac probabilities with LCU among Tiles
341      if( (uiTileLCUX != 0) &&
342          (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) )
343      {       
344        TComDataCU *pcCULeft = pcCU->getCULeft();
345        UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);
346
347        if ( (true/*bEnforceSliceRestriction*/ &&
348              ((pcCULeft==NULL) || (pcCULeft->getSlice()==NULL) || 
349               ((pcCULeft->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) 
350              )
351             )||
352             (true/*bEnforceEntropySliceRestriction*/ &&
353              ((pcCULeft==NULL) || (pcCULeft->getSlice()==NULL) || 
354               ((pcCULeft->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr())
355              )
356             )
357           )
358        {
359          // Left not available.
360        }
361        else
362        {
363          // Left is available, we use it.
364          pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferLowLatSbacDecoders[uiTileCol-1] );
365          pcSbacDecoder->loadContexts(&pcSbacDecoders[uiSubStrm]);  //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)
366        }
367      }
368    }
369#endif
370
371
372#if ENC_DEC_TRACE
373    g_bJustDoIt = g_bEncDecTraceEnable;
374#endif
375#if SAO_UNIT_INTERLEAVING
376    if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() )
377    {
378      pcSlice->getAPS()->getSaoParam()->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
379      if (iCUAddr == iStartCUAddr)
380      {
381        pcSlice->getAPS()->getSaoParam()->bSaoFlag[1] = pcSlice->getSaoEnabledFlagCb();
382        pcSlice->getAPS()->getSaoParam()->bSaoFlag[2] = pcSlice->getSaoEnabledFlagCr();
383      }
384      Int numCuInWidth     = pcSlice->getAPS()->getSaoParam()->numCuInWidth;
385      Int cuAddrInSlice = iCUAddr - pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU();
386      Int cuAddrUpInSlice  = cuAddrInSlice - numCuInWidth;
387      Int rx = iCUAddr % numCuInWidth;
388      Int ry = iCUAddr / numCuInWidth;
389      pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() );
390    }
391#endif
392
393    m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
394    m_pcCuDecoder->decompressCU ( pcCU );
395   
396#if ENC_DEC_TRACE
397    g_bJustDoIt = g_bEncDecTraceDisable;
398#endif
399    if( iSymbolMode )
400    {
401#if OL_FLUSH
402      /*If at the end of a LCU line but not at the end of a substream, perform CABAC flush*/
403#if WPP_SIMPLIFICATION
404      if (!uiIsLast && pcSlice->getPPS()->getNumSubstreams() > 1)
405#else
406      if (!uiIsLast && pcSlice->getPPS()->getCabacIstateReset())
407#endif
408      {
409#if !REMOVE_TILE_DEPENDENCE
410        if ((iBreakDep && (uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight))
411            || (!iBreakDep && (uiCol == uiWidthInLCUs-1) && (uiLin+iNumSubstreams < pcCU->getPic()->getFrameHeightInCU())))
412#else
413        if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight))
414#endif
415        {
416          m_pcEntropyDecoder->decodeFlush();
417        }
418      }
419#endif
420      pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
421
422      //Store probabilities of second LCU in line into buffer
423#if WPP_SIMPLIFICATION
424      if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiCol == uiTileLCUX+1))
425#else
426      if (pcSlice->getPPS()->getEntropyCodingSynchro() && (uiCol == uiTileLCUX+pcSlice->getPPS()->getEntropyCodingSynchro()))
427#endif
428      {
429        m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );
430      }
431
432    }
433#if !REMOVE_TILE_DEPENDENCE
434    if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )
435    {
436      pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
437       //Store probabilties for next tile
438      if( (uiLin == (rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr() / uiWidthInLCUs )) && 
439          (uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU()) )
440      {
441        m_pcBufferLowLatSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );
442      }
443    }
444#endif
445  }
446#if DEBUGLOGOUT
447  m_pcCuDecoder->m_cDebug.DebugLogFileClose();
448#endif
449
450}
451
452ParameterSetManagerDecoder::ParameterSetManagerDecoder()
453: m_spsBuffer(256)
454, m_ppsBuffer(16)
455, m_apsBuffer(64)
456#if VIDYO_VPS_INTEGRATION
457, m_vpsBuffer(16)
458#endif
459{
460
461}
462
463ParameterSetManagerDecoder::~ParameterSetManagerDecoder()
464{
465
466}
467
468#if VIDYO_VPS_INTEGRATION
469TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS  (Int vpsId)
470{
471  if (m_vpsBuffer.getPS(vpsId) != NULL )
472  {
473    return m_vpsBuffer.getPS(vpsId);
474  }
475  else
476  {
477    return getVPS(vpsId);
478  }
479}
480#endif
481
482TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS  (Int spsId)
483{
484  if (m_spsBuffer.getPS(spsId) != NULL )
485  {
486    return m_spsBuffer.getPS(spsId);
487  }
488  else
489  {
490    return getSPS(spsId);
491  }
492}
493
494TComPPS* ParameterSetManagerDecoder::getPrefetchedPPS  (Int ppsId)
495{
496  if (m_ppsBuffer.getPS(ppsId) != NULL )
497  {
498    return m_ppsBuffer.getPS(ppsId);
499  }
500  else
501  {
502    return getPPS(ppsId);
503  }
504}
505
506TComAPS* ParameterSetManagerDecoder::getPrefetchedAPS  (Int apsId)
507{
508  if (m_apsBuffer.getPS(apsId) != NULL )
509  {
510    return m_apsBuffer.getPS(apsId);
511  }
512  else
513  {
514    return getAPS(apsId);
515  }
516}
517
518Void     ParameterSetManagerDecoder::applyPrefetchedPS()
519{
520  m_apsMap.mergePSList(m_apsBuffer);
521  m_ppsMap.mergePSList(m_ppsBuffer);
522  m_spsMap.mergePSList(m_spsBuffer);
523#if VIDYO_VPS_INTEGRATION
524  m_vpsMap.mergePSList(m_vpsBuffer);
525#endif
526}
527
528//! \}
Note: See TracBrowser for help on using the repository browser.