Changeset 1029 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
- Timestamp:
- 26 Feb 2015, 00:21:54 (10 years ago)
- Location:
- branches/SHM-dev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev
- Property svn:mergeinfo changed
-
branches/SHM-dev/source
- Property svn:mergeinfo changed
-
branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
r595 r1029 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 6 * Copyright (c) 2010-2014, ITU/ISO/IEC … … 39 39 #include "TComPattern.h" 40 40 #include "TComDataCU.h" 41 #include "TComTU.h" 42 #include "Debug.h" 43 #include "TComPrediction.h" 41 44 42 45 //! \ingroup TLibCommon 43 46 //! \{ 44 47 45 // ==================================================================================================================== 46 // Tables 47 // ==================================================================================================================== 48 49 const UChar TComPattern::m_aucIntraFilter[5] = 50 { 51 10, //4x4 52 7, //8x8 53 1, //16x16 54 0, //32x32 55 10, //64x64 56 }; 48 // Forward declarations 49 50 /// padding of unavailable reference samples for intra prediction 51 #if O0043_BEST_EFFORT_DECODING 52 Void fillReferenceSamples( const Int bitDepth, const Int bitDepthDelta, TComDataCU* pcCU, const Pel* piRoiOrigin, Pel* piAdiTemp, const Bool* bNeighborFlags, 53 #else 54 Void fillReferenceSamples( const Int bitDepth, TComDataCU* pcCU, const Pel* piRoiOrigin, Pel* piAdiTemp, const Bool* bNeighborFlags, 55 #endif 56 const Int iNumIntraNeighbor, const Int unitWidth, const Int unitHeight, const Int iAboveUnits, const Int iLeftUnits, 57 const UInt uiCuWidth, const UInt uiCuHeight, const UInt uiWidth, const UInt uiHeight, const Int iPicStride, 58 const ChannelType chType, const ChromaFormat chFmt ); 59 60 /// constrained intra prediction 61 Bool isAboveLeftAvailable ( TComDataCU* pcCU, UInt uiPartIdxLT ); 62 Int isAboveAvailable ( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool* bValidFlags ); 63 Int isLeftAvailable ( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool* bValidFlags ); 64 Int isAboveRightAvailable ( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool* bValidFlags ); 65 Int isBelowLeftAvailable ( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool* bValidFlags ); 66 57 67 58 68 // ==================================================================================================================== … … 65 75 \param iStride buffer stride 66 76 \param iOffsetLeft neighbour offset (left) 77 \param iOffsetRight neighbour offset (right) 67 78 \param iOffsetAbove neighbour offset (above) 79 \param iOffsetBottom neighbour offset (bottom) 68 80 */ 69 81 Void TComPatternParam::setPatternParamPel ( Pel* piTexture, 70 82 Int iRoiWidth, 71 83 Int iRoiHeight, 72 Int iStride, 73 Int iOffsetLeft, 74 Int iOffsetAbove ) 75 { 76 m_piPatternOrigin = piTexture; 84 Int iStride 85 ) 86 { 87 m_piROIOrigin = piTexture; 77 88 m_iROIWidth = iRoiWidth; 78 89 m_iROIHeight = iRoiHeight; 79 90 m_iPatternStride = iStride; 80 m_iOffsetLeft = iOffsetLeft;81 m_iOffsetAbove = iOffsetAbove;82 }83 84 /**85 \param pcCU CU data structure86 \param iComp component index (0=Y, 1=Cb, 2=Cr)87 \param iRoiWidth pattern width88 \param iRoiHeight pattern height89 \param iStride buffer stride90 \param iOffsetLeft neighbour offset (left)91 \param iOffsetAbove neighbour offset (above)92 \param uiAbsPartIdx part index93 */94 Void TComPatternParam::setPatternParamCU( TComDataCU* pcCU,95 UChar iComp,96 UChar iRoiWidth,97 UChar iRoiHeight,98 Int iOffsetLeft,99 Int iOffsetAbove,100 UInt uiAbsPartIdx )101 {102 m_iOffsetLeft = iOffsetLeft;103 m_iOffsetAbove = iOffsetAbove;104 105 m_iROIWidth = iRoiWidth;106 m_iROIHeight = iRoiHeight;107 108 UInt uiAbsZorderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;109 110 if ( iComp == 0 )111 {112 m_iPatternStride = pcCU->getPic()->getStride();113 m_piPatternOrigin = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft;114 }115 else116 {117 m_iPatternStride = pcCU->getPic()->getCStride();118 if ( iComp == 1 )119 {120 m_piPatternOrigin = pcCU->getPic()->getPicYuvRec()->getCbAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft;121 }122 else123 {124 m_piPatternOrigin = pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), uiAbsZorderIdx) - m_iOffsetAbove * m_iPatternStride - m_iOffsetLeft;125 }126 }127 91 } 128 92 … … 131 95 // ==================================================================================================================== 132 96 133 Void TComPattern::initPattern ( Pel* piY, 134 Pel* piCb, 135 Pel* piCr, 97 Void TComPattern::initPattern (Pel* piY, 136 98 Int iRoiWidth, 137 99 Int iRoiHeight, 138 Int iStride, 139 Int iOffsetLeft, 140 Int iOffsetAbove ) 141 { 142 m_cPatternY. setPatternParamPel( piY, iRoiWidth, iRoiHeight, iStride, iOffsetLeft, iOffsetAbove ); 143 m_cPatternCb.setPatternParamPel( piCb, iRoiWidth >> 1, iRoiHeight >> 1, iStride >> 1, iOffsetLeft >> 1, iOffsetAbove >> 1 ); 144 m_cPatternCr.setPatternParamPel( piCr, iRoiWidth >> 1, iRoiHeight >> 1, iStride >> 1, iOffsetLeft >> 1, iOffsetAbove >> 1 ); 145 146 return; 147 } 148 149 Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx ) 150 { 151 Int uiOffsetLeft = 0; 152 Int uiOffsetAbove = 0; 153 154 UChar uiWidth = pcCU->getWidth (0)>>uiPartDepth; 155 UChar uiHeight = pcCU->getHeight(0)>>uiPartDepth; 156 157 UInt uiAbsZorderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 158 UInt uiCurrPicPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 159 UInt uiCurrPicPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 160 161 if( uiCurrPicPelX != 0 ) 162 { 163 uiOffsetLeft = 1; 164 } 165 166 if( uiCurrPicPelY != 0 ) 167 { 168 uiOffsetAbove = 1; 169 } 170 171 m_cPatternY .setPatternParamCU( pcCU, 0, uiWidth, uiHeight, uiOffsetLeft, uiOffsetAbove, uiAbsPartIdx ); 172 m_cPatternCb.setPatternParamCU( pcCU, 1, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetAbove, uiAbsPartIdx ); 173 m_cPatternCr.setPatternParamCU( pcCU, 2, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetAbove, uiAbsPartIdx ); 174 } 175 176 Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft, Bool bLMmode ) 177 { 178 Pel* piRoiOrigin; 179 Int* piAdiTemp; 180 UInt uiCuWidth = pcCU->getWidth(0) >> uiPartDepth; 181 UInt uiCuHeight = pcCU->getHeight(0)>> uiPartDepth; 182 UInt uiCuWidth2 = uiCuWidth<<1; 183 UInt uiCuHeight2 = uiCuHeight<<1; 184 UInt uiWidth; 185 UInt uiHeight; 186 Int iPicStride = pcCU->getPic()->getStride(); 187 Int iUnitSize = 0; 188 Int iNumUnitsInCu = 0; 189 Int iTotalUnits = 0; 100 Int iStride) 101 { 102 m_cPatternY. setPatternParamPel( piY, iRoiWidth, iRoiHeight, iStride); 103 } 104 105 106 // TODO: move this function to TComPrediction.cpp. 107 Void TComPrediction::initAdiPatternChType( TComTU &rTu, Bool& bAbove, Bool& bLeft, const ComponentID compID, const Bool bFilterRefSamples DEBUG_STRING_FN_DECLARE(sDebug)) 108 { 109 const ChannelType chType = toChannelType(compID); 110 111 TComDataCU *pcCU=rTu.getCU(); 112 const UInt uiZorderIdxInPart=rTu.GetAbsPartIdxTU(); 113 const UInt uiTuWidth = rTu.getRect(compID).width; 114 const UInt uiTuHeight = rTu.getRect(compID).height; 115 const UInt uiTuWidth2 = uiTuWidth << 1; 116 const UInt uiTuHeight2 = uiTuHeight << 1; 117 118 const Int iBaseUnitSize = g_uiMaxCUWidth >> g_uiMaxCUDepth; 119 const Int iUnitWidth = iBaseUnitSize >> pcCU->getPic()->getPicYuvRec()->getComponentScaleX(compID); 120 const Int iUnitHeight = iBaseUnitSize >> pcCU->getPic()->getPicYuvRec()->getComponentScaleY(compID); 121 const Int iTUWidthInUnits = uiTuWidth / iUnitWidth; 122 const Int iTUHeightInUnits = uiTuHeight / iUnitHeight; 123 const Int iAboveUnits = iTUWidthInUnits << 1; 124 const Int iLeftUnits = iTUHeightInUnits << 1; 125 126 assert(iTUHeightInUnits > 0 && iTUWidthInUnits > 0); 127 128 const Int iPartIdxStride = pcCU->getPic()->getNumPartInCtuWidth(); 129 const UInt uiPartIdxLT = pcCU->getZorderIdxInCtu() + uiZorderIdxInPart; 130 const UInt uiPartIdxRT = g_auiRasterToZscan[ g_auiZscanToRaster[ uiPartIdxLT ] + iTUWidthInUnits - 1 ]; 131 const UInt uiPartIdxLB = g_auiRasterToZscan[ g_auiZscanToRaster[ uiPartIdxLT ] + ((iTUHeightInUnits - 1) * iPartIdxStride)]; 132 133 Int iPicStride = pcCU->getPic()->getStride(compID); 190 134 Bool bNeighborFlags[4 * MAX_NUM_SPU_W + 1]; 191 135 Int iNumIntraNeighbor = 0; 192 193 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 194 195 196 pcCU->deriveLeftRightTopIdxAdi( uiPartIdxLT, uiPartIdxRT, uiZorderIdxInPart, uiPartDepth ); 197 pcCU->deriveLeftBottomIdxAdi ( uiPartIdxLB, uiZorderIdxInPart, uiPartDepth ); 198 199 iUnitSize = g_uiMaxCUWidth >> g_uiMaxCUDepth; 200 iNumUnitsInCu = uiCuWidth / iUnitSize; 201 iTotalUnits = (iNumUnitsInCu << 2) + 1; 202 203 bNeighborFlags[iNumUnitsInCu*2] = isAboveLeftAvailable( pcCU, uiPartIdxLT ); 204 iNumIntraNeighbor += (Int)(bNeighborFlags[iNumUnitsInCu*2]); 205 iNumIntraNeighbor += isAboveAvailable ( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*2)+1 ); 206 iNumIntraNeighbor += isAboveRightAvailable( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*3)+1 ); 207 iNumIntraNeighbor += isLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+(iNumUnitsInCu*2)-1 ); 208 iNumIntraNeighbor += isBelowLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+ iNumUnitsInCu -1 ); 209 136 137 bNeighborFlags[iLeftUnits] = isAboveLeftAvailable( pcCU, uiPartIdxLT ); 138 iNumIntraNeighbor += bNeighborFlags[iLeftUnits] ? 1 : 0; 139 iNumIntraNeighbor += isAboveAvailable ( pcCU, uiPartIdxLT, uiPartIdxRT, (bNeighborFlags + iLeftUnits + 1) ); 140 iNumIntraNeighbor += isAboveRightAvailable( pcCU, uiPartIdxLT, uiPartIdxRT, (bNeighborFlags + iLeftUnits + 1 + iTUWidthInUnits ) ); 141 iNumIntraNeighbor += isLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, (bNeighborFlags + iLeftUnits - 1) ); 142 iNumIntraNeighbor += isBelowLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, (bNeighborFlags + iLeftUnits - 1 - iTUHeightInUnits) ); 143 210 144 bAbove = true; 211 145 bLeft = true; 212 146 213 uiWidth=uiCuWidth2+1; 214 uiHeight=uiCuHeight2+1; 215 216 if (((uiWidth<<2)>iOrgBufStride)||((uiHeight<<2)>iOrgBufHeight)) 217 { 218 return; 219 } 220 221 piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiZorderIdxInPart); 222 piAdiTemp = piAdiBuf; 223 224 fillReferenceSamples (g_bitDepthY, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bLMmode); 225 226 Int i; 227 // generate filtered intra prediction samples 228 Int iBufSize = uiCuHeight2 + uiCuWidth2 + 1; // left and left above border + above and above right border + top left corner = length of 3. filter buffer 229 230 UInt uiWH = uiWidth * uiHeight; // number of elements in one buffer 231 232 Int* piFilteredBuf1 = piAdiBuf + uiWH; // 1. filter buffer 233 Int* piFilteredBuf2 = piFilteredBuf1 + uiWH; // 2. filter buffer 234 Int* piFilterBuf = piFilteredBuf2 + uiWH; // buffer for 2. filtering (sequential) 235 Int* piFilterBufN = piFilterBuf + iBufSize; // buffer for 1. filtering (sequential) 236 237 Int l = 0; 238 // left border from bottom to top 239 for (i = 0; i < uiCuHeight2; i++) 240 { 241 piFilterBuf[l++] = piAdiTemp[uiWidth * (uiCuHeight2 - i)]; 242 } 243 // top left corner 244 piFilterBuf[l++] = piAdiTemp[0]; 245 // above border from left to right 246 for (i=0; i < uiCuWidth2; i++) 247 { 248 piFilterBuf[l++] = piAdiTemp[1 + i]; 249 } 250 251 if (pcCU->getSlice()->getSPS()->getUseStrongIntraSmoothing()) 252 { 253 Int blkSize = 32; 254 Int bottomLeft = piFilterBuf[0]; 255 Int topLeft = piFilterBuf[uiCuHeight2]; 256 Int topRight = piFilterBuf[iBufSize-1]; 257 Int threshold = 1 << (g_bitDepthY - 5); 258 Bool bilinearLeft = abs(bottomLeft+topLeft-2*piFilterBuf[uiCuHeight]) < threshold; 259 Bool bilinearAbove = abs(topLeft+topRight-2*piFilterBuf[uiCuHeight2+uiCuHeight]) < threshold; 260 261 if (uiCuWidth>=blkSize && (bilinearLeft && bilinearAbove)) 262 { 263 Int shift = g_aucConvertToBit[uiCuWidth] + 3; // log2(uiCuHeight2) 264 piFilterBufN[0] = piFilterBuf[0]; 265 piFilterBufN[uiCuHeight2] = piFilterBuf[uiCuHeight2]; 266 piFilterBufN[iBufSize - 1] = piFilterBuf[iBufSize - 1]; 267 for (i = 1; i < uiCuHeight2; i++) 268 { 269 piFilterBufN[i] = ((uiCuHeight2-i)*bottomLeft + i*topLeft + uiCuHeight) >> shift; 270 } 271 272 for (i = 1; i < uiCuWidth2; i++) 273 { 274 piFilterBufN[uiCuHeight2 + i] = ((uiCuWidth2-i)*topLeft + i*topRight + uiCuWidth) >> shift; 275 } 276 } 277 else 278 { 279 // 1. filtering with [1 2 1] 280 piFilterBufN[0] = piFilterBuf[0]; 281 piFilterBufN[iBufSize - 1] = piFilterBuf[iBufSize - 1]; 282 for (i = 1; i < iBufSize - 1; i++) 283 { 284 piFilterBufN[i] = (piFilterBuf[i - 1] + 2 * piFilterBuf[i]+piFilterBuf[i + 1] + 2) >> 2; 285 } 286 } 287 } 288 else 289 { 290 // 1. filtering with [1 2 1] 291 piFilterBufN[0] = piFilterBuf[0]; 292 piFilterBufN[iBufSize - 1] = piFilterBuf[iBufSize - 1]; 293 for (i = 1; i < iBufSize - 1; i++) 294 { 295 piFilterBufN[i] = (piFilterBuf[i - 1] + 2 * piFilterBuf[i]+piFilterBuf[i + 1] + 2) >> 2; 296 } 297 } 298 299 // fill 1. filter buffer with filtered values 300 l=0; 301 for (i = 0; i < uiCuHeight2; i++) 302 { 303 piFilteredBuf1[uiWidth * (uiCuHeight2 - i)] = piFilterBufN[l++]; 304 } 305 piFilteredBuf1[0] = piFilterBufN[l++]; 306 for (i = 0; i < uiCuWidth2; i++) 307 { 308 piFilteredBuf1[1 + i] = piFilterBufN[l++]; 309 } 310 } 311 312 Void TComPattern::initAdiPatternChroma( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft ) 313 { 314 Pel* piRoiOrigin; 315 Int* piAdiTemp; 316 UInt uiCuWidth = pcCU->getWidth (0) >> uiPartDepth; 317 UInt uiCuHeight = pcCU->getHeight(0) >> uiPartDepth; 318 UInt uiWidth; 319 UInt uiHeight; 320 Int iPicStride = pcCU->getPic()->getCStride(); 321 322 Int iUnitSize = 0; 323 Int iNumUnitsInCu = 0; 324 Int iTotalUnits = 0; 325 Bool bNeighborFlags[4 * MAX_NUM_SPU_W + 1]; 326 Int iNumIntraNeighbor = 0; 327 328 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 329 330 pcCU->deriveLeftRightTopIdxAdi( uiPartIdxLT, uiPartIdxRT, uiZorderIdxInPart, uiPartDepth ); 331 pcCU->deriveLeftBottomIdxAdi ( uiPartIdxLB, uiZorderIdxInPart, uiPartDepth ); 332 333 iUnitSize = (g_uiMaxCUWidth >> g_uiMaxCUDepth) >> 1; // for chroma 334 iNumUnitsInCu = (uiCuWidth / iUnitSize) >> 1; // for chroma 335 iTotalUnits = (iNumUnitsInCu << 2) + 1; 336 337 bNeighborFlags[iNumUnitsInCu*2] = isAboveLeftAvailable( pcCU, uiPartIdxLT ); 338 iNumIntraNeighbor += (Int)(bNeighborFlags[iNumUnitsInCu*2]); 339 iNumIntraNeighbor += isAboveAvailable ( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*2)+1 ); 340 iNumIntraNeighbor += isAboveRightAvailable( pcCU, uiPartIdxLT, uiPartIdxRT, bNeighborFlags+(iNumUnitsInCu*3)+1 ); 341 iNumIntraNeighbor += isLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+(iNumUnitsInCu*2)-1 ); 342 iNumIntraNeighbor += isBelowLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, bNeighborFlags+ iNumUnitsInCu -1 ); 343 344 bAbove = true; 345 bLeft = true; 346 347 uiCuWidth=uiCuWidth>>1; // for chroma 348 uiCuHeight=uiCuHeight>>1; // for chroma 349 350 uiWidth=uiCuWidth*2+1; 351 uiHeight=uiCuHeight*2+1; 352 353 if ((4*uiWidth>iOrgBufStride)||(4*uiHeight>iOrgBufHeight)) 354 { 355 return; 356 } 357 358 // get Cb pattern 359 piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getCbAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiZorderIdxInPart); 360 piAdiTemp = piAdiBuf; 361 362 fillReferenceSamples (g_bitDepthC, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride); 363 364 // get Cr pattern 365 piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiZorderIdxInPart); 366 piAdiTemp = piAdiBuf+uiWidth*uiHeight; 367 368 fillReferenceSamples (g_bitDepthC, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride); 369 } 370 371 Void TComPattern::fillReferenceSamples(Int bitDepth, 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 ) 372 { 373 Pel* piRoiTemp; 147 const ChromaFormat chFmt = rTu.GetChromaFormat(); 148 const UInt uiROIWidth = uiTuWidth2+1; 149 const UInt uiROIHeight = uiTuHeight2+1; 150 151 assert(uiROIWidth*uiROIHeight <= m_iYuvExtSize); 152 153 #ifdef DEBUG_STRING 154 std::stringstream ss(stringstream::out); 155 #endif 156 157 { 158 Pel *piAdiTemp = m_piYuvExt[compID][PRED_BUF_UNFILTERED]; 159 Pel *piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiZorderIdxInPart); 160 #if O0043_BEST_EFFORT_DECODING 161 fillReferenceSamples (g_bitDepthInStream[chType], g_bitDepthInStream[chType] - g_bitDepth[chType], pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits, 162 #else 163 fillReferenceSamples (g_bitDepth[chType], pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits, 164 #endif 165 uiTuWidth, uiTuHeight, uiROIWidth, uiROIHeight, iPicStride, toChannelType(compID), chFmt); 166 167 168 #ifdef DEBUG_STRING 169 if (DebugOptionList::DebugString_Pred.getInt()&DebugStringGetPredModeMask(MODE_INTRA)) 170 { 171 ss << "###: generating Ref Samples for channel " << compID << " and " << rTu.getRect(compID).width << " x " << rTu.getRect(compID).height << "\n"; 172 for (UInt y=0; y<uiROIHeight; y++) 173 { 174 ss << "###: - "; 175 for (UInt x=0; x<uiROIWidth; x++) 176 { 177 if (x==0 || y==0) 178 ss << piAdiTemp[y*uiROIWidth + x] << ", "; 179 // if (x%16==15) ss << "\nPart size: ~ "; 180 } 181 ss << "\n"; 182 } 183 } 184 #endif 185 186 if (bFilterRefSamples) 187 { 188 // generate filtered intra prediction samples 189 190 Int stride = uiROIWidth; 191 const Pel *piSrcPtr = piAdiTemp + (stride * uiTuHeight2); // bottom left 192 Pel *piDestPtr = m_piYuvExt[compID][PRED_BUF_FILTERED] + (stride * uiTuHeight2); // bottom left 193 194 //------------------------------------------------ 195 196 Bool useStrongIntraSmoothing = isLuma(chType) && pcCU->getSlice()->getSPS()->getUseStrongIntraSmoothing(); 197 198 const Pel bottomLeft = piAdiTemp[stride * uiTuHeight2]; 199 const Pel topLeft = piAdiTemp[0]; 200 const Pel topRight = piAdiTemp[uiTuWidth2]; 201 202 if (useStrongIntraSmoothing) 203 { 204 #if O0043_BEST_EFFORT_DECODING 205 const Int threshold = 1 << (g_bitDepthInStream[chType] - 5); 206 #else 207 const Int threshold = 1 << (g_bitDepth[chType] - 5); 208 #endif 209 const Bool bilinearLeft = abs((bottomLeft + topLeft ) - (2 * piAdiTemp[stride * uiTuHeight])) < threshold; //difference between the 210 const Bool bilinearAbove = abs((topLeft + topRight) - (2 * piAdiTemp[ uiTuWidth ])) < threshold; //ends and the middle 211 if ((uiTuWidth < 32) || (!bilinearLeft) || (!bilinearAbove)) 212 useStrongIntraSmoothing = false; 213 } 214 215 *piDestPtr = *piSrcPtr; // bottom left is not filtered 216 piDestPtr -= stride; 217 piSrcPtr -= stride; 218 219 //------------------------------------------------ 220 221 //left column (bottom to top) 222 223 if (useStrongIntraSmoothing) 224 { 225 const Int shift = g_aucConvertToBit[uiTuHeight] + 3; //log2(uiTuHeight2) 226 227 for(UInt i=1; i<uiTuHeight2; i++, piDestPtr-=stride) 228 { 229 *piDestPtr = (((uiTuHeight2 - i) * bottomLeft) + (i * topLeft) + uiTuHeight) >> shift; 230 } 231 232 piSrcPtr -= stride * (uiTuHeight2 - 1); 233 } 234 else 235 { 236 for(UInt i=1; i<uiTuHeight2; i++, piDestPtr-=stride, piSrcPtr-=stride) 237 { 238 *piDestPtr = ( piSrcPtr[stride] + 2*piSrcPtr[0] + piSrcPtr[-stride] + 2 ) >> 2; 239 } 240 } 241 242 //------------------------------------------------ 243 244 //top-left 245 246 if (useStrongIntraSmoothing) 247 { 248 *piDestPtr = piSrcPtr[0]; 249 } 250 else 251 { 252 *piDestPtr = ( piSrcPtr[stride] + 2*piSrcPtr[0] + piSrcPtr[1] + 2 ) >> 2; 253 } 254 piDestPtr += 1; 255 piSrcPtr += 1; 256 257 //------------------------------------------------ 258 259 //top row (left-to-right) 260 261 if (useStrongIntraSmoothing) 262 { 263 const Int shift = g_aucConvertToBit[uiTuWidth] + 3; //log2(uiTuWidth2) 264 265 for(UInt i=1; i<uiTuWidth2; i++, piDestPtr++) 266 { 267 *piDestPtr = (((uiTuWidth2 - i) * topLeft) + (i * topRight) + uiTuWidth) >> shift; 268 } 269 270 piSrcPtr += uiTuWidth2 - 1; 271 } 272 else 273 { 274 for(UInt i=1; i<uiTuWidth2; i++, piDestPtr++, piSrcPtr++) 275 { 276 *piDestPtr = ( piSrcPtr[1] + 2*piSrcPtr[0] + piSrcPtr[-1] + 2 ) >> 2; 277 } 278 } 279 280 //------------------------------------------------ 281 282 *piDestPtr=*piSrcPtr; // far right is not filtered 283 284 #ifdef DEBUG_STRING 285 if (DebugOptionList::DebugString_Pred.getInt()&DebugStringGetPredModeMask(MODE_INTRA)) 286 { 287 ss << "###: filtered result for channel " << compID <<"\n"; 288 for (UInt y=0; y<uiROIHeight; y++) 289 { 290 ss << "###: - "; 291 for (UInt x=0; x<uiROIWidth; x++) 292 { 293 if (x==0 || y==0) 294 ss << m_piYuvExt[compID][PRED_BUF_FILTERED][y*uiROIWidth + x] << ", "; 295 // if (x%16==15) ss << "\nPart size: ~ "; 296 } 297 ss << "\n"; 298 } 299 } 300 #endif 301 302 303 } 304 } 305 DEBUG_STRING_APPEND(sDebug, ss.str()) 306 } 307 308 #if O0043_BEST_EFFORT_DECODING 309 Void fillReferenceSamples( const Int bitDepth, const Int bitDepthDelta, TComDataCU* pcCU, const Pel* piRoiOrigin, Pel* piAdiTemp, const Bool* bNeighborFlags, 310 #else 311 Void fillReferenceSamples( const Int bitDepth, TComDataCU* pcCU, const Pel* piRoiOrigin, Pel* piAdiTemp, const Bool* bNeighborFlags, 312 #endif 313 const Int iNumIntraNeighbor, const Int unitWidth, const Int unitHeight, const Int iAboveUnits, const Int iLeftUnits, 314 const UInt uiCuWidth, const UInt uiCuHeight, const UInt uiWidth, const UInt uiHeight, const Int iPicStride, 315 const ChannelType chType, const ChromaFormat chFmt ) 316 { 317 const Pel* piRoiTemp; 374 318 Int i, j; 375 319 Int iDCValue = 1 << (bitDepth - 1); 320 const Int iTotalUnits = iAboveUnits + iLeftUnits + 1; //+1 for top-left 376 321 377 322 if (iNumIntraNeighbor == 0) … … 389 334 else if (iNumIntraNeighbor == iTotalUnits) 390 335 { 391 // Fill top-left border with rec. samples336 // Fill top-left border and top and top right with rec. samples 392 337 piRoiTemp = piRoiOrigin - iPicStride - 1; 393 piAdiTemp[0] = piRoiTemp[0]; 394 395 // Fill left border with rec. samples 338 339 for (i=0; i<uiWidth; i++) 340 { 341 #if O0043_BEST_EFFORT_DECODING 342 piAdiTemp[i] = piRoiTemp[i] << bitDepthDelta; 343 #else 344 piAdiTemp[i] = piRoiTemp[i]; 345 #endif 346 } 347 348 // Fill left and below left border with rec. samples 396 349 piRoiTemp = piRoiOrigin - 1; 397 350 398 if (bLMmode) 399 { 400 piRoiTemp --; // move to the second left column 401 } 402 403 for (i=0; i<uiCuHeight; i++) 404 { 405 piAdiTemp[(1+i)*uiWidth] = piRoiTemp[0]; 351 for (i=1; i<uiHeight; i++) 352 { 353 #if O0043_BEST_EFFORT_DECODING 354 piAdiTemp[i*uiWidth] = (*(piRoiTemp)) << bitDepthDelta; 355 #else 356 piAdiTemp[i*uiWidth] = *(piRoiTemp); 357 #endif 406 358 piRoiTemp += iPicStride; 407 359 } 408 409 // Fill below left border with rec. samples410 for (i=0; i<uiCuHeight; i++)411 {412 piAdiTemp[(1+uiCuHeight+i)*uiWidth] = piRoiTemp[0];413 piRoiTemp += iPicStride;414 }415 416 // Fill top border with rec. samples417 piRoiTemp = piRoiOrigin - iPicStride;418 for (i=0; i<uiCuWidth; i++)419 {420 piAdiTemp[1+i] = piRoiTemp[i];421 }422 423 // Fill top right border with rec. samples424 piRoiTemp = piRoiOrigin - iPicStride + uiCuWidth;425 for (i=0; i<uiCuWidth; i++)426 {427 piAdiTemp[1+uiCuWidth+i] = piRoiTemp[i];428 }429 360 } 430 361 else // reference samples are partially available 431 362 { 432 Int iNumUnits2 = iNumUnitsInCu<<1;433 Int iTotalSamples = iTotalUnits*iUnitSize;363 // all above units have "unitWidth" samples each, all left/below-left units have "unitHeight" samples each 364 const Int iTotalSamples = (iLeftUnits * unitHeight) + ((iAboveUnits + 1) * unitWidth); 434 365 Pel piAdiLine[5 * MAX_CU_SIZE]; 435 Pel *piAdiLineTemp; 436 Bool *pbNeighborFlags; 437 Int iNext, iCurr; 438 Pel piRef = 0; 366 Pel *piAdiLineTemp; 367 const Bool *pbNeighborFlags; 368 439 369 440 370 // Initialize … … 443 373 piAdiLine[i] = iDCValue; 444 374 } 445 375 446 376 // Fill top-left sample 447 377 piRoiTemp = piRoiOrigin - iPicStride - 1; 448 piAdiLineTemp = piAdiLine + (i NumUnits2*iUnitSize);449 pbNeighborFlags = bNeighborFlags + i NumUnits2;378 piAdiLineTemp = piAdiLine + (iLeftUnits * unitHeight); 379 pbNeighborFlags = bNeighborFlags + iLeftUnits; 450 380 if (*pbNeighborFlags) 451 381 { 452 piAdiLineTemp[0] = piRoiTemp[0]; 453 for (i=1; i<iUnitSize; i++) 454 { 455 piAdiLineTemp[i] = piAdiLineTemp[0]; 456 } 457 } 458 459 // Fill left & below-left samples 382 #if O0043_BEST_EFFORT_DECODING 383 Pel topLeftVal=piRoiTemp[0] << bitDepthDelta; 384 #else 385 Pel topLeftVal=piRoiTemp[0]; 386 #endif 387 for (i=0; i<unitWidth; i++) 388 { 389 piAdiLineTemp[i] = topLeftVal; 390 } 391 } 392 393 // Fill left & below-left samples (downwards) 460 394 piRoiTemp += iPicStride; 461 if (bLMmode)462 {463 piRoiTemp --; // move the second left column464 }465 395 piAdiLineTemp--; 466 396 pbNeighborFlags--; 467 for (j=0; j<iNumUnits2; j++) 397 398 for (j=0; j<iLeftUnits; j++) 468 399 { 469 400 if (*pbNeighborFlags) 470 401 { 471 for (i=0; i<iUnitSize; i++) 472 { 402 for (i=0; i<unitHeight; i++) 403 { 404 #if O0043_BEST_EFFORT_DECODING 405 piAdiLineTemp[-i] = piRoiTemp[i*iPicStride] << bitDepthDelta; 406 #else 473 407 piAdiLineTemp[-i] = piRoiTemp[i*iPicStride]; 474 } 475 } 476 piRoiTemp += iUnitSize*iPicStride; 477 piAdiLineTemp -= iUnitSize; 408 #endif 409 } 410 } 411 piRoiTemp += unitHeight*iPicStride; 412 piAdiLineTemp -= unitHeight; 478 413 pbNeighborFlags--; 479 414 } 480 415 481 // Fill above & above-right samples 416 // Fill above & above-right samples (left-to-right) (each unit has "unitWidth" samples) 482 417 piRoiTemp = piRoiOrigin - iPicStride; 483 piAdiLineTemp = piAdiLine + ((iNumUnits2+1)*iUnitSize); 484 pbNeighborFlags = bNeighborFlags + iNumUnits2 + 1; 485 for (j=0; j<iNumUnits2; j++) 418 // offset line buffer by iNumUints2*unitHeight (for left/below-left) + unitWidth (for above-left) 419 piAdiLineTemp = piAdiLine + (iLeftUnits * unitHeight) + unitWidth; 420 pbNeighborFlags = bNeighborFlags + iLeftUnits + 1; 421 for (j=0; j<iAboveUnits; j++) 486 422 { 487 423 if (*pbNeighborFlags) 488 424 { 489 for (i=0; i<iUnitSize; i++) 490 { 425 for (i=0; i<unitWidth; i++) 426 { 427 #if O0043_BEST_EFFORT_DECODING 428 piAdiLineTemp[i] = piRoiTemp[i] << bitDepthDelta; 429 #else 491 430 piAdiLineTemp[i] = piRoiTemp[i]; 492 } 493 } 494 piRoiTemp += iUnitSize; 495 piAdiLineTemp += iUnitSize; 431 #endif 432 } 433 } 434 piRoiTemp += unitWidth; 435 piAdiLineTemp += unitWidth; 496 436 pbNeighborFlags++; 497 437 } 498 438 499 439 // Pad reference samples when necessary 500 iCurr = 0; 501 iNext = 1; 502 piAdiLineTemp = piAdiLine; 503 while (iCurr < iTotalUnits) 504 { 505 if (!bNeighborFlags[iCurr]) 506 { 507 if(iCurr == 0) 508 { 509 while (iNext < iTotalUnits && !bNeighborFlags[iNext]) 440 Int iCurrJnit = 0; 441 Pel *piAdiLineCur = piAdiLine; 442 const UInt piAdiLineTopRowOffset = iLeftUnits * (unitHeight - unitWidth); 443 444 if (!bNeighborFlags[0]) 445 { 446 // very bottom unit of bottom-left; at least one unit will be valid. 447 { 448 Int iNext = 1; 449 while (iNext < iTotalUnits && !bNeighborFlags[iNext]) 450 { 451 iNext++; 452 } 453 Pel *piAdiLineNext = piAdiLine + ((iNext < iLeftUnits) ? (iNext * unitHeight) : (piAdiLineTopRowOffset + (iNext * unitWidth))); 454 const Pel refSample = *piAdiLineNext; 455 // Pad unavailable samples with new value 456 Int iNextOrTop = std::min<Int>(iNext, iLeftUnits); 457 // fill left column 458 while (iCurrJnit < iNextOrTop) 459 { 460 for (i=0; i<unitHeight; i++) 510 461 { 511 iNext++;462 piAdiLineCur[i] = refSample; 512 463 } 513 piRef = piAdiLine[iNext*iUnitSize]; 514 // Pad unavailable samples with new value 515 while (iCurr < iNext) 464 piAdiLineCur += unitHeight; 465 iCurrJnit++; 466 } 467 // fill top row 468 while (iCurrJnit < iNext) 469 { 470 for (i=0; i<unitWidth; i++) 516 471 { 517 for (i=0; i<iUnitSize; i++) 518 { 519 piAdiLineTemp[i] = piRef; 520 } 521 piAdiLineTemp += iUnitSize; 522 iCurr++; 472 piAdiLineCur[i] = refSample; 523 473 } 524 } 525 else 526 { 527 piRef = piAdiLine[iCurr*iUnitSize-1]; 528 for (i=0; i<iUnitSize; i++) 474 piAdiLineCur += unitWidth; 475 iCurrJnit++; 476 } 477 } 478 } 479 480 // pad all other reference samples. 481 while (iCurrJnit < iTotalUnits) 482 { 483 if (!bNeighborFlags[iCurrJnit]) // samples not available 484 { 485 { 486 const Int numSamplesInCurrUnit = (iCurrJnit >= iLeftUnits) ? unitWidth : unitHeight; 487 const Pel refSample = *(piAdiLineCur-1); 488 for (i=0; i<numSamplesInCurrUnit; i++) 529 489 { 530 piAdiLine Temp[i] = piRef;490 piAdiLineCur[i] = refSample; 531 491 } 532 piAdiLine Temp += iUnitSize;533 iCurr ++;534 } 535 } 536 else 537 { 538 piAdiLine Temp += iUnitSize;539 iCurr ++;492 piAdiLineCur += numSamplesInCurrUnit; 493 iCurrJnit++; 494 } 495 } 496 else 497 { 498 piAdiLineCur += (iCurrJnit >= iLeftUnits) ? unitWidth : unitHeight; 499 iCurrJnit++; 540 500 } 541 501 } 542 502 543 503 // Copy processed samples 544 piAdiLineTemp = piAdiLine + uiHeight + iUnitSize - 2; 504 505 piAdiLineTemp = piAdiLine + uiHeight + unitWidth - 2; 506 // top left, top and top right samples 545 507 for (i=0; i<uiWidth; i++) 546 508 { 547 509 piAdiTemp[i] = piAdiLineTemp[i]; 548 510 } 511 549 512 piAdiLineTemp = piAdiLine + uiHeight - 1; 550 513 for (i=1; i<uiHeight; i++) … … 553 516 } 554 517 } 555 }556 557 Int* TComPattern::getAdiOrgBuf( Int /*iCuWidth*/, Int /*iCuHeight*/, Int* piAdiBuf)558 {559 return piAdiBuf;560 }561 562 Int* TComPattern::getAdiCbBuf( Int /*iCuWidth*/, Int /*iCuHeight*/, Int* piAdiBuf)563 {564 return piAdiBuf;565 }566 567 Int* TComPattern::getAdiCrBuf(Int iCuWidth,Int iCuHeight, Int* piAdiBuf)568 {569 return piAdiBuf+(iCuWidth*2+1)*(iCuHeight*2+1);570 518 } 571 519 … … 578 526 * The prediction mode index is used to determine whether a smoothed reference sample buffer is returned. 579 527 */ 580 Int* TComPattern::getPredictorPtr( UInt uiDirMode, UInt log2BlkSize, Int* piAdiBuf ) 581 { 582 Int* piSrc; 583 assert(log2BlkSize >= 2 && log2BlkSize < 7); 584 Int diff = min<Int>(abs((Int) uiDirMode - HOR_IDX), abs((Int)uiDirMode - VER_IDX)); 585 UChar ucFiltIdx = diff > m_aucIntraFilter[log2BlkSize - 2] ? 1 : 0; 586 if (uiDirMode == DC_IDX) 587 { 588 ucFiltIdx = 0; //no smoothing for DC or LM chroma 589 } 590 591 assert( ucFiltIdx <= 1 ); 592 593 Int width = 1 << log2BlkSize; 594 Int height = 1 << log2BlkSize; 595 596 piSrc = getAdiOrgBuf( width, height, piAdiBuf ); 597 598 if ( ucFiltIdx ) 599 { 600 piSrc += (2 * width + 1) * (2 * height + 1); 601 } 602 603 return piSrc; 604 } 605 606 Bool TComPattern::isAboveLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT ) 528 529 Bool TComPrediction::filteringIntraReferenceSamples(const ComponentID compID, UInt uiDirMode, UInt uiTuChWidth, UInt uiTuChHeight, const ChromaFormat chFmt, const Bool intraReferenceSmoothingDisabled) 530 { 531 Bool bFilter; 532 533 if (!filterIntraReferenceSamples(toChannelType(compID), chFmt, intraReferenceSmoothingDisabled)) 534 { 535 bFilter=false; 536 } 537 else 538 { 539 assert(uiTuChWidth>=4 && uiTuChHeight>=4 && uiTuChWidth<128 && uiTuChHeight<128); 540 541 if (uiDirMode == DC_IDX) 542 { 543 bFilter=false; //no smoothing for DC or LM chroma 544 } 545 else 546 { 547 Int diff = min<Int>(abs((Int) uiDirMode - HOR_IDX), abs((Int)uiDirMode - VER_IDX)); 548 UInt sizeIndex=g_aucConvertToBit[uiTuChWidth]; 549 assert(sizeIndex < MAX_INTRA_FILTER_DEPTHS); 550 bFilter = diff > m_aucIntraFilter[toChannelType(compID)][sizeIndex]; 551 } 552 } 553 return bFilter; 554 } 555 556 Bool isAboveLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT ) 607 557 { 608 558 Bool bAboveLeftFlag; … … 611 561 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 612 562 { 613 bAboveLeftFlag = ( pcCUAboveLeft && pcCUAboveLeft-> getPredictionMode( uiPartAboveLeft ) == MODE_INTRA);563 bAboveLeftFlag = ( pcCUAboveLeft && pcCUAboveLeft->isIntra( uiPartAboveLeft ) ); 614 564 } 615 565 else … … 620 570 } 621 571 622 Int TComPattern::isAboveAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags )572 Int isAboveAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags ) 623 573 { 624 574 const UInt uiRasterPartBegin = g_auiZscanToRaster[uiPartIdxLT]; … … 634 584 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 635 585 { 636 if ( pcCUAbove && pcCUAbove-> getPredictionMode( uiPartAbove ) == MODE_INTRA)586 if ( pcCUAbove && pcCUAbove->isIntra( uiPartAbove ) ) 637 587 { 638 588 iNumIntra++; … … 661 611 } 662 612 663 Int TComPattern::isLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags )613 Int isLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags ) 664 614 { 665 615 const UInt uiRasterPartBegin = g_auiZscanToRaster[uiPartIdxLT]; 666 616 const UInt uiRasterPartEnd = g_auiZscanToRaster[uiPartIdxLB]+1; 667 const UInt uiIdxStep = pcCU->getPic()->getNumPartIn Width();617 const UInt uiIdxStep = pcCU->getPic()->getNumPartInCtuWidth(); 668 618 Bool *pbValidFlags = bValidFlags; 669 619 Int iNumIntra = 0; … … 675 625 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 676 626 { 677 if ( pcCULeft && pcCULeft-> getPredictionMode( uiPartLeft ) == MODE_INTRA)627 if ( pcCULeft && pcCULeft->isIntra( uiPartLeft ) ) 678 628 { 679 629 iNumIntra++; … … 703 653 } 704 654 705 Int TComPattern::isAboveRightAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags )655 Int isAboveRightAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxRT, Bool *bValidFlags ) 706 656 { 707 657 const UInt uiNumUnitsInPU = g_auiZscanToRaster[uiPartIdxRT] - g_auiZscanToRaster[uiPartIdxLT] + 1; … … 715 665 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 716 666 { 717 if ( pcCUAboveRight && pcCUAboveRight-> getPredictionMode( uiPartAboveRight ) == MODE_INTRA)667 if ( pcCUAboveRight && pcCUAboveRight->isIntra( uiPartAboveRight ) ) 718 668 { 719 669 iNumIntra++; … … 743 693 } 744 694 745 Int TComPattern::isBelowLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags )746 { 747 const UInt uiNumUnitsInPU = (g_auiZscanToRaster[uiPartIdxLB] - g_auiZscanToRaster[uiPartIdxLT]) / pcCU->getPic()->getNumPartIn Width() + 1;695 Int isBelowLeftAvailable( TComDataCU* pcCU, UInt uiPartIdxLT, UInt uiPartIdxLB, Bool *bValidFlags ) 696 { 697 const UInt uiNumUnitsInPU = (g_auiZscanToRaster[uiPartIdxLB] - g_auiZscanToRaster[uiPartIdxLT]) / pcCU->getPic()->getNumPartInCtuWidth() + 1; 748 698 Bool *pbValidFlags = bValidFlags; 749 699 Int iNumIntra = 0; … … 755 705 if(pcCU->getSlice()->getPPS()->getConstrainedIntraPred()) 756 706 { 757 if ( pcCUBelowLeft && pcCUBelowLeft-> getPredictionMode( uiPartBelowLeft ) == MODE_INTRA)707 if ( pcCUBelowLeft && pcCUBelowLeft->isIntra( uiPartBelowLeft ) ) 758 708 { 759 709 iNumIntra++;
Note: See TracChangeset for help on using the changeset viewer.