[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 |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2011, 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 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 | */ |
---|
[2] | 33 | |
---|
| 34 | |
---|
[5] | 35 | |
---|
[2] | 36 | /** \file TComPic.h |
---|
| 37 | \brief picture class (header) |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | #ifndef __TCOMPIC__ |
---|
| 41 | #define __TCOMPIC__ |
---|
| 42 | |
---|
| 43 | // Include files |
---|
| 44 | #include "CommonDef.h" |
---|
| 45 | #include "TComPicSym.h" |
---|
| 46 | #include "TComPicYuv.h" |
---|
| 47 | #include "TComBitStream.h" |
---|
| 48 | #include "TComMVDRefData.h" |
---|
| 49 | |
---|
| 50 | class SEImessages; |
---|
| 51 | |
---|
| 52 | // ==================================================================================================================== |
---|
| 53 | // Class definition |
---|
| 54 | // ==================================================================================================================== |
---|
| 55 | |
---|
| 56 | /// picture class (symbol + YUV buffers) |
---|
| 57 | class TComPic |
---|
| 58 | { |
---|
| 59 | private: |
---|
| 60 | TComPicSym* m_apcPicSym; // Symbol |
---|
[5] | 61 | |
---|
[2] | 62 | TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec |
---|
[11] | 63 | |
---|
[12] | 64 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 65 | TComPicYuv* m_apcPicYuvAvail; // Availability Map - Does the given pixel can be synthesised in receiver |
---|
| 66 | #endif |
---|
| 67 | |
---|
[12] | 68 | #if POZNAN_CU_SYNTH |
---|
[11] | 69 | TComPicYuv* m_apcPicYuvSynth; // Sythesied image |
---|
[12] | 70 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 71 | TComPicYuv* m_apcPicYuvSynthDepth; // Sythesied depth image |
---|
[11] | 72 | #endif |
---|
[12] | 73 | #endif |
---|
[11] | 74 | |
---|
[5] | 75 | #if DEPTH_MAP_GENERATION |
---|
[2] | 76 | TComPicYuv* m_pcPredDepthMap; // estimated depth map |
---|
[5] | 77 | #endif |
---|
| 78 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 79 | TComPicYuv* m_pcOrgDepthMap; // original depth map |
---|
[5] | 80 | #endif |
---|
| 81 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 82 | TComPicYuv* m_pcResidual; // residual buffer (coded or inter-view predicted residual) |
---|
[5] | 83 | #endif |
---|
| 84 | |
---|
[2] | 85 | TComPicYuv* m_pcPicYuvPred; // Prediction |
---|
| 86 | TComPicYuv* m_pcPicYuvResi; // Residual |
---|
| 87 | #if PARALLEL_MERGED_DEBLK |
---|
| 88 | TComPicYuv* m_pcPicYuvDeblkBuf; |
---|
| 89 | #endif |
---|
| 90 | Bool m_bReconstructed; |
---|
| 91 | UInt m_uiCurrSliceIdx; // Index of current slice |
---|
[5] | 92 | |
---|
[2] | 93 | SEImessages* m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. |
---|
| 94 | |
---|
| 95 | SliceType m_eSliceType; |
---|
| 96 | double m_dQP; |
---|
| 97 | Bool m_bReferenced; |
---|
| 98 | UInt m_uiColDir; |
---|
| 99 | Int m_aiRefPOCList[2][MAX_NUM_REF]; |
---|
| 100 | Int m_aiRefViewIdxList[2][MAX_NUM_REF]; |
---|
| 101 | Int m_aiNumRefIdx[2]; // for multiple reference of current slice |
---|
| 102 | |
---|
| 103 | Int m_iViewIdx; |
---|
| 104 | Int** m_aaiCodedScale; |
---|
| 105 | Int** m_aaiCodedOffset; |
---|
| 106 | |
---|
[5] | 107 | #if HHI_VSO |
---|
[2] | 108 | TComMVDRefData m_cReferenceInfo; |
---|
[5] | 109 | #endif |
---|
| 110 | #if HHI_INTERVIEW_SKIP |
---|
| 111 | TComPicYuv* m_pcUsedPelsMap; |
---|
| 112 | #endif |
---|
[12] | 113 | #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC |
---|
| 114 | Double m_dTextureCuDeltaQpOffset; |
---|
| 115 | Double m_dTextureCuDeltaQpMul; |
---|
| 116 | Int m_iTextureCuDeltaQpTopBottomRow; |
---|
| 117 | #endif |
---|
[2] | 118 | |
---|
| 119 | |
---|
| 120 | public: |
---|
| 121 | TComPic(); |
---|
| 122 | virtual ~TComPic(); |
---|
| 123 | |
---|
[5] | 124 | |
---|
[2] | 125 | Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); |
---|
| 126 | Void destroy(); |
---|
[5] | 127 | |
---|
[2] | 128 | TComPicSym* getPicSym() { return m_apcPicSym; } |
---|
| 129 | TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } |
---|
| 130 | TComSlice* getCurrSlice() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx); } |
---|
| 131 | TComSPS* getSPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS(); } |
---|
| 132 | Int getPOC() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } |
---|
| 133 | #if 0 |
---|
| 134 | Bool getDRBFlag() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getDRBFlag(); } |
---|
| 135 | Int getERBIndex() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getERBIndex(); } |
---|
| 136 | #endif |
---|
| 137 | TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcPicSym->getCU( uiCUAddr ); } |
---|
[5] | 138 | |
---|
[2] | 139 | SliceType getSliceType() { return m_eSliceType ;} |
---|
| 140 | double getQP() { return m_dQP ;} |
---|
| 141 | Bool getReferenced() { return m_bReferenced ;} |
---|
| 142 | |
---|
| 143 | TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } |
---|
| 144 | TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } |
---|
[5] | 145 | |
---|
[12] | 146 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 147 | TComPicYuv* getPicYuvAvail() { return m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image |
---|
| 148 | #endif |
---|
| 149 | |
---|
[12] | 150 | #if POZNAN_CU_SYNTH |
---|
[11] | 151 | TComPicYuv* getPicYuvSynth() { return m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image |
---|
[12] | 152 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 153 | TComPicYuv* getPicYuvSynthDepth() { return m_apcPicYuvSynthDepth; }; // Sythesied depth image |
---|
[11] | 154 | #endif |
---|
[12] | 155 | #endif |
---|
[11] | 156 | |
---|
[5] | 157 | #if DEPTH_MAP_GENERATION |
---|
[2] | 158 | TComPicYuv* getPredDepthMap() { return m_pcPredDepthMap; } |
---|
[5] | 159 | #endif |
---|
| 160 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 161 | TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } |
---|
[5] | 162 | #endif |
---|
| 163 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 164 | TComPicYuv* getResidual() { return m_pcResidual; } |
---|
[5] | 165 | #endif |
---|
| 166 | |
---|
| 167 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 168 | TComPicYuv* getUsedPelsMap() { return m_pcUsedPelsMap; } |
---|
[5] | 169 | #endif |
---|
[2] | 170 | |
---|
| 171 | |
---|
| 172 | TComPicYuv* getPicYuvPred() { return m_pcPicYuvPred; } |
---|
| 173 | TComPicYuv* getPicYuvResi() { return m_pcPicYuvResi; } |
---|
| 174 | Void setPicYuvPred( TComPicYuv* pcPicYuv ) { m_pcPicYuvPred = pcPicYuv; } |
---|
| 175 | Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; } |
---|
| 176 | Void setQP( double dQP ) { m_dQP = dQP; } |
---|
| 177 | Void setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; } |
---|
| 178 | Void setReferenced( Bool bReferenced ) { m_bReferenced = bReferenced; } |
---|
| 179 | Void setColDir( UInt uiColDir ) { m_uiColDir = uiColDir; } |
---|
| 180 | UInt getColDir() { return m_uiColDir; } |
---|
| 181 | Void setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 182 | Int getRefPOC( RefPicList e, Int iRefIdx ) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
| 183 | Void setRefViewIdx( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdxList[e][iRefIdx] = i; } |
---|
| 184 | Int getRefViewIdx( RefPicList e, Int iRefIdx ) { return m_aiRefViewIdxList[e][iRefIdx]; } |
---|
| 185 | Int getNumRefs( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
| 186 | Void setNumRefs( Int i, RefPicList e ) { m_aiNumRefIdx[e] = i; } |
---|
| 187 | Void setViewIdx( Int i ) { m_iViewIdx = i; } |
---|
| 188 | Int getViewIdx() { return m_iViewIdx; } |
---|
| 189 | |
---|
| 190 | Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } |
---|
| 191 | Int** getCodedScale () { return m_aaiCodedScale; } |
---|
| 192 | Int** getCodedOffset() { return m_aaiCodedOffset; } |
---|
| 193 | |
---|
[5] | 194 | #if HHI_VSO |
---|
[2] | 195 | TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; } |
---|
[5] | 196 | #endif |
---|
| 197 | |
---|
[2] | 198 | UInt getNumCUsInFrame() { return m_apcPicSym->getNumberOfCUsInFrame(); } |
---|
| 199 | UInt getNumPartInWidth() { return m_apcPicSym->getNumPartInWidth(); } |
---|
| 200 | UInt getNumPartInHeight() { return m_apcPicSym->getNumPartInHeight(); } |
---|
| 201 | UInt getNumPartInCU() { return m_apcPicSym->getNumPartition(); } |
---|
| 202 | UInt getFrameWidthInCU() { return m_apcPicSym->getFrameWidthInCU(); } |
---|
| 203 | UInt getFrameHeightInCU() { return m_apcPicSym->getFrameHeightInCU(); } |
---|
| 204 | UInt getMinCUWidth() { return m_apcPicSym->getMinCUWidth(); } |
---|
| 205 | UInt getMinCUHeight() { return m_apcPicSym->getMinCUHeight(); } |
---|
[5] | 206 | |
---|
[2] | 207 | UInt getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); } |
---|
| 208 | UInt getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); } |
---|
[5] | 209 | |
---|
[2] | 210 | Int getStride() { return m_apcPicYuv[1]->getStride(); } |
---|
| 211 | Int getCStride() { return m_apcPicYuv[1]->getCStride(); } |
---|
[5] | 212 | |
---|
[2] | 213 | Void setReconMark (Bool b) { m_bReconstructed = b; } |
---|
| 214 | Bool getReconMark () { return m_bReconstructed; } |
---|
[5] | 215 | |
---|
[2] | 216 | #if AMVP_BUFFERCOMPRESS |
---|
[5] | 217 | Void compressMotion(); |
---|
| 218 | #endif |
---|
[2] | 219 | UInt getCurrSliceIdx() { return m_uiCurrSliceIdx; } |
---|
| 220 | Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } |
---|
| 221 | UInt getNumAllocatedSlice() {return m_apcPicSym->getNumAllocatedSlice();} |
---|
| 222 | Void allocateNewSlice() {m_apcPicSym->allocateNewSlice(); } |
---|
| 223 | Void clearSliceBuffer() {m_apcPicSym->clearSliceBuffer(); } |
---|
| 224 | |
---|
| 225 | Void addOriginalBuffer (); |
---|
[12] | 226 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 227 | Void addAvailabilityBuffer (); |
---|
| 228 | #endif |
---|
[12] | 229 | #if POZNAN_CU_SYNTH |
---|
[11] | 230 | Void addSynthesisBuffer (); |
---|
[12] | 231 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 232 | Void addSynthesisDepthBuffer (); |
---|
[11] | 233 | #endif |
---|
[12] | 234 | #endif |
---|
[2] | 235 | #if PARALLEL_MERGED_DEBLK |
---|
| 236 | Void addDeblockBuffer (); |
---|
| 237 | #endif |
---|
[5] | 238 | #if DEPTH_MAP_GENERATION |
---|
[2] | 239 | Void addPrdDepthMapBuffer (); |
---|
[5] | 240 | #endif |
---|
| 241 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 242 | Void addOrgDepthMapBuffer (); |
---|
[5] | 243 | #endif |
---|
| 244 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 245 | Void addResidualBuffer (); |
---|
[5] | 246 | #endif |
---|
| 247 | |
---|
| 248 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 249 | Void addUsedPelsMapBuffer (); |
---|
[5] | 250 | #endif |
---|
| 251 | |
---|
[2] | 252 | Void removeOriginalBuffer (); |
---|
[12] | 253 | #if POZNAN_CU_SYNTH |
---|
[11] | 254 | Void removeSynthesisBuffer (); |
---|
[12] | 255 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 256 | Void removeSynthesisDepthBuffer (); |
---|
[11] | 257 | #endif |
---|
[12] | 258 | #endif |
---|
| 259 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 260 | Void removeAvailabilityBuffer(); |
---|
| 261 | #endif |
---|
[2] | 262 | #if PARALLEL_MERGED_DEBLK |
---|
| 263 | Void removeDeblockBuffer (); |
---|
| 264 | #endif |
---|
[5] | 265 | #if DEPTH_MAP_GENERATION |
---|
[2] | 266 | Void removePrdDepthMapBuffer (); |
---|
[5] | 267 | #endif |
---|
| 268 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 269 | Void removeOrgDepthMapBuffer (); |
---|
[5] | 270 | #endif |
---|
| 271 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 272 | Void removeResidualBuffer (); |
---|
[5] | 273 | #endif |
---|
| 274 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 275 | Void removeUsedPelsMapBuffer (); |
---|
[5] | 276 | #endif |
---|
| 277 | |
---|
[12] | 278 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP |
---|
[11] | 279 | Void checkSynthesisAvailability( TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied); |
---|
| 280 | #endif |
---|
| 281 | |
---|
[2] | 282 | #if PARALLEL_MERGED_DEBLK |
---|
| 283 | TComPicYuv* getPicYuvDeblkBuf() { return m_pcPicYuvDeblkBuf; } |
---|
| 284 | #endif |
---|
| 285 | |
---|
| 286 | /** transfer ownership of @seis to @this picture */ |
---|
| 287 | void setSEIs(SEImessages* seis) { m_SEIs = seis; } |
---|
| 288 | |
---|
| 289 | /** |
---|
| 290 | * return the current list of SEI messages associated with this picture. |
---|
| 291 | * Pointer is valid until @this->destroy() is called */ |
---|
| 292 | SEImessages* getSEIs() { return m_SEIs; } |
---|
| 293 | |
---|
| 294 | /** |
---|
| 295 | * return the current list of SEI messages associated with this picture. |
---|
| 296 | * Pointer is valid until @this->destroy() is called */ |
---|
| 297 | const SEImessages* getSEIs() const { return m_SEIs; } |
---|
| 298 | |
---|
[12] | 299 | #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC |
---|
| 300 | Double getTextureCuDeltaQpOffset( ) { return m_dTextureCuDeltaQpOffset;} |
---|
| 301 | Double getTextureCuDeltaQpMul( ) { return m_dTextureCuDeltaQpMul;} |
---|
| 302 | Int getTextureCuDeltaQpTopBottomRow( ){ return m_iTextureCuDeltaQpTopBottomRow;} |
---|
| 303 | Void setTextureCuDeltaQpOffset ( Double dTextureCuDeltaQpOffset ){ m_dTextureCuDeltaQpOffset = dTextureCuDeltaQpOffset; } |
---|
| 304 | Void setTextureCuDeltaQpMul ( Double dTextureCuDeltaQpMul ){ m_dTextureCuDeltaQpMul = dTextureCuDeltaQpMul; } |
---|
| 305 | Void setTextureCuDeltaQpTopBottomRow( Int iTextureCuDeltaQpTopBottomRow ){ m_iTextureCuDeltaQpTopBottomRow = iTextureCuDeltaQpTopBottomRow; } |
---|
| 306 | #endif |
---|
[2] | 307 | };// END CLASS DEFINITION TComPic |
---|
| 308 | |
---|
| 309 | |
---|
| 310 | #endif // __TCOMPIC__ |
---|
| 311 | |
---|