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.

Rule about NV12 stride value ?

Mamil_A_
Beginner
1,819 Views

Say we have a dump of NV12 raw video stream whose width and height are known, but not the stride value. 

Given the image dump originated from Intel Media library, what would be an algorithm (simple one, presumably) that could be used to make the right guess as to what the stride value for given width/height might be ?

0 Kudos
2 Replies
Anthony_P_Intel
Employee
1,819 Views

For NV12, the pitch is simply the 'width' of the surface.  Actual storage in a file can depend on how the application writes a file.  The Intel Meida SDK Library does not actually write to file, but the sample and tutorial applications do.  The 'width' of surfaces that hold NV12 data are a multiple of 32. 

#define ALIGN32(X) (((mfxU32)((X)+31)) & (~ (mfxU32)31))

 

 

0 Kudos
Mamil_A_
Beginner
1,819 Views

>> The 'width' of surfaces that hold NV12 data are a multiple of 32.

Thanks a lot for very valuable answer.

0 Kudos
Reply