Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

Pitch of a YUV frame

Matthew_C_7
Beginner
592 Views

Hello,

I am trying to rewrite the function in common_utils.cpp:

mfxStatus ReadPlaneData(mfxU16 w, mfxU16 h, mfxU8 *buf, mfxU8 *ptr, mfxU16 pitch, mfxU16 offset, FILE* fSource)

 

How can a YUV frame have a pitch to it, defined as the distance between two consecutive rows in a frame when Y is 4 times bigger than U or V?

 

Is it the distance between the Y and U or U and V?  I appears to be U and V but I can't completely tell.

Thank you,

Matt

0 Kudos
1 Reply
Petter_L_Intel
Employee
592 Views

Hi Matthew,

The raw input surface read from disk does not have any pitch but the destination memory surface often has a pitch (different from the content frame dimensions) due to memory allocation alignment requirements. Take a look at for instance the Media SDK Tutorial (which I'm guessing you are basing your code on?) "simple_encode.cpp" code, at the stage in the code where "mfxEncParams.mfx.FrameInfo.Width" and "mfxEncParams.mfx.FrameInfo.Height" is set. Here you can see how the actual size of the allocated surface gets determined; which does impact surface pitch.

Regards,
Petter

0 Kudos
Reply