读取数据: mfxBitstream
对于按照什么方式对齐,逐行的是16位,隔行的是32位,d3d加速的时候,还不知道如何设置
创建surface 是存储 : mfxFrameSurface
mfxU16 width = (mfxU16)MSDK_ALIGN32(Request.Info.Width);
mfxU16 height = (mfxU16)MSDK_ALIGN32(Request.Info.Height);
mfxU8 bitsPerPixel = 12; // NV12 format is a 12 bits per pixel format
mfxU32 surfaceSize = width * height * bitsPerPixel / 8;
mfxU8* surfaceBuffers = (mfxU8 *)new mfxU8[surfaceSize * numSurfaces]; //申请空间
mfxFrameSurface1** pmfxSurfaces = new mfxFrameSurface1*[numSurfaces]; //一个二级指针
for (int i = 0; i < numSurfaces; i++)
{
pmfxSurfaces[i] = new mfxFrameSurface1; //重新申请空间
memset(pmfxSurfaces[i], 0, sizeof(mfxFrameSurface1));
memcpy(&(pmfxSurfaces[i]->Info), &(mfxVideoParams.mfx.FrameInfo), sizeof(mfxFrameInfo));
pmfxSurfaces[i]->Data.Y = &surfaceBuffers[surfaceSize * i];
pmfxSurfaces[i]->Data.U = pmfxSurfaces[i]->Data.Y + width * height;
pmfxSurfaces[i]->Data.V = pmfxSurfaces[i]->Data.U + 1;
pmfxSurfaces[i]->Data.Pitch = width;
}
创建任务: AsyncDepth 同时运行的线程数量(相当于一个线程池) 以及需要创建的surface的数量
内存的访问方式 : IOPattern
sps和pps数据:mfxExtCodingOptionSPSPPS