[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.cpp |
---|
| 37 | \brief picture class |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | #include "TComPic.h" |
---|
| 41 | #include "SEI.h" |
---|
| 42 | |
---|
| 43 | // ==================================================================================================================== |
---|
| 44 | // Constructor / destructor / create / destroy |
---|
| 45 | // ==================================================================================================================== |
---|
| 46 | |
---|
| 47 | TComPic::TComPic() |
---|
| 48 | { |
---|
| 49 | m_apcPicSym = NULL; |
---|
| 50 | m_apcPicYuv[0] = NULL; |
---|
| 51 | m_apcPicYuv[1] = NULL; |
---|
[12] | 52 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 53 | m_apcPicYuvAvail = NULL; |
---|
| 54 | #endif |
---|
[12] | 55 | #if POZNAN_CU_SYNTH |
---|
[11] | 56 | m_apcPicYuvSynth = NULL; |
---|
[12] | 57 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 58 | m_apcPicYuvSynthDepth= NULL; |
---|
[11] | 59 | #endif |
---|
[12] | 60 | #endif |
---|
[5] | 61 | #if DEPTH_MAP_GENERATION |
---|
[2] | 62 | m_pcPredDepthMap = NULL; |
---|
[5] | 63 | #endif |
---|
| 64 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 65 | m_pcOrgDepthMap = NULL; |
---|
[5] | 66 | #endif |
---|
| 67 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 68 | m_pcResidual = NULL; |
---|
[5] | 69 | #endif |
---|
[2] | 70 | m_pcPicYuvPred = NULL; |
---|
| 71 | m_pcPicYuvResi = NULL; |
---|
[5] | 72 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 73 | m_pcUsedPelsMap = NULL; |
---|
[5] | 74 | #endif |
---|
[2] | 75 | |
---|
| 76 | #if PARALLEL_MERGED_DEBLK |
---|
| 77 | m_pcPicYuvDeblkBuf = NULL; |
---|
| 78 | #endif |
---|
| 79 | |
---|
| 80 | m_bReconstructed = false; |
---|
| 81 | |
---|
| 82 | m_aiNumRefIdx[0] = 0; |
---|
| 83 | m_aiNumRefIdx[1] = 0; |
---|
| 84 | |
---|
| 85 | m_iViewIdx = 0; |
---|
| 86 | m_aaiCodedScale = 0; |
---|
| 87 | m_aaiCodedOffset = 0; |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | TComPic::~TComPic() |
---|
| 91 | { |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ) |
---|
| 95 | { |
---|
| 96 | m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); |
---|
| 97 | m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); |
---|
| 98 | |
---|
| 99 | /* there are no SEI messages associated with this picture initially */ |
---|
| 100 | m_SEIs = NULL; |
---|
| 101 | |
---|
| 102 | return; |
---|
| 103 | } |
---|
| 104 | |
---|
| 105 | Void TComPic::destroy() |
---|
| 106 | { |
---|
| 107 | if (m_apcPicSym) |
---|
| 108 | { |
---|
| 109 | m_apcPicSym->destroy(); |
---|
| 110 | delete m_apcPicSym; |
---|
| 111 | m_apcPicSym = NULL; |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | if (m_apcPicYuv[0]) |
---|
| 115 | { |
---|
| 116 | m_apcPicYuv[0]->destroy(); |
---|
| 117 | delete m_apcPicYuv[0]; |
---|
| 118 | m_apcPicYuv[0] = NULL; |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | if (m_apcPicYuv[1]) |
---|
| 122 | { |
---|
| 123 | m_apcPicYuv[1]->destroy(); |
---|
| 124 | delete m_apcPicYuv[1]; |
---|
| 125 | m_apcPicYuv[1] = NULL; |
---|
| 126 | } |
---|
[12] | 127 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 128 | if (m_apcPicYuvAvail) |
---|
| 129 | { |
---|
| 130 | m_apcPicYuvAvail->destroy(); |
---|
| 131 | delete m_apcPicYuvAvail; |
---|
| 132 | m_apcPicYuvAvail = NULL; |
---|
| 133 | } |
---|
| 134 | #endif |
---|
| 135 | |
---|
[12] | 136 | #if POZNAN_CU_SYNTH |
---|
[11] | 137 | if (m_apcPicYuvSynth) |
---|
| 138 | { |
---|
| 139 | m_apcPicYuvSynth->destroy(); |
---|
| 140 | delete m_apcPicYuvSynth; |
---|
| 141 | m_apcPicYuvSynth = NULL; |
---|
| 142 | } |
---|
[12] | 143 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 144 | if (m_apcPicYuvSynthDepth) |
---|
| 145 | { |
---|
| 146 | m_apcPicYuvSynthDepth->destroy(); |
---|
| 147 | delete m_apcPicYuvSynthDepth; |
---|
| 148 | m_apcPicYuvSynthDepth = NULL; |
---|
| 149 | } |
---|
[11] | 150 | #endif |
---|
[12] | 151 | #endif |
---|
[2] | 152 | |
---|
[5] | 153 | #if DEPTH_MAP_GENERATION |
---|
[2] | 154 | if( m_pcPredDepthMap ) |
---|
| 155 | { |
---|
| 156 | m_pcPredDepthMap->destroy(); |
---|
| 157 | delete m_pcPredDepthMap; |
---|
| 158 | m_pcPredDepthMap = NULL; |
---|
| 159 | } |
---|
[5] | 160 | #endif |
---|
[2] | 161 | |
---|
[5] | 162 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 163 | if( m_pcOrgDepthMap ) |
---|
| 164 | { |
---|
| 165 | m_pcOrgDepthMap->destroy(); |
---|
| 166 | delete m_pcOrgDepthMap; |
---|
| 167 | m_pcOrgDepthMap = NULL; |
---|
| 168 | } |
---|
[5] | 169 | #endif |
---|
[2] | 170 | |
---|
[5] | 171 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 172 | if( m_pcResidual ) |
---|
| 173 | { |
---|
| 174 | m_pcResidual->destroy(); |
---|
| 175 | delete m_pcResidual; |
---|
| 176 | m_pcResidual = NULL; |
---|
| 177 | } |
---|
[5] | 178 | #endif |
---|
[2] | 179 | |
---|
[5] | 180 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 181 | if( m_pcUsedPelsMap ) |
---|
| 182 | { |
---|
| 183 | m_pcUsedPelsMap->destroy(); |
---|
| 184 | delete m_pcUsedPelsMap; |
---|
| 185 | m_pcUsedPelsMap = NULL; |
---|
| 186 | } |
---|
[5] | 187 | #endif |
---|
[2] | 188 | |
---|
| 189 | #if PARALLEL_MERGED_DEBLK |
---|
| 190 | if (m_pcPicYuvDeblkBuf) |
---|
| 191 | { |
---|
| 192 | m_pcPicYuvDeblkBuf->destroy(); |
---|
| 193 | delete m_pcPicYuvDeblkBuf; |
---|
| 194 | m_pcPicYuvDeblkBuf = NULL; |
---|
| 195 | } |
---|
| 196 | #endif |
---|
| 197 | |
---|
| 198 | delete m_SEIs; |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | #if AMVP_BUFFERCOMPRESS |
---|
| 202 | Void TComPic::compressMotion() |
---|
| 203 | { |
---|
| 204 | TComPicSym* pPicSym = getPicSym(); |
---|
| 205 | for ( UInt uiCUAddr = 0; uiCUAddr < pPicSym->getFrameHeightInCU()*pPicSym->getFrameWidthInCU(); uiCUAddr++ ) |
---|
| 206 | { |
---|
| 207 | TComDataCU* pcCU = pPicSym->getCU(uiCUAddr); |
---|
| 208 | pcCU->compressMV(); |
---|
| 209 | } |
---|
| 210 | } |
---|
| 211 | #endif |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | |
---|
| 215 | Void |
---|
| 216 | TComPic::addOriginalBuffer() |
---|
| 217 | { |
---|
| 218 | AOT( m_apcPicYuv[0] ); |
---|
| 219 | AOF( m_apcPicYuv[1] ); |
---|
| 220 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 221 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 222 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 223 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 224 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 225 | m_apcPicYuv[0] = new TComPicYuv; |
---|
| 226 | m_apcPicYuv[0] ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 227 | } |
---|
| 228 | |
---|
[12] | 229 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 230 | Void |
---|
| 231 | TComPic::addAvailabilityBuffer() |
---|
| 232 | { |
---|
| 233 | AOT( m_apcPicYuvAvail ); |
---|
| 234 | AOF( m_apcPicYuv[1] ); |
---|
| 235 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 236 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 237 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 238 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 239 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 240 | m_apcPicYuvAvail = new TComPicYuv; |
---|
| 241 | m_apcPicYuvAvail ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 242 | } |
---|
| 243 | #endif |
---|
| 244 | |
---|
[12] | 245 | #if POZNAN_CU_SYNTH |
---|
[11] | 246 | Void |
---|
| 247 | TComPic::addSynthesisBuffer() |
---|
| 248 | { |
---|
| 249 | AOT( m_apcPicYuvSynth ); |
---|
| 250 | AOF( m_apcPicYuv[1] ); |
---|
| 251 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 252 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 253 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 254 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 255 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 256 | m_apcPicYuvSynth = new TComPicYuv; |
---|
| 257 | m_apcPicYuvSynth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 258 | } |
---|
[12] | 259 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 260 | Void |
---|
| 261 | TComPic::addSynthesisDepthBuffer() |
---|
| 262 | { |
---|
| 263 | AOT( m_apcPicYuvSynthDepth ); |
---|
| 264 | AOF( m_apcPicYuv[1] ); |
---|
| 265 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 266 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 267 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 268 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 269 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 270 | m_apcPicYuvSynthDepth = new TComPicYuv; |
---|
| 271 | m_apcPicYuvSynthDepth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 272 | } |
---|
[11] | 273 | #endif |
---|
[12] | 274 | #endif |
---|
[11] | 275 | |
---|
[2] | 276 | #if PARALLEL_MERGED_DEBLK |
---|
| 277 | Void |
---|
| 278 | TComPic::addDeblockBuffer() |
---|
| 279 | { |
---|
| 280 | AOT( m_pcPicYuvDeblkBuf ); |
---|
| 281 | AOF( m_apcPicYuv[1] ); |
---|
| 282 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 283 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 284 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 285 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 286 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 287 | m_pcPicYuvDeblkBuf = new TComPicYuv; |
---|
| 288 | m_pcPicYuvDeblkBuf ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 289 | } |
---|
| 290 | #endif |
---|
| 291 | |
---|
[5] | 292 | #if DEPTH_MAP_GENERATION |
---|
[2] | 293 | Void |
---|
| 294 | TComPic::addPrdDepthMapBuffer() |
---|
| 295 | { |
---|
| 296 | AOT( m_pcPredDepthMap ); |
---|
| 297 | AOF( m_apcPicYuv[1] ); |
---|
| 298 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 299 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 300 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 301 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 302 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 303 | m_pcPredDepthMap = new TComPicYuv; |
---|
| 304 | m_pcPredDepthMap ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 305 | } |
---|
[5] | 306 | #endif |
---|
[2] | 307 | |
---|
[5] | 308 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 309 | Void |
---|
| 310 | TComPic::addOrgDepthMapBuffer() |
---|
| 311 | { |
---|
| 312 | AOT( m_pcOrgDepthMap ); |
---|
| 313 | AOF( m_apcPicYuv[1] ); |
---|
| 314 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 315 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 316 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 317 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 318 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 319 | m_pcOrgDepthMap = new TComPicYuv; |
---|
| 320 | m_pcOrgDepthMap ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 321 | } |
---|
[5] | 322 | #endif |
---|
[2] | 323 | |
---|
[5] | 324 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 325 | Void |
---|
| 326 | TComPic::addResidualBuffer() |
---|
| 327 | { |
---|
| 328 | AOT( m_pcResidual ); |
---|
| 329 | AOF( m_apcPicYuv[1] ); |
---|
| 330 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 331 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 332 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 333 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 334 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 335 | m_pcResidual = new TComPicYuv; |
---|
| 336 | m_pcResidual ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 337 | } |
---|
[5] | 338 | #endif |
---|
[2] | 339 | |
---|
[5] | 340 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 341 | Void |
---|
| 342 | TComPic::addUsedPelsMapBuffer() |
---|
| 343 | { |
---|
| 344 | AOT( m_pcUsedPelsMap ); |
---|
| 345 | AOF( m_apcPicYuv[1] ); |
---|
| 346 | Int iWidth = m_apcPicYuv[1]->getWidth (); |
---|
| 347 | Int iHeight = m_apcPicYuv[1]->getHeight (); |
---|
| 348 | UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); |
---|
| 349 | UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); |
---|
| 350 | UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); |
---|
| 351 | m_pcUsedPelsMap = new TComPicYuv; |
---|
| 352 | m_pcUsedPelsMap ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); |
---|
| 353 | } |
---|
[5] | 354 | #endif |
---|
[2] | 355 | |
---|
| 356 | Void |
---|
| 357 | TComPic::removeOriginalBuffer() |
---|
| 358 | { |
---|
| 359 | if( m_apcPicYuv[0] ) |
---|
| 360 | { |
---|
| 361 | m_apcPicYuv[0]->destroy(); |
---|
| 362 | delete m_apcPicYuv[0]; |
---|
| 363 | m_apcPicYuv[0] = NULL; |
---|
| 364 | } |
---|
| 365 | } |
---|
| 366 | |
---|
[12] | 367 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
[11] | 368 | Void |
---|
| 369 | TComPic::removeAvailabilityBuffer() |
---|
| 370 | { |
---|
| 371 | if( m_apcPicYuvAvail ) |
---|
| 372 | { |
---|
| 373 | m_apcPicYuvAvail->destroy(); |
---|
| 374 | delete m_apcPicYuvAvail; |
---|
| 375 | m_apcPicYuvAvail = NULL; |
---|
| 376 | } |
---|
| 377 | } |
---|
| 378 | #endif |
---|
| 379 | |
---|
[12] | 380 | #if POZNAN_CU_SYNTH |
---|
[11] | 381 | Void |
---|
| 382 | TComPic::removeSynthesisBuffer() |
---|
| 383 | { |
---|
| 384 | if( m_apcPicYuvSynth ) |
---|
| 385 | { |
---|
| 386 | m_apcPicYuvSynth->destroy(); |
---|
| 387 | delete m_apcPicYuvSynth; |
---|
| 388 | m_apcPicYuvSynth = NULL; |
---|
| 389 | } |
---|
| 390 | } |
---|
[12] | 391 | #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH |
---|
| 392 | Void |
---|
| 393 | TComPic::removeSynthesisDepthBuffer() |
---|
| 394 | { |
---|
| 395 | if( m_apcPicYuvSynthDepth ) |
---|
| 396 | { |
---|
| 397 | m_apcPicYuvSynthDepth->destroy(); |
---|
| 398 | delete m_apcPicYuvSynthDepth; |
---|
| 399 | m_apcPicYuvSynthDepth = NULL; |
---|
| 400 | } |
---|
| 401 | } |
---|
[11] | 402 | #endif |
---|
[12] | 403 | #endif |
---|
[11] | 404 | |
---|
[2] | 405 | #if PARALLEL_MERGED_DEBLK |
---|
| 406 | Void |
---|
| 407 | TComPic::removeDeblockBuffer() |
---|
| 408 | { |
---|
| 409 | if( m_pcPicYuvDeblkBuf ) |
---|
| 410 | { |
---|
| 411 | m_pcPicYuvDeblkBuf->destroy(); |
---|
| 412 | delete m_pcPicYuvDeblkBuf; |
---|
| 413 | m_pcPicYuvDeblkBuf = NULL; |
---|
| 414 | } |
---|
| 415 | } |
---|
| 416 | #endif |
---|
| 417 | |
---|
[5] | 418 | #if DEPTH_MAP_GENERATION |
---|
[2] | 419 | Void |
---|
| 420 | TComPic::removePrdDepthMapBuffer() |
---|
| 421 | { |
---|
| 422 | if( m_pcPredDepthMap ) |
---|
| 423 | { |
---|
| 424 | m_pcPredDepthMap->destroy(); |
---|
| 425 | delete m_pcPredDepthMap; |
---|
| 426 | m_pcPredDepthMap = NULL; |
---|
| 427 | } |
---|
| 428 | } |
---|
[5] | 429 | #endif |
---|
[2] | 430 | |
---|
[5] | 431 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 432 | Void |
---|
| 433 | TComPic::removeOrgDepthMapBuffer() |
---|
| 434 | { |
---|
| 435 | if( m_pcOrgDepthMap ) |
---|
| 436 | { |
---|
| 437 | m_pcOrgDepthMap->destroy(); |
---|
| 438 | delete m_pcOrgDepthMap; |
---|
| 439 | m_pcOrgDepthMap = NULL; |
---|
| 440 | } |
---|
| 441 | } |
---|
[5] | 442 | #endif |
---|
[2] | 443 | |
---|
[5] | 444 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 445 | Void |
---|
| 446 | TComPic::removeResidualBuffer() |
---|
| 447 | { |
---|
| 448 | if( m_pcResidual ) |
---|
| 449 | { |
---|
| 450 | m_pcResidual->destroy(); |
---|
| 451 | delete m_pcResidual; |
---|
| 452 | m_pcResidual = NULL; |
---|
| 453 | } |
---|
| 454 | } |
---|
[5] | 455 | #endif |
---|
[2] | 456 | |
---|
[5] | 457 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 458 | Void |
---|
| 459 | TComPic::removeUsedPelsMapBuffer() |
---|
| 460 | { |
---|
| 461 | if( m_pcUsedPelsMap ) |
---|
| 462 | { |
---|
| 463 | m_pcUsedPelsMap->destroy(); |
---|
| 464 | delete m_pcUsedPelsMap; |
---|
| 465 | m_pcUsedPelsMap = NULL; |
---|
| 466 | } |
---|
| 467 | } |
---|
[5] | 468 | #endif |
---|
[2] | 469 | |
---|
[12] | 470 | #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP |
---|
[11] | 471 | Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied ) |
---|
| 472 | { |
---|
| 473 | rpbCUSynthesied[0] = true; |
---|
| 474 | rpbCUSynthesied[1] = true; |
---|
| 475 | rpbCUSynthesied[2] = true; |
---|
| 476 | rpbCUSynthesied[3] = true; |
---|
| 477 | |
---|
| 478 | if (!getPicYuvAvail()) |
---|
| 479 | { |
---|
| 480 | rpbCUSynthesied[0] = false; |
---|
| 481 | rpbCUSynthesied[1] = false; |
---|
| 482 | rpbCUSynthesied[2] = false; |
---|
| 483 | rpbCUSynthesied[3] = false; |
---|
| 484 | return; |
---|
| 485 | } |
---|
| 486 | |
---|
| 487 | Int x, y; |
---|
| 488 | Bool bAvailable = true; |
---|
| 489 | Pel* pAvail = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx ); |
---|
| 490 | Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx); |
---|
| 491 | Int CUWidth = g_uiMaxCUWidth >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx); |
---|
| 492 | |
---|
| 493 | Int iStride = getPicYuvAvail()->getStride(); |
---|
| 494 | for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) |
---|
| 495 | { |
---|
| 496 | for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) |
---|
| 497 | { |
---|
| 498 | rpbCUSynthesied[0] &= (pAvail[x] != 0); |
---|
| 499 | } |
---|
| 500 | for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) |
---|
| 501 | { |
---|
| 502 | rpbCUSynthesied[1] &= (pAvail[x] != 0); |
---|
| 503 | } |
---|
| 504 | pAvail += iStride; |
---|
| 505 | } |
---|
| 506 | //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- ) |
---|
| 507 | for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka |
---|
| 508 | { |
---|
| 509 | for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) |
---|
| 510 | { |
---|
| 511 | rpbCUSynthesied[2] &= (pAvail[x] != 0); |
---|
| 512 | } |
---|
| 513 | for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) |
---|
| 514 | { |
---|
| 515 | rpbCUSynthesied[3] &= (pAvail[x] != 0); |
---|
| 516 | } |
---|
| 517 | pAvail += iStride; |
---|
| 518 | } |
---|
| 519 | |
---|
| 520 | //rpbCUSynthesied[0] = !rpbCUSynthesied[0]; |
---|
| 521 | //rpbCUSynthesied[1] = !rpbCUSynthesied[1]; |
---|
| 522 | //rpbCUSynthesied[2] = !rpbCUSynthesied[2]; |
---|
| 523 | //rpbCUSynthesied[3] = !rpbCUSynthesied[3]; |
---|
| 524 | } |
---|
[12] | 525 | #endif |
---|