上次留下两个帧内预测中最为重要的两个函数xPredIntraPlanar和xPredIntraAng,本文先介绍第一个函数。先看代码及相应的注释:
/** Function for deriving planar intra prediction.
* \param pSrc pointer to reconstructed sample array
* \param srcStride the stride of the reconstructed sample array
* \param rpDst reference to pointer for the prediction sample array
* \param dstStride the stride of the prediction sample array
* \param width the width of the block
* \param height the height of the block
*
* This function derives the prediction samples for planar mode (intra coding).
*/
Void TComPrediction::xPredIntraPlanar( Int* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height )
{
assert(width == height);
Int k, l, bottomLeft, topRight;
Int horPred;
Int leftColumn[MAX_CU_SIZE], topRow[MAX_CU_SIZE], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];
UInt blkSize = width;
UInt offset2D