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