- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
I don't quite understand with the source codes that deal with mfxsurface plane pointers in the h264 encoder filter project:
case MFX_FOURCC_NV12:
pmfxSurface->Data.Y = pBuffer;
pmfxSurface->Data.UV = pBuffer + pmfxSurface->Data.Pitch * lConnectionHeight;
break;
case MFX_FOURCC_YUY2:
pmfxSurface->Data.Y = pBuffer;
pmfxSurface->Data.U = pmfxSurface->Data.Y + 1;
pmfxSurface->Data.V = pmfxSurface->Data.Y + 3;
break;
case MFX_FOURCC_RGB4:
pmfxSurface->Data.R = pBuffer;
pmfxSurface->Data.G = pBuffer + 4;
pmfxSurface->Data.B = pBuffer + 8;
break;
The first 2 cases are easy to understand. But in the third case, I don’t know why Data.G = pBuffer + 4 and Data.B = pBuffer + 8.The byte format for RGB32 is like: r0 = rgb[0]; g0 = rgb[1]; b0 = rgb[2];
Alpha0 = rgb[3];r1 = rgb[4];g1 = rgb[5];b1 = rgb[6];alpha1=rgb[7].......So why shouldn’t be “Data.G = pBuffer+1,Data.B=pBuffer+2”?
My purpose is to modify the codes to support RGB24. Is this feasible? If so,how should I set the mfxsurface plane pointers to the color channels in RGB24 format?
Best regards!
-Patrick
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page