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