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 ?
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))