前言
该系列文章记录自己阅读HM代码的理解,防止自己以后遗忘,同时可以交流学习,可能会有错误,欢迎批评指正。
帧内预测
HEVC的帧内预测(intra)有以下特点:
1. 使用四叉树的编码块划分框架。
2. 使用细致的预测角度划分方式,共33个方向(如下图所示),加上planar模式,DC模式,一共35个方向模式。
3. 使用planar模式预测平滑区域。
4. 在特定情况下对块边缘进行滤波。
5. 对参考边缘进行自适应滤波。
还有其它一些特定,涉及到之后再加上。本文函数主要涉及特性2和特性4.
源代码及注释
//Function for deriving the angular Intra predictions
/** Function for deriving the simplified angular intra predictions.
* \param bitDepth bit depth
* \param pSrc pointer to reconstructed sample array,指向当前块的(0,0)位置
* \param srcStride the stride of the reconstructed sample array,相当于图像的宽
* \param pTrueDst reference to pointer for the prediction sample array
* \param dstStrideTrue the stride of the prediction sample array
* \param uiWidth the width of the block
* \param uiHeight the height of the block
* \param channelType type of pel array (luma/chroma)
* \param format chroma format
* \param dirMode the intra prediction mode index
* \param blkAboveAvailable boolean indication if the block above is available
* \param blkLeftAvailable boolean indication if the block to the left is available
* \param bEnableEdgeFilters indication whether to enable edge filters:针对垂直和水平模式使用,boundray smoothing
*
* This function derives the prediction samples for the angular mode based on the prediction direction indicated by
* the prediction mode index. The prediction direction is given by the displacement of the bottom row of the block and
* the reference row above the block in the case of vertical prediction or displacement of the rightmost column
* of the block and<