[313] | 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 |
---|
[1029] | 4 | * granted under this license. |
---|
[313] | 5 | * |
---|
[1259] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[313] | 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 ITU/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 | */ |
---|
| 33 | |
---|
| 34 | /** \file TComPic.cpp |
---|
| 35 | \brief picture class |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #include "TComPic.h" |
---|
| 39 | #include "SEI.h" |
---|
| 40 | |
---|
| 41 | //! \ingroup TLibCommon |
---|
| 42 | //! \{ |
---|
| 43 | |
---|
| 44 | // ==================================================================================================================== |
---|
| 45 | // Constructor / destructor / create / destroy |
---|
| 46 | // ==================================================================================================================== |
---|
| 47 | |
---|
| 48 | TComPic::TComPic() |
---|
| 49 | : m_uiTLayer (0) |
---|
| 50 | , m_bUsedByCurr (false) |
---|
| 51 | , m_bIsLongTerm (false) |
---|
| 52 | , m_pcPicYuvPred (NULL) |
---|
| 53 | , m_pcPicYuvResi (NULL) |
---|
| 54 | , m_bReconstructed (false) |
---|
| 55 | , m_bNeededForOutput (false) |
---|
| 56 | , m_uiCurrSliceIdx (0) |
---|
[595] | 57 | , m_bCheckLTMSB (false) |
---|
| 58 | #if SVC_EXTENSION |
---|
| 59 | , m_layerId( 0 ) |
---|
[540] | 60 | #endif |
---|
[313] | 61 | { |
---|
| 62 | #if SVC_EXTENSION |
---|
| 63 | memset( m_pcFullPelBaseRec, 0, sizeof( m_pcFullPelBaseRec ) ); |
---|
| 64 | memset( m_bSpatialEnhLayer, false, sizeof( m_bSpatialEnhLayer ) ); |
---|
[901] | 65 | memset( m_equalPictureSizeAndOffsetFlag, false, sizeof( m_equalPictureSizeAndOffsetFlag ) ); |
---|
[313] | 66 | #endif |
---|
[1029] | 67 | for(UInt i=0; i<NUM_PIC_YUV; i++) |
---|
| 68 | { |
---|
| 69 | m_apcPicYuv[i] = NULL; |
---|
| 70 | } |
---|
[313] | 71 | } |
---|
| 72 | |
---|
| 73 | TComPic::~TComPic() |
---|
| 74 | { |
---|
| 75 | } |
---|
[815] | 76 | #if SVC_EXTENSION |
---|
[1290] | 77 | Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId ) |
---|
[313] | 78 | { |
---|
[1235] | 79 | const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId); |
---|
[1290] | 80 | const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); |
---|
| 81 | const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); |
---|
| 82 | const UInt uiMaxCuWidth = sps.getMaxCUWidth(); |
---|
| 83 | const UInt uiMaxCuHeight = sps.getMaxCUHeight(); |
---|
| 84 | const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); |
---|
[1235] | 85 | |
---|
| 86 | const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId ); |
---|
| 87 | |
---|
[1289] | 88 | m_picSym.create( vps, sps, pps, uiMaxDepth, layerId ); |
---|
[1235] | 89 | |
---|
[313] | 90 | if (!bIsVirtual) |
---|
| 91 | { |
---|
[1289] | 92 | m_apcPicYuv[PIC_YUV_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); |
---|
| 93 | m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); |
---|
[313] | 94 | } |
---|
[1289] | 95 | m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); |
---|
[313] | 96 | |
---|
| 97 | for( Int i = 0; i < MAX_LAYERS; i++ ) |
---|
| 98 | { |
---|
| 99 | if( m_bSpatialEnhLayer[i] ) |
---|
| 100 | { |
---|
[1289] | 101 | m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); |
---|
[313] | 102 | } |
---|
[1235] | 103 | } |
---|
[313] | 104 | |
---|
| 105 | // there are no SEI messages associated with this picture initially |
---|
| 106 | if (m_SEIs.size() > 0) |
---|
| 107 | { |
---|
| 108 | deleteSEIs (m_SEIs); |
---|
| 109 | } |
---|
| 110 | m_bUsedByCurr = false; |
---|
| 111 | } |
---|
| 112 | #else |
---|
[1290] | 113 | Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual) |
---|
[313] | 114 | { |
---|
[1290] | 115 | const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); |
---|
| 116 | const Int iWidth = sps.getPicWidthInLumaSamples(); |
---|
| 117 | const Int iHeight = sps.getPicHeightInLumaSamples(); |
---|
| 118 | const UInt uiMaxCuWidth = sps.getMaxCUWidth(); |
---|
| 119 | const UInt uiMaxCuHeight = sps.getMaxCUHeight(); |
---|
| 120 | const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); |
---|
[1235] | 121 | |
---|
[1289] | 122 | m_picSym.create( sps, pps, uiMaxDepth ); |
---|
[313] | 123 | if (!bIsVirtual) |
---|
| 124 | { |
---|
[1289] | 125 | m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); |
---|
| 126 | m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); |
---|
[313] | 127 | } |
---|
[1289] | 128 | m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); |
---|
[1029] | 129 | |
---|
[313] | 130 | // there are no SEI messages associated with this picture initially |
---|
| 131 | if (m_SEIs.size() > 0) |
---|
| 132 | { |
---|
| 133 | deleteSEIs (m_SEIs); |
---|
| 134 | } |
---|
| 135 | m_bUsedByCurr = false; |
---|
| 136 | } |
---|
| 137 | #endif |
---|
| 138 | |
---|
| 139 | Void TComPic::destroy() |
---|
| 140 | { |
---|
[1235] | 141 | m_picSym.destroy(); |
---|
[1029] | 142 | |
---|
| 143 | for(UInt i=0; i<NUM_PIC_YUV; i++) |
---|
[313] | 144 | { |
---|
[1029] | 145 | if (m_apcPicYuv[i]) |
---|
| 146 | { |
---|
| 147 | m_apcPicYuv[i]->destroy(); |
---|
| 148 | delete m_apcPicYuv[i]; |
---|
| 149 | m_apcPicYuv[i] = NULL; |
---|
| 150 | } |
---|
[313] | 151 | } |
---|
[1029] | 152 | |
---|
[313] | 153 | deleteSEIs(m_SEIs); |
---|
[815] | 154 | #if SVC_EXTENSION |
---|
[313] | 155 | for( Int i = 0; i < MAX_LAYERS; i++ ) |
---|
| 156 | { |
---|
[827] | 157 | if( m_bSpatialEnhLayer[i] && m_pcFullPelBaseRec[i] ) |
---|
[313] | 158 | { |
---|
| 159 | m_pcFullPelBaseRec[i]->destroy(); |
---|
| 160 | delete m_pcFullPelBaseRec[i]; |
---|
| 161 | m_pcFullPelBaseRec[i] = NULL; |
---|
| 162 | } |
---|
| 163 | } |
---|
| 164 | #endif |
---|
| 165 | } |
---|
| 166 | |
---|
| 167 | Void TComPic::compressMotion() |
---|
| 168 | { |
---|
[1029] | 169 | TComPicSym* pPicSym = getPicSym(); |
---|
| 170 | for ( UInt uiCUAddr = 0; uiCUAddr < pPicSym->getNumberOfCtusInFrame(); uiCUAddr++ ) |
---|
[313] | 171 | { |
---|
[1029] | 172 | TComDataCU* pCtu = pPicSym->getCtu(uiCUAddr); |
---|
| 173 | pCtu->compressMV(); |
---|
| 174 | } |
---|
[313] | 175 | } |
---|
[595] | 176 | |
---|
[540] | 177 | Bool TComPic::getSAOMergeAvailability(Int currAddr, Int mergeAddr) |
---|
| 178 | { |
---|
[1029] | 179 | Bool mergeCtbInSliceSeg = (mergeAddr >= getPicSym()->getCtuTsToRsAddrMap(getCtu(currAddr)->getSlice()->getSliceCurStartCtuTsAddr())); |
---|
[540] | 180 | Bool mergeCtbInTile = (getPicSym()->getTileIdxMap(mergeAddr) == getPicSym()->getTileIdxMap(currAddr)); |
---|
| 181 | return (mergeCtbInSliceSeg && mergeCtbInTile); |
---|
| 182 | } |
---|
[313] | 183 | |
---|
[1029] | 184 | UInt TComPic::getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice) |
---|
| 185 | { |
---|
| 186 | UInt subStrm; |
---|
[1235] | 187 | const bool bWPPEnabled=pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag(); |
---|
| 188 | const TComPicSym &picSym = *(getPicSym()); |
---|
[1029] | 189 | |
---|
[1235] | 190 | if ((bWPPEnabled && picSym.getFrameHeightInCtus()>1) || (picSym.getNumTiles()>1)) // wavefronts, and possibly tiles being used. |
---|
[1029] | 191 | { |
---|
[1235] | 192 | if (bWPPEnabled) |
---|
[1029] | 193 | { |
---|
| 194 | const UInt ctuRsAddr = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr); |
---|
| 195 | const UInt frameWidthInCtus = picSym.getFrameWidthInCtus(); |
---|
| 196 | const UInt tileIndex = picSym.getTileIdxMap(ctuRsAddr); |
---|
| 197 | const UInt numTileColumns = (picSym.getNumTileColumnsMinus1()+1); |
---|
| 198 | const TComTile *pTile = picSym.getTComTile(tileIndex); |
---|
| 199 | const UInt firstCtuRsAddrOfTile = pTile->getFirstCtuRsAddr(); |
---|
| 200 | const UInt tileYInCtus = firstCtuRsAddrOfTile / frameWidthInCtus; |
---|
| 201 | // independent tiles => substreams are "per tile" |
---|
| 202 | const UInt ctuLine = ctuRsAddr / frameWidthInCtus; |
---|
| 203 | const UInt startingSubstreamForTile =(tileYInCtus*numTileColumns) + (pTile->getTileHeightInCtus()*(tileIndex%numTileColumns)); |
---|
| 204 | subStrm = startingSubstreamForTile + (ctuLine - tileYInCtus); |
---|
| 205 | } |
---|
| 206 | else |
---|
| 207 | { |
---|
| 208 | const UInt ctuRsAddr = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr); |
---|
| 209 | const UInt tileIndex = picSym.getTileIdxMap(ctuRsAddr); |
---|
| 210 | subStrm=tileIndex; |
---|
| 211 | } |
---|
| 212 | } |
---|
| 213 | else |
---|
| 214 | { |
---|
| 215 | // dependent tiles => substreams are "per frame". |
---|
| 216 | subStrm = 0; |
---|
| 217 | } |
---|
| 218 | return subStrm; |
---|
| 219 | } |
---|
| 220 | |
---|
[442] | 221 | #if SVC_EXTENSION |
---|
[313] | 222 | Void copyOnetoOnePicture( // SVC_NONCOLL |
---|
| 223 | Pel *in, |
---|
| 224 | Pel *out, |
---|
| 225 | Int nCols, |
---|
| 226 | Int nRows, |
---|
| 227 | Int fullRowWidth) |
---|
| 228 | { |
---|
| 229 | Int rX; |
---|
| 230 | |
---|
| 231 | for (rX = 0; rX < nRows; rX++) |
---|
| 232 | { |
---|
| 233 | memcpy( out, in, sizeof(Pel) * nCols ); |
---|
| 234 | in = in + fullRowWidth; |
---|
| 235 | out = out + fullRowWidth; |
---|
| 236 | } |
---|
| 237 | } |
---|
| 238 | |
---|
| 239 | Void TComPic::copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut) |
---|
| 240 | { |
---|
[1029] | 241 | Int upsampledRowWidthLuma = pcPicYuvOut->getStride(COMPONENT_Y); // 2 * pcPicYuvOut->getLumaMargin() + pcPicYuvOut->getWidth(); |
---|
| 242 | Int upsampledRowWidthCroma = pcPicYuvOut->getStride(COMPONENT_Cb); //2 * pcPicYuvOut->getChromaMargin() + (pcPicYuvOut->getWidth()>>1); |
---|
[313] | 243 | |
---|
| 244 | copyOnetoOnePicture( |
---|
[1029] | 245 | pcPicYuvIn->getAddr(COMPONENT_Y), |
---|
| 246 | pcPicYuvOut->getAddr(COMPONENT_Y), |
---|
| 247 | pcPicYuvOut->getWidth(COMPONENT_Y), |
---|
| 248 | pcPicYuvOut->getHeight(COMPONENT_Y), |
---|
[313] | 249 | upsampledRowWidthLuma); |
---|
| 250 | copyOnetoOnePicture( |
---|
[1029] | 251 | pcPicYuvIn->getAddr(COMPONENT_Cr), |
---|
| 252 | pcPicYuvOut->getAddr(COMPONENT_Cr), |
---|
| 253 | pcPicYuvOut->getWidth(COMPONENT_Y)>>1, |
---|
| 254 | pcPicYuvOut->getHeight(COMPONENT_Y)>>1, |
---|
[313] | 255 | upsampledRowWidthCroma); |
---|
| 256 | copyOnetoOnePicture( |
---|
[1029] | 257 | pcPicYuvIn->getAddr(COMPONENT_Cb), |
---|
| 258 | pcPicYuvOut->getAddr(COMPONENT_Cb), |
---|
| 259 | pcPicYuvOut->getWidth(COMPONENT_Y)>>1, |
---|
| 260 | pcPicYuvOut->getHeight(COMPONENT_Y)>>1, |
---|
[313] | 261 | upsampledRowWidthCroma); |
---|
| 262 | } |
---|
| 263 | |
---|
[1289] | 264 | Void TComPic::copyUpsampledMvField(UInt refLayerIdc) |
---|
[313] | 265 | { |
---|
[1290] | 266 | const TComSPS *sps = getSlice(0)->getSPS(); |
---|
| 267 | const UInt uiMaxDepth = sps->getMaxTotalCUDepth(); |
---|
| 268 | const UInt numPartitions = 1<<(uiMaxDepth<<1); |
---|
| 269 | const UInt widthMinPU = sps->getMaxCUWidth() / (1<<uiMaxDepth); |
---|
| 270 | const UInt heightMinPU = sps->getMaxCUHeight() / (1<<uiMaxDepth); |
---|
| 271 | const Int unitNum = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); |
---|
[313] | 272 | |
---|
[1029] | 273 | for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++) //each LCU |
---|
[313] | 274 | { |
---|
[1029] | 275 | TComDataCU* pcCUDes = getCtu(cuIdx); |
---|
[313] | 276 | |
---|
| 277 | for(UInt absPartIdx = 0; absPartIdx < numPartitions; absPartIdx+=unitNum ) //each 16x16 unit |
---|
| 278 | { |
---|
| 279 | //pixel position of each unit in up-sampled layer |
---|
[1289] | 280 | UInt pelX = pcCUDes->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[absPartIdx] ]; |
---|
| 281 | UInt pelY = pcCUDes->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[absPartIdx] ]; |
---|
[313] | 282 | UInt baseCUAddr, baseAbsPartIdx; |
---|
| 283 | |
---|
| 284 | TComDataCU *pcColCU = 0; |
---|
[822] | 285 | pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX, pelY, baseCUAddr, baseAbsPartIdx, true); |
---|
[313] | 286 | |
---|
[1029] | 287 | if( pcColCU && pcColCU->getPredictionMode(baseAbsPartIdx) == MODE_INTER ) //base layer unit not skip and invalid mode |
---|
[313] | 288 | { |
---|
| 289 | for(UInt refPicList = 0; refPicList < 2; refPicList++) //for each reference list |
---|
| 290 | { |
---|
| 291 | TComMvField sMvFieldBase, sMvField; |
---|
| 292 | pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); |
---|
| 293 | pcCUDes->scaleBaseMV( refLayerIdc, sMvField, sMvFieldBase ); |
---|
| 294 | |
---|
| 295 | pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx); |
---|
| 296 | pcCUDes->setPredictionMode(absPartIdx, MODE_INTER); |
---|
| 297 | } |
---|
| 298 | } |
---|
| 299 | else |
---|
| 300 | { |
---|
| 301 | TComMvField zeroMvField; //zero MV and invalid reference index |
---|
| 302 | pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, absPartIdx); |
---|
| 303 | pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, absPartIdx); |
---|
| 304 | pcCUDes->setPredictionMode(absPartIdx, MODE_INTRA); |
---|
| 305 | } |
---|
| 306 | |
---|
| 307 | for(UInt i = 1; i < unitNum; i++ ) |
---|
| 308 | { |
---|
| 309 | pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_0)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_0)->getRefIdx(absPartIdx), absPartIdx + i); |
---|
| 310 | pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_1)->getMv(absPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_1)->getRefIdx(absPartIdx), absPartIdx + i); |
---|
| 311 | pcCUDes->setPredictionMode(absPartIdx+i, pcCUDes->getPredictionMode(absPartIdx)); |
---|
| 312 | } |
---|
| 313 | } |
---|
[822] | 314 | memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(Char)*numPartitions ); |
---|
[313] | 315 | } |
---|
| 316 | } |
---|
| 317 | |
---|
| 318 | Void TComPic::initUpsampledMvField() |
---|
| 319 | { |
---|
[1290] | 320 | const TComSPS *sps = getSlice(0)->getSPS(); |
---|
| 321 | const UInt uiMaxDepth = sps->getMaxTotalCUDepth(); |
---|
| 322 | const UInt uiNumPartitions = 1<<(uiMaxDepth<<1); |
---|
[313] | 323 | |
---|
[1029] | 324 | for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++) //each LCU |
---|
[313] | 325 | { |
---|
[1029] | 326 | TComDataCU* pcCUDes = getCtu(cuIdx); |
---|
[313] | 327 | TComMvField zeroMvField; |
---|
| 328 | for(UInt list = 0; list < 2; list++) //each reference list |
---|
| 329 | { |
---|
| 330 | for(UInt i = 0; i < uiNumPartitions; i++ ) |
---|
| 331 | { |
---|
| 332 | pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, i); |
---|
| 333 | pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, i); |
---|
| 334 | pcCUDes->setPredictionMode(i, MODE_INTRA); |
---|
| 335 | pcCUDes->setPartitionSize(i, SIZE_2Nx2N); |
---|
| 336 | } |
---|
| 337 | } |
---|
| 338 | } |
---|
| 339 | return; |
---|
| 340 | } |
---|
| 341 | |
---|
[494] | 342 | Bool TComPic::checkSameRefInfo() |
---|
| 343 | { |
---|
| 344 | Bool bSameRefInfo = true; |
---|
| 345 | TComSlice * pSlice0 = getSlice( 0 ); |
---|
| 346 | for( UInt uSliceID = getNumAllocatedSlice() - 1 ; bSameRefInfo && uSliceID > 0 ; uSliceID-- ) |
---|
| 347 | { |
---|
| 348 | TComSlice * pSliceN = getSlice( uSliceID ); |
---|
| 349 | if( pSlice0->getSliceType() != pSliceN->getSliceType() ) |
---|
| 350 | { |
---|
| 351 | bSameRefInfo = false; |
---|
| 352 | } |
---|
| 353 | else if( pSlice0->getSliceType() != I_SLICE ) |
---|
| 354 | { |
---|
| 355 | Int nListNum = pSlice0->getSliceType() == B_SLICE ? 2 : 1; |
---|
| 356 | for( Int nList = 0 ; nList < nListNum ; nList++ ) |
---|
| 357 | { |
---|
| 358 | RefPicList eRefList = ( RefPicList )nList; |
---|
| 359 | if( pSlice0->getNumRefIdx( eRefList ) == pSliceN->getNumRefIdx( eRefList ) ) |
---|
| 360 | { |
---|
| 361 | for( Int refIdx = pSlice0->getNumRefIdx( eRefList ) - 1 ; refIdx >= 0 ; refIdx-- ) |
---|
| 362 | { |
---|
| 363 | if( pSlice0->getRefPic( eRefList , refIdx ) != pSliceN->getRefPic( eRefList , refIdx ) ) |
---|
| 364 | { |
---|
| 365 | bSameRefInfo = false; |
---|
| 366 | break; |
---|
| 367 | } |
---|
| 368 | } |
---|
| 369 | } |
---|
| 370 | else |
---|
| 371 | { |
---|
| 372 | bSameRefInfo = false; |
---|
| 373 | break; |
---|
| 374 | } |
---|
| 375 | } |
---|
| 376 | } |
---|
| 377 | } |
---|
[313] | 378 | |
---|
[494] | 379 | return( bSameRefInfo ); |
---|
| 380 | } |
---|
[1029] | 381 | #endif //SVC_EXTENSION |
---|
[494] | 382 | |
---|
[313] | 383 | //! \} |
---|