HM源码分析
程序员文章站
2022-07-07 09:07:06
...
HM16.15源码分析一:TComPicYuv类
TComPicYuv类
TComPicYuv类用于保存yuv图像数据,定义如下:
class class TComPicYuv
{
private:
// ------------------------------------------------------------------------------------------------
// YUV buffer
// ------------------------------------------------------------------------------------------------
Pel* m_apiPicBuf[MAX_NUM_COMPONENT]; ///< Buffer (including margin)//指向图像的每个分量top-left处,图像包含了margin
Pel* m_piPicOrg[MAX_NUM_COMPONENT]; ///< m_apiPicBufY + m_iMarginLuma*getStride() + m_iMarginLuma
///如果图像宽度不是LCU大小的整倍数,每一行需要填充为stride大小
// ------------------------------------------------------------------------------------------------
// Parameter for general YUV buffer usage
// ------------------------------------------------------------------------------------------------
Int m_picWidth; ///< Width of picture in pixels
Int m_picHeight; ///< Height of picture in pixels
ChromaFormat m_chromaFormatIDC; ///< Chroma Format 420 400 422 444
Int* m_ctuOffsetInBuffer[MAX_NUM_CHANNEL_TYPE]; ///< Gives an offset in the buffer for a given CTU (and channel)//指向某个ctu起始位置所在图像的位置
Int* m_subCuOffsetInBuffer[MAX_NUM_CHANNEL_TYPE];///< Gives an offset in the buffer for a given sub-CU (and channel), relative to start of CTU //指向某个4*4块在TCU的位置
Int m_marginX; ///< margin of Luma channel (chroma's may be smaller, depending on ratio)
Int m_marginY; ///< margin of Luma channel (chroma's may be smaller, depending on ratio)
Bool m_bIsBorderExtended; //是否需要填充图像,如果不是64的整数倍需要填充为64的整数倍
{
private:
// ------------------------------------------------------------------------------------------------
// YUV buffer
// ------------------------------------------------------------------------------------------------
Pel* m_apiPicBuf[MAX_NUM_COMPONENT]; ///< Buffer (including margin)//指向图像的每个分量top-left处,图像包含了margin
Pel* m_piPicOrg[MAX_NUM_COMPONENT]; ///< m_apiPicBufY + m_iMarginLuma*getStride() + m_iMarginLuma
///如果图像宽度不是LCU大小的整倍数,每一行需要填充为stride大小
// ------------------------------------------------------------------------------------------------
// Parameter for general YUV buffer usage
// ------------------------------------------------------------------------------------------------
Int m_picWidth; ///< Width of picture in pixels
Int m_picHeight; ///< Height of picture in pixels
ChromaFormat m_chromaFormatIDC; ///< Chroma Format 420 400 422 444
Int* m_ctuOffsetInBuffer[MAX_NUM_CHANNEL_TYPE]; ///< Gives an offset in the buffer for a given CTU (and channel)//指向某个ctu起始位置所在图像的位置
Int* m_subCuOffsetInBuffer[MAX_NUM_CHANNEL_TYPE];///< Gives an offset in the buffer for a given sub-CU (and channel), relative to start of CTU //指向某个4*4块在TCU的位置
Int m_marginX; ///< margin of Luma channel (chroma's may be smaller, depending on ratio)
Int m_marginY; ///< margin of Luma channel (chroma's may be smaller, depending on ratio)
Bool m_bIsBorderExtended; //是否需要填充图像,如果不是64的整数倍需要填充为64的整数倍
图1:TComPicYuv类说明,以亮度分量为例子,如果yuv420格式的话,cb,cr的stride和totalHeight分别减半
上一篇: 前端谷歌浏览器显示海康rtsp视频