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-2014, 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 | |
---|
47 | TDecSlice::TDecSlice() |
---|
48 | { |
---|
49 | m_pcBufferSbacDecoders = NULL; |
---|
50 | m_pcBufferBinCABACs = NULL; |
---|
51 | m_pcBufferLowLatSbacDecoders = NULL; |
---|
52 | m_pcBufferLowLatBinCABACs = NULL; |
---|
53 | } |
---|
54 | |
---|
55 | TDecSlice::~TDecSlice() |
---|
56 | { |
---|
57 | for (std::vector<TDecSbac*>::iterator i = CTXMem.begin(); i != CTXMem.end(); i++) |
---|
58 | { |
---|
59 | delete (*i); |
---|
60 | } |
---|
61 | CTXMem.clear(); |
---|
62 | } |
---|
63 | |
---|
64 | Void 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 | |
---|
74 | Void TDecSlice::create() |
---|
75 | { |
---|
76 | } |
---|
77 | |
---|
78 | Void TDecSlice::destroy() |
---|
79 | { |
---|
80 | if ( m_pcBufferSbacDecoders ) |
---|
81 | { |
---|
82 | delete[] m_pcBufferSbacDecoders; |
---|
83 | m_pcBufferSbacDecoders = NULL; |
---|
84 | } |
---|
85 | if ( m_pcBufferBinCABACs ) |
---|
86 | { |
---|
87 | delete[] m_pcBufferBinCABACs; |
---|
88 | m_pcBufferBinCABACs = NULL; |
---|
89 | } |
---|
90 | if ( m_pcBufferLowLatSbacDecoders ) |
---|
91 | { |
---|
92 | delete[] m_pcBufferLowLatSbacDecoders; |
---|
93 | m_pcBufferLowLatSbacDecoders = NULL; |
---|
94 | } |
---|
95 | if ( m_pcBufferLowLatBinCABACs ) |
---|
96 | { |
---|
97 | delete[] m_pcBufferLowLatBinCABACs; |
---|
98 | m_pcBufferLowLatBinCABACs = NULL; |
---|
99 | } |
---|
100 | } |
---|
101 | |
---|
102 | Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder) |
---|
103 | { |
---|
104 | m_pcEntropyDecoder = pcEntropyDecoder; |
---|
105 | m_pcCuDecoder = pcCuDecoder; |
---|
106 | } |
---|
107 | |
---|
108 | Void TDecSlice::decompressSlice(TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders) |
---|
109 | { |
---|
110 | TComDataCU* pcCU; |
---|
111 | UInt uiIsLast = 0; |
---|
112 | Int iStartCUEncOrder = max(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU(), rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr()/rpcPic->getNumPartInCU()); |
---|
113 | Int iStartCUAddr = rpcPic->getPicSym()->getCUOrderMap(iStartCUEncOrder); |
---|
114 | |
---|
115 | // decoder don't need prediction & residual frame buffer |
---|
116 | rpcPic->setPicYuvPred( 0 ); |
---|
117 | rpcPic->setPicYuvResi( 0 ); |
---|
118 | |
---|
119 | #if ENC_DEC_TRACE |
---|
120 | g_bJustDoIt = g_bEncDecTraceEnable; |
---|
121 | #endif |
---|
122 | DTRACE_CABAC_VL( g_nSymbolCounter++ ); |
---|
123 | DTRACE_CABAC_T( "\tPOC: " ); |
---|
124 | 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 |
---|
129 | DTRACE_CABAC_T( "\n" ); |
---|
130 | |
---|
131 | #if ENC_DEC_TRACE |
---|
132 | g_bJustDoIt = g_bEncDecTraceDisable; |
---|
133 | #endif |
---|
134 | |
---|
135 | UInt uiTilesAcross = rpcPic->getPicSym()->getNumColumnsMinus1()+1; |
---|
136 | TComSlice* pcSlice = rpcPic->getSlice(rpcPic->getCurrSliceIdx()); |
---|
137 | Int iNumSubstreams = pcSlice->getPPS()->getNumSubstreams(); |
---|
138 | |
---|
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); |
---|
180 | } |
---|
181 | |
---|
182 | UInt uiWidthInLCUs = rpcPic->getPicSym()->getFrameWidthInCU(); |
---|
183 | //UInt uiHeightInLCUs = rpcPic->getPicSym()->getFrameHeightInCU(); |
---|
184 | UInt uiCol=0, uiLin=0, uiSubStrm=0; |
---|
185 | |
---|
186 | UInt uiTileCol; |
---|
187 | UInt uiTileStartLCU; |
---|
188 | UInt uiTileLCUX; |
---|
189 | Int iNumSubstreamsPerTile = 1; // if independent. |
---|
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 | } |
---|
223 | for( Int iCUAddr = iStartCUAddr; !uiIsLast && iCUAddr < rpcPic->getNumCUsInFrame(); iCUAddr = rpcPic->getPicSym()->xCalculateNxtCUAddr(iCUAddr) ) |
---|
224 | { |
---|
225 | pcCU = rpcPic->getCU( iCUAddr ); |
---|
226 | pcCU->initCU( rpcPic, iCUAddr ); |
---|
227 | uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // what column of tiles are we in? |
---|
228 | uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr(); |
---|
229 | uiTileLCUX = uiTileStartLCU % uiWidthInLCUs; |
---|
230 | uiCol = 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); |
---|
233 | // inherit from TR if necessary, select substream to use. |
---|
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; |
---|
240 | m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] ); |
---|
241 | // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line. |
---|
242 | if (((pcSlice->getPPS()->getNumSubstreams() > 1) || depSliceSegmentsEnabled ) && (uiCol == uiTileLCUX)&&(pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())) |
---|
243 | { |
---|
244 | // We'll sync if the TR is available. |
---|
245 | TComDataCU *pcCUUp = pcCU->getCUAbove(); |
---|
246 | UInt uiWidthInCU = rpcPic->getFrameWidthInCU(); |
---|
247 | TComDataCU *pcCUTR = NULL; |
---|
248 | if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU) ) |
---|
249 | { |
---|
250 | pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 ); |
---|
251 | } |
---|
252 | UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1); |
---|
253 | |
---|
254 | if ( (true/*bEnforceSliceRestriction*/ && |
---|
255 | ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || |
---|
256 | ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) || |
---|
257 | ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))) |
---|
258 | )) |
---|
259 | ) |
---|
260 | { |
---|
261 | // TR not available. |
---|
262 | } |
---|
263 | else |
---|
264 | { |
---|
265 | // TR is available, we use it. |
---|
266 | pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferSbacDecoders[uiTileCol] ); |
---|
267 | } |
---|
268 | } |
---|
269 | pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders) |
---|
270 | } |
---|
271 | else if ( pcSlice->getPPS()->getNumSubstreams() <= 1 ) |
---|
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()) |
---|
279 | && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceSegmentCurStartCUAddr())/rpcPic->getNumPartInCU()) |
---|
280 | ) // !1st in frame && !1st in slice |
---|
281 | { |
---|
282 | if (pcSlice->getPPS()->getNumSubstreams() > 1) |
---|
283 | { |
---|
284 | // We're crossing into another tile, tiles are independent. |
---|
285 | // When tiles are independent, we have "substreams per tile". Each substream has already been terminated, and we no longer |
---|
286 | // have to perform it here. |
---|
287 | // For TILES_DECODER, there can be a header at the start of the 1st substream in a tile. These are read when the substreams |
---|
288 | // are extracted, not here. |
---|
289 | } |
---|
290 | else |
---|
291 | { |
---|
292 | SliceType sliceType = pcSlice->getSliceType(); |
---|
293 | if (pcSlice->getCabacInitFlag()) |
---|
294 | { |
---|
295 | switch (sliceType) |
---|
296 | { |
---|
297 | case P_SLICE: // change initialization table to B_SLICE intialization |
---|
298 | sliceType = B_SLICE; |
---|
299 | break; |
---|
300 | case B_SLICE: // change initialization table to P_SLICE intialization |
---|
301 | sliceType = P_SLICE; |
---|
302 | break; |
---|
303 | default : // should not occur |
---|
304 | assert(0); |
---|
305 | } |
---|
306 | } |
---|
307 | m_pcEntropyDecoder->updateContextTables( sliceType, pcSlice->getSliceQp() ); |
---|
308 | } |
---|
309 | |
---|
310 | } |
---|
311 | |
---|
312 | #if ENC_DEC_TRACE |
---|
313 | g_bJustDoIt = g_bEncDecTraceEnable; |
---|
314 | #endif |
---|
315 | |
---|
316 | if ( pcSlice->getSPS()->getUseSAO() ) |
---|
317 | { |
---|
318 | SAOBlkParam& saoblkParam = (rpcPic->getPicSym()->getSAOBlkParam())[iCUAddr]; |
---|
319 | if (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) |
---|
320 | { |
---|
321 | Bool sliceEnabled[NUM_SAO_COMPONENTS]; |
---|
322 | sliceEnabled[SAO_Y] = pcSlice->getSaoEnabledFlag(); |
---|
323 | sliceEnabled[SAO_Cb]= sliceEnabled[SAO_Cr]= pcSlice->getSaoEnabledFlagChroma(); |
---|
324 | |
---|
325 | Bool leftMergeAvail = false; |
---|
326 | Bool aboveMergeAvail= false; |
---|
327 | |
---|
328 | //merge left condition |
---|
329 | Int rx = (iCUAddr % uiWidthInLCUs); |
---|
330 | if(rx > 0) |
---|
331 | { |
---|
332 | leftMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-1); |
---|
333 | } |
---|
334 | //merge up condition |
---|
335 | Int ry = (iCUAddr / uiWidthInLCUs); |
---|
336 | if(ry > 0) |
---|
337 | { |
---|
338 | aboveMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-uiWidthInLCUs); |
---|
339 | } |
---|
340 | |
---|
341 | pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); |
---|
342 | } |
---|
343 | else |
---|
344 | { |
---|
345 | saoblkParam[SAO_Y ].modeIdc = SAO_MODE_OFF; |
---|
346 | saoblkParam[SAO_Cb].modeIdc = SAO_MODE_OFF; |
---|
347 | saoblkParam[SAO_Cr].modeIdc = SAO_MODE_OFF; |
---|
348 | } |
---|
349 | } |
---|
350 | m_pcCuDecoder->decodeCU ( pcCU, uiIsLast ); |
---|
351 | m_pcCuDecoder->decompressCU ( pcCU ); |
---|
352 | |
---|
353 | #if ENC_DEC_TRACE |
---|
354 | g_bJustDoIt = g_bEncDecTraceDisable; |
---|
355 | #endif |
---|
356 | pcSbacDecoders[uiSubStrm].load(pcSbacDecoder); |
---|
357 | |
---|
358 | if ( uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU() |
---|
359 | && pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() |
---|
360 | && !uiIsLast ) |
---|
361 | { |
---|
362 | // Parse end_of_substream_one_bit for WPP case |
---|
363 | UInt binVal; |
---|
364 | pcSbacDecoder->parseTerminatingBit( binVal ); |
---|
365 | assert( binVal ); |
---|
366 | } |
---|
367 | |
---|
368 | //Store probabilities of second LCU in line into buffer |
---|
369 | if ( (uiCol == uiTileLCUX+1)&& (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) ) |
---|
370 | { |
---|
371 | m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] ); |
---|
372 | } |
---|
373 | if( uiIsLast && depSliceSegmentsEnabled ) |
---|
374 | { |
---|
375 | if (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) |
---|
376 | { |
---|
377 | CTXMem[1]->loadContexts( &m_pcBufferSbacDecoders[uiTileCol] );//ctx 2.LCU |
---|
378 | } |
---|
379 | CTXMem[0]->loadContexts( pcSbacDecoder );//ctx end of dep.slice |
---|
380 | return; |
---|
381 | } |
---|
382 | } |
---|
383 | } |
---|
384 | |
---|
385 | ParameterSetManagerDecoder::ParameterSetManagerDecoder() |
---|
386 | : m_vpsBuffer(MAX_NUM_VPS) |
---|
387 | , m_spsBuffer(MAX_NUM_SPS) |
---|
388 | , m_ppsBuffer(MAX_NUM_PPS) |
---|
389 | { |
---|
390 | } |
---|
391 | |
---|
392 | ParameterSetManagerDecoder::~ParameterSetManagerDecoder() |
---|
393 | { |
---|
394 | |
---|
395 | } |
---|
396 | |
---|
397 | TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS (Int vpsId) |
---|
398 | { |
---|
399 | if (m_vpsBuffer.getPS(vpsId) != NULL ) |
---|
400 | { |
---|
401 | return m_vpsBuffer.getPS(vpsId); |
---|
402 | } |
---|
403 | else |
---|
404 | { |
---|
405 | return getVPS(vpsId); |
---|
406 | } |
---|
407 | } |
---|
408 | |
---|
409 | |
---|
410 | TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS (Int spsId) |
---|
411 | { |
---|
412 | if (m_spsBuffer.getPS(spsId) != NULL ) |
---|
413 | { |
---|
414 | return m_spsBuffer.getPS(spsId); |
---|
415 | } |
---|
416 | else |
---|
417 | { |
---|
418 | return getSPS(spsId); |
---|
419 | } |
---|
420 | } |
---|
421 | |
---|
422 | TComPPS* ParameterSetManagerDecoder::getPrefetchedPPS (Int ppsId) |
---|
423 | { |
---|
424 | if (m_ppsBuffer.getPS(ppsId) != NULL ) |
---|
425 | { |
---|
426 | return m_ppsBuffer.getPS(ppsId); |
---|
427 | } |
---|
428 | else |
---|
429 | { |
---|
430 | return getPPS(ppsId); |
---|
431 | } |
---|
432 | } |
---|
433 | |
---|
434 | Void ParameterSetManagerDecoder::applyPrefetchedPS() |
---|
435 | { |
---|
436 | m_vpsMap.mergePSList(m_vpsBuffer); |
---|
437 | m_ppsMap.mergePSList(m_ppsBuffer); |
---|
438 | m_spsMap.mergePSList(m_spsBuffer); |
---|
439 | } |
---|
440 | |
---|
441 | //! \} |
---|