Media (Intel® oneAPI 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 sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Pitch of a YUV frame

Matthew_C_7
Beginner
310 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
310 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

Reply