I am using an independent hardware development board to perform computer vision operations. This was one example, in order to store and YUV frame in to the DDR memory. But I was bit confused with YUV frame buffer code which is declared as below :
extern U8 inputFrame
void InitTestBuffers(int width, int height)
{
testFrameSpec.width = width;
testFrameSpec.height = height;
testFrameSpec.stride = width;
testFrameSpec.type = YUV420p;
testFrameSpec.bytesPP = 1;
inBuffer.spec = testFrameSpec;
//******************NEED TO KNOW THE BELOW PART***************
inBuffer.p1 = (u8*)(&inputFrame);
inBuffer.p2 = (u8*)((u32)(&inputFrame) + width * height);
inBuffer.p3 = (u8*)((u32)(&inputFrame) + width * height + width * height / 4);
//p1,p2,p3 are pointers to 1,2 and 3 image plane
//*************************************************************
return;
}
And even in some places it states the below for a buffer frame
static u8 FRAMES outputFrame[FRAME_WIDTH * FRAME_HEIGHT * 3 / 2];
Below is one example where they use these concepts but in different way :
My question is not about the code understanding but I did not understand why is this computation needed(conceptually).