今天开始看了看代码单步跟踪到了一个
// allocate original YUV buffer
pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
就看看编码中最基本的单元每一个图像里面是怎么分配空间的。
Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
m_cuOffsetY = new Int[numCuInWidth * numCuInHeight];
m_cuOffsetC = new Int[numCuInWidth * numCuInHeight];
for (Int cuRow = 0; cuRow < numCuInHeight; cuRow++)
{
for (Int cuCol = 0; cuCol < numCuInWidth; cuCol++)
{
m_cuOffsetY[cuRow * numCuInWidth + cuCol] = getStride() * cuRow * m_iCuHeight + cuCol * m_iCuWidth;
m_cuOffsetC[cuRow * numCuInWidth + cuCol] = getCStride() * cuRow * (m_iCuHeight / 2) + cuCol * (m_iCuWidth / 2);
}
}
m_buOffsetY = new Int[(size_t)1 << (2 * uiMaxCUDepth)];
m_buOffsetC = new Int[(size_t)1 << (2 * uiMaxCUDepth)];
for (Int buRow = 0; buRow < (1 << uiMaxCUDepth); buRow++)
{
for (Int buCol = 0; buCol < (1 << uiMaxCUDepth); buCol++)
{
m_buOffsetY[(buRow << uiMaxCUDepth) + buCol] = getStride() * buRow * (uiMaxCUHeight >> uiMaxCUDepth) + buCol * (uiMaxCUWidth >> uiMaxCUDepth);
m_buOffsetC[(buRow << uiMaxCUDepth) + buCol] = getCStride() * buRow * (uiMaxCUHeight / 2 >> uiMaxCUDepth) + buCol * (uiMaxCUWidth / 2 >> uiMaxCUDepth);
}
}
m_cuOffsetY这个变量是作为每一个LCU的偏移吗?
m_buOffsetY是指LCU中每一个最小的CU的偏移?
请各位大神指教。。。。