[5] | 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 |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[56] | 6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
[5] | 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. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 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 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TComPic.h |
---|
| 35 | \brief picture class (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TCOMPIC__ |
---|
| 39 | #define __TCOMPIC__ |
---|
| 40 | |
---|
| 41 | // Include files |
---|
| 42 | #include "CommonDef.h" |
---|
| 43 | #include "TComPicSym.h" |
---|
| 44 | #include "TComPicYuv.h" |
---|
| 45 | #include "TComBitStream.h" |
---|
| 46 | |
---|
[56] | 47 | //! \ingroup TLibCommon |
---|
| 48 | //! \{ |
---|
| 49 | |
---|
[2] | 50 | class SEImessages; |
---|
| 51 | |
---|
| 52 | // ==================================================================================================================== |
---|
| 53 | // Class definition |
---|
| 54 | // ==================================================================================================================== |
---|
| 55 | |
---|
| 56 | /// picture class (symbol + YUV buffers) |
---|
| 57 | class TComPic |
---|
| 58 | { |
---|
| 59 | private: |
---|
[56] | 60 | UInt m_uiTLayer; // Temporal layer |
---|
| 61 | Bool m_bUsedByCurr; // Used by current picture |
---|
| 62 | Bool m_bIsLongTerm; // IS long term picture |
---|
[2] | 63 | TComPicSym* m_apcPicSym; // Symbol |
---|
[56] | 64 | |
---|
[2] | 65 | TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec |
---|
[56] | 66 | |
---|
[5] | 67 | #if DEPTH_MAP_GENERATION |
---|
[2] | 68 | TComPicYuv* m_pcPredDepthMap; // estimated depth map |
---|
[100] | 69 | #if PDM_REMOVE_DEPENDENCE |
---|
| 70 | TComPicYuv* m_pcPredDepthMap_temp; // estimated depth map |
---|
| 71 | Bool m_bPDMV2; |
---|
[5] | 72 | #endif |
---|
[100] | 73 | #endif |
---|
[56] | 74 | |
---|
[189] | 75 | #if LG_ZEROINTRADEPTHRESI_A0087 |
---|
[100] | 76 | Int m_uiIntraPeriod; |
---|
| 77 | #endif |
---|
| 78 | |
---|
[292] | 79 | #if H3D_IVMP |
---|
[2] | 80 | TComPicYuv* m_pcOrgDepthMap; // original depth map |
---|
[289] | 81 | #if H3D_NBDV |
---|
[293] | 82 | Bool m_checked; |
---|
[189] | 83 | UInt m_uiRapRefIdx; |
---|
| 84 | RefPicList m_eRapRefList; |
---|
| 85 | Bool m_bRapCheck; |
---|
[100] | 86 | #endif |
---|
[189] | 87 | #endif |
---|
[295] | 88 | #if H3D_IVRP |
---|
[2] | 89 | TComPicYuv* m_pcResidual; // residual buffer (coded or inter-view predicted residual) |
---|
[5] | 90 | #endif |
---|
| 91 | |
---|
[2] | 92 | TComPicYuv* m_pcPicYuvPred; // Prediction |
---|
| 93 | TComPicYuv* m_pcPicYuvResi; // Residual |
---|
| 94 | Bool m_bReconstructed; |
---|
[56] | 95 | Bool m_bNeededForOutput; |
---|
[2] | 96 | UInt m_uiCurrSliceIdx; // Index of current slice |
---|
[5] | 97 | |
---|
[56] | 98 | Bool m_usedForTMVP; |
---|
| 99 | |
---|
| 100 | Int* m_pSliceSUMap; |
---|
| 101 | Bool* m_pbValidSlice; |
---|
| 102 | Int m_sliceGranularityForNDBFilter; |
---|
| 103 | Bool m_bIndependentSliceBoundaryForNDBFilter; |
---|
| 104 | Bool m_bIndependentTileBoundaryForNDBFilter; |
---|
| 105 | TComPicYuv* m_pNDBFilterYuvTmp; //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled |
---|
| 106 | std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink; |
---|
| 107 | |
---|
[2] | 108 | SEImessages* m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. |
---|
[56] | 109 | #if HHI_INTERVIEW_SKIP |
---|
| 110 | TComPicYuv* m_pcUsedPelsMap; |
---|
| 111 | #endif |
---|
[280] | 112 | #if INTER_VIEW_VECTOR_SCALING_C0115 |
---|
| 113 | Int m_iViewOrderIdx; // will be changed to view_id |
---|
[21] | 114 | #endif |
---|
[2] | 115 | Int** m_aaiCodedScale; |
---|
| 116 | Int** m_aaiCodedOffset; |
---|
| 117 | |
---|
[189] | 118 | #if OL_QTLIMIT_PREDCODING_B0068 |
---|
| 119 | Bool m_bReduceBitsQTL; |
---|
[126] | 120 | #endif |
---|
| 121 | |
---|
[2] | 122 | public: |
---|
| 123 | TComPic(); |
---|
| 124 | virtual ~TComPic(); |
---|
[56] | 125 | |
---|
| 126 | Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual = false ); |
---|
| 127 | virtual Void destroy(); |
---|
| 128 | |
---|
| 129 | UInt getTLayer() { return m_uiTLayer; } |
---|
| 130 | Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
[2] | 131 | |
---|
[56] | 132 | Bool getUsedByCurr() { return m_bUsedByCurr; } |
---|
| 133 | Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; } |
---|
| 134 | Bool getIsLongTerm() { return m_bIsLongTerm; } |
---|
| 135 | Void setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; } |
---|
[5] | 136 | |
---|
[2] | 137 | TComPicSym* getPicSym() { return m_apcPicSym; } |
---|
| 138 | TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } |
---|
| 139 | TComSlice* getCurrSlice() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx); } |
---|
[210] | 140 | #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 |
---|
[77] | 141 | TComVPS* getVPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS(); } |
---|
| 142 | #endif |
---|
[189] | 143 | #if LG_ZEROINTRADEPTHRESI_A0087 |
---|
[100] | 144 | Int getIntraPeriod() { return m_uiIntraPeriod; } |
---|
| 145 | Void setIntraPeriod(Int uiIntraPeriod) { m_uiIntraPeriod = uiIntraPeriod; } |
---|
| 146 | #endif |
---|
[2] | 147 | TComSPS* getSPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS(); } |
---|
| 148 | Int getPOC() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } |
---|
[56] | 149 | Int getViewId() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); } |
---|
[100] | 150 | TComDataCU*& getCU( UInt uiCUAddr ){ return m_apcPicSym->getCU( uiCUAddr ); } |
---|
[56] | 151 | |
---|
[2] | 152 | TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } |
---|
| 153 | TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } |
---|
[56] | 154 | #if HHI_INTERVIEW_SKIP |
---|
| 155 | TComPicYuv* getUsedPelsMap() { return m_pcUsedPelsMap; } |
---|
| 156 | #endif |
---|
| 157 | |
---|
[5] | 158 | #if DEPTH_MAP_GENERATION |
---|
[2] | 159 | TComPicYuv* getPredDepthMap() { return m_pcPredDepthMap; } |
---|
[100] | 160 | #if PDM_REMOVE_DEPENDENCE |
---|
| 161 | TComPicYuv* getPredDepthMapTemp() { return m_pcPredDepthMap_temp; } |
---|
| 162 | Void setStoredPDMforV2 (Bool flag) { m_bPDMV2 = flag;} |
---|
| 163 | Bool getStoredPDMforV2 () { return m_bPDMV2;} |
---|
[5] | 164 | #endif |
---|
[56] | 165 | |
---|
[100] | 166 | #endif |
---|
[292] | 167 | #if H3D_IVMP |
---|
[2] | 168 | TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } |
---|
[289] | 169 | #if H3D_NBDV |
---|
[100] | 170 | Void setCandPicCheckedFlag (Bool bchecked) { m_checked = bchecked; } |
---|
| 171 | Bool getCandPicCheckedFlag () { return m_checked;} |
---|
[5] | 172 | #endif |
---|
[100] | 173 | #endif |
---|
[56] | 174 | |
---|
[295] | 175 | #if H3D_IVRP |
---|
[2] | 176 | TComPicYuv* getResidual() { return m_pcResidual; } |
---|
[5] | 177 | #endif |
---|
[289] | 178 | #if H3D_NBDV |
---|
[189] | 179 | UInt getRapRefIdx() {return m_uiRapRefIdx;} |
---|
| 180 | RefPicList getRapRefList() {return m_eRapRefList;} |
---|
| 181 | Void setRapRefIdx(UInt uiRapRefIdx) {m_uiRapRefIdx = uiRapRefIdx;} |
---|
| 182 | Void setRapRefList(RefPicList eRefPicList) {m_eRapRefList = eRefPicList;} |
---|
| 183 | Bool getRapbCheck() {return m_bRapCheck;} |
---|
| 184 | Void setRapbCheck(Bool bCheck) {m_bRapCheck = bCheck;} |
---|
| 185 | Bool getDisCandRefPictures(Int iColPOC); |
---|
| 186 | #endif |
---|
[5] | 187 | |
---|
[280] | 188 | #if INTER_VIEW_VECTOR_SCALING_C0115 |
---|
| 189 | Void setViewOrderIdx(Int i) { m_iViewOrderIdx = i; } // will be changed to view_id |
---|
| 190 | Int getViewOrderIdx() { return m_iViewOrderIdx; } // will be changed to view_id |
---|
[21] | 191 | #endif |
---|
[189] | 192 | |
---|
| 193 | #if OL_QTLIMIT_PREDCODING_B0068 |
---|
| 194 | Bool getReduceBitsFlag () { return m_bReduceBitsQTL; } |
---|
| 195 | Void setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag; } |
---|
| 196 | #endif |
---|
| 197 | |
---|
[2] | 198 | Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } |
---|
| 199 | Int** getCodedScale () { return m_aaiCodedScale; } |
---|
| 200 | Int** getCodedOffset() { return m_aaiCodedOffset; } |
---|
| 201 | |
---|
[56] | 202 | TComPicYuv* getPicYuvPred() { return m_pcPicYuvPred; } |
---|
| 203 | TComPicYuv* getPicYuvResi() { return m_pcPicYuvResi; } |
---|
| 204 | Void setPicYuvPred( TComPicYuv* pcPicYuv ) { m_pcPicYuvPred = pcPicYuv; } |
---|
| 205 | Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; } |
---|
| 206 | |
---|
[2] | 207 | UInt getNumCUsInFrame() { return m_apcPicSym->getNumberOfCUsInFrame(); } |
---|
| 208 | UInt getNumPartInWidth() { return m_apcPicSym->getNumPartInWidth(); } |
---|
| 209 | UInt getNumPartInHeight() { return m_apcPicSym->getNumPartInHeight(); } |
---|
| 210 | UInt getNumPartInCU() { return m_apcPicSym->getNumPartition(); } |
---|
| 211 | UInt getFrameWidthInCU() { return m_apcPicSym->getFrameWidthInCU(); } |
---|
| 212 | UInt getFrameHeightInCU() { return m_apcPicSym->getFrameHeightInCU(); } |
---|
| 213 | UInt getMinCUWidth() { return m_apcPicSym->getMinCUWidth(); } |
---|
| 214 | UInt getMinCUHeight() { return m_apcPicSym->getMinCUHeight(); } |
---|
[56] | 215 | |
---|
[2] | 216 | UInt getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); } |
---|
| 217 | UInt getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); } |
---|
[56] | 218 | |
---|
[2] | 219 | Int getStride() { return m_apcPicYuv[1]->getStride(); } |
---|
| 220 | Int getCStride() { return m_apcPicYuv[1]->getCStride(); } |
---|
[56] | 221 | |
---|
[2] | 222 | Void setReconMark (Bool b) { m_bReconstructed = b; } |
---|
| 223 | Bool getReconMark () { return m_bReconstructed; } |
---|
[5] | 224 | |
---|
[56] | 225 | Void setUsedForTMVP( Bool b ) { m_usedForTMVP = b; } |
---|
| 226 | Bool getUsedForTMVP() { return m_usedForTMVP; } |
---|
| 227 | |
---|
| 228 | Void setOutputMark (Bool b) { m_bNeededForOutput = b; } |
---|
| 229 | Bool getOutputMark () { return m_bNeededForOutput; } |
---|
| 230 | |
---|
| 231 | Void compressMotion(); |
---|
[2] | 232 | UInt getCurrSliceIdx() { return m_uiCurrSliceIdx; } |
---|
| 233 | Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } |
---|
| 234 | UInt getNumAllocatedSlice() {return m_apcPicSym->getNumAllocatedSlice();} |
---|
| 235 | Void allocateNewSlice() {m_apcPicSym->allocateNewSlice(); } |
---|
| 236 | Void clearSliceBuffer() {m_apcPicSym->clearSliceBuffer(); } |
---|
[56] | 237 | #if HHI_INTERVIEW_SKIP |
---|
| 238 | Void addUsedPelsMapBuffer (); |
---|
| 239 | Void removeUsedPelsMapBuffer (); |
---|
| 240 | #endif |
---|
| 241 | |
---|
| 242 | Void createNonDBFilterInfo (UInt* pSliceStartAddress = NULL, Int numSlices = 1, Int sliceGranularityDepth= 0 |
---|
| 243 | ,Bool bNDBFilterCrossSliceBoundary = true |
---|
| 244 | ,Int numTiles = 1 |
---|
| 245 | ,Bool bNDBFilterCrossTileBoundary = true); |
---|
| 246 | Void createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight); |
---|
| 247 | Void destroyNonDBFilterInfo(); |
---|
[2] | 248 | |
---|
[5] | 249 | #if DEPTH_MAP_GENERATION |
---|
[21] | 250 | Void addPrdDepthMapBuffer ( UInt uiSubSampExpX, UInt uiSubSampExpY ); |
---|
[5] | 251 | #endif |
---|
[292] | 252 | #if H3D_IVMP |
---|
[2] | 253 | Void addOrgDepthMapBuffer (); |
---|
[5] | 254 | #endif |
---|
[295] | 255 | #if H3D_IVRP |
---|
[2] | 256 | Void addResidualBuffer (); |
---|
[5] | 257 | #endif |
---|
| 258 | #if DEPTH_MAP_GENERATION |
---|
[2] | 259 | Void removePrdDepthMapBuffer (); |
---|
[5] | 260 | #endif |
---|
[292] | 261 | #if H3D_IVMP |
---|
[2] | 262 | Void removeOrgDepthMapBuffer (); |
---|
[5] | 263 | #endif |
---|
[295] | 264 | #if H3D_IVRP |
---|
[2] | 265 | Void removeResidualBuffer (); |
---|
[5] | 266 | #endif |
---|
[126] | 267 | |
---|
[56] | 268 | Bool getValidSlice (Int sliceID) {return m_pbValidSlice[sliceID];} |
---|
| 269 | Int getSliceGranularityForNDBFilter () {return m_sliceGranularityForNDBFilter;} |
---|
| 270 | Bool getIndependentSliceBoundaryForNDBFilter () {return m_bIndependentSliceBoundaryForNDBFilter;} |
---|
| 271 | Bool getIndependentTileBoundaryForNDBFilter () {return m_bIndependentTileBoundaryForNDBFilter; } |
---|
| 272 | TComPicYuv* getYuvPicBufferForIndependentBoundaryProcessing() {return m_pNDBFilterYuvTmp;} |
---|
| 273 | std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter (Int sliceID) { return m_vSliceCUDataLink[sliceID];} |
---|
[5] | 274 | |
---|
[56] | 275 | /** transfer ownership of seis to this picture */ |
---|
[2] | 276 | void setSEIs(SEImessages* seis) { m_SEIs = seis; } |
---|
| 277 | |
---|
| 278 | /** |
---|
| 279 | * return the current list of SEI messages associated with this picture. |
---|
[56] | 280 | * Pointer is valid until this->destroy() is called */ |
---|
[2] | 281 | SEImessages* getSEIs() { return m_SEIs; } |
---|
| 282 | |
---|
| 283 | /** |
---|
| 284 | * return the current list of SEI messages associated with this picture. |
---|
[56] | 285 | * Pointer is valid until this->destroy() is called */ |
---|
[2] | 286 | const SEImessages* getSEIs() const { return m_SEIs; } |
---|
| 287 | |
---|
| 288 | };// END CLASS DEFINITION TComPic |
---|
| 289 | |
---|
[56] | 290 | //! \} |
---|
[2] | 291 | |
---|
| 292 | #endif // __TCOMPIC__ |
---|