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-2016, 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 TComPic.cpp |
---|
35 | \brief picture class |
---|
36 | */ |
---|
37 | |
---|
38 | #include "TComPic.h" |
---|
39 | #include "SEI.h" |
---|
40 | |
---|
41 | //! \ingroup TLibCommon |
---|
42 | //! \{ |
---|
43 | |
---|
44 | // ==================================================================================================================== |
---|
45 | // Constructor / destructor / create / destroy |
---|
46 | // ==================================================================================================================== |
---|
47 | |
---|
48 | TComPic::TComPic() |
---|
49 | : m_uiTLayer (0) |
---|
50 | , m_bUsedByCurr (false) |
---|
51 | , m_bIsLongTerm (false) |
---|
52 | , m_pcPicYuvPred (NULL) |
---|
53 | , m_pcPicYuvResi (NULL) |
---|
54 | , m_bReconstructed (false) |
---|
55 | , m_bNeededForOutput (false) |
---|
56 | , m_uiCurrSliceIdx (0) |
---|
57 | , m_bCheckLTMSB (false) |
---|
58 | #if NH_MV |
---|
59 | , m_layerId (0) |
---|
60 | , m_viewId (0) |
---|
61 | , m_bPicOutputFlag (false) |
---|
62 | #if NH_3D_VSO || NH_3D |
---|
63 | , m_viewIndex (0) |
---|
64 | , m_isDepth (false) |
---|
65 | , m_aaiCodedScale (0) |
---|
66 | , m_aaiCodedOffset (0) |
---|
67 | #endif |
---|
68 | #endif |
---|
69 | |
---|
70 | { |
---|
71 | for(UInt i=0; i<NUM_PIC_YUV; i++) |
---|
72 | { |
---|
73 | m_apcPicYuv[i] = NULL; |
---|
74 | } |
---|
75 | #if NH_3D_QTLPC |
---|
76 | m_bReduceBitsQTL = 0; |
---|
77 | #endif |
---|
78 | #if NH_3D_NBDV |
---|
79 | m_iNumDdvCandPics = 0; |
---|
80 | m_eRapRefList = REF_PIC_LIST_0; |
---|
81 | m_uiRapRefIdx = 0; |
---|
82 | #endif |
---|
83 | #if NH_MV |
---|
84 | m_isPocResettingPic = false; |
---|
85 | m_hasGeneratedRefPics = false; |
---|
86 | m_isFstPicOfAllLayOfPocResetPer = false; |
---|
87 | m_decodingOrder = 0; |
---|
88 | m_noRaslOutputFlag = false; |
---|
89 | m_noClrasOutputFlag = false; |
---|
90 | m_picLatencyCount = 0; |
---|
91 | m_isGenerated = false; |
---|
92 | m_isGeneratedCl833 = false; |
---|
93 | m_activatesNewVps = false; |
---|
94 | #endif |
---|
95 | } |
---|
96 | |
---|
97 | TComPic::~TComPic() |
---|
98 | { |
---|
99 | destroy(); |
---|
100 | } |
---|
101 | |
---|
102 | Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual) |
---|
103 | { |
---|
104 | destroy(); |
---|
105 | |
---|
106 | const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); |
---|
107 | const Int iWidth = sps.getPicWidthInLumaSamples(); |
---|
108 | const Int iHeight = sps.getPicHeightInLumaSamples(); |
---|
109 | const UInt uiMaxCuWidth = sps.getMaxCUWidth(); |
---|
110 | const UInt uiMaxCuHeight = sps.getMaxCUHeight(); |
---|
111 | const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); |
---|
112 | |
---|
113 | m_picSym.create( sps, pps, uiMaxDepth ); |
---|
114 | if (!bIsVirtual) |
---|
115 | { |
---|
116 | m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); |
---|
117 | m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); |
---|
118 | } |
---|
119 | m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); |
---|
120 | |
---|
121 | // there are no SEI messages associated with this picture initially |
---|
122 | if (m_SEIs.size() > 0) |
---|
123 | { |
---|
124 | deleteSEIs (m_SEIs); |
---|
125 | } |
---|
126 | m_bUsedByCurr = false; |
---|
127 | |
---|
128 | #if H_3D_FCO |
---|
129 | /* initialize the texture to depth reference status */ |
---|
130 | for (int j=0; j<2; j++) |
---|
131 | { |
---|
132 | for (int i=0; i<MAX_NUM_REF; i++) |
---|
133 | { |
---|
134 | m_aiTexToDepRef[j][i] = -1; |
---|
135 | } |
---|
136 | } |
---|
137 | #endif |
---|
138 | |
---|
139 | } |
---|
140 | |
---|
141 | Void TComPic::destroy() |
---|
142 | { |
---|
143 | m_picSym.destroy(); |
---|
144 | |
---|
145 | for(UInt i=0; i<NUM_PIC_YUV; i++) |
---|
146 | { |
---|
147 | if (m_apcPicYuv[i]) |
---|
148 | { |
---|
149 | m_apcPicYuv[i]->destroy(); |
---|
150 | delete m_apcPicYuv[i]; |
---|
151 | m_apcPicYuv[i] = NULL; |
---|
152 | } |
---|
153 | } |
---|
154 | |
---|
155 | deleteSEIs(m_SEIs); |
---|
156 | } |
---|
157 | #if NH_3D |
---|
158 | #if NH_3D_ARP |
---|
159 | Void TComPic::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ) |
---|
160 | { |
---|
161 | Int iMaxCUWidth = (Int) ( getPicSym()->getSPS().getMaxCUWidth() ); |
---|
162 | Int iMaxCuHeight = (Int) ( getPicSym()->getSPS().getMaxCUHeight() ); |
---|
163 | |
---|
164 | UInt uiMaxTotalCUDepth = getPicSym()->getSPS().getMaxTotalCUDepth(); |
---|
165 | Int iBaseUnitWidth = iMaxCUWidth >> uiMaxTotalCUDepth; |
---|
166 | Int iBaseUnitHeight = iMaxCUWidth >> uiMaxTotalCUDepth; |
---|
167 | |
---|
168 | Int iNumCuInWidth = getPicYuvRec()->getWidth(COMPONENT_Y) / iMaxCUWidth; |
---|
169 | iNumCuInWidth += ( getPicYuvRec()->getWidth(COMPONENT_Y) % iMaxCUWidth ) ? 1 : 0; |
---|
170 | |
---|
171 | |
---|
172 | Int iCuX = iX / iMaxCUWidth; |
---|
173 | Int iCuY = iY / iMaxCuHeight; |
---|
174 | Int iBaseX = ( iX - iCuX * iMaxCUWidth ) / iBaseUnitWidth; |
---|
175 | Int iBaseY = ( iY - iCuY * iMaxCuHeight ) / iBaseUnitHeight; |
---|
176 | Int iCuSizeInBases = iMaxCuHeight / iBaseUnitWidth; |
---|
177 | |
---|
178 | riCuAddr = iCuY * iNumCuInWidth + iCuX; |
---|
179 | Int iRastPartIdx = iBaseY * iCuSizeInBases + iBaseX; |
---|
180 | riAbsZorderIdx = g_auiRasterToZscan[ iRastPartIdx ]; |
---|
181 | } |
---|
182 | #endif |
---|
183 | Void TComPic::compressMotion(Int scale) |
---|
184 | #else |
---|
185 | Void TComPic::compressMotion() |
---|
186 | #endif |
---|
187 | { |
---|
188 | TComPicSym* pPicSym = getPicSym(); |
---|
189 | for ( UInt uiCUAddr = 0; uiCUAddr < pPicSym->getNumberOfCtusInFrame(); uiCUAddr++ ) |
---|
190 | { |
---|
191 | TComDataCU* pCtu = pPicSym->getCtu(uiCUAddr); |
---|
192 | #if NH_3D |
---|
193 | pCtu->compressMV(scale); |
---|
194 | #else |
---|
195 | pCtu->compressMV(); |
---|
196 | #endif |
---|
197 | |
---|
198 | } |
---|
199 | } |
---|
200 | |
---|
201 | |
---|
202 | Bool TComPic::getSAOMergeAvailability(Int currAddr, Int mergeAddr) |
---|
203 | { |
---|
204 | Bool mergeCtbInSliceSeg = (mergeAddr >= getPicSym()->getCtuTsToRsAddrMap(getCtu(currAddr)->getSlice()->getSliceCurStartCtuTsAddr())); |
---|
205 | Bool mergeCtbInTile = (getPicSym()->getTileIdxMap(mergeAddr) == getPicSym()->getTileIdxMap(currAddr)); |
---|
206 | return (mergeCtbInSliceSeg && mergeCtbInTile); |
---|
207 | } |
---|
208 | |
---|
209 | UInt TComPic::getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice) |
---|
210 | { |
---|
211 | UInt subStrm; |
---|
212 | const bool bWPPEnabled=pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag(); |
---|
213 | const TComPicSym &picSym = *(getPicSym()); |
---|
214 | |
---|
215 | if ((bWPPEnabled && picSym.getFrameHeightInCtus()>1) || (picSym.getNumTiles()>1)) // wavefronts, and possibly tiles being used. |
---|
216 | { |
---|
217 | if (bWPPEnabled) |
---|
218 | { |
---|
219 | const UInt ctuRsAddr = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr); |
---|
220 | const UInt frameWidthInCtus = picSym.getFrameWidthInCtus(); |
---|
221 | const UInt tileIndex = picSym.getTileIdxMap(ctuRsAddr); |
---|
222 | const UInt numTileColumns = (picSym.getNumTileColumnsMinus1()+1); |
---|
223 | const TComTile *pTile = picSym.getTComTile(tileIndex); |
---|
224 | const UInt firstCtuRsAddrOfTile = pTile->getFirstCtuRsAddr(); |
---|
225 | const UInt tileYInCtus = firstCtuRsAddrOfTile / frameWidthInCtus; |
---|
226 | // independent tiles => substreams are "per tile" |
---|
227 | const UInt ctuLine = ctuRsAddr / frameWidthInCtus; |
---|
228 | const UInt startingSubstreamForTile =(tileYInCtus*numTileColumns) + (pTile->getTileHeightInCtus()*(tileIndex%numTileColumns)); |
---|
229 | subStrm = startingSubstreamForTile + (ctuLine - tileYInCtus); |
---|
230 | } |
---|
231 | else |
---|
232 | { |
---|
233 | const UInt ctuRsAddr = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr); |
---|
234 | const UInt tileIndex = picSym.getTileIdxMap(ctuRsAddr); |
---|
235 | subStrm=tileIndex; |
---|
236 | } |
---|
237 | } |
---|
238 | else |
---|
239 | { |
---|
240 | // dependent tiles => substreams are "per frame". |
---|
241 | subStrm = 0; |
---|
242 | } |
---|
243 | return subStrm; |
---|
244 | } |
---|
245 | |
---|
246 | #if NH_MV |
---|
247 | Bool TComPic::getPocResetPeriodId() |
---|
248 | { |
---|
249 | return getSlice(0)->getPocResetIdc(); |
---|
250 | } |
---|
251 | |
---|
252 | Void TComPic::markAsUsedForShortTermReference() |
---|
253 | { |
---|
254 | getSlice(0)->setReferenced( true ); |
---|
255 | setIsLongTerm( false ); |
---|
256 | } |
---|
257 | |
---|
258 | Void TComPic::markAsUsedForLongTermReference() |
---|
259 | { |
---|
260 | getSlice(0)->setReferenced( true ); |
---|
261 | setIsLongTerm( true ); |
---|
262 | } |
---|
263 | |
---|
264 | |
---|
265 | Void TComPic::markAsUnusedForReference() |
---|
266 | { |
---|
267 | getSlice(0)->setReferenced( false ); |
---|
268 | setIsLongTerm( false ); |
---|
269 | } |
---|
270 | |
---|
271 | |
---|
272 | Bool TComPic::getMarkedUnUsedForReference() |
---|
273 | { |
---|
274 | return !getSlice(0)->isReferenced( ); |
---|
275 | } |
---|
276 | |
---|
277 | |
---|
278 | Bool TComPic::getMarkedAsShortTerm() |
---|
279 | { |
---|
280 | return ( getSlice(0)->isReferenced( ) && !getIsLongTerm() ); |
---|
281 | } |
---|
282 | |
---|
283 | Void TComPic::print( Int outputLevel ) |
---|
284 | { |
---|
285 | if ( outputLevel== 0 ) |
---|
286 | { |
---|
287 | std::cout << std::endl |
---|
288 | << "LId" |
---|
289 | << "\t" << "POC" |
---|
290 | << "\t" << "Rec" |
---|
291 | << "\t" << "Ref" |
---|
292 | << "\t" << "LT" |
---|
293 | << "\t" << "OutMark" |
---|
294 | << "\t" << "OutFlag" |
---|
295 | << "\t" << "Type" |
---|
296 | << "\t" << "PReFlag" |
---|
297 | << std::endl; |
---|
298 | } |
---|
299 | else if( outputLevel == 1 ) |
---|
300 | { |
---|
301 | std::cout << getLayerId() |
---|
302 | << "\t" << getPOC() |
---|
303 | << "\t" << getReconMark() |
---|
304 | << "\t" << getSlice(0)->isReferenced() |
---|
305 | << "\t" << getIsLongTerm() |
---|
306 | << "\t" << getOutputMark() |
---|
307 | << "\t" << getSlice(0)->getPicOutputFlag() |
---|
308 | << "\t" << getSlice(0)->getNalUnitTypeString() |
---|
309 | << "\t" << getSlice(0)->getPocResetFlag() |
---|
310 | << std::endl; |
---|
311 | } |
---|
312 | else if ( outputLevel == 2 ) |
---|
313 | { |
---|
314 | std::cout << std:: setfill(' ') |
---|
315 | << " LayerId: " << std::setw(2) << getLayerId() |
---|
316 | << "\t" << " POC: " << std::setw(5) << getPOC() |
---|
317 | << "\t" << " Dec. Order: " << std::setw(5) << getDecodingOrder() |
---|
318 | << "\t" << " Referenced: " << std::setw(1) << getSlice(0)->isReferenced() |
---|
319 | << "\t" << " Pic type: " << getSlice(0)->getNalUnitTypeString() |
---|
320 | << "\t" << " Generated: " << std::setw(1) << getIsGenerated() |
---|
321 | << "\t" << " Gen. Ref. Pics: " << std::setw(1) << getHasGeneratedRefPics(); |
---|
322 | } |
---|
323 | else if ( outputLevel == 4 ) |
---|
324 | { |
---|
325 | std::cout << std:: setfill(' ') |
---|
326 | << " LayerId: " << std::setw(2) << getLayerId() |
---|
327 | << "\t" << " POC: " << std::setw(5) << getPOC() |
---|
328 | << "\t" << " Referenced: " << std::setw(1) << getSlice(0)->isReferenced() << std::endl; |
---|
329 | } |
---|
330 | } |
---|
331 | |
---|
332 | #if NH_3D |
---|
333 | Void TComPic::printMotion() |
---|
334 | { |
---|
335 | TComPicSym* pPicSym = getPicSym(); |
---|
336 | for ( UInt uiCUAddr = 0; uiCUAddr < pPicSym->getNumberOfCtusInFrame(); uiCUAddr++ ) |
---|
337 | { |
---|
338 | TComDataCU* pCtu = pPicSym->getCtu(uiCUAddr); |
---|
339 | std::cout << "CUAddr " << uiCUAddr << std::endl; |
---|
340 | pCtu->printMV(); |
---|
341 | std::cout << std::endl; |
---|
342 | } |
---|
343 | } |
---|
344 | |
---|
345 | #if NH_3D_NBDV |
---|
346 | Int TComPic::getDisCandRefPictures(Int iColPOC) |
---|
347 | { |
---|
348 | UInt uiTempLayerCurr = 7; |
---|
349 | TComSlice* currSlice = getSlice(getCurrSliceIdx()); |
---|
350 | UInt numDdvCandPics = 0; |
---|
351 | |
---|
352 | if(!currSlice->getEnableTMVPFlag()) |
---|
353 | { |
---|
354 | return numDdvCandPics; |
---|
355 | } |
---|
356 | |
---|
357 | numDdvCandPics += 1; |
---|
358 | |
---|
359 | UInt pocCurr = currSlice->getPOC(); |
---|
360 | UInt pocDiff = 255; |
---|
361 | |
---|
362 | for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr++) |
---|
363 | { |
---|
364 | Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); |
---|
365 | |
---|
366 | for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) |
---|
367 | { |
---|
368 | if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() |
---|
369 | && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) && numDdvCandPics != 2) |
---|
370 | { |
---|
371 | TComSlice* refSlice = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx()); |
---|
372 | Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1 : 0; |
---|
373 | UInt uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer(); |
---|
374 | |
---|
375 | if(bRAP) |
---|
376 | { |
---|
377 | this->setRapRefIdx(i); |
---|
378 | this->setRapRefList((RefPicList)x); |
---|
379 | numDdvCandPics = 2; |
---|
380 | |
---|
381 | return numDdvCandPics; |
---|
382 | } |
---|
383 | else if (uiTempLayerCurr > uiTempLayer) |
---|
384 | { |
---|
385 | uiTempLayerCurr = uiTempLayer; |
---|
386 | } |
---|
387 | } |
---|
388 | } |
---|
389 | } |
---|
390 | |
---|
391 | UInt z = -1; // GT: Added to make code compile needs to be checked! |
---|
392 | UInt idx = 0; |
---|
393 | |
---|
394 | for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++) |
---|
395 | { |
---|
396 | Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); |
---|
397 | |
---|
398 | for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) |
---|
399 | { |
---|
400 | Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC(); |
---|
401 | Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc); |
---|
402 | |
---|
403 | if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) |
---|
404 | && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff) |
---|
405 | { |
---|
406 | pocDiff = iTempDiff; |
---|
407 | z = x; |
---|
408 | idx = i; |
---|
409 | } |
---|
410 | } |
---|
411 | } |
---|
412 | |
---|
413 | if(pocDiff < 255) |
---|
414 | { |
---|
415 | this->setRapRefIdx(idx); |
---|
416 | this->setRapRefList((RefPicList) z); |
---|
417 | numDdvCandPics = 2; |
---|
418 | } |
---|
419 | |
---|
420 | return numDdvCandPics; |
---|
421 | } |
---|
422 | |
---|
423 | Void TComPic::checkTemporalIVRef() |
---|
424 | { |
---|
425 | TComSlice* currSlice = getSlice(getCurrSliceIdx()); |
---|
426 | const Int numCandPics = this->getNumDdvCandPics(); |
---|
427 | |
---|
428 | for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++) |
---|
429 | { |
---|
430 | RefPicList eCurRefPicList = REF_PIC_LIST_0 ; |
---|
431 | Int curCandPicRefIdx = 0; |
---|
432 | if(curCandPic == 0) |
---|
433 | { |
---|
434 | eCurRefPicList = RefPicList(currSlice->isInterB() ? 1 - currSlice->getColFromL0Flag() : 0); |
---|
435 | curCandPicRefIdx = currSlice->getColRefIdx(); |
---|
436 | } |
---|
437 | else |
---|
438 | { |
---|
439 | eCurRefPicList = this->getRapRefList(); |
---|
440 | curCandPicRefIdx = this->getRapRefIdx(); |
---|
441 | } |
---|
442 | |
---|
443 | TComPic* pcCandColPic = currSlice->getRefPic(eCurRefPicList, curCandPicRefIdx); |
---|
444 | TComSlice* pcCandColSlice = pcCandColPic->getSlice(0); // currently only support single slice |
---|
445 | |
---|
446 | if(!pcCandColSlice->isIntra()) |
---|
447 | { |
---|
448 | for(Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2 : 1); iColRefDir++) |
---|
449 | { |
---|
450 | for(Int iColRefIdx = 0; iColRefIdx < pcCandColSlice->getNumRefIdx((RefPicList)iColRefDir); iColRefIdx++) |
---|
451 | { |
---|
452 | m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false; |
---|
453 | Int iColViewIdx = pcCandColSlice->getViewIndex(); |
---|
454 | // The picture pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx) might not be in DPB anymore |
---|
455 | // So don't access it directly. |
---|
456 | Int iColRefViewIdx = pcCandColSlice->getVPS()->getViewOrderIdx( pcCandColSlice->getRefLayerId( (RefPicList)iColRefDir, iColRefIdx ) ); |
---|
457 | if(iColViewIdx == iColRefViewIdx) |
---|
458 | { |
---|
459 | continue; |
---|
460 | } |
---|
461 | |
---|
462 | for(Int iCurrRefDir = 0; (iCurrRefDir < (currSlice->isInterB() ? 2 : 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false); iCurrRefDir++) |
---|
463 | { |
---|
464 | for(Int iCurrRefIdx = 0; iCurrRefIdx < currSlice->getNumRefIdx((RefPicList)iCurrRefDir); iCurrRefIdx++) |
---|
465 | { |
---|
466 | if(currSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iColRefViewIdx) |
---|
467 | { |
---|
468 | m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true; |
---|
469 | break; |
---|
470 | } |
---|
471 | } |
---|
472 | } |
---|
473 | } |
---|
474 | } |
---|
475 | } |
---|
476 | } |
---|
477 | } |
---|
478 | |
---|
479 | Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx) |
---|
480 | { |
---|
481 | return m_abTIVRINCurrRL[currCandPic][iColRefDir][iColRefIdx]; |
---|
482 | } |
---|
483 | |
---|
484 | Void TComPic::checkTextureRef() |
---|
485 | { |
---|
486 | TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); |
---|
487 | TComPic* pcTextPic = pcCurrSlice->getIvPic(0, getViewIndex()); |
---|
488 | #if H_3D_FCO |
---|
489 | if ( pcTextPic ) |
---|
490 | { |
---|
491 | #endif |
---|
492 | TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice |
---|
493 | |
---|
494 | for(Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB() ? 2 :1) ) && !pcTextSlice->isIntra(); iTextRefDir++) |
---|
495 | { |
---|
496 | for(Int iTextRefIdx =0; iTextRefIdx < pcTextSlice->getNumRefIdx((RefPicList)iTextRefDir); iTextRefIdx++) |
---|
497 | { |
---|
498 | Int iTextRefPOC = pcTextSlice->getRefPOC((RefPicList)iTextRefDir, iTextRefIdx); |
---|
499 | Int iTextRefViewId = pcTextSlice->getRefPic((RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex(); |
---|
500 | m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; |
---|
501 | Int iCurrRefDir = iTextRefDir; |
---|
502 | |
---|
503 | for(Int iCurrRefIdx = 0; (iCurrRefIdx<pcCurrSlice->getNumRefIdx((RefPicList)iCurrRefDir)) && (m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0); iCurrRefIdx++) |
---|
504 | { |
---|
505 | if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && |
---|
506 | pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId) |
---|
507 | { |
---|
508 | m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; |
---|
509 | } |
---|
510 | } |
---|
511 | } |
---|
512 | } |
---|
513 | #if H_3D_FCO |
---|
514 | } |
---|
515 | #endif |
---|
516 | } |
---|
517 | |
---|
518 | Int TComPic::isTextRefValid(Int iTextRefDir, Int iTextRefIdx) |
---|
519 | { |
---|
520 | return m_aiTexToDepRef[iTextRefDir][iTextRefIdx]; |
---|
521 | } |
---|
522 | #endif |
---|
523 | #endif |
---|
524 | |
---|
525 | Void TComAu::setPicLatencyCount( Int picLatenyCount ) |
---|
526 | { |
---|
527 | for(TComList<TComPic*>::iterator itP= begin(); itP!= end(); itP++) |
---|
528 | { |
---|
529 | (*itP)->setPicLatencyCount( picLatenyCount ); |
---|
530 | } |
---|
531 | } |
---|
532 | |
---|
533 | TComPic* TComAu::getPic( Int nuhLayerId ) |
---|
534 | { |
---|
535 | TComPic* pic = NULL; |
---|
536 | for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) |
---|
537 | { |
---|
538 | if ( (*itP)->getLayerId() == nuhLayerId ) |
---|
539 | { |
---|
540 | pic = (*itP); |
---|
541 | } |
---|
542 | } |
---|
543 | return pic; |
---|
544 | } |
---|
545 | |
---|
546 | Void TComAu::addPic( TComPic* pic, Bool pocUnkown ) |
---|
547 | { |
---|
548 | if ( !empty() ) |
---|
549 | { |
---|
550 | if (!pocUnkown) |
---|
551 | { |
---|
552 | assert( pic->getPOC() == ( getPoc() )); |
---|
553 | } |
---|
554 | pic->setPicLatencyCount( getPicLatencyCount() ); |
---|
555 | |
---|
556 | assert( getPic( pic->getLayerId() ) == NULL ); |
---|
557 | |
---|
558 | // Add sorted |
---|
559 | TComAu::iterator itP = begin(); |
---|
560 | Bool inserted = false; |
---|
561 | while( !inserted ) |
---|
562 | { |
---|
563 | if ( ( itP == end()) || pic->getLayerId() < (*itP)->getLayerId() ) |
---|
564 | { |
---|
565 | insert(itP, pic ); |
---|
566 | inserted = true; |
---|
567 | } |
---|
568 | else |
---|
569 | { |
---|
570 | ++itP; |
---|
571 | } |
---|
572 | } |
---|
573 | } |
---|
574 | else |
---|
575 | { |
---|
576 | pushBack( pic ); |
---|
577 | } |
---|
578 | } |
---|
579 | |
---|
580 | Bool TComAu::containsPic( TComPic* pic ) |
---|
581 | { |
---|
582 | Bool isInList = false; |
---|
583 | for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (!isInList) ); itP++) |
---|
584 | { |
---|
585 | isInList = isInList || ( pic == (*itP)); |
---|
586 | } |
---|
587 | return isInList; |
---|
588 | } |
---|
589 | |
---|
590 | TComSubDpb::TComSubDpb( Int nuhLayerid ) |
---|
591 | { |
---|
592 | m_nuhLayerId = nuhLayerid; |
---|
593 | } |
---|
594 | |
---|
595 | TComPic* TComSubDpb::getPic( Int poc ) |
---|
596 | { |
---|
597 | TComPic* pic = NULL; |
---|
598 | for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) |
---|
599 | { |
---|
600 | if ( (*itP)->getPOC() == poc ) |
---|
601 | { |
---|
602 | pic = (*itP); |
---|
603 | } |
---|
604 | } |
---|
605 | return pic; |
---|
606 | } |
---|
607 | |
---|
608 | TComPic* TComSubDpb::getPicFromLsb( Int pocLsb, Int maxPicOrderCntLsb ) |
---|
609 | { |
---|
610 | TComPic* pic = NULL; |
---|
611 | for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) |
---|
612 | { |
---|
613 | if ( ( (*itP)->getPOC() & ( maxPicOrderCntLsb - 1 ) ) == pocLsb ) |
---|
614 | { |
---|
615 | pic = (*itP); |
---|
616 | } |
---|
617 | } |
---|
618 | return pic; |
---|
619 | } |
---|
620 | |
---|
621 | TComPic* TComSubDpb::getShortTermRefPic( Int poc ) |
---|
622 | { |
---|
623 | TComPic* pic = NULL; |
---|
624 | for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++) |
---|
625 | { |
---|
626 | if ( (*itP)->getPOC() == poc && (*itP)->getMarkedAsShortTerm() ) |
---|
627 | { |
---|
628 | pic = (*itP); |
---|
629 | } |
---|
630 | } |
---|
631 | return pic; |
---|
632 | } |
---|
633 | |
---|
634 | TComList<TComPic*> TComSubDpb::getPicsMarkedNeedForOutput() |
---|
635 | { |
---|
636 | TComList<TComPic*> picsMarkedNeedForOutput; |
---|
637 | |
---|
638 | for(TComList<TComPic*>::iterator itP= begin(); itP!= end() ; itP++ ) |
---|
639 | { |
---|
640 | if ( (*itP)->getOutputMark() ) |
---|
641 | { |
---|
642 | picsMarkedNeedForOutput.push_back( (*itP) ); |
---|
643 | } |
---|
644 | } |
---|
645 | return picsMarkedNeedForOutput; |
---|
646 | } |
---|
647 | |
---|
648 | Void TComSubDpb::markAllAsUnusedForReference() |
---|
649 | { |
---|
650 | for(TComList<TComPic*>::iterator itP= begin(); itP!= end() ; itP++ ) |
---|
651 | { |
---|
652 | (*itP)->markAsUnusedForReference(); |
---|
653 | } |
---|
654 | } |
---|
655 | |
---|
656 | Void TComSubDpb::addPic( TComPic* pic ) |
---|
657 | { |
---|
658 | assert( pic != NULL ); |
---|
659 | assert( m_nuhLayerId == pic->getLayerId() || m_nuhLayerId == -1); |
---|
660 | if ( !empty() ) |
---|
661 | { |
---|
662 | assert( getPic( pic->getPOC() ) == NULL ); // Don't add twice; assert( pic->getLayerId() == m_nuhLayerId ); |
---|
663 | |
---|
664 | // Add sorted |
---|
665 | TComSubDpb::iterator itP = begin(); |
---|
666 | Bool inserted = false; |
---|
667 | while( !inserted ) |
---|
668 | { |
---|
669 | if ( ( itP == end()) || pic->getPOC() < (*itP)->getPOC() ) |
---|
670 | { |
---|
671 | insert(itP, pic ); |
---|
672 | inserted = true; |
---|
673 | } |
---|
674 | else |
---|
675 | { |
---|
676 | ++itP; |
---|
677 | } |
---|
678 | } |
---|
679 | } |
---|
680 | else |
---|
681 | { |
---|
682 | pushBack( pic ); |
---|
683 | } |
---|
684 | } |
---|
685 | |
---|
686 | Void TComSubDpb::removePics( std::vector<TComPic*> picToRemove ) |
---|
687 | { |
---|
688 | for (Int i = 0; i < picToRemove.size(); i++ ) |
---|
689 | { |
---|
690 | if( picToRemove[i] != NULL) |
---|
691 | { |
---|
692 | remove( picToRemove[i] ); |
---|
693 | } |
---|
694 | } |
---|
695 | } |
---|
696 | |
---|
697 | Bool TComSubDpb::areAllPicsMarkedNotNeedForOutput() |
---|
698 | { |
---|
699 | return ( getPicsMarkedNeedForOutput().size() == 0 ); |
---|
700 | } |
---|
701 | |
---|
702 | |
---|
703 | TComPicLists::~TComPicLists() |
---|
704 | { |
---|
705 | emptyAllSubDpbs(); |
---|
706 | for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end()); itL++) |
---|
707 | { |
---|
708 | if ( (*itL) != NULL ) |
---|
709 | { |
---|
710 | delete (*itL); |
---|
711 | (*itL) = NULL; |
---|
712 | } |
---|
713 | } |
---|
714 | } |
---|
715 | |
---|
716 | Void TComPicLists::addNewPic( TComPic* pic ) |
---|
717 | { |
---|
718 | getSubDpb ( pic->getLayerId() , true )->addPic( pic ); |
---|
719 | getAu ( pic->getPOC() , true )->addPic( pic , false ); |
---|
720 | if ( m_printPicOutput ) |
---|
721 | { |
---|
722 | std::cout << " Add picture: "; |
---|
723 | pic->print( 2 ); |
---|
724 | std::cout << std::endl; |
---|
725 | } |
---|
726 | } |
---|
727 | |
---|
728 | Void TComPicLists::removePic( TComPic* pic ) |
---|
729 | { |
---|
730 | if (pic != NULL) |
---|
731 | { |
---|
732 | |
---|
733 | TComSubDpb* curSubDpb = getSubDpb( pic->getLayerId(), false ); |
---|
734 | curSubDpb->remove( pic ); |
---|
735 | |
---|
736 | TComAu* curAu = getAu ( pic->getPOC(), false ); |
---|
737 | |
---|
738 | if (curAu != NULL) |
---|
739 | { |
---|
740 | curAu->remove( pic ); |
---|
741 | // Remove AU when empty. |
---|
742 | if (curAu->empty() ) |
---|
743 | { |
---|
744 | m_aus.remove( curAu ); |
---|
745 | delete curAu; |
---|
746 | } |
---|
747 | } |
---|
748 | |
---|
749 | if ( m_printPicOutput ) |
---|
750 | { |
---|
751 | std::cout << " Remove picture: "; |
---|
752 | pic->print( 2 ); |
---|
753 | std::cout << std::endl; |
---|
754 | } |
---|
755 | |
---|
756 | pic->destroy(); |
---|
757 | delete pic; |
---|
758 | } |
---|
759 | } |
---|
760 | |
---|
761 | TComPic* TComPicLists::getPic( Int layerIdInNuh, Int poc ) |
---|
762 | { |
---|
763 | TComPic* pcPic = NULL; |
---|
764 | TComSubDpb* subDpb = getSubDpb( layerIdInNuh, false ); |
---|
765 | if ( subDpb != NULL ) |
---|
766 | { |
---|
767 | pcPic = subDpb->getPic( poc ); |
---|
768 | } |
---|
769 | return pcPic; |
---|
770 | } |
---|
771 | |
---|
772 | TComPicYuv* TComPicLists::getPicYuv( Int layerIdInNuh, Int poc, Bool reconFlag ) |
---|
773 | { |
---|
774 | TComPic* pcPic = getPic( layerIdInNuh, poc ); |
---|
775 | TComPicYuv* pcPicYuv = NULL; |
---|
776 | |
---|
777 | if (pcPic != NULL) |
---|
778 | { |
---|
779 | if( reconFlag ) |
---|
780 | { |
---|
781 | if ( pcPic->getReconMark() ) |
---|
782 | { |
---|
783 | pcPicYuv = pcPic->getPicYuvRec(); |
---|
784 | } |
---|
785 | } |
---|
786 | else |
---|
787 | { |
---|
788 | pcPicYuv = pcPic->getPicYuvOrg(); |
---|
789 | } |
---|
790 | }; |
---|
791 | |
---|
792 | return pcPicYuv; |
---|
793 | } |
---|
794 | |
---|
795 | TComSubDpb* TComPicLists::getSubDpb( Int nuhLayerId, Bool create ) |
---|
796 | { |
---|
797 | TComSubDpb* subDpb = NULL; |
---|
798 | for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end() && subDpb == NULL ); itL++) |
---|
799 | { |
---|
800 | if ( (*itL)->getLayerId() == nuhLayerId ) |
---|
801 | { |
---|
802 | subDpb = (*itL); |
---|
803 | } |
---|
804 | } |
---|
805 | if ( subDpb == NULL && create ) |
---|
806 | { |
---|
807 | m_subDpbs.push_back( new TComSubDpb(nuhLayerId) ); |
---|
808 | } |
---|
809 | return subDpb; |
---|
810 | } |
---|
811 | |
---|
812 | TComList<TComSubDpb*>* TComPicLists::getSubDpbs() |
---|
813 | { |
---|
814 | return (&m_subDpbs); |
---|
815 | } |
---|
816 | |
---|
817 | TComAu* TComPicLists::addAu( Int poc ) |
---|
818 | { |
---|
819 | TComList<TComAu*>::iterator itA = m_aus.begin(); |
---|
820 | |
---|
821 | assert( getAu(poc, false) == NULL ); |
---|
822 | Bool inserted = false; |
---|
823 | while( !inserted) |
---|
824 | { |
---|
825 | if ( ( itA == m_aus.end()) || poc < (*itA)->getPoc() ) |
---|
826 | { |
---|
827 | m_aus.insert(itA, new TComAu ); |
---|
828 | inserted = true; |
---|
829 | --itA; |
---|
830 | } |
---|
831 | else |
---|
832 | { |
---|
833 | ++itA; |
---|
834 | } |
---|
835 | } |
---|
836 | return (*itA); |
---|
837 | } |
---|
838 | |
---|
839 | TComAu* TComPicLists::getAu( Int poc, Bool create ) |
---|
840 | { |
---|
841 | TComAu* au = NULL; |
---|
842 | |
---|
843 | for( TComList<TComAu*>::iterator itA = m_aus.begin(); ( itA != m_aus.end() && au == NULL ); itA++) |
---|
844 | { |
---|
845 | if ( (*itA)->getPoc() == poc ) |
---|
846 | { |
---|
847 | au = (*itA); |
---|
848 | } |
---|
849 | } |
---|
850 | |
---|
851 | if ( au == NULL && create ) |
---|
852 | { |
---|
853 | au = addAu( poc ); |
---|
854 | } |
---|
855 | return au; |
---|
856 | } |
---|
857 | |
---|
858 | TComList<TComAu*>* TComPicLists::getAus() |
---|
859 | { |
---|
860 | return (&m_aus); |
---|
861 | } |
---|
862 | |
---|
863 | TComList<TComAu*> TComPicLists::getAusHavingPicsMarkedForOutput() |
---|
864 | { |
---|
865 | TComList<TComAu*> ausHavingPicsForOutput; |
---|
866 | for(TComList<TComAu*>::iterator itA= m_aus.begin(); ( itA!=m_aus.end()); itA++) |
---|
867 | { |
---|
868 | Bool hasPicMarkedAsNeedForOutput = false; |
---|
869 | for( TComAu::iterator itP= (*itA)->begin(); (itP!=(*itA)->end() && !hasPicMarkedAsNeedForOutput); itP++ ) |
---|
870 | { |
---|
871 | if( (*itP)->getOutputMark() ) |
---|
872 | { |
---|
873 | hasPicMarkedAsNeedForOutput = true; |
---|
874 | } |
---|
875 | } |
---|
876 | if (hasPicMarkedAsNeedForOutput) |
---|
877 | { |
---|
878 | ausHavingPicsForOutput.pushBack( (*itA) ); |
---|
879 | } |
---|
880 | } |
---|
881 | return ausHavingPicsForOutput; |
---|
882 | } |
---|
883 | |
---|
884 | Void TComPicLists::markSubDpbAsUnusedForReference( Int layerIdInNuh ) |
---|
885 | { |
---|
886 | TComSubDpb* subDpb = getSubDpb( layerIdInNuh, false ); |
---|
887 | markSubDpbAsUnusedForReference( *subDpb ); |
---|
888 | } |
---|
889 | |
---|
890 | Void TComPicLists::markSubDpbAsUnusedForReference( TComSubDpb& subDpb ) |
---|
891 | { |
---|
892 | for(TComList<TComPic*>::iterator itP=subDpb.begin(); ( itP!=subDpb.end()); itP++) |
---|
893 | { |
---|
894 | (*itP)->markAsUnusedForReference(); |
---|
895 | } |
---|
896 | } |
---|
897 | |
---|
898 | Void TComPicLists::markAllSubDpbAsUnusedForReference() |
---|
899 | { |
---|
900 | for(TComList<TComSubDpb*>::iterator itS= m_subDpbs.begin(); ( itS!=m_subDpbs.end()); itS++) |
---|
901 | { |
---|
902 | markSubDpbAsUnusedForReference( *(*itS) ); |
---|
903 | } |
---|
904 | } |
---|
905 | |
---|
906 | Void TComPicLists::decrementPocsInSubDpb( Int nuhLayerId, Int deltaPocVal ) |
---|
907 | { |
---|
908 | TComSubDpb* subDpb = getSubDpb( nuhLayerId, false ); |
---|
909 | |
---|
910 | for(TComSubDpb::iterator itP = subDpb->begin(); itP!=subDpb->end(); itP++) |
---|
911 | { |
---|
912 | TComPic* pic = (*itP); |
---|
913 | for (Int i = 0; i < pic->getNumAllocatedSlice(); i++) |
---|
914 | { |
---|
915 | TComSlice* slice = pic->getSlice(i); |
---|
916 | slice->setPOC( slice->getPOC() - deltaPocVal ); |
---|
917 | } |
---|
918 | } |
---|
919 | } |
---|
920 | Void TComPicLists::emptyAllSubDpbs() |
---|
921 | { |
---|
922 | emptySubDpbs( &m_subDpbs ); |
---|
923 | } |
---|
924 | |
---|
925 | Void TComPicLists::emptySubDpbs( TComList<TComSubDpb*>* subDpbs ) |
---|
926 | { |
---|
927 | assert( subDpbs != NULL ); |
---|
928 | for( TComList<TComSubDpb*>::iterator itS = subDpbs->begin(); itS != subDpbs->end(); itS++ ) |
---|
929 | { |
---|
930 | emptySubDpb( (*itS) ); |
---|
931 | } |
---|
932 | } |
---|
933 | |
---|
934 | Void TComPicLists::emptySubDpb( TComSubDpb* subDpb ) |
---|
935 | { |
---|
936 | if(subDpb != NULL) |
---|
937 | { |
---|
938 | while( !subDpb->empty() ) |
---|
939 | { |
---|
940 | TComPic* curPic = *(subDpb->begin()); |
---|
941 | removePic( curPic ); |
---|
942 | } |
---|
943 | } |
---|
944 | } |
---|
945 | |
---|
946 | Void TComPicLists::emptySubDpb( Int nuhLayerId ) |
---|
947 | { |
---|
948 | emptySubDpb( getSubDpb( nuhLayerId , false) ); |
---|
949 | } |
---|
950 | |
---|
951 | Void TComPicLists::emptyNotNeedForOutputAndUnusedForRef() |
---|
952 | { |
---|
953 | for(TComList<TComSubDpb*>::iterator itS= m_subDpbs.begin(); ( itS!=m_subDpbs.end()); itS++) |
---|
954 | { |
---|
955 | emptySubDpbNotNeedForOutputAndUnusedForRef( *(*itS) ); |
---|
956 | } |
---|
957 | } |
---|
958 | |
---|
959 | Void TComPicLists::emptySubDpbNotNeedForOutputAndUnusedForRef( Int layerId ) |
---|
960 | { |
---|
961 | TComSubDpb* subDpb = getSubDpb( layerId, false ); |
---|
962 | emptySubDpbNotNeedForOutputAndUnusedForRef( *subDpb ); |
---|
963 | } |
---|
964 | |
---|
965 | Void TComPicLists::emptySubDpbNotNeedForOutputAndUnusedForRef( TComSubDpb subDpb ) |
---|
966 | { |
---|
967 | for(TComSubDpb::iterator itP= subDpb.begin(); ( itP!=subDpb.end()); itP++) |
---|
968 | { |
---|
969 | TComPic* pic = (*itP); |
---|
970 | if ( !pic->getOutputMark() && pic->getMarkedUnUsedForReference() ) |
---|
971 | { |
---|
972 | removePic( pic ); |
---|
973 | } |
---|
974 | } |
---|
975 | } |
---|
976 | |
---|
977 | Void TComPicLists::print() |
---|
978 | { |
---|
979 | Bool first = true; |
---|
980 | for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end() ); itL++) |
---|
981 | { |
---|
982 | for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() ); itP++) |
---|
983 | { |
---|
984 | if ( first ) |
---|
985 | { |
---|
986 | (*itP)->print( true ); |
---|
987 | first = false; |
---|
988 | } |
---|
989 | (*itP)->print( false ); |
---|
990 | } |
---|
991 | } |
---|
992 | } |
---|
993 | |
---|
994 | #if NH_3D_VSO || NH_3D |
---|
995 | TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int auxId, Int poc, Bool recon ) |
---|
996 | { |
---|
997 | Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag, auxId ); |
---|
998 | return getPicYuv( layerIdInNuh, poc, recon ); |
---|
999 | } |
---|
1000 | |
---|
1001 | TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int auxId, Int poc ) |
---|
1002 | { |
---|
1003 | return getPic ( m_vps->getLayerIdInNuh( viewIndex, depthFlag, auxId ), poc ); |
---|
1004 | } |
---|
1005 | |
---|
1006 | #endif |
---|
1007 | |
---|
1008 | #endif |
---|
1009 | |
---|
1010 | |
---|
1011 | |
---|
1012 | |
---|
1013 | //! \} |
---|
1014 | |
---|