Hi ! I try to convert a frame YUV420 to RGB32 with vpp conversion but when i draw the new picture I don't retrieve the same picture
I think the problem is the initialization of mfxframesurface for RGB4.
My code :
// Allocate surfaces for VPP: Out
width = (mfxU16)VPPParams.vpp.Out.Width;
height = (mfxU16)VPPParams.vpp.Out.Height;
surfaceSize = width * height*4 ;
mfxU8* surfaceBuffersOut = (mfxU8 *)new mfxU8[surfaceSize * nVPPSurfNumOut];
pVPPSurfacesOut = new mfxFrameSurface1*[nVPPSurfNumOut];
MSDK_CHECK_POINTER(pVPPSurfacesOut, MFX_ERR_MEMORY_ALLOC);
for (int i = 0; i < nVPPSurfNumOut; i++)
{
pVPPSurfacesOut[i] = new mfxFrameSurface1;
memset(pVPPSurfacesOut[i], 0, sizeof(mfxFrameSurface1));
memcpy(&(pVPPSurfacesOut[i]->Info), &(VPPParams.vpp.Out), sizeof(mfxFrameInfo));
pVPPSurfacesOut[i]->Data.R = &surfaceBuffersOut[surfaceSize * i];
pVPPSurfacesOut[i]->Data.G = pVPPSurfacesOut[i]->Data.R + width * height;
pVPPSurfacesOut[i]->Data.B = pVPPSurfacesOut[i]->Data.R + width * height*2;
pVPPSurfacesOut[i]->Data.A = pVPPSurfacesOut[i]->Data.R + width * height*3;
pVPPSurfacesOut[i]->Data.Pitch = width;
}
Thanks.


