Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComPattern.cpp
- Timestamp:
- 11 May 2012, 21:20:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComPattern.cpp
r21 r56 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 1,ISO/IEC6 * Copyright (c) 2010-2012, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 15 15 * this list of conditions and the following disclaimer in the documentation 16 16 * and/or other materials provided with the distribution. 17 * * Neither the name of the I SO/IEC nor the names of its contributors may17 * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may 18 18 * be used to endorse or promote products derived from this software without 19 19 * specific prior written permission. … … 32 32 */ 33 33 34 35 36 34 /** \file TComPattern.cpp 37 35 \brief neighbouring pixel access classes … … 42 40 #include "TComDataCU.h" 43 41 42 //! \ingroup TLibCommon 43 //! \{ 44 44 45 // ==================================================================================================================== 45 46 // Tables 46 47 // ==================================================================================================================== 47 48 48 const UChar g_aaucAvailableBlkMask[16][8] = 49 { 50 // 4x4 block neighbor availability // MB neighbor availability 51 {0x0,0x0,0x0,0x0, 0x0,0x8,0x0,0x08 }, // L, A, AL, AR <== WTF (blkIdx < 8) 52 {0x1,0x0,0x0,0x0, 0x1,0x8,0x0,0x08 }, // A, AL, AR 53 {0xA,0xE,0xE,0x6, 0x0,0x8,0x0,0x08 }, // L, AL, AR 54 {0xB,0xE,0xE,0x6, 0x1,0x8,0x0,0x08 }, // AL, AR 55 56 {0x4,0x0,0x0,0x0, 0x0,0x8,0x0,0x08 }, // L, A, AR 57 {0x5,0x0,0x0,0x0, 0x1,0x8,0x0,0x08 }, // A, AR 58 {0xE,0xE,0xE,0x6, 0x0,0x8,0x0,0x08 }, // L, AR 59 {0xF,0xE,0xE,0x6, 0x1,0x8,0x0,0x08 }, // AR 60 61 {0x0,0x0,0x0,0x8, 0x0,0x8,0x0,0x08 }, // L, A, AL <== WTF (blkIdx < 8 || blkIdx >= 8) 62 {0x1,0x0,0x0,0x8, 0x1,0x8,0x0,0x08 }, // A, AL 63 {0xA,0xE,0xE,0xE, 0x0,0x8,0x0,0x08 }, // L, AL 64 {0xB,0xE,0xE,0xE, 0x1,0x8,0x0,0x08 }, // AL 65 66 {0x4,0x0,0x0,0x8, 0x0,0x8,0x0,0x08 }, // L, A, 67 {0x5,0x0,0x0,0x8, 0x1,0x8,0x0,0x08 }, // A, 68 {0xE,0xE,0xE,0xE, 0x0,0x8,0x0,0x08 }, // L, 69 {0xF,0xE,0xE,0xE, 0x1,0x8,0x0,0x08 } // 49 #if LOGI_INTRA_NAME_3MPM 50 const UChar TComPattern::m_aucIntraFilter[5] = 51 { 52 10, //4x4 53 7, //8x8 54 1, //16x16 55 0, //32x32 56 10, //64x64 70 57 }; 58 #else 59 const UChar TComPattern::m_aucIntraFilter[5][NUM_INTRA_MODE] = 60 { 61 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 62 }, //4x4 63 {1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 64 }, //8x8 65 {1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0 66 }, //16x16 67 {1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 68 }, //32x32 69 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 70 }, //64x64 71 }; 72 #endif 71 73 72 74 // ==================================================================================================================== … … 124 126 Int iOffsetBottom, 125 127 UInt uiPartDepth, 126 UInt uiAbsPartIdx 127 #if DEPTH_MAP_GENERATION 128 ,Bool bPrdDepthMap128 UInt uiAbsPartIdx 129 #if DEPTH_MAP_GENERATION 130 ,Bool bPrdDepthMap 129 131 #endif 130 132 ) … … 145 147 TComPicYuv* pcPic = pcCU->getPic()->getPicYuvRec(); 146 148 #endif 149 147 150 if ( iComp == 0 ) 148 151 { … … 162 165 #endif 163 166 if ( iComp == 1 ) 167 { 164 168 m_piPatternOrigin = pcPic->getCbAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft; 169 } 165 170 else 171 { 166 172 m_piPatternOrigin = pcPic->getCrAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft; 173 } 167 174 } 168 175 } … … 190 197 } 191 198 192 Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx 193 #if DEPTH_MAP_GENERATION 194 , Bool bPrdDepthMap195 #endif 196 )199 Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx 200 #if DEPTH_MAP_GENERATION 201 , Bool bPrdDepthMap 202 #endif 203 ) 197 204 { 198 205 Int uiOffsetLeft = 0; … … 209 216 210 217 if( uiCurrPicPelX != 0 ) 218 { 211 219 uiOffsetLeft = 1; 220 } 221 212 222 if( uiCurrPicPelY != 0 ) 213 223 { … … 215 225 uiOffsetAbove = 1; 216 226 217 if( uiCurrPicPelX + uiWidth < pcCU->getSlice()->getSPS()->get Width() )227 if( uiCurrPicPelX + uiWidth < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) 218 228 { 219 229 if( ( g_auiZscanToRaster[uiAbsZorderIdx] + uiNumPartInWidth ) % pcPic->getNumPartInWidth() ) // Not CU boundary 220 230 { 221 231 if( g_auiRasterToZscan[ (Int)g_auiZscanToRaster[uiAbsZorderIdx] - (Int)pcPic->getNumPartInWidth() + (Int)uiNumPartInWidth ] < uiAbsZorderIdx ) 232 { 222 233 uiOffsetRight = 1; 234 } 223 235 } 224 236 else // if it is CU boundary … … 232 244 } 233 245 234 #if LM_CHROMA235 m_bLeftAvailable = uiCurrPicPelX > 0 ? true : false;236 m_bAboveAvailable = uiCurrPicPelY > 0 ? true : false;237 #endif238 239 246 #if DEPTH_MAP_GENERATION 240 247 m_cPatternY .setPatternParamCU( pcCU, 0, uiWidth, uiHeight, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap ); … … 248 255 } 249 256 250 Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft 251 #if DEPTH_MAP_GENERATION 252 , Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY253 #endif 254 257 Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft, Bool bLMmode 258 #if DEPTH_MAP_GENERATION 259 , Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY 260 #endif 261 ) 255 262 { 256 263 Pel* piRoiOrigin; … … 262 269 UInt uiWidth; 263 270 UInt uiHeight; 264 265 271 #if DEPTH_MAP_GENERATION 266 272 Int iPicStride = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap()->getStride() : pcCU->getPic()->getStride() ); … … 268 274 Int iPicStride = pcCU->getPic()->getStride(); 269 275 #endif 270 271 Int iCuAddr;272 #if REFERENCE_SAMPLE_PADDING273 276 Int iUnitSize = 0; 274 277 Int iNumUnitsInCu = 0; 275 278 Int iTotalUnits = 0; 276 Bool * bNeighborFlags;279 Bool bNeighborFlags[4 * MAX_NUM_SPU_W + 1]; 277 280 Int iNumIntraNeighbor = 0; 278 #else // REFERENCE_SAMPLE_PADDING 279 Pel* piRoiTemp; 280 Bool bAboveFlag = false; 281 Bool bAboveRightFlag = false; 282 Bool bLeftFlag = false; 283 Bool bBelowLeftFlag = false; 284 Bool bAboveLeftFlag = false; 285 #endif // REFERENCE_SAMPLE_PADDING 286 287 iCuAddr = pcCU->getAddr(); 288 289 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB, uiPartDum; 281 282 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 283 290 284 291 285 pcCU->deriveLeftRightTopIdxAdi( uiPartIdxLT, uiPartIdxRT, uiZorderIdxInPart, uiPartDepth ); 292 286 pcCU->deriveLeftBottomIdxAdi ( uiPartIdxLB, uiZorderIdxInPart, uiPartDepth ); 293 287 294 #if CONSTRAINED_INTRA_PRED 295 if ( pcCU->getSlice()->getPPS()->getConstrainedIntraPred() ) 296 { 297 #if REFERENCE_SAMPLE_PADDING 298 iUnitSize = g_uiMaxCUWidth >> g_uiMaxCUDepth; 299 iNumUnitsInCu = uiCuWidth / iUnitSize; 300 iTotalUnits = (iNumUnitsInCu << 2) + 1; 301 bNeighborFlags = new Bool[iTotalUnits]; 302 303 bNeighborFlags[iNumUnitsInCu*2] = isAboveLeftAvailableForCIP( pcCU, uiPartIdxLT ); 304 iNumIntraNeighbor += (Int)(bNeighborFlags[iNumUnitsInCu*2]); 305 iNumIntraNeighbor += isAboveAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*2)+1 ); 306 iNumIntraNeighbor += isAboveRightAvailableForCIP( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*3)+1 ); 307 iNumIntraNeighbor += isLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+(iNumUnitsInCu*2)-1 ); 308 iNumIntraNeighbor += isBelowLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+ iNumUnitsInCu -1 ); 309 #else // REFERENCE_SAMPLE_PADDING 310 bAboveFlag = isAboveAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxRT ); 311 bAboveRightFlag = isAboveRightAvailableForCIP( pcCU, uiPartIdxLT, uiPartIdxRT ); 312 bLeftFlag = isLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB ); 313 bBelowLeftFlag = isBelowLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB ); 314 bAboveLeftFlag = isAboveLeftAvailableForCIP ( pcCU, uiPartIdxLT ); 315 #endif // REFERENCE_SAMPLE_PADDING 316 } 317 else 318 { 319 #if REFERENCE_SAMPLE_PADDING 320 iUnitSize = uiCuWidth; 321 iNumUnitsInCu = 1; 322 iTotalUnits = 5; 323 bNeighborFlags = new Bool[iTotalUnits]; 324 325 ::memset(bNeighborFlags, false, sizeof(Bool)*iTotalUnits); 326 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[3] = true; iNumIntraNeighbor++; } 327 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, 1, true, false ) ) { bNeighborFlags[4] = true; iNumIntraNeighbor++; } 328 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[1] = true; iNumIntraNeighbor++; } 329 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, 1, true, false ) ) { bNeighborFlags[0] = true; iNumIntraNeighbor++; } 330 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[2] = true; iNumIntraNeighbor++; } 331 #if MN_DC_PRED_FILTER 332 m_bAboveFlagForDCFilt = bNeighborFlags[3]; 333 m_bLeftFlagForDCFilt = bNeighborFlags[1]; 334 #endif 335 #else // REFERENCE_SAMPLE_PADDING 336 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveFlag = true; 337 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, 1, true, false ) ) bAboveRightFlag = true; 338 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) bLeftFlag = true; 339 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, 1, true, false ) ) bBelowLeftFlag = true; 340 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveLeftFlag = true; 341 #if MN_DC_PRED_FILTER 342 m_bAboveFlagForDCFilt = bAboveFlag; 343 m_bLeftFlagForDCFilt = bLeftFlag; 344 #endif 345 #endif // REFERENCE_SAMPLE_PADDING 346 } 347 #else //CONSTRAINED_INTRA_PRED 348 #if REFERENCE_SAMPLE_PADDING 349 iUnitSize = uiCuWidth; 350 iNumUnitsInCu = 1; 351 iTotalUnits = 5; 352 bNeighborFlags = new Bool[iTotalUnits]; 353 354 ::memset(bNeighborFlags, false, sizeof(Bool)*iTotalUnits); 355 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[3] = true; iNumIntraNeighbor++; } 356 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, true, false ) ) { bNeighborFlags[4] = true; iNumIntraNeighbor++; } 357 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[1] = true; iNumIntraNeighbor++; } 358 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, true, false ) ) { bNeighborFlags[0] = true; iNumIntraNeighbor++; } 359 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[2] = true; iNumIntraNeighbor++; } 360 #if MN_DC_PRED_FILTER 361 m_bAboveFlagForDCFilt = bNeighborFlags[3]; 362 m_bLeftFlagForDCFilt = bNeighborFlags[1]; 363 #endif 364 #else // REFERENCE_SAMPLE_PADDING 365 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveFlag = true; 366 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, true, false ) ) bAboveRightFlag = true; 367 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) bLeftFlag = true; 368 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, true, false ) ) bBelowLeftFlag = true; 369 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveLeftFlag = true; 370 #if MN_DC_PRED_FILTER 371 m_bAboveFlagForDCFilt = bAboveFlag; 372 m_bLeftFlagForDCFilt = bLeftFlag; 373 #endif 374 #endif // REFERENCE_SAMPLE_PADDING 375 #endif //CONSTRAINED_INTRA_PRED 376 377 #if MN_DC_PRED_FILTER 378 m_bDCPredFilterFlag = (m_bAboveFlagForDCFilt && m_bLeftFlagForDCFilt) ? true : false; 379 #endif 380 381 #if REFERENCE_SAMPLE_PADDING 288 iUnitSize = g_uiMaxCUWidth >> g_uiMaxCUDepth; 289 iNumUnitsInCu = uiCuWidth / iUnitSize; 290 iTotalUnits = (iNumUnitsInCu << 2) + 1; 291 292 bNeighborFlags[iNumUnitsInCu*2] = isAboveLeftAvailable( pcCU, uiPartIdxLT ); 293 iNumIntraNeighbor += (Int)(bNeighborFlags[iNumUnitsInCu*2]); 294 iNumIntraNeighbor += isAboveAvailable ( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*2)+1 ); 295 iNumIntraNeighbor += isAboveRightAvailable( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*3)+1 ); 296 iNumIntraNeighbor += isLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+(iNumUnitsInCu*2)-1 ); 297 iNumIntraNeighbor += isBelowLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+ iNumUnitsInCu -1 ); 298 382 299 bAbove = true; 383 300 bLeft = true; 384 #else // REFERENCE_SAMPLE_PADDING 385 bAbove = bAboveFlag; 386 bLeft = bLeftFlag; 387 388 Int iDCValue = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ); 389 #endif // REFERENCE_SAMPLE_PADDING 390 301 391 302 #if DEPTH_MAP_GENERATION 392 303 if ( bPrdDepthMap ) … … 397 308 else 398 309 { 310 uiWidth=uiCuWidth2+1; 311 uiHeight=uiCuHeight2+1; 312 } 313 #else 399 314 uiWidth=uiCuWidth2+1; 400 315 uiHeight=uiCuHeight2+1; 401 }402 #else403 uiWidth=uiCuWidth2+1;404 uiHeight=uiCuHeight2+1;405 316 #endif 406 317 407 318 if (((uiWidth<<2)>iOrgBufStride)||((uiHeight<<2)>iOrgBufHeight)) 319 { 408 320 return; 321 } 409 322 410 323 piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiZorderIdxInPart); … … 415 328 { 416 329 piRoiOrigin = pcCU->getPic()->getPredDepthMap()->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiZorderIdxInPart ); 417 #if REFERENCE_SAMPLE_PADDING 418 #else 419 iDCValue = PDM_UNDEFINED_DEPTH; 420 #endif 421 } 422 #endif 423 424 425 #if REFERENCE_SAMPLE_PADDING 330 } 331 #endif 332 426 333 #if DEPTH_MAP_GENERATION 427 334 if ( bPrdDepthMap ) 428 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize >> uiSubSampExpX, iNumUnitsInCu, iTotalUnits, uiCuWidth >> uiSubSampExpX, uiCuHeight >> uiSubSampExpY, uiWidth, uiHeight, iPicStride, b PrdDepthMap );335 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize >> uiSubSampExpX, iNumUnitsInCu, iTotalUnits, uiCuWidth >> uiSubSampExpX, uiCuHeight >> uiSubSampExpY, uiWidth, uiHeight, iPicStride, bLMmode, bPrdDepthMap ); 429 336 else 430 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bPrdDepthMap ); 431 #else 432 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride ); 433 #endif 434 delete [] bNeighborFlags; 435 bNeighborFlags = NULL; 436 #else // REFERENCE_SAMPLE_PADDING 437 //BB: fill border with DC value - needed if( bAboveFlag=false || bLeftFlag=false ) 438 for (i=0;i<uiWidth;i++) 439 piAdiTemp[i]=iDCValue; 440 for (i=0;i<uiHeight;i++) //BB: can start from 1? 441 piAdiTemp[i*uiWidth]=iDCValue; 442 443 piRoiTemp=piRoiOrigin; //BB: not needed? 444 445 if (bAboveFlag) 446 { 447 // BB: fill top border with rec. samples 448 piRoiTemp=piRoiOrigin-iPicStride; 449 for (i=0;i<uiCuWidth;i++) 450 piAdiTemp[1+i]=piRoiTemp[i]; 451 // BB: fill top right border with rec. samples 452 if (bAboveRightFlag) 453 { 454 piRoiTemp=piRoiOrigin-iPicStride+uiCuWidth; 455 for (i=0;i<uiCuWidth;i++) 456 piAdiTemp[1+uiCuWidth+i]=piRoiTemp[i]; 457 } 458 // BB: fill top right border with last sample from top 459 else 460 { 461 for (i=0;i<uiCuWidth;i++) 462 piAdiTemp[1+uiCuWidth+i]=piAdiTemp[uiCuWidth]; 463 } 464 } 465 466 if (bAboveLeftFlag) 467 { 468 piRoiTemp=piRoiOrigin-iPicStride-1; 469 piAdiTemp[0]=piRoiTemp[0]; 470 } 471 472 if (bLeftFlag) 473 { 474 // BB: fill left border with rec. samples 475 piRoiTemp=piRoiOrigin-1; 476 for (i=0;i<uiCuHeight;i++) 477 { 478 piAdiTemp[(1+i)*uiWidth]=piRoiTemp[0]; 479 piRoiTemp+=iPicStride; 480 } 481 // BB: fill below left border with rec. samples 482 if (bBelowLeftFlag) 483 { 484 for (i=0;i<uiCuHeight;i++) 485 { 486 piAdiTemp[(1+uiCuHeight+i)*uiWidth]=piRoiTemp[0]; 487 piRoiTemp+=iPicStride; 488 } 489 } 490 // BB: fill below left border with last sample from left 491 else 492 { 493 for (i=0;i<uiCuHeight;i++) 494 piAdiTemp[(1+uiCuHeight+i)*uiWidth]=piAdiTemp[(uiCuHeight)*uiWidth]; 495 } 496 } 497 #endif // REFERENCE_SAMPLE_PADDING 498 499 #if QC_MDIS 337 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bLMmode, bPrdDepthMap ); 338 #else 339 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bLMmode); 340 #endif 341 342 343 Int i; 500 344 // generate filtered intra prediction samples 501 345 Int iBufSize = uiCuHeight2 + uiCuWidth2 + 1; // left and left above border + above and above right border + top left corner = length of 3. filter buffer 502 Int i;503 346 504 347 UInt uiWH = uiWidth * uiHeight; // number of elements in one buffer … … 512 355 // left border from bottom to top 513 356 for (i = 0; i < uiCuHeight2; i++) 357 { 514 358 piFilterBuf[l++] = piAdiTemp[uiWidth * (uiCuHeight2 - i)]; 359 } 515 360 // top left corner 516 361 piFilterBuf[l++] = piAdiTemp[0]; 517 362 // above border from left to right 518 363 for (i=0; i < uiCuWidth2; i++) 364 { 519 365 piFilterBuf[l++] = piAdiTemp[1 + i]; 366 } 520 367 521 368 // 1. filtering with [1 2 1] … … 523 370 piFilterBufN[iBufSize - 1] = piFilterBuf[iBufSize - 1]; 524 371 for (i = 1; i < iBufSize - 1; i++) 372 { 525 373 piFilterBufN[i] = (piFilterBuf[i - 1] + 2 * piFilterBuf[i]+piFilterBuf[i + 1] + 2) >> 2; 374 } 526 375 527 376 // fill 1. filter buffer with filtered values 528 377 l=0; 529 378 for (i = 0; i < uiCuHeight2; i++) 379 { 530 380 piFilteredBuf1[uiWidth * (uiCuHeight2 - i)] = piFilterBufN[l++]; 381 } 531 382 piFilteredBuf1[0] = piFilterBufN[l++]; 532 383 for (i = 0; i < uiCuWidth2; i++) 384 { 533 385 piFilteredBuf1[1 + i] = piFilterBufN[l++]; 534 535 #if !MN_MDIS_SIMPLIFICATION 536 // 2. filtering with [1 2 1] 537 piFilterBuf[0] = piFilterBufN[0]; 538 piFilterBuf[iBufSize - 1] = piFilterBufN[iBufSize - 1]; 539 for (i = 1; i < iBufSize - 1; i++) 540 piFilterBuf[i] = (piFilterBufN[i - 1] + 2 * piFilterBufN[i] + piFilterBufN[i + 1] + 2) >> 2; 541 542 // fill 2. filter buffer with filtered values 543 l=0; 544 for (i = 0; i < uiCuHeight2; i++) 545 piFilteredBuf2[uiWidth * (uiCuHeight2 - i)] = piFilterBuf[l++]; 546 piFilteredBuf2[0] = piFilterBuf[l++]; 547 for (i = 0; i < uiCuWidth2; i++) 548 piFilteredBuf2[1 + i] = piFilterBuf[l++]; 549 #endif 550 #endif //QC_MDIS 551 386 } 552 387 } 553 388 … … 561 396 UInt uiHeight; 562 397 Int iPicStride = pcCU->getPic()->getCStride(); 563 Int iCuAddr; 564 #if REFERENCE_SAMPLE_PADDING 398 565 399 Int iUnitSize = 0; 566 400 Int iNumUnitsInCu = 0; 567 401 Int iTotalUnits = 0; 568 Bool * bNeighborFlags;402 Bool bNeighborFlags[4 * MAX_NUM_SPU_W + 1]; 569 403 Int iNumIntraNeighbor = 0; 570 #else // REFERENCE_SAMPLE_PADDING 571 Pel* piRoiTemp; 572 Int i; 573 Bool bAboveFlag=false; 574 Bool bAboveRightFlag=false; 575 Bool bLeftFlag=false; 576 Bool bBelowLeftFlag=false; 577 Bool bAboveLeftFlag = false; 578 #endif // REFERENCE_SAMPLE_PADDING 579 580 iCuAddr = pcCU->getAddr(); 581 582 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB,uiPartDum; 404 405 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 583 406 584 407 pcCU->deriveLeftRightTopIdxAdi( uiPartIdxLT, uiPartIdxRT, uiZorderIdxInPart, uiPartDepth ); 585 408 pcCU->deriveLeftBottomIdxAdi ( uiPartIdxLB, uiZorderIdxInPart, uiPartDepth ); 586 409 587 #if CONSTRAINED_INTRA_PRED 588 if ( pcCU->getSlice()->getPPS()->getConstrainedIntraPred() ) 589 { 590 #if REFERENCE_SAMPLE_PADDING 591 iUnitSize = (g_uiMaxCUWidth >> g_uiMaxCUDepth) >> 1; // for chroma 592 iNumUnitsInCu = (uiCuWidth / iUnitSize) >> 1; // for chroma 593 iTotalUnits = (iNumUnitsInCu << 2) + 1; 594 bNeighborFlags = new Bool[iTotalUnits]; 595 596 bNeighborFlags[iNumUnitsInCu*2] = isAboveLeftAvailableForCIP( pcCU, uiPartIdxLT ); 597 iNumIntraNeighbor += (Int)(bNeighborFlags[iNumUnitsInCu*2]); 598 iNumIntraNeighbor += isAboveAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*2)+1 ); 599 iNumIntraNeighbor += isAboveRightAvailableForCIP( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*3)+1 ); 600 iNumIntraNeighbor += isLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+(iNumUnitsInCu*2)-1 ); 601 iNumIntraNeighbor += isBelowLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+ iNumUnitsInCu -1 ); 602 #else // REFERENCE_SAMPLE_PADDING 603 bAboveFlag = isAboveAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxRT ); 604 bAboveRightFlag = isAboveRightAvailableForCIP( pcCU, uiPartIdxLT, uiPartIdxRT ); 605 bLeftFlag = isLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB ); 606 bBelowLeftFlag = isBelowLeftAvailableForCIP ( pcCU, uiPartIdxLT, uiPartIdxLB ); 607 bAboveLeftFlag = isAboveLeftAvailableForCIP ( pcCU, uiPartIdxLT ); 608 #endif // REFERENCE_SAMPLE_PADDING 609 } 610 else 611 { 612 #if REFERENCE_SAMPLE_PADDING 613 iUnitSize = uiCuWidth >> 1; 614 iNumUnitsInCu = 1; 615 iTotalUnits = 5; 616 bNeighborFlags = new Bool[iTotalUnits]; 617 618 ::memset(bNeighborFlags, false, sizeof(Bool)*iTotalUnits); 619 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[3] = true; iNumIntraNeighbor++; } 620 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, 1, true, false ) ) { bNeighborFlags[4] = true; iNumIntraNeighbor++; } 621 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[1] = true; iNumIntraNeighbor++; } 622 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, 1, true, false ) ) { bNeighborFlags[0] = true; iNumIntraNeighbor++; } 623 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[2] = true; iNumIntraNeighbor++; } 624 #else // REFERENCE_SAMPLE_PADDING 625 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveFlag = true; 626 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, 1, true, false ) ) bAboveRightFlag = true; 627 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) bLeftFlag = true; 628 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, 1, true, false ) ) bBelowLeftFlag = true; 629 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveLeftFlag = true; 630 #endif // REFERENCE_SAMPLE_PADDING 631 } 632 #else //CONSTRAINED_INTRA_PRED 633 #if REFERENCE_SAMPLE_PADDING 634 iUnitSize = uiCuWidth >> 1; 635 iNumUnitsInCu = 1; 636 iTotalUnits = 5; 637 bNeighborFlags = new Bool[iTotalUnits]; 638 639 ::memset(bNeighborFlags, false, sizeof(Bool)*iTotalUnits); 640 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[3] = true; iNumIntraNeighbor++; } 641 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, true, false ) ) { bNeighborFlags[4] = true; iNumIntraNeighbor++; } 642 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[1] = true; iNumIntraNeighbor++; } 643 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, true, false ) ) { bNeighborFlags[0] = true; iNumIntraNeighbor++; } 644 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) { bNeighborFlags[2] = true; iNumIntraNeighbor++; } 645 #else // REFERENCE_SAMPLE_PADDING 646 if( pcCU->getPUAbove ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveFlag = true; 647 if( pcCU->getPUAboveRightAdi( uiPartDum, uiCuWidth, uiPartIdxRT, true, false ) ) bAboveRightFlag = true; 648 if( pcCU->getPULeft ( uiPartDum, uiPartIdxLT, true, false ) ) bLeftFlag = true; 649 if( pcCU->getPUBelowLeftAdi ( uiPartDum, uiCuHeight, uiPartIdxLB, true, false ) ) bBelowLeftFlag = true; 650 if( pcCU->getPUAboveLeft ( uiPartDum, uiPartIdxLT, true, false ) ) bAboveLeftFlag = true; 651 #endif // REFERENCE_SAMPLE_PADDING 652 #endif //CONSTRAINED_INTRA_PRED 653 654 #if REFERENCE_SAMPLE_PADDING 410 iUnitSize = (g_uiMaxCUWidth >> g_uiMaxCUDepth) >> 1; // for chroma 411 iNumUnitsInCu = (uiCuWidth / iUnitSize) >> 1; // for chroma 412 iTotalUnits = (iNumUnitsInCu << 2) + 1; 413 414 bNeighborFlags[iNumUnitsInCu*2] = isAboveLeftAvailable( pcCU, uiPartIdxLT ); 415 iNumIntraNeighbor += (Int)(bNeighborFlags[iNumUnitsInCu*2]); 416 iNumIntraNeighbor += isAboveAvailable ( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*2)+1 ); 417 iNumIntraNeighbor += isAboveRightAvailable( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*3)+1 ); 418 iNumIntraNeighbor += isLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+(iNumUnitsInCu*2)-1 ); 419 iNumIntraNeighbor += isBelowLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+ iNumUnitsInCu -1 ); 420 655 421 bAbove = true; 656 422 bLeft = true; 657 #else // REFERENCE_SAMPLE_PADDING658 bAbove = bAboveFlag;659 bLeft = bLeftFlag;660 661 Int iDCValue = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) );662 #endif // REFERENCE_SAMPLE_PADDING663 423 664 424 uiCuWidth=uiCuWidth>>1; // for chroma … … 669 429 670 430 if ((4*uiWidth>iOrgBufStride)||(4*uiHeight>iOrgBufHeight)) 431 { 671 432 return; 433 } 672 434 673 435 // get Cb pattern … … 675 437 piAdiTemp = piAdiBuf; 676 438 677 #if REFERENCE_SAMPLE_PADDING 678 #if DEPTH_MAP_GENERATION 679 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false ); 680 #else 681 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride ); 682 #endif 683 #else // REFERENCE_SAMPLE_PADDING 684 for (i=0;i<uiWidth;i++) 685 piAdiTemp[i]=iDCValue; 686 for (i=0;i<uiHeight;i++) 687 piAdiTemp[i*uiWidth]=iDCValue; 688 689 piRoiTemp=piRoiOrigin; 690 691 if (bAboveFlag) 692 { 693 piRoiTemp=piRoiOrigin-iPicStride; 694 for (i=0;i<uiCuWidth;i++) 695 piAdiTemp[1+i]=piRoiTemp[i]; 696 if (bAboveRightFlag) 697 { 698 piRoiTemp=piRoiOrigin-iPicStride+uiCuWidth; 699 for (i=0;i<uiCuWidth;i++) 700 piAdiTemp[1+uiCuWidth+i]=piRoiTemp[i]; 701 } 702 else 703 { 704 for (i=0;i<uiCuWidth;i++) 705 piAdiTemp[1+uiCuWidth+i]=piAdiTemp[uiCuWidth]; 706 } 707 } 708 709 if (bAboveLeftFlag) 710 { 711 piRoiTemp=piRoiOrigin-iPicStride-1; 712 piAdiTemp[0]=piRoiTemp[0]; 713 } 714 715 if (bLeftFlag) 716 { 717 piRoiTemp=piRoiOrigin-1; 718 for (i=0;i<uiCuHeight;i++) 719 { 720 piAdiTemp[(1+i)*uiWidth]=piRoiTemp[0]; 721 piRoiTemp+=iPicStride; 722 } 723 if (bBelowLeftFlag) 724 { 725 for (i=0;i<uiCuHeight;i++) 726 { 727 piAdiTemp[(1+uiCuHeight+i)*uiWidth]=piRoiTemp[0]; 728 piRoiTemp+=iPicStride; 729 } 730 } 731 else 732 { 733 for (i=0;i<uiCuHeight;i++) 734 piAdiTemp[(1+uiCuHeight+i)*uiWidth]=piAdiTemp[(uiCuHeight)*uiWidth]; 735 } 736 } 737 #endif // REFERENCE_SAMPLE_PADDING 439 #if DEPTH_MAP_GENERATION 440 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false, false ); 441 #else 442 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride); 443 #endif 738 444 739 445 // get Cr pattern … … 741 447 piAdiTemp = piAdiBuf+uiWidth*uiHeight; 742 448 743 #if REFERENCE_SAMPLE_PADDING 744 #if DEPTH_MAP_GENERATION 745 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false ); 746 #else 747 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride ); 748 #endif 749 delete [] bNeighborFlags; 750 bNeighborFlags = NULL; 751 #else // REFERENCE_SAMPLE_PADDING 752 for (i=0;i<uiWidth;i++) 753 piAdiTemp[i]=iDCValue; 754 for (i=0;i<uiHeight;i++) 755 piAdiTemp[i*uiWidth]=iDCValue; 756 757 piRoiTemp=piRoiOrigin; 758 759 if (bAboveFlag) 760 { 761 piRoiTemp=piRoiOrigin-iPicStride; 762 for (i=0;i<uiCuWidth;i++) 763 piAdiTemp[1+i]=piRoiTemp[i]; 764 if (bAboveRightFlag) 765 { 766 piRoiTemp=piRoiOrigin-iPicStride+uiCuWidth; 767 for (i=0;i<uiCuWidth;i++) 768 piAdiTemp[1+uiCuWidth+i]=piRoiTemp[i]; 769 } 770 else 771 { 772 for (i=0;i<uiCuWidth;i++) 773 piAdiTemp[1+uiCuWidth+i]=piAdiTemp[uiCuWidth]; 774 } 775 } 776 777 if (bAboveLeftFlag) 778 { 779 piRoiTemp=piRoiOrigin-iPicStride-1; 780 piAdiTemp[0]=piRoiTemp[0]; 781 } 782 783 if (bLeftFlag) 784 { 785 piRoiTemp=piRoiOrigin-1; 786 for (i=0;i<uiCuHeight;i++) 787 { 788 piAdiTemp[(1+i)*uiWidth]=piRoiTemp[0]; 789 piRoiTemp+=iPicStride; 790 } 791 if (bBelowLeftFlag) 792 { 793 for (i=0;i<uiCuHeight;i++) 794 { 795 piAdiTemp[(1+uiCuHeight+i)*uiWidth]=piRoiTemp[0]; 796 piRoiTemp+=iPicStride; 797 } 798 } 799 else 800 { 801 for (i=0;i<uiCuHeight;i++) 802 piAdiTemp[(1+uiCuHeight+i)*uiWidth]=piAdiTemp[(uiCuHeight)*uiWidth]; 803 } 804 } 805 #endif // REFERENCE_SAMPLE_PADDING 806 } 807 808 #if REFERENCE_SAMPLE_PADDING 809 Void TComPattern::fillReferenceSamples( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride 810 #if DEPTH_MAP_GENERATION 811 , Bool bPrdDepthMap 812 #endif 813 ) 449 #if DEPTH_MAP_GENERATION 450 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false, false ); 451 #else 452 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride); 453 #endif 454 455 } 456 457 Void TComPattern::fillReferenceSamples( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride, Bool bLMmode 458 #if DEPTH_MAP_GENERATION 459 , Bool bPrdDepthMap 460 #endif 461 ) 814 462 { 815 463 Pel* piRoiTemp; … … 820 468 Int iDCValue = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ); 821 469 #endif 822 470 823 471 if (iNumIntraNeighbor == 0) 824 472 { 825 473 // Fill border with DC value 826 474 for (i=0; i<uiWidth; i++) 475 { 827 476 piAdiTemp[i] = iDCValue; 477 } 828 478 for (i=1; i<uiHeight; i++) 479 { 829 480 piAdiTemp[i*uiWidth] = iDCValue; 481 } 830 482 } 831 483 else if (iNumIntraNeighbor == iTotalUnits) … … 837 489 // Fill left border with rec. samples 838 490 piRoiTemp = piRoiOrigin - 1; 491 492 if (bLMmode) 493 { 494 piRoiTemp --; // move to the second left column 495 } 496 839 497 for (i=0; i<uiCuHeight; i++) 840 498 { … … 853 511 piRoiTemp = piRoiOrigin - iPicStride; 854 512 for (i=0; i<uiCuWidth; i++) 513 { 855 514 piAdiTemp[1+i] = piRoiTemp[i]; 856 515 } 516 857 517 // Fill top right border with rec. samples 858 518 piRoiTemp = piRoiOrigin - iPicStride + uiCuWidth; 859 519 for (i=0; i<uiCuWidth; i++) 520 { 860 521 piAdiTemp[1+uiCuWidth+i] = piRoiTemp[i]; 522 } 861 523 } 862 524 else // reference samples are partially available … … 864 526 Int iNumUnits2 = iNumUnitsInCu<<1; 865 527 Int iTotalSamples = iTotalUnits*iUnitSize; 866 Pel *piAdiLine = new Pel[iTotalSamples];528 Pel piAdiLine[5 * MAX_CU_SIZE]; 867 529 Pel *piAdiLineTemp; 868 530 Bool *pbNeighborFlags; 869 Int i Prev, iNext, iCurr;531 Int iNext, iCurr; 870 532 Pel piRef = 0; 871 533 872 534 // Initialize 873 535 for (i=0; i<iTotalSamples; i++) 536 { 874 537 piAdiLine[i] = iDCValue; 875 538 } 539 876 540 // Fill top-left sample 877 541 piRoiTemp = piRoiOrigin - iPicStride - 1; … … 882 546 piAdiLineTemp[0] = piRoiTemp[0]; 883 547 for (i=1; i<iUnitSize; i++) 548 { 884 549 piAdiLineTemp[i] = piAdiLineTemp[0]; 550 } 885 551 } 886 552 887 553 // Fill left & below-left samples 888 554 piRoiTemp += iPicStride; 555 if (bLMmode) 556 { 557 piRoiTemp --; // move the second left column 558 } 889 559 piAdiLineTemp--; 890 560 pbNeighborFlags--; … … 894 564 { 895 565 for (i=0; i<iUnitSize; i++) 566 { 896 567 piAdiLineTemp[-i] = piRoiTemp[i*iPicStride]; 568 } 897 569 } 898 570 piRoiTemp += iUnitSize*iPicStride; … … 910 582 { 911 583 for (i=0; i<iUnitSize; i++) 584 { 912 585 piAdiLineTemp[i] = piRoiTemp[i]; 586 } 913 587 } 914 588 piRoiTemp += iUnitSize; … … 918 592 919 593 // Pad reference samples when necessary 920 iPrev = -1;921 594 iCurr = 0; 922 595 iNext = 1; … … 924 597 while (iCurr < iTotalUnits) 925 598 { 926 if (bNeighborFlags[iCurr]) 927 { 928 // Move on to next block if current unit is available 929 piAdiLineTemp += iUnitSize; 930 iPrev++; 931 iCurr++; 932 iNext++; 933 } 934 else 935 { 936 // Interpolate from nearest samples if current unit is not available 937 938 while (iNext < iTotalUnits && !bNeighborFlags[iNext]) 939 iNext++; 940 941 if (iPrev >= 0 && iNext < iTotalUnits) 942 piRef = (piAdiLine[iCurr*iUnitSize-1] + piAdiLine[iNext*iUnitSize] + 1) >> 1; 943 else if (iPrev >= 0) 599 if (!bNeighborFlags[iCurr]) 600 { 601 if(iCurr == 0) 602 { 603 while (iNext < iTotalUnits && !bNeighborFlags[iNext]) 604 { 605 iNext++; 606 } 607 piRef = piAdiLine[iNext*iUnitSize]; 608 // Pad unavailable samples with new value 609 while (iCurr < iNext) 610 { 611 for (i=0; i<iUnitSize; i++) 612 { 613 piAdiLineTemp[i] = piRef; 614 } 615 piAdiLineTemp += iUnitSize; 616 iCurr++; 617 } 618 } 619 else 620 { 944 621 piRef = piAdiLine[iCurr*iUnitSize-1]; 945 else if (iNext < iTotalUnits)946 piRef = piAdiLine[iNext*iUnitSize];947 else948 printf("\nERROR! No valid samples to interpolate.\n");949 950 // Pad unavailable samples with new value951 while (iCurr < iNext)952 {953 622 for (i=0; i<iUnitSize; i++) 623 { 954 624 piAdiLineTemp[i] = piRef; 625 } 955 626 piAdiLineTemp += iUnitSize; 956 iPrev++;957 627 iCurr++; 958 628 } 959 iNext++; 629 } 630 else 631 { 632 piAdiLineTemp += iUnitSize; 633 iCurr++; 960 634 } 961 635 } … … 964 638 piAdiLineTemp = piAdiLine + uiHeight + iUnitSize - 2; 965 639 for (i=0; i<uiWidth; i++) 640 { 966 641 piAdiTemp[i] = piAdiLineTemp[i]; 642 } 967 643 piAdiLineTemp = piAdiLine + uiHeight - 1; 968 644 for (i=1; i<uiHeight; i++) 645 { 969 646 piAdiTemp[i*uiWidth] = piAdiLineTemp[-i]; 970 971 delete [] piAdiLine; 972 piAdiLine = NULL; 973 } 974 } 975 #endif // REFERENCE_SAMPLE_PADDING 647 } 648 } 649 } 976 650 977 651 Int* TComPattern::getAdiOrgBuf( Int iCuWidth, Int iCuHeight, Int* piAdiBuf) … … 990 664 } 991 665 992 #if QC_MDIS 993 Int* TComPattern::getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf ) 994 { 995 #if MN_MDIS_SIMPLIFICATION 996 static const UChar g_aucIntraFilter[7][34] = 997 { 998 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //2x2 999 {0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //4x4 1000 {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //8x8 1001 {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //16x16 1002 {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, //32x32 1003 {0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //64x64 1004 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} //128x128 1005 }; 1006 #else 1007 static const UChar g_aucIntraFilter[7][34] = 1008 { 1009 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //2x2 1010 {0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //4x4 1011 {0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //8x8 1012 {0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //16x16 1013 {0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, //32x32 1014 {0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //64x64 1015 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} //128x128 1016 }; 1017 #endif 1018 666 /** Get pointer to reference samples for intra prediction 667 * \param uiDirMode prediction mode index 668 * \param log2BlkSize size of block (2 = 4x4, 3 = 8x8, 4 = 16x16, 5 = 32x32, 6 = 64x64) 669 * \param piAdiBuf pointer to unfiltered reference samples 670 * \return pointer to (possibly filtered) reference samples 671 * 672 * The prediction mode index is used to determine whether a smoothed reference sample buffer is returned. 673 */ 674 Int* TComPattern::getPredictorPtr( UInt uiDirMode, UInt log2BlkSize, Int* piAdiBuf ) 675 { 1019 676 Int* piSrc; 1020 #if ADD_PLANAR_MODE 1021 mapPlanartoDC( uiDirMode ); 1022 #endif 677 assert(log2BlkSize >= 2 && log2BlkSize < 7); 1023 678 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1024 UChar ucFiltIdx = 0; 1025 if ( uiDirMode < 34 ) 1026 { 1027 ucFiltIdx = g_aucIntraFilter[uiWidthBits][uiDirMode]; 1028 } 1029 #else 1030 UChar ucFiltIdx = g_aucIntraFilter[uiWidthBits][uiDirMode]; 1031 #endif 1032 1033 #if MN_MDIS_SIMPLIFICATION 679 mapDMMtoIntraMode( uiDirMode ); 680 #endif 681 #if LOGI_INTRA_NAME_3MPM 682 Int diff = min<Int>(abs((Int) uiDirMode - HOR_IDX), abs((Int)uiDirMode - VER_IDX)); 683 UChar ucFiltIdx = diff > m_aucIntraFilter[log2BlkSize - 2] ? 1 : 0; 684 if (uiDirMode == DC_IDX || uiDirMode == LM_CHROMA_IDX) 685 { 686 ucFiltIdx = 0; //no smoothing for DC or LM chroma 687 } 688 #else 689 UChar ucFiltIdx = m_aucIntraFilter[log2BlkSize - 2][uiDirMode]; 690 #endif 691 1034 692 assert( ucFiltIdx <= 1 ); 1035 #else 1036 assert( ucFiltIdx <= 2 );1037 #endif 1038 1039 piSrc = getAdiOrgBuf( iCuWidth, iCuHeight, piAdiBuf );693 694 Int width = 1 << log2BlkSize; 695 Int height = 1 << log2BlkSize; 696 697 piSrc = getAdiOrgBuf( width, height, piAdiBuf ); 1040 698 1041 699 if ( ucFiltIdx ) 1042 700 { 1043 #if MN_MDIS_SIMPLIFICATION 1044 piSrc += ((iCuWidth << 1) + 1) * ((iCuHeight << 1) + 1); 1045 #else 1046 piSrc += (((iCuWidth << 1) + 1) * ((iCuHeight << 1) + 1) << (ucFiltIdx - 1)); 1047 #endif 701 piSrc += (2 * width + 1) * (2 * height + 1); 1048 702 } 1049 703 1050 704 return piSrc; 1051 705 } 1052 #endif //QC_MDIS 1053 1054 #if CONSTRAINED_INTRA_PRED 1055 Bool TComPattern::isAboveLeftAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT ) 706 707 Bool TComPattern::isAboveLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT ) 1056 708 { 1057 709 Bool bAboveLeftFlag; 1058 710 UInt uiPartAboveLeft; 1059 711 TComDataCU* pcCUAboveLeft = pcCU->getPUAboveLeft( uiPartAboveLeft, uiPartIdxLT, true, false ); 1060 bAboveLeftFlag = ( pcCUAboveLeft && pcCUAboveLeft->getPredictionMode( uiPartAboveLeft ) == MODE_INTRA ); 712 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 713 { 714 bAboveLeftFlag = ( pcCUAboveLeft && pcCUAboveLeft->getPredictionMode( uiPartAboveLeft ) == MODE_INTRA ); 715 } 716 else 717 { 718 bAboveLeftFlag = (pcCUAboveLeft ? true : false); 719 } 1061 720 return bAboveLeftFlag; 1062 721 } 1063 722 1064 #if REFERENCE_SAMPLE_PADDING 1065 Int TComPattern::isAboveAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags ) 1066 #else 1067 Bool TComPattern::isAboveAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT ) 1068 #endif 723 Int TComPattern::isAboveAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags ) 1069 724 { 1070 725 const UInt uiRasterPartBegin = g_auiZscanToRaster[uiPartIdxLT]; 1071 726 const UInt uiRasterPartEnd = g_auiZscanToRaster[uiPartIdxRT]+1; 1072 727 const UInt uiIdxStep = 1; 1073 #if REFERENCE_SAMPLE_PADDING1074 728 Bool *pbValidFlags = bValidFlags; 1075 729 Int iNumIntra = 0; 1076 #else1077 Bool bAboveFlag = true;1078 #endif1079 #if MN_DC_PRED_FILTER1080 m_bAboveFlagForDCFilt = true;1081 #endif1082 730 1083 731 for ( UInt uiRasterPart = uiRasterPartBegin; uiRasterPart < uiRasterPartEnd; uiRasterPart += uiIdxStep ) … … 1085 733 UInt uiPartAbove; 1086 734 TComDataCU* pcCUAbove = pcCU->getPUAbove( uiPartAbove, g_auiRasterToZscan[uiRasterPart], true, false ); 1087 #if REFERENCE_SAMPLE_PADDING 1088 if ( pcCUAbove && pcCUAbove->getPredictionMode( uiPartAbove ) == MODE_INTRA ) 1089 { 1090 iNumIntra++; 1091 *pbValidFlags = true; 735 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 736 { 737 if ( pcCUAbove && pcCUAbove->getPredictionMode( uiPartAbove ) == MODE_INTRA ) 738 { 739 iNumIntra++; 740 *pbValidFlags = true; 741 } 742 else 743 { 744 *pbValidFlags = false; 745 } 1092 746 } 1093 747 else 1094 748 { 1095 *pbValidFlags = false; 1096 #if MN_DC_PRED_FILTER 1097 m_bAboveFlagForDCFilt = false; 1098 #endif 749 if (pcCUAbove) 750 { 751 iNumIntra++; 752 *pbValidFlags = true; 753 } 754 else 755 { 756 *pbValidFlags = false; 757 } 1099 758 } 1100 759 pbValidFlags++; 1101 #else 1102 if ( !pcCUAbove || pcCUAbove->getPredictionMode( uiPartAbove ) != MODE_INTRA ) 1103 { 1104 bAboveFlag = false; 1105 #if MN_DC_PRED_FILTER 1106 m_bAboveFlagForDCFilt = false; 1107 #endif 1108 break; 1109 } 1110 #endif 1111 } 1112 #if REFERENCE_SAMPLE_PADDING 760 } 1113 761 return iNumIntra; 1114 #else 1115 return bAboveFlag; 1116 #endif 1117 } 1118 1119 #if REFERENCE_SAMPLE_PADDING 1120 Int TComPattern::isLeftAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags ) 1121 #else 1122 Bool TComPattern::isLeftAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB ) 1123 #endif 762 } 763 764 Int TComPattern::isLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags ) 1124 765 { 1125 766 const UInt uiRasterPartBegin = g_auiZscanToRaster[uiPartIdxLT]; 1126 767 const UInt uiRasterPartEnd = g_auiZscanToRaster[uiPartIdxLB]+1; 1127 768 const UInt uiIdxStep = pcCU->getPic()->getNumPartInWidth(); 1128 #if REFERENCE_SAMPLE_PADDING1129 769 Bool *pbValidFlags = bValidFlags; 1130 770 Int iNumIntra = 0; 1131 #else1132 Bool bLeftFlag = true;1133 #endif1134 #if MN_DC_PRED_FILTER1135 m_bLeftFlagForDCFilt = true;1136 #endif1137 771 1138 772 for ( UInt uiRasterPart = uiRasterPartBegin; uiRasterPart < uiRasterPartEnd; uiRasterPart += uiIdxStep ) … … 1140 774 UInt uiPartLeft; 1141 775 TComDataCU* pcCULeft = pcCU->getPULeft( uiPartLeft, g_auiRasterToZscan[uiRasterPart], true, false ); 1142 #if REFERENCE_SAMPLE_PADDING 1143 if ( pcCULeft && pcCULeft->getPredictionMode( uiPartLeft ) == MODE_INTRA ) 1144 { 1145 iNumIntra++; 1146 *pbValidFlags = true; 776 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 777 { 778 if ( pcCULeft && pcCULeft->getPredictionMode( uiPartLeft ) == MODE_INTRA ) 779 { 780 iNumIntra++; 781 *pbValidFlags = true; 782 } 783 else 784 { 785 *pbValidFlags = false; 786 } 1147 787 } 1148 788 else 1149 789 { 1150 *pbValidFlags = false; 1151 #if MN_DC_PRED_FILTER 1152 m_bLeftFlagForDCFilt = false; 1153 #endif 790 if ( pcCULeft ) 791 { 792 iNumIntra++; 793 *pbValidFlags = true; 794 } 795 else 796 { 797 *pbValidFlags = false; 798 } 1154 799 } 1155 800 pbValidFlags--; // opposite direction 1156 #else 1157 if ( !pcCULeft || pcCULeft->getPredictionMode( uiPartLeft ) != MODE_INTRA ) 1158 { 1159 bLeftFlag = false; 1160 #if MN_DC_PRED_FILTER 1161 m_bLeftFlagForDCFilt = false; 1162 #endif 1163 break; 1164 } 1165 #endif 1166 } 1167 1168 #if REFERENCE_SAMPLE_PADDING 801 } 802 1169 803 return iNumIntra; 1170 #else 1171 return bLeftFlag; 1172 #endif 1173 } 1174 1175 #if REFERENCE_SAMPLE_PADDING 1176 Int TComPattern::isAboveRightAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags ) 1177 #else 1178 Bool TComPattern::isAboveRightAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT ) 1179 #endif 804 } 805 806 Int TComPattern::isAboveRightAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags ) 1180 807 { 1181 808 const UInt uiNumUnitsInPU = g_auiZscanToRaster[uiPartIdxRT] - g_auiZscanToRaster[uiPartIdxLT] + 1; 1182 809 const UInt uiPuWidth = uiNumUnitsInPU * pcCU->getPic()->getMinCUWidth(); 1183 #if REFERENCE_SAMPLE_PADDING1184 810 Bool *pbValidFlags = bValidFlags; 1185 811 Int iNumIntra = 0; 1186 #else1187 Bool bAboveRightFlag = true;1188 #endif1189 812 1190 813 for ( UInt uiOffset = 1; uiOffset <= uiNumUnitsInPU; uiOffset++ ) … … 1192 815 UInt uiPartAboveRight; 1193 816 TComDataCU* pcCUAboveRight = pcCU->getPUAboveRightAdi( uiPartAboveRight, uiPuWidth, uiPartIdxRT, uiOffset, true, false ); 1194 #if REFERENCE_SAMPLE_PADDING 1195 if ( pcCUAboveRight && pcCUAboveRight->getPredictionMode( uiPartAboveRight ) == MODE_INTRA ) 1196 { 1197 iNumIntra++; 1198 *pbValidFlags = true; 817 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 818 { 819 if ( pcCUAboveRight && pcCUAboveRight->getPredictionMode( uiPartAboveRight ) == MODE_INTRA ) 820 { 821 iNumIntra++; 822 *pbValidFlags = true; 823 } 824 else 825 { 826 *pbValidFlags = false; 827 } 1199 828 } 1200 829 else 1201 830 { 1202 *pbValidFlags = false; 831 if ( pcCUAboveRight ) 832 { 833 iNumIntra++; 834 *pbValidFlags = true; 835 } 836 else 837 { 838 *pbValidFlags = false; 839 } 1203 840 } 1204 841 pbValidFlags++; 1205 #else 1206 if ( !pcCUAboveRight || pcCUAboveRight->getPredictionMode( uiPartAboveRight ) != MODE_INTRA ) 1207 { 1208 bAboveRightFlag = false; 1209 break; 1210 } 1211 #endif 1212 } 1213 1214 #if REFERENCE_SAMPLE_PADDING 842 } 843 1215 844 return iNumIntra; 1216 #else 1217 return bAboveRightFlag; 1218 #endif 1219 } 1220 1221 #if REFERENCE_SAMPLE_PADDING 1222 Int TComPattern::isBelowLeftAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags ) 1223 #else 1224 Bool TComPattern::isBelowLeftAvailableForCIP( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB ) 1225 #endif 845 } 846 847 Int TComPattern::isBelowLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags ) 1226 848 { 1227 849 const UInt uiNumUnitsInPU = (g_auiZscanToRaster[uiPartIdxLB] - g_auiZscanToRaster[uiPartIdxLT]) / pcCU->getPic()->getNumPartInWidth() + 1; 1228 850 const UInt uiPuHeight = uiNumUnitsInPU * pcCU->getPic()->getMinCUHeight(); 1229 #if REFERENCE_SAMPLE_PADDING1230 851 Bool *pbValidFlags = bValidFlags; 1231 852 Int iNumIntra = 0; 1232 #else1233 Bool bBelowLeftFlag = true;1234 #endif1235 853 1236 854 for ( UInt uiOffset = 1; uiOffset <= uiNumUnitsInPU; uiOffset++ ) … … 1238 856 UInt uiPartBelowLeft; 1239 857 TComDataCU* pcCUBelowLeft = pcCU->getPUBelowLeftAdi( uiPartBelowLeft, uiPuHeight, uiPartIdxLB, uiOffset, true, false ); 1240 #if REFERENCE_SAMPLE_PADDING 1241 if ( pcCUBelowLeft && pcCUBelowLeft->getPredictionMode( uiPartBelowLeft ) == MODE_INTRA ) 1242 { 1243 iNumIntra++; 1244 *pbValidFlags = true; 858 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 859 { 860 if ( pcCUBelowLeft && pcCUBelowLeft->getPredictionMode( uiPartBelowLeft ) == MODE_INTRA ) 861 { 862 iNumIntra++; 863 *pbValidFlags = true; 864 } 865 else 866 { 867 *pbValidFlags = false; 868 } 1245 869 } 1246 870 else 1247 871 { 1248 *pbValidFlags = false; 872 if ( pcCUBelowLeft ) 873 { 874 iNumIntra++; 875 *pbValidFlags = true; 876 } 877 else 878 { 879 *pbValidFlags = false; 880 } 1249 881 } 1250 882 pbValidFlags--; // opposite direction 1251 #else 1252 if ( !pcCUBelowLeft || pcCUBelowLeft->getPredictionMode( uiPartBelowLeft ) != MODE_INTRA ) 1253 { 1254 bBelowLeftFlag = false; 1255 break; 1256 } 1257 #endif 1258 } 1259 1260 #if REFERENCE_SAMPLE_PADDING 883 } 884 1261 885 return iNumIntra; 1262 #else 1263 return bBelowLeftFlag; 1264 #endif 1265 } 1266 #endif //CONSTRAINED_INTRA_PRED 886 } 887 //! \}
Note: See TracChangeset for help on using the changeset viewer.