Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/Lib/TLibCommon/TComPic.cpp
- Timestamp:
- 12 Apr 2018, 11:12:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.2-dev/source/Lib/TLibCommon/TComPic.cpp
r1405 r1412 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 73 73 m_apcPicYuv[i] = NULL; 74 74 } 75 #if NH_3D _QTLPC75 #if NH_3D 76 76 m_bReduceBitsQTL = 0; 77 #endif78 #if NH_3D_NBDV79 77 m_iNumDdvCandPics = 0; 80 78 m_eRapRefList = REF_PIC_LIST_0; … … 100 98 } 101 99 100 #if REDUCED_ENCODER_MEMORY 101 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction ) 102 #else 102 103 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual) 104 #endif 103 105 { 104 106 destroy(); … … 111 113 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 112 114 115 #if REDUCED_ENCODER_MEMORY 116 m_picSym.create( sps, pps, uiMaxDepth, bCreateForImmediateReconstruction ); 117 if (bCreateEncoderSourcePicYuv) 118 #else 113 119 m_picSym.create( sps, pps, uiMaxDepth ); 114 120 if (!bIsVirtual) 121 #endif 115 122 { 116 123 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 117 124 m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 118 125 } 126 #if REDUCED_ENCODER_MEMORY 127 if (bCreateForImmediateReconstruction) 128 { 129 #endif 119 130 m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 131 #if REDUCED_ENCODER_MEMORY 132 } 133 #endif 120 134 121 135 // there are no SEI messages associated with this picture initially … … 125 139 } 126 140 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 } 141 } 142 143 #if REDUCED_ENCODER_MEMORY 144 Void TComPic::prepareForEncoderSourcePicYuv() 145 { 146 const TComSPS &sps=m_picSym.getSPS(); 147 148 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 149 const Int iWidth = sps.getPicWidthInLumaSamples(); 150 const Int iHeight = sps.getPicHeightInLumaSamples(); 151 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 152 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 153 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 154 155 if (m_apcPicYuv[PIC_YUV_ORG ]==NULL) 156 { 157 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 158 } 159 if (m_apcPicYuv[PIC_YUV_TRUE_ORG ]==NULL) 160 { 161 m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 162 } 163 } 164 165 Void TComPic::prepareForReconstruction() 166 { 167 if (m_apcPicYuv[PIC_YUV_REC] == NULL) 168 { 169 const TComSPS &sps=m_picSym.getSPS(); 170 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 171 const Int iWidth = sps.getPicWidthInLumaSamples(); 172 const Int iHeight = sps.getPicHeightInLumaSamples(); 173 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 174 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 175 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 176 177 m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 178 } 179 180 // mark it should be extended 181 m_apcPicYuv[PIC_YUV_REC]->setBorderExtension(false); 182 183 m_picSym.prepareForReconstruction(); 184 } 185 186 Void TComPic::releaseReconstructionIntermediateData() 187 { 188 m_picSym.releaseReconstructionIntermediateData(); 189 } 190 191 Void TComPic::releaseEncoderSourceImageData() 192 { 193 if (m_apcPicYuv[PIC_YUV_ORG ]) 194 { 195 m_apcPicYuv[PIC_YUV_ORG]->destroy(); 196 delete m_apcPicYuv[PIC_YUV_ORG]; 197 m_apcPicYuv[PIC_YUV_ORG] = NULL; 198 } 199 if (m_apcPicYuv[PIC_YUV_TRUE_ORG ]) 200 { 201 m_apcPicYuv[PIC_YUV_TRUE_ORG]->destroy(); 202 delete m_apcPicYuv[PIC_YUV_TRUE_ORG]; 203 m_apcPicYuv[PIC_YUV_TRUE_ORG] = NULL; 204 } 205 } 206 207 Void TComPic::releaseAllReconstructionData() 208 { 209 if (m_apcPicYuv[PIC_YUV_REC ]) 210 { 211 m_apcPicYuv[PIC_YUV_REC]->destroy(); 212 delete m_apcPicYuv[PIC_YUV_REC]; 213 m_apcPicYuv[PIC_YUV_REC] = NULL; 214 } 215 m_picSym.releaseAllReconstructionData(); 216 } 217 #endif 218 140 219 141 220 Void TComPic::destroy() … … 156 235 } 157 236 #if NH_3D 158 #if NH_3D_ARP159 237 Void TComPic::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ) 160 238 { … … 180 258 riAbsZorderIdx = g_auiRasterToZscan[ iRastPartIdx ]; 181 259 } 182 #endif183 260 Void TComPic::compressMotion(Int scale) 184 261 #else … … 343 420 } 344 421 345 #if NH_3D_NBDV346 422 Int TComPic::getDisCandRefPictures(Int iColPOC) 347 423 { … … 486 562 TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); 487 563 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 } 564 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 565 566 for(Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB() ? 2 :1) ) && !pcTextSlice->isIntra(); iTextRefDir++) 567 { 568 for(Int iTextRefIdx =0; iTextRefIdx < pcTextSlice->getNumRefIdx((RefPicList)iTextRefDir); iTextRefIdx++) 569 { 570 Int iTextRefPOC = pcTextSlice->getRefPOC((RefPicList)iTextRefDir, iTextRefIdx); 571 Int iTextRefViewId = pcTextSlice->getRefPic((RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex(); 572 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; 573 Int iCurrRefDir = iTextRefDir; 574 575 for(Int iCurrRefIdx = 0; (iCurrRefIdx<pcCurrSlice->getNumRefIdx((RefPicList)iCurrRefDir)) && (m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0); iCurrRefIdx++) 576 { 577 if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 578 pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId) 579 { 580 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; 510 581 } 511 582 } 512 583 } 513 #if H_3D_FCO 514 } 515 #endif 584 } 516 585 } 517 586 … … 520 589 return m_aiTexToDepRef[iTextRefDir][iTextRefIdx]; 521 590 } 522 #endif 591 523 592 #endif 524 593
Note: See TracChangeset for help on using the changeset viewer.